From e40652b1a0a7b7444cfdc45cf624f61997d12cd9 Mon Sep 17 00:00:00 2001 From: alexion Date: Tue, 8 Sep 2026 18:39:07 -0400 Subject: [PATCH] refactor(nixos): simplify shared defaults --- configs/nixos/modules/default.nix | 56 ++++----------- docs/TODO.md | 116 +++++++++++++++++++++++++++++- 2 files changed, 128 insertions(+), 44 deletions(-) diff --git a/configs/nixos/modules/default.nix b/configs/nixos/modules/default.nix index 50ad91a..be827cf 100644 --- a/configs/nixos/modules/default.nix +++ b/configs/nixos/modules/default.nix @@ -7,54 +7,33 @@ }: # The shared foundation for every host and guest. let - inherit (lib) mkOption types; - user = config.user; - - pinArgs = prev: { - inherit (prev.stdenv.hostPlatform) system; - config.allowUnfree = true; - }; + stateVersion = "26.05"; in { imports = [ inputs.home-manager.nixosModules.home-manager ]; options.user = { - name = mkOption { - type = types.str; + name = lib.mkOption { + type = lib.types.str; default = "alexion"; description = '' Primary interactive user for this system. This drives the system account and Home Manager user together. ''; }; - description = mkOption { - type = types.str; - default = "Alexion"; - description = "Human-readable description for the primary user."; - }; }; config = { - nixpkgs.overlays = [ - (_final: prev: { - unstable = import inputs.nixpkgs-unstable (pinArgs prev); - stable = import inputs.nixpkgs-stable (pinArgs prev); - }) - ]; - nixpkgs.config.allowUnfree = true; + system.stateVersion = stateVersion; + nixpkgs.config.allowUnfree = true; nix.settings.experimental-features = [ "nix-command" "flakes" ]; - system.stateVersion = "26.05"; - time.timeZone = "America/New_York"; - i18n.defaultLocale = "en_GB.UTF-8"; - - users.users.${user.name} = { + users.users.${config.user.name} = { isNormalUser = true; - description = user.description; extraGroups = [ "wheel" "storage" @@ -63,16 +42,16 @@ in users.groups.storage.gid = 10000; + time.timeZone = "America/New_York"; + i18n.defaultLocale = "en_GB.UTF-8"; + home-manager = { useGlobalPkgs = true; useUserPackages = true; - extraSpecialArgs = { - inherit inputs; - }; - users.${user.name} = { - home.username = user.name; - home.homeDirectory = "/home/${user.name}"; - home.stateVersion = "26.05"; + users.${config.user.name} = { + home.username = config.user.name; + home.homeDirectory = "/home/${config.user.name}"; + home.stateVersion = stateVersion; home.packages = with pkgs; [ eza wget @@ -85,10 +64,6 @@ in command = "eza -alg --color=always --group-directories-first --icons=always"; abbreviation = false; }; - la = { - command = "eza -a --color=always --group-directories-first --icons=always"; - abbreviation = false; - }; ll = { command = "eza -lg --color=always --group-directories-first --icons=always"; abbreviation = false; @@ -97,11 +72,6 @@ in command = "eza -aT -I '.git' --color=always --group-directories-first --icons=always"; abbreviation = false; }; - "l." = { - command = "eza -a | grep -e '^\\.'"; - abbreviation = false; - }; - ".." = "cd .."; "..." = "cd ../.."; "...." = "cd ../../.."; diff --git a/docs/TODO.md b/docs/TODO.md index e1b7718..b73ab6e 100644 --- a/docs/TODO.md +++ b/docs/TODO.md @@ -27,4 +27,118 @@ - refactor/review `configs/nixos` # learning -- https://www.youtube.com/@EeroAlvar/videos \ No newline at end of file +- https://www.youtube.com/@EeroAlvar/videos + +# nix refactor +```text +├── guests +│ ├── actualbudget.nix +│ ├── copyparty.nix +│ └── reverse-proxy.nix +├── hosts +│ ├── neogaia +│ │ ├── default.nix +│ │ ├── disk.nix +│ │ ├── hardware-configuration.nix +│ │ ├── ssh_host_ed25519_key.pub +│ │ └── ssh_host_rsa_key.pub +│ ├── pikachu +│ │ ├── default.nix +│ │ ├── disk.nix +│ │ ├── hardware-configuration.nix +│ │ ├── ssh_host_ed25519_key.pub +│ │ └── ssh_host_rsa_key.pub +│ └── zeus +│ ├── default.nix +│ ├── disk.nix +│ ├── hardware-configuration.nix +│ ├── ssh_host_ed25519_key.pub +│ └── ssh_host_rsa_key.pub +├── modules +│ ├── desktop +│ │ ├── apps +│ │ │ ├── alacritty.nix +│ │ │ ├── firefox.nix +│ │ │ ├── ghostty.nix +│ │ │ ├── obsidian.nix +│ │ │ ├── signal.nix +│ │ │ ├── steam.nix +│ │ │ └── vencord.nix +│ │ ├── session +│ │ │ ├── hyprland +│ │ │ │ ├── default.nix +│ │ │ │ ├── hypridle.nix +│ │ │ │ └── hyprlock.nix +│ │ │ ├── login.nix +│ │ │ ├── mako.nix +│ │ │ ├── portals.nix +│ │ │ ├── rofi.nix +│ │ │ └── waybar.nix +│ │ ├── utilities +│ │ │ ├── audio.nix +│ │ │ ├── clipboard.nix +│ │ │ ├── osd.nix +│ │ │ ├── recording.nix +│ │ │ ├── screenshot.nix +│ │ │ ├── theming.nix +│ │ │ └── userdirs.nix +│ │ └── default.nix +│ ├── network +│ │ ├── ssh.nix +│ │ ├── vlans.nix +│ │ └── vpn-client.nix +│ ├── services +│ │ ├── actualbudget.nix +│ │ ├── copyparty.nix +│ │ └── reverse-proxy.nix +│ ├── shell +│ │ ├── direnv +│ │ │ ├── default.nix +│ │ │ └── repo-flake.sh +│ │ ├── fish +│ │ │ ├── completions +│ │ │ │ └── bazel.fish +│ │ │ ├── functions +│ │ │ │ ├── copy.fish +│ │ │ │ └── deploy-to.fish +│ │ │ ├── config.fish +│ │ │ └── default.nix +│ │ ├── nvim +│ │ │ ├── config.lua +│ │ │ └── default.nix +│ │ ├── pi +│ │ │ ├── patches +│ │ │ │ ├── pi-flex-spacer.patch +│ │ │ │ ├── pi-project-resource-ancestors.patch +│ │ │ │ └── pi-tool-lookup-validation.patch +│ │ │ └── default.nix +│ │ ├── tmux +│ │ │ ├── default.nix +│ │ │ └── extra.conf +│ │ ├── bazel.nix +│ │ ├── git.nix +│ │ ├── gitea-axi.nix +│ │ ├── herdr.nix +│ │ ├── python.nix +│ │ ├── rust.nix +│ │ └── yazi.nix +│ ├── default.nix +│ ├── guest.nix +│ ├── host.nix +│ ├── monorepo.nix +│ └── zfs.nix +├── registry +│ ├── address.nix +│ ├── env-var.nix +│ ├── route.nix +│ ├── shell-shortcut.nix +│ └── stable-uid.nix +├── secrets +│ ├── neogaia.yaml +│ ├── pikachu.yaml +│ ├── shared.yaml +│ └── zeus.yaml +├── .sops.yaml +├── AGENTS.md +└── README.md +```