.
This commit is contained in:
parent
59a1fbaf0f
commit
ac3dac322d
78 changed files with 893 additions and 802 deletions
78
users/default.nix
Normal file
78
users/default.nix
Normal file
|
|
@ -0,0 +1,78 @@
|
|||
{
|
||||
config,
|
||||
inputs,
|
||||
lib,
|
||||
mkPkgs,
|
||||
sharedContext,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkOption types;
|
||||
|
||||
mkHomeUserModule = spec:
|
||||
(import spec.path {}).home-manager.users.${spec.user};
|
||||
in {
|
||||
options.localUsers = {
|
||||
homeEntries = mkOption {
|
||||
type = types.attrsOf types.raw;
|
||||
default = {};
|
||||
};
|
||||
|
||||
homeSharedModules = mkOption {
|
||||
type = types.listOf types.raw;
|
||||
default = [];
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
localUsers.homeEntries = {
|
||||
"chris@mandos" = {
|
||||
machine = "mandos";
|
||||
user = "chris";
|
||||
path = ../users/chris/mandos.nix;
|
||||
};
|
||||
"chris@manwe" = {
|
||||
machine = "manwe";
|
||||
user = "chris";
|
||||
path = ../users/chris/manwe.nix;
|
||||
};
|
||||
"chris@orome" = {
|
||||
machine = "orome";
|
||||
user = "chris";
|
||||
path = ../users/chris/orome.nix;
|
||||
};
|
||||
"chris@tulkas" = {
|
||||
machine = "tulkas";
|
||||
user = "chris";
|
||||
path = ../users/chris/tulkas.nix;
|
||||
};
|
||||
};
|
||||
|
||||
localUsers.homeSharedModules =
|
||||
[
|
||||
inputs.stylix.homeModules.stylix
|
||||
inputs.plasma-manager.homeModules.plasma-manager
|
||||
inputs.zen-browser.homeModules.default
|
||||
]
|
||||
++ [ ../modules/home ];
|
||||
|
||||
flake.homeConfigurations = lib.mapAttrs (_: spec:
|
||||
inputs.home-manager.lib.homeManagerConfiguration {
|
||||
pkgs = mkPkgs "x86_64-linux";
|
||||
extraSpecialArgs =
|
||||
sharedContext
|
||||
// {
|
||||
osConfig = config.flake.nixosConfigurations.${spec.machine}.config;
|
||||
};
|
||||
modules =
|
||||
config.localUsers.homeSharedModules
|
||||
++ [
|
||||
{
|
||||
home.username = spec.user;
|
||||
home.homeDirectory = "/home/${spec.user}";
|
||||
}
|
||||
(mkHomeUserModule spec)
|
||||
];
|
||||
})
|
||||
config.localUsers.homeEntries;
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue