refactor(nixos): simplify shared defaults

This commit is contained in:
2026-09-08 18:39:07 -04:00
parent 3a3c612a83
commit e40652b1a0
2 changed files with 128 additions and 44 deletions

View File

@@ -7,54 +7,33 @@
}: }:
# The shared foundation for every host and guest. # The shared foundation for every host and guest.
let let
inherit (lib) mkOption types; stateVersion = "26.05";
user = config.user;
pinArgs = prev: {
inherit (prev.stdenv.hostPlatform) system;
config.allowUnfree = true;
};
in in
{ {
imports = [ inputs.home-manager.nixosModules.home-manager ]; imports = [ inputs.home-manager.nixosModules.home-manager ];
options.user = { options.user = {
name = mkOption { name = lib.mkOption {
type = types.str; type = lib.types.str;
default = "alexion"; default = "alexion";
description = '' description = ''
Primary interactive user for this system. Primary interactive user for this system.
This drives the system account and Home Manager user together. 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 = { config = {
nixpkgs.overlays = [ system.stateVersion = stateVersion;
(_final: prev: {
unstable = import inputs.nixpkgs-unstable (pinArgs prev);
stable = import inputs.nixpkgs-stable (pinArgs prev);
})
];
nixpkgs.config.allowUnfree = true;
nixpkgs.config.allowUnfree = true;
nix.settings.experimental-features = [ nix.settings.experimental-features = [
"nix-command" "nix-command"
"flakes" "flakes"
]; ];
system.stateVersion = "26.05"; users.users.${config.user.name} = {
time.timeZone = "America/New_York";
i18n.defaultLocale = "en_GB.UTF-8";
users.users.${user.name} = {
isNormalUser = true; isNormalUser = true;
description = user.description;
extraGroups = [ extraGroups = [
"wheel" "wheel"
"storage" "storage"
@@ -63,16 +42,16 @@ in
users.groups.storage.gid = 10000; users.groups.storage.gid = 10000;
time.timeZone = "America/New_York";
i18n.defaultLocale = "en_GB.UTF-8";
home-manager = { home-manager = {
useGlobalPkgs = true; useGlobalPkgs = true;
useUserPackages = true; useUserPackages = true;
extraSpecialArgs = { users.${config.user.name} = {
inherit inputs; home.username = config.user.name;
}; home.homeDirectory = "/home/${config.user.name}";
users.${user.name} = { home.stateVersion = stateVersion;
home.username = user.name;
home.homeDirectory = "/home/${user.name}";
home.stateVersion = "26.05";
home.packages = with pkgs; [ home.packages = with pkgs; [
eza eza
wget wget
@@ -85,10 +64,6 @@ in
command = "eza -alg --color=always --group-directories-first --icons=always"; command = "eza -alg --color=always --group-directories-first --icons=always";
abbreviation = false; abbreviation = false;
}; };
la = {
command = "eza -a --color=always --group-directories-first --icons=always";
abbreviation = false;
};
ll = { ll = {
command = "eza -lg --color=always --group-directories-first --icons=always"; command = "eza -lg --color=always --group-directories-first --icons=always";
abbreviation = false; abbreviation = false;
@@ -97,11 +72,6 @@ in
command = "eza -aT -I '.git' --color=always --group-directories-first --icons=always"; command = "eza -aT -I '.git' --color=always --group-directories-first --icons=always";
abbreviation = false; abbreviation = false;
}; };
"l." = {
command = "eza -a | grep -e '^\\.'";
abbreviation = false;
};
".." = "cd .."; ".." = "cd ..";
"..." = "cd ../.."; "..." = "cd ../..";
"...." = "cd ../../.."; "...." = "cd ../../..";

View File

@@ -28,3 +28,117 @@
# learning # learning
- https://www.youtube.com/@EeroAlvar/videos - 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
```