mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 04:19:19 -08:00
refactor(hakurei): add kyuuto
This commit is contained in:
parent
8335b8f3a0
commit
6814747c40
15 changed files with 158 additions and 13 deletions
25
generate.nix
Normal file
25
generate.nix
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
{
|
||||
inputs,
|
||||
tree,
|
||||
}: let
|
||||
nixlib = inputs.nixpkgs.lib;
|
||||
inherit (nixlib.attrsets) filterAttrs mapAttrsToList;
|
||||
inherit (nixlib.lists) sortOn;
|
||||
inherit (inputs.self.lib.lib) userIs;
|
||||
templateSystem = inputs.self.nixosConfigurations.reimu;
|
||||
templateUsers = filterAttrs (_: userIs "peeps") templateSystem.config.users.users;
|
||||
mkNodeUsers = users: let
|
||||
nodeUsers = mapAttrsToList (_: mkNodeUser) templateUsers;
|
||||
in sortOn (user: user.uid) nodeUsers;
|
||||
mkNodeUser = user: {
|
||||
inherit (user) name uid;
|
||||
authorizedKeys = user.openssh.authorizedKeys.keys;
|
||||
};
|
||||
mkNode = {
|
||||
name,
|
||||
}: {
|
||||
users = mkNodeUsers templateUsers;
|
||||
};
|
||||
in {
|
||||
reisen = mkNode { name = "reisen"; };
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue