refactor: Tidy flake.nix and break it apart

This commit is contained in:
Madeleine Sydney
2024-12-30 19:24:07 -07:00
parent 2e3b262d05
commit c6170d5284
6 changed files with 164 additions and 97 deletions

View File

@@ -0,0 +1,26 @@
{ ... }@inputs:
let users = builtins.readDir ../users;
mkUser = username: _: {
imports = [
(import ../users/${username}/default.nix).homeConfiguration
inputs.self.homeManagerModules.default
inputs.sops-nix.homeManagerModules.sops
inputs.impermanence.homeManagerModules.impermanence
# Directory name should always match username.
({ ... }: { home.username = username; })
({ lib, ... }: {
nix = {
settings.experimental-features =
lib.mkDefault
[ "nix-command" "flakes" ];
};
})
];
};
in
builtins.mapAttrs mkUser users