feasible config for the beginning
This commit is contained in:
parent
b4c2ba8174
commit
25d5980e6c
13 changed files with 563 additions and 203 deletions
60
modules/nixOS/bundles/users.nix
Normal file
60
modules/nixOS/bundles/users.nix
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
{
|
||||
lib,
|
||||
config,
|
||||
inputs,
|
||||
outputs,
|
||||
helperLib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
cfg = config.myNixOS;
|
||||
in {
|
||||
options.myNixOS.home-users = lib.mkOption {
|
||||
type = lib.types.attrsOf ( lib.types.submodule {
|
||||
options = {
|
||||
userConfig = lib.mkOption {
|
||||
example = "home.nix";
|
||||
};
|
||||
userSettings = lib.mkOption {
|
||||
default = {};
|
||||
example = "{}";
|
||||
};
|
||||
};
|
||||
});
|
||||
default = {};
|
||||
};
|
||||
|
||||
config = {
|
||||
programs.zsh.enable = true;
|
||||
|
||||
home-manager = {
|
||||
useGlobalPkgs = true;
|
||||
useUserPackages = true;
|
||||
|
||||
extraSpecialArgs = {
|
||||
inherit inputs;
|
||||
inherit helperLib;
|
||||
outputs = inputs.self.outputs;
|
||||
};
|
||||
|
||||
users =
|
||||
builtins.mapAttrs (name: user: {...}: {
|
||||
imports = [
|
||||
(import user.userConfig)
|
||||
outputs.homeManagerModules.default
|
||||
];
|
||||
})
|
||||
(config.myNixOS.home-users);
|
||||
};
|
||||
|
||||
users.users = builtins.mapAttrs (
|
||||
name: user:
|
||||
{
|
||||
isNormalUser = true;
|
||||
shell = pkgs.zsh;
|
||||
extraGroups = ["libvirtd" "networkmanager"];
|
||||
}
|
||||
// user.userSettings
|
||||
) (config.myNixOS.home-users);
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue