summaryrefslogtreecommitdiff
path: root/flake.nix
diff options
context:
space:
mode:
authorHenry J. Webster <hwebs@hwebs.info>2026-07-30 10:38:54 -0500
committerHenry J. Webster <hwebs@hwebs.info>2026-07-30 10:38:54 -0500
commit11ba75e40728e8b5735c9c7cefc7af1631c942af (patch)
treecaef581fd56be96ec9c5338a17d0332b51b08e64 /flake.nix
parentd47d76336a9680b661220d23c5d429d90a2f3f9e (diff)
Restructure into a multi-machine flake and add the enzo laptop
Split the single-host config into a shared minimal base plus opt-in profiles, and add a second machine (enzo laptop) alongside kusanagi. - flake: add mkMachine helper; declare nixosConfigurations.kusanagi and .enzo; add the disko input; move overlays per-machine. - common/: minimal base only (boot, networking, tailscale, locale, nix settings, neovim editor). Old configuration.nix/programs.nix removed. - profiles/: coarse opt-in bundles (desktop, dev, apps). kusanagi imports all three and stays byte-for-byte identical to the running system. - machines/kusanagi/: all workstation-only config (ROCm, Scarlett audio, optical-disc archiving, NAS mounts, kavita/immich/ollama); hardware config moved here unchanged. User stays 'henz'. - machines/enzo/: new laptop. Declarative LUKS+btrfs via disko (LVM-on-LUKS, TPM2+PIN unlock, zram + encrypted swap for suspend-then-hibernate); its own minimal niri desktop with playback-only audio (no rtkit/jack); user 'hwebs'. Assisted-by: Claude:claude-opus-4-8
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix27
1 files changed, 22 insertions, 5 deletions
diff --git a/flake.nix b/flake.nix
index 3a8765b..75732a6 100644
--- a/flake.nix
+++ b/flake.nix
@@ -4,18 +4,33 @@
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-26.05";
+ disko.url = "github:nix-community/disko";
+ disko.inputs.nixpkgs.follows = "nixpkgs";
+
discidurl.url = "git+https://git.hwebs.info/discidurl?ref=main";
discidurl.inputs.nixpkgs.follows = "nixpkgs";
};
outputs =
{ self, nixpkgs, ... }@inputs:
+ let
+ # A machine is common/ + its own machines/<name> module, plus any extra
+ # inline modules (e.g. per-machine overlays).
+ mkMachine =
+ machineModule: extraModules:
+ nixpkgs.lib.nixosSystem {
+ system = "x86_64-linux";
+ specialArgs = { inherit inputs; };
+ modules = [
+ ./common
+ machineModule
+ ]
+ ++ extraModules;
+ };
+ in
{
- nixosConfigurations.kusanagi = nixpkgs.lib.nixosSystem {
- system = "x86_64-linux";
- modules = [
- ./configuration.nix
- ./programs.nix
+ nixosConfigurations = {
+ kusanagi = mkMachine ./machines/kusanagi [
{
nixpkgs.overlays = [
(import ./overlays/haunt.nix)
@@ -23,6 +38,8 @@
];
}
];
+
+ enzo = mkMachine ./machines/enzo [ ];
};
};
}