feat(flake): add home-manager nixos module support to host.admin
This commit is contained in:
parent
25e02c034c
commit
ba2cbc18de
2 changed files with 22 additions and 3 deletions
|
|
@ -96,6 +96,8 @@
|
||||||
systems = [ "x86_64-linux" "aarch64-linux" ];
|
systems = [ "x86_64-linux" "aarch64-linux" ];
|
||||||
forEachSystem = f: lib.genAttrs systems (sys: f pkgsFor.${sys});
|
forEachSystem = f: lib.genAttrs systems (sys: f pkgsFor.${sys});
|
||||||
pkgsFor = nixpkgs.legacyPackages;
|
pkgsFor = nixpkgs.legacyPackages;
|
||||||
|
|
||||||
|
hm = inputs.home-manager.nixosModules.home-manager;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
inherit lib;
|
inherit lib;
|
||||||
|
|
@ -140,7 +142,10 @@
|
||||||
};
|
};
|
||||||
# Main Desktop
|
# Main Desktop
|
||||||
"ooks@ooksdesk" = lib.homeManagerConfiguration {
|
"ooks@ooksdesk" = lib.homeManagerConfiguration {
|
||||||
modules = [ ./home/user/ooks/ooksdesk ];
|
modules = [
|
||||||
|
./home/user/ooks/ooksdesk
|
||||||
|
hm
|
||||||
|
];
|
||||||
pkgs = pkgsFor.x86_64-linux;
|
pkgs = pkgsFor.x86_64-linux;
|
||||||
extraSpecialArgs = { inherit inputs outputs; };
|
extraSpecialArgs = { inherit inputs outputs; };
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,10 @@
|
||||||
{ lib, config, pkgs, ... }:
|
{ lib, config, pkgs, inputs, outputs, self, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.systemModules.host.admin;
|
cfg = config.systemModules.host.admin;
|
||||||
|
host = config.systemModules.host;
|
||||||
ifTheyExist = groups: builtins.filter (group: builtins.hasAttr group config.users.groups) groups;
|
ifTheyExist = groups: builtins.filter (group: builtins.hasAttr group config.users.groups) groups;
|
||||||
inherit (lib) types mkOption;
|
inherit (lib) mkIf types mkOption;
|
||||||
in
|
in
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
@ -23,6 +24,11 @@ in
|
||||||
default = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBn3ff3HaZHIyH4K13k8Mwqu/o7jIABJ8rANK+r2PfJk";
|
default = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBn3ff3HaZHIyH4K13k8Mwqu/o7jIABJ8rANK+r2PfJk";
|
||||||
description = "The ssh key for the admin user";
|
description = "The ssh key for the admin user";
|
||||||
};
|
};
|
||||||
|
homeManager = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
description = "Enables home manager module for the admin user";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
|
|
@ -45,5 +51,13 @@ in
|
||||||
"torrenter"
|
"torrenter"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
home-manager = mkIf cfg.homeManager {
|
||||||
|
useGlobalPkgs = true;
|
||||||
|
useUserPackages = true;
|
||||||
|
backupFileExtension = "hm.old";
|
||||||
|
verbose = true;
|
||||||
|
extraSpecialArgs = { inherit inputs outputs self; };
|
||||||
|
users.${cfg.name} = import "${self}/home/user/${cfg.name}/${host.name}";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue