feat(meta): use manifest to define system configurations

This commit is contained in:
Mohammad Rafiq 2025-07-15 21:54:00 +08:00
parent 96321d4026
commit 084caa727b
No known key found for this signature in database
18 changed files with 125 additions and 131 deletions

View file

@ -1,6 +1,7 @@
{ config, lib, ... }:
let
cfg = config.flake;
inherit (config.manifest) users;
inherit (cfg.lib.modules) forAllUsers';
inherit (lib.attrsets) mapAttrs';
in
@ -12,7 +13,7 @@ in
programs = mapAttrs' (name: value: {
name = value.shell;
value.enable = true;
}) cfg.manifest.users;
}) users;
users.users = forAllUsers' (_: value: { shell = pkgs.${value.shell}; });
};
darwin.default =
@ -21,14 +22,14 @@ in
programs = mapAttrs' (name: value: {
name = value.shell;
value.enable = true;
}) cfg.manifest.users;
}) users;
users.users = forAllUsers' (_: value: { shell = pkgs.${value.shell}; });
environment.shells = [ pkgs.fish ];
};
homeManager.default =
{ config, ... }:
{
programs.${cfg.manifest.users.${config.home.username}.shell}.enable = true;
programs.${users.${config.home.username}.shell}.enable = true;
home.shell.enableShellIntegration = true;
};
};