WIP BROKEN SYSTEM ATM
This commit is contained in:
parent
2087ee1015
commit
1d9c4beaf3
21 changed files with 767 additions and 93 deletions
52
common/home_manager/default.nix
Normal file
52
common/home_manager/default.nix
Normal file
|
@ -0,0 +1,52 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
let
|
||||
ccfg = import ../config.nix;
|
||||
cfg_path = [
|
||||
ccfg.custom_config_key
|
||||
"homeManager"
|
||||
];
|
||||
cfg = lib.attrsets.getAttrFromPath cfg_path config;
|
||||
in
|
||||
{
|
||||
options =
|
||||
{ }
|
||||
// lib.attrsets.setAttrByPath cfg_path {
|
||||
users = lib.mkOption {
|
||||
type = lib.types.attrsOf lib.types.attrs;
|
||||
default = { };
|
||||
description = "Home manager users to configure. Should match nix options of home-manager.users.<name>.*";
|
||||
};
|
||||
stateVersion = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "23.11";
|
||||
description = "Home manager state version";
|
||||
};
|
||||
};
|
||||
config = {
|
||||
# Home manager options
|
||||
security.polkit.enable = true;
|
||||
home-manager.useUserPackages = true;
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.backupFileExtension = "bak";
|
||||
|
||||
home-manager.sharedModules = [
|
||||
./programs/tmux/tmux.nix
|
||||
./programs/alacritty.nix
|
||||
./programs/atuin.nix
|
||||
];
|
||||
|
||||
home-manager.users = lib.mapAttrs' (name: userConfig: {
|
||||
inherit name;
|
||||
value = userConfig // {
|
||||
home.stateVersion = cfg.stateVersion;
|
||||
programs.home-manager.enable = true;
|
||||
home.username = name;
|
||||
home.homeDirectory = lib.mkForce "/home/${name}";
|
||||
};
|
||||
}) cfg.users;
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue