refactored

This commit is contained in:
alsaiduq-lab 2025-09-25 17:52:36 -06:00
parent 38eda7fdd6
commit 72ea5ade11
9 changed files with 208 additions and 279 deletions

49
flake.lock generated
View file

@ -61,11 +61,11 @@
"zon2nix": "zon2nix" "zon2nix": "zon2nix"
}, },
"locked": { "locked": {
"lastModified": 1758616426, "lastModified": 1758653744,
"narHash": "sha256-pPzbbpuh44gGHtA/diB5pv8w8qe9w6+TZLWm1qPUjwk=", "narHash": "sha256-y0B40QQ//4fpTAUfhZjoDEiUejhb2hXl5LcpNenRpYM=",
"owner": "ghostty-org", "owner": "ghostty-org",
"repo": "ghostty", "repo": "ghostty",
"rev": "3eb646ea6baf5eb45bbd39cd7ad624cda0264554", "rev": "f97518cc100599186846282457be520fda11f467",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -95,6 +95,24 @@
"type": "github" "type": "github"
} }
}, },
"hu-tao-cursor": {
"inputs": {
"nixpkgs": "nixpkgs_3"
},
"locked": {
"lastModified": 1758727127,
"narHash": "sha256-FdeiMlPVyu6tANl/EQatvVOEyX8d6rNMD31Emiaz8UQ=",
"ref": "refs/heads/master",
"rev": "d8d1da400e3835dfc211bfa67fb359e06bfff130",
"revCount": 4,
"type": "git",
"url": "ssh://git@github.com/alsaiduq-lab/Hu-Tao-Animated-Cursor"
},
"original": {
"type": "git",
"url": "ssh://git@github.com/alsaiduq-lab/Hu-Tao-Animated-Cursor"
}
},
"i3-dotfiles": { "i3-dotfiles": {
"flake": false, "flake": false,
"locked": { "locked": {
@ -119,11 +137,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1758420014, "lastModified": 1758678659,
"narHash": "sha256-a7IGWXPRppgXMRpBosBl2Afr5DICt21ogeZL45uVkX0=", "narHash": "sha256-Ff5IFCEABf3CStKvf8MqJe7jwrHk2J8swdYTrwOj9dk=",
"owner": "fufexan", "owner": "fufexan",
"repo": "nix-gaming", "repo": "nix-gaming",
"rev": "cd931e08409954b2e3595b1532039f8052dd8198", "rev": "6418c314274a8ce27078402ab1fbac7c06da7a36",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -189,13 +207,30 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs_4": {
"locked": {
"lastModified": 1758589230,
"narHash": "sha256-zMTCFGe8aVGTEr2RqUi/QzC1nOIQ0N1HRsbqB4f646k=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "d1d883129b193f0b495d75c148c2c3a7d95789a0",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-25.05",
"repo": "nixpkgs",
"type": "github"
}
},
"root": { "root": {
"inputs": { "inputs": {
"ghostty": "ghostty", "ghostty": "ghostty",
"home-manager": "home-manager", "home-manager": "home-manager",
"hu-tao-cursor": "hu-tao-cursor",
"i3-dotfiles": "i3-dotfiles", "i3-dotfiles": "i3-dotfiles",
"nix-gaming": "nix-gaming", "nix-gaming": "nix-gaming",
"nixpkgs": "nixpkgs_3", "nixpkgs": "nixpkgs_4",
"unstable": "unstable" "unstable": "unstable"
} }
}, },

View file

@ -24,6 +24,9 @@
url = "git+ssh://git@github.com/alsaiduq-lab/i3-dotfiles"; url = "git+ssh://git@github.com/alsaiduq-lab/i3-dotfiles";
flake = false; flake = false;
}; };
hu-tao-cursor = {
url = "git+ssh://git@github.com/alsaiduq-lab/Hu-Tao-Animated-Cursor";
};
}; };
outputs = { outputs = {
@ -33,6 +36,7 @@
nix-gaming, nix-gaming,
unstable, unstable,
ghostty, ghostty,
hu-tao-cursor,
... ...
} @ inputs: let } @ inputs: let
system = "x86_64-linux"; system = "x86_64-linux";
@ -85,6 +89,9 @@
binary-font = prev.binary-font.binary-clock-font; binary-font = prev.binary-font.binary-clock-font;
}) })
(final: prev: {ghostty = inputs.ghostty.packages.${system}.default;}) (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, pkgs,
lib, lib,
config,
... ...
}: { }: let
t = config.theme;
in {
environment.shellInit = '' environment.shellInit = ''
if [ -d "$HOME/.cargo/bin" ]; then if [ -d "$HOME/.cargo/bin" ]; then
export PATH="$PATH:$HOME/.cargo/bin" export PATH="$PATH:$HOME/.cargo/bin"
@ -13,6 +16,9 @@
EDITOR = "nvim"; EDITOR = "nvim";
VISUAL = "nvim"; VISUAL = "nvim";
TERM = "ghostty"; TERM = "ghostty";
BROWSER = "thorium";
XCURSOR_THEME = t.cursorName;
XCURSOR_SIZE = toString t.cursorSize;
CC = "${pkgs.gcc}/bin/gcc"; CC = "${pkgs.gcc}/bin/gcc";
LUA_PATH = "${pkgs.luajit}/share/lua/5.1/?.lua;${pkgs.luajit}/share/lua/5.1/?/init.lua;;"; 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;;"; LUA_CPATH = "${pkgs.luajit}/lib/lua/5.1/?.so;;";
@ -54,6 +60,8 @@
environment.pathsToLink = [ environment.pathsToLink = [
"/share/fish" "/share/fish"
"/bin" "/bin"
"/share/icons"
"/share/pixmaps"
]; ];
programs.direnv = { 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, ...}: { {pkgs, ...}: {
imports = [ imports = [
./cachix.nix ./cachix.nix
./modules/settings.nix
./modules/i3.nix
./modules/gtk.nix
./modules/audio.nix ./modules/audio.nix
./modules/bluetooth.nix ./modules/bluetooth.nix
./modules/boot.nix ./modules/boot.nix
@ -18,7 +21,6 @@
./modules/tailscale.nix ./modules/tailscale.nix
./modules/ld.nix ./modules/ld.nix
./modules/x11.nix ./modules/x11.nix
./modules/i3-xfce.nix
./modules/ollama.nix ./modules/ollama.nix
./modules/cups.nix ./modules/cups.nix
./modules/rust.nix ./modules/rust.nix