refactor: flatten the single-file lib and system directories

Each held one default.nix, so the directory added a level to descend without
grouping anything. They are now lib.nix and system.nix beside flake.nix, which
reads as the flake's own scaffolding.

The shared base config's reference to the shared secrets file was relative to
the directory it sat in, so it moves with the file.

Verified to build the same system toplevel as before the move.
This commit is contained in:
2026-07-20 13:02:26 -04:00
parent 58bf41f62d
commit 9a860d7715
3 changed files with 11 additions and 13 deletions

View File

@@ -49,7 +49,7 @@
{ self, nixpkgs, ... }@inputs: { self, nixpkgs, ... }@inputs:
let let
inherit (nixpkgs) lib; inherit (nixpkgs) lib;
my = import ./lib { inherit lib inputs self; }; my = import ./lib.nix { inherit lib inputs self; };
in in
{ {
# Helper functions for discovering and building hosts. # Helper functions for discovering and building hosts.

View File

@@ -46,17 +46,15 @@ let
inherit inputs; inherit inputs;
my = self.lib; my = self.lib;
}; };
modules = modules = (collectNixFiles (self + "/modules")) ++ [
(collectNixFiles (self + "/modules")) inputs.home-manager.nixosModules.home-manager
++ [ inputs.chaotic.nixosModules.default
inputs.home-manager.nixosModules.home-manager inputs.disko.nixosModules.disko
inputs.chaotic.nixosModules.default inputs.sops-nix.nixosModules.sops
inputs.disko.nixosModules.disko (self + "/system.nix")
inputs.sops-nix.nixosModules.sops (self + "/hosts/${hostName}")
(self + "/system") { networking.hostName = hostName; }
(self + "/hosts/${hostName}") ];
{ networking.hostName = hostName; }
];
}; };
# Discover every host (a subdirectory of `hostsDir`) and build each one. # Discover every host (a subdirectory of `hostsDir`) and build each one.

View File

@@ -93,7 +93,7 @@ in
# satisfy the secret below. # satisfy the secret below.
# Clearing both `sshKeyPaths` defaults keeps the SSH host keys out of the # Clearing both `sshKeyPaths` defaults keeps the SSH host keys out of the
# decryption path. # decryption path.
sops.defaultSopsFile = ../secrets/shared.yaml; sops.defaultSopsFile = ./secrets/shared.yaml;
sops.age.keyFile = "/var/lib/sops-nix/key.txt"; sops.age.keyFile = "/var/lib/sops-nix/key.txt";
sops.age.sshKeyPaths = [ ]; sops.age.sshKeyPaths = [ ];
sops.gnupg.sshKeyPaths = [ ]; sops.gnupg.sshKeyPaths = [ ];