pantheon/nix/modules/shell.nix
Mohammad Rafiq 4e74db3938
refactor(lib): add lib output to flake
This is needed so we can use subattributes of flake.lib
2025-07-07 17:42:31 +08:00

22 lines
559 B
Nix

{ config, lib, ... }:
let
cfg = config.flake;
inherit (cfg.lib.modules) forAllUsers';
inherit (lib.attrsets) mapAttrs';
in
{
flake.modules.nixos.default =
{ pkgs, ... }:
{
programs = mapAttrs' (name: value: {
name = value.shell;
value.enable = true;
}) cfg.manifest.users;
users.users = forAllUsers' (_: value: { shell = pkgs.${value.shell}; });
};
flake.modules.homeManager.default =
{ config, ... }:
{
programs.${cfg.manifest.users.${config.home.username}.shell}.enable = true;
};
}