refactored

This commit is contained in:
alsaiduq-lab 2025-09-25 17:54:26 -06:00
parent 346c1fd1de
commit 85eaf56a0c
8 changed files with 166 additions and 272 deletions

View file

@ -24,6 +24,9 @@
url = "git+ssh://git@github.com/alsaiduq-lab/i3-dotfiles";
flake = false;
};
hu-tao-cursor = {
url = "git+ssh://git@github.com/alsaiduq-lab/Hu-Tao-Animated-Cursor";
};
};
outputs = {
@ -33,6 +36,7 @@
nix-gaming,
unstable,
ghostty,
hu-tao-cursor,
...
} @ inputs: let
system = "x86_64-linux";
@ -85,6 +89,9 @@
binary-font = prev.binary-font.binary-clock-font;
})
(final: prev: {ghostty = inputs.ghostty.packages.${system}.default;})
(final: prev: {
hu-tao-animated-cursor = inputs.hu-tao-cursor.packages.${system}.default;
})
];
};
}

View file

@ -1,41 +0,0 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usbhid" "uas" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/042fab51-5d9c-454f-bd8f-315af4060a7d";
fsType = "ext4";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/5830-C7C5";
fsType = "vfat";
options = [ "fmask=0077" "dmask=0077" ];
};
swapDevices =
[ { device = "/dev/disk/by-uuid/68153c66-e234-49a8-9ec3-7e9af73efd1c"; }
];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.enp6s0.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp5s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View file

@ -0,0 +1 @@
/etc/nixos/hardware-configuration.nix

View file

@ -1,8 +1,11 @@
{
pkgs,
lib,
config,
...
}: {
}: let
t = config.theme;
in {
environment.shellInit = ''
if [ -d "$HOME/.cargo/bin" ]; then
export PATH="$PATH:$HOME/.cargo/bin"
@ -13,6 +16,9 @@
EDITOR = "nvim";
VISUAL = "nvim";
TERM = "ghostty";
BROWSER = "thorium";
XCURSOR_THEME = t.cursorName;
XCURSOR_SIZE = toString t.cursorSize;
CC = "${pkgs.gcc}/bin/gcc";
LUA_PATH = "${pkgs.luajit}/share/lua/5.1/?.lua;${pkgs.luajit}/share/lua/5.1/?/init.lua;;";
LUA_CPATH = "${pkgs.luajit}/lib/lua/5.1/?.so;;";
@ -54,6 +60,8 @@
environment.pathsToLink = [
"/share/fish"
"/bin"
"/share/icons"
"/share/pixmaps"
];
programs.direnv = {

52
hosts/modules/gtk.nix Normal file
View file

@ -0,0 +1,52 @@
{
config,
pkgs,
...
}: let
t = config.theme;
cursorName = t.cursorName;
cursorSize = toString t.cursorSize;
gtkTheme = t.gtkTheme;
iconTheme = t.iconTheme;
fontName = t.fontName;
in {
environment.etc = {
"gtk-2.0/gtkrc".text = ''
gtk-theme-name=${gtkTheme}
gtk-icon-theme-name=${iconTheme}
gtk-font-name=${fontName}
gtk-cursor-theme-name=${cursorName}
gtk-cursor-theme-size=${cursorSize}
'';
"gtk-3.0/settings.ini".text = ''
[Settings]
gtk-application-prefer-dark-theme=1
gtk-theme-name=${gtkTheme}
gtk-icon-theme-name=${iconTheme}
gtk-font-name=${fontName}
gtk-cursor-theme-name=${cursorName}
gtk-cursor-theme-size=${cursorSize}
'';
"gtk-4.0/settings.ini".text = ''
[Settings]
gtk-application-prefer-dark-theme=1
gtk-theme-name=${gtkTheme}
gtk-icon-theme-name=${iconTheme}
gtk-font-name=${fontName}
gtk-cursor-theme-name=${cursorName}
gtk-cursor-theme-size=${cursorSize}
'';
};
programs.dconf.enable = true;
programs.dconf.profiles.user.databases = [
{
settings."org/gnome/desktop/interface" = {
gtk-theme = gtkTheme;
icon-theme = iconTheme;
cursor-theme = cursorName;
font-name = fontName;
};
}
];
}

View file

@ -1,229 +0,0 @@
{
pkgs,
i3dotfiles,
...
}: let
wallpaperDir = "/home/cobray/wallpapers";
randomWallpaper = pkgs.writeShellScript "wallpaper.sh" ''
#!${pkgs.runtimeShell}
set -e
BG_DIR="/var/lib/lightdm-background"
BG_LINK="''$BG_DIR/random-wallpaper.png"
LAST_WALLPAPER="''$BG_DIR/.last-wallpaper"
WALLPAPER_DIR="${wallpaperDir}"
mkdir -p "''$BG_DIR"
rm -f "''$BG_LINK"
mapfile -t WALLPAPERS < <(${pkgs.findutils}/bin/find "''$WALLPAPER_DIR" -type f \( -name "*.png" -o -name "*.jpg" -o -name "*.jpeg" \))
COUNT=''${#WALLPAPERS[@]}
if [[ "''$COUNT" -eq 0 ]]; then
cp -f "${pkgs.nixos-artwork.wallpapers.simple-dark-gray}/share/backgrounds/nixos/nixos-wallpaper.png" "''$BG_LINK"
echo "${pkgs.nixos-artwork.wallpapers.simple-dark-gray}/share/backgrounds/nixos/nixos-wallpaper.png" > "''$LAST_WALLPAPER"
chown lightdm:lightdm "''$BG_LINK" "''$LAST_WALLPAPER"
exit 0
fi
RAND=$(${pkgs.coreutils}/bin/shuf -i 0-''$((COUNT - 1)) -n 1)
SELECT=''${WALLPAPERS[''$RAND]}
cp -f "''$SELECT" "''$BG_LINK"
echo "''$SELECT" > "''$LAST_WALLPAPER"
chown lightdm:lightdm "''$BG_LINK" "''$LAST_WALLPAPER"
'';
in {
services.xserver.enable = true;
services.xserver.xkb = {
layout = "us";
variant = "";
};
services.xserver.windowManager.i3 = {
enable = true;
package = pkgs.i3-gaps;
extraSessionCommands = ''
if [ -f /var/lib/lightdm-background/.last-wallpaper ]; then
${pkgs.feh}/bin/feh --bg-fill "$(cat /var/lib/lightdm-background/.last-wallpaper)"
fi
export GSETTINGS_SCHEMA_DIR="${pkgs.gsettings-desktop-schemas}/share/gsettings-schemas/${pkgs.gsettings-desktop-schemas.name}/glib-2.0/schemas"
${pkgs.glib}/bin/gsettings set org.gnome.desktop.interface gtk-theme "Tokyonight-Dark"
${pkgs.glib}/bin/gsettings set org.gnome.desktop.interface icon-theme "candy-icons"
${pkgs.glib}/bin/gsettings set org.gnome.desktop.interface cursor-theme "capitaine-cursors"
cat > $HOME/.config/xsettingsd << EOF
Net/ThemeName "Tokyonight-Dark"
Net/IconThemeName "candy-icons"
Gtk/CursorThemeName "capitaine-cursors"
EOF
killall xsettingsd || true
${pkgs.xsettingsd}/bin/xsettingsd &
'';
};
services.xserver.desktopManager.xfce = {
enable = true;
noDesktop = true;
enableXfwm = false;
};
services.xserver.displayManager.lightdm = {
enable = true;
background = "/var/lib/lightdm-background/random-wallpaper.png";
greeters.gtk = {
enable = true;
theme = {
package = pkgs.tokyonight-gtk-theme;
name = "Tokyonight-Dark";
};
iconTheme = {
package = pkgs.candy-icons;
name = "candy-icons";
};
cursorTheme = {
package = pkgs.capitaine-cursors;
name = "capitaine-cursors";
};
extraConfig = ''
[greeter]
greeting = Welcome back, Traveller
font-name=Clear Sans 10
cursor-theme-name=capitaine-cursors
icon-theme-name=candy-icons
'';
};
};
systemd.tmpfiles.rules = [
"d /var/lib/lightdm-background 0755 lightdm lightdm - -"
"d ${wallpaperDir} 0755 cobray users - -"
"f /var/log/random-wallpaper.log 0644 root root - -"
];
systemd.services.random-wallpaper = {
description = "Update wallpaper to a random image";
before = ["display-manager.service"];
wantedBy = ["display-manager.service"];
serviceConfig = {
Type = "oneshot";
ExecStart = "${randomWallpaper}";
User = "root";
};
};
systemd.timers.random-wallpaper = {
description = "Daily wallpaper refresh for LightDM";
wantedBy = ["timers.target"];
timerConfig = {
OnCalendar = "daily";
Persistent = true;
};
};
services.displayManager.defaultSession = "xfce+i3";
services.displayManager.autoLogin = {
enable = true;
user = "cobray";
};
qt = {
enable = true;
platformTheme = "qt5ct";
};
environment.etc = {
"xdg/i3/config" = {
source = "${i3dotfiles}/i3/config";
mode = "0644";
};
"gtk-2.0/gtkrc".text = ''
gtk-theme-name="Tokyonight-Dark"
gtk-icon-theme-name="candy-icons"
gtk-font-name="Clear Sans 10"
gtk-cursor-theme-name="capitaine-cursors"
gtk-cursor-theme-size=24
'';
"gtk-3.0/settings.ini".text = ''
[Settings]
gtk-application-prefer-dark-theme=1
gtk-theme-name=Tokyonight-Dark
gtk-icon-theme-name=candy-icons
gtk-font-name=Clear Sans 10
gtk-cursor-theme-name=capitaine-cursors
gtk-cursor-theme-size=24
'';
"gtk-4.0/settings.ini".text = ''
[Settings]
gtk-application-prefer-dark-theme=1
gtk-theme-name=Tokyonight-Dark
gtk-icon-theme-name=candy-icons
gtk-font-name=Clear Sans 10
gtk-cursor-theme-name=capitaine-cursors
gtk-cursor-theme-size=24
'';
};
environment.systemPackages = with pkgs; [
dmenu
i3status
i3lock-color
i3blocks
picom
feh
rofi
dunst
polybar
i3-auto-layout
mpv
yt-dlp
flameshot
imagemagick
slop
ghostscript
via
arandr
xclip
xsettingsd
lxappearance
gsettings-desktop-schemas
adwaita-qt
candy-icons
capitaine-cursors
tokyonight-gtk-theme
hicolor-icon-theme
adwaita-icon-theme
kdePackages.breeze-icons
gnome-themes-extra
findutils
coreutils
];
environment.pathsToLink = [
"/share/icons"
"/share/pixmaps"
];
services.xserver.desktopManager.session = [
{
name = "xfce+i3";
start = ''
if [ -f /var/lib/lightdm-background/.last-wallpaper ]; then
${pkgs.feh}/bin/feh --bg-fill "$(cat /var/lib/lightdm-background/.last-wallpaper)"
fi
export XDG_DATA_DIRS="${pkgs.tokyonight-gtk-theme}/share:${pkgs.candy-icons}/share:${pkgs.hicolor-icon-theme}/share:${pkgs.adwaita-icon-theme}/share:$XDG_DATA_DIRS"
${pkgs.xfce.xfce4-session}/bin/xfce4-session --with-ck-launch &
${pkgs.i3-gaps}/bin/i3
'';
}
];
programs.dconf.enable = true;
programs.dconf.profiles.user.databases = [
{
settings = {
"org/gnome/desktop/interface" = {
icon-theme = "candy-icons";
gtk-theme = "Tokyonight-Dark";
cursor-theme = "capitaine-cursors";
};
};
}
];
}

69
hosts/modules/i3.nix Normal file
View file

@ -0,0 +1,69 @@
{pkgs, ...}: {
services.xserver = {
enable = true;
xkb = {
layout = "us";
variant = "";
};
windowManager.i3 = {
enable = true;
package = pkgs.i3-gaps;
extraSessionCommands = ''
if [ -f /var/lib/lightdm-background/.last-wallpaper ]; then
${pkgs.feh}/bin/feh --bg-fill "$(cat /var/lib/lightdm-background/.last-wallpaper)"
fi
'';
};
# this is actually here because i get peeved personally when I see a none in "none+i3"
desktopManager.xfce = {
enable = true;
noDesktop = true;
enableXfwm = false;
};
desktopManager.session = [
{
name = "xfce+i3";
start = ''
if [ -f /var/lib/lightdm-background/.last-wallpaper ]; then
${pkgs.feh}/bin/feh --bg-fill "$(cat /var/lib/lightdm-background/.last-wallpaper)"
fi
export XDG_DATA_DIRS="${pkgs.tokyonight-gtk-theme}/share:${pkgs.candy-icons}/share:${pkgs.hicolor-icon-theme}/share:${pkgs.adwaita-icon-theme}/share:$XDG_DATA_DIRS"
${pkgs.xfce.xfce4-session}/bin/xfce4-session --with-ck-launch &
${pkgs.i3-gaps}/bin/i3
'';
}
];
};
environment.systemPackages = with pkgs; [
dmenu
i3status
i3lock-color
i3blocks
picom
feh
i3-auto-layout
yt-dlp
flameshot
imagemagick
slop
ghostscript
via
arandr
xsettingsd
lxappearance
gsettings-desktop-schemas
adwaita-qt
candy-icons
tokyonight-gtk-theme
hicolor-icon-theme
adwaita-icon-theme
gnome-themes-extra
findutils
coreutils
hu-tao-animated-cursor
];
}

View file

@ -0,0 +1,25 @@
{lib, ...}:
with lib; {
options.theme = {
cursorName = mkOption {
type = types.str;
default = "Hu-Tao-Animated-Cursor";
};
cursorSize = mkOption {
type = types.int;
default = 24;
};
gtkTheme = mkOption {
type = types.str;
default = "Tokyonight-Dark";
};
iconTheme = mkOption {
type = types.str;
default = "candy-icons";
};
fontName = mkOption {
type = types.str;
default = "Clear Sans 10";
};
};
}

View file

@ -1,6 +1,9 @@
{pkgs, ...}: {
imports = [
./cachix.nix
./modules/settings.nix
./modules/i3.nix
./modules/gtk.nix
./modules/audio.nix
./modules/bluetooth.nix
./modules/boot.nix
@ -18,7 +21,6 @@
./modules/tailscale.nix
./modules/ld.nix
./modules/x11.nix
./modules/i3-xfce.nix
./modules/ollama.nix
./modules/cups.nix
./modules/rust.nix