feat(meta): use manifest to define system configurations
This commit is contained in:
parent
96321d4026
commit
084caa727b
18 changed files with 125 additions and 131 deletions
|
@ -1,6 +1,7 @@
|
|||
{ config, lib, ... }:
|
||||
let
|
||||
cfg = config.flake;
|
||||
inherit (config.manifest) users admin;
|
||||
inherit (cfg.lib.modules) userListToAttrs forAllUsers';
|
||||
inherit (lib.lists) findFirstIndex;
|
||||
inherit (builtins) attrNames;
|
||||
|
@ -36,12 +37,12 @@ in
|
|||
flake.modules.darwin.default =
|
||||
{ config, ... }:
|
||||
{
|
||||
system.primaryUser = cfg.admin.username;
|
||||
users.knownUsers = attrNames cfg.manifest.users;
|
||||
system.primaryUser = admin.username;
|
||||
users.knownUsers = attrNames users;
|
||||
users.users = forAllUsers' (
|
||||
name: _: {
|
||||
home = "/Users/${name}";
|
||||
uid = 501 + (findFirstIndex (x: x == name) null (attrNames cfg.manifest.users));
|
||||
uid = 501 + (findFirstIndex (x: x == name) null (attrNames users));
|
||||
}
|
||||
);
|
||||
home-manager.users = forAllUsers' (
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue