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:
@@ -49,7 +49,7 @@
|
||||
{ self, nixpkgs, ... }@inputs:
|
||||
let
|
||||
inherit (nixpkgs) lib;
|
||||
my = import ./lib { inherit lib inputs self; };
|
||||
my = import ./lib.nix { inherit lib inputs self; };
|
||||
in
|
||||
{
|
||||
# Helper functions for discovering and building hosts.
|
||||
|
||||
@@ -46,17 +46,15 @@ let
|
||||
inherit inputs;
|
||||
my = self.lib;
|
||||
};
|
||||
modules =
|
||||
(collectNixFiles (self + "/modules"))
|
||||
++ [
|
||||
inputs.home-manager.nixosModules.home-manager
|
||||
inputs.chaotic.nixosModules.default
|
||||
inputs.disko.nixosModules.disko
|
||||
inputs.sops-nix.nixosModules.sops
|
||||
(self + "/system")
|
||||
(self + "/hosts/${hostName}")
|
||||
{ networking.hostName = hostName; }
|
||||
];
|
||||
modules = (collectNixFiles (self + "/modules")) ++ [
|
||||
inputs.home-manager.nixosModules.home-manager
|
||||
inputs.chaotic.nixosModules.default
|
||||
inputs.disko.nixosModules.disko
|
||||
inputs.sops-nix.nixosModules.sops
|
||||
(self + "/system.nix")
|
||||
(self + "/hosts/${hostName}")
|
||||
{ networking.hostName = hostName; }
|
||||
];
|
||||
};
|
||||
|
||||
# Discover every host (a subdirectory of `hostsDir`) and build each one.
|
||||
@@ -93,7 +93,7 @@ in
|
||||
# satisfy the secret below.
|
||||
# Clearing both `sshKeyPaths` defaults keeps the SSH host keys out of the
|
||||
# decryption path.
|
||||
sops.defaultSopsFile = ../secrets/shared.yaml;
|
||||
sops.defaultSopsFile = ./secrets/shared.yaml;
|
||||
sops.age.keyFile = "/var/lib/sops-nix/key.txt";
|
||||
sops.age.sshKeyPaths = [ ];
|
||||
sops.gnupg.sshKeyPaths = [ ];
|
||||
Reference in New Issue
Block a user