Use Nixos modules for home manager configurations
All checks were successful
/ build-all (push) Successful in 54s

This commit is contained in:
ant 2026-03-12 23:32:44 +01:00
parent 632061ac61
commit 85e75928dc
10 changed files with 65 additions and 91 deletions

View file

@ -21,7 +21,6 @@
let
system = "x86_64-linux";
pkgs = inputs.nixpkgs.legacyPackages.${system};
pkgs-unstable = inputs.unstable.legacyPackages.${system};
nixgl = inputs.nixgl.packages.${system};
sshKeys = (import ./sshKeys.nix);
osConfig = modules: nixpkgs.lib.nixosSystem {
@ -35,12 +34,25 @@
inherit pkgs;
extraSpecialArgs = {
inherit pkgs-unstable;
inherit inputs;
};
inherit modules;
};
homeConfigInOs = {username, modules, userOptions ? []}: {
imports = [ inputs.home-manager.nixosModules.home-manager ];
users.users.${username} = { isNormalUser = true; } // userOptions;
home-manager = {
extraSpecialArgs = { inherit inputs; };
useGlobalPkgs = true;
useUserPackages = true;
users.${username} = {
imports = modules ++ [
{ home.username = username; }
];
};
};
};
in
rec {
homeConfigurations."anvaure@Allegro23-12" = homeConfig [
@ -62,35 +74,6 @@
];
homeConfigurations."anvaure@msm-lnx-demo-01" = homeConfigurations."anvaure@msm-lnx-ipva-01";
homeConfigurations."ant@hs" = homeConfig [
{ home.username = "ant"; }
./home/more-software.nix
];
homeConfigurations."ant@ks" = homeConfig [
{ home.username = "ant"; }
./home/more-software.nix
];
homeConfigurations."ant@basado" = homeConfig [
{ home.username = "ant"; }
./home/ui.nix
./home/more-software.nix
./home/gaming.nix
./home/syncthing.nix
{ services.kdeconnect.enable = true; }
./home/basado.nix
];
homeConfigurations."ant@moon" = homeConfig [
{ home.username = "ant"; }
./home/more-software.nix
./home/ui.nix
./home/syncthing.nix
{ services.kdeconnect.enable = true; }
./home/moon.nix
];
nixosConfigurations.basado = osConfig [
./os/basado/configuration.nix
./os/basado/hardware-configuration.nix
@ -102,14 +85,40 @@
./os/kdeconnect-ports.nix
(import ./os/swapfile.nix 64)
./os/ccache.nix
(homeConfigInOs {
username = "ant";
modules = [
./home/ui.nix
./home/more-software.nix
./home/gaming.nix
./home/syncthing.nix
{ services.kdeconnect.enable = true; }
./home/basado.nix
];
userOptions = {
extraGroups = [ "networkmanager" "wheel" "video" "libvirtd" "msr" "docker" "gamemode" ];
};
})
];
nixosConfigurations.moon = osConfig [
./os/moon/configuration.nix
./os/moon/hardware-configuration.nix
./os/common.nix
./os/common-graphics.nix
./os/kdeconnect-ports.nix
(homeConfigInOs {
username = "ant";
modules = [
./home/more-software.nix
./home/ui.nix
./home/syncthing.nix
{ services.kdeconnect.enable = true; }
./home/moon.nix
];
userOptions = {
extraGroups = [ "networkmanager" "wheel" "video" ];
};
} )
];
nixosConfigurations.hs = osConfig [
./os/hs/configuration.nix
@ -124,12 +133,28 @@
./os/builder.nix
./os/ccache.nix
(import ./os/swapfile.nix 64)
(homeConfigInOs {
username = "ant";
modules = [ ./home/more-software.nix ];
userOptions = {
extraGroups = [ "networkmanager" "wheel" "jellyfin" ];
openssh.authorizedKeys.keys = (with sshKeys; [ basado moon allegro hs ]);
};
})
];
nixosConfigurations.ks = osConfig [
./os/ks/configuration.nix
./os/ks/hardware-configuration.nix
./os/common.nix
./os/3proxy.nix
(homeConfigInOs {
username = "ant";
modules = [ ./home/more-software.nix ];
userOptions = {
extraGroups = [ "networkmanager" "wheel" "jellyfin" ];
openssh.authorizedKeys.keys = with sshKeys; [ basado hs moon ];
};
})
];
build-all = pkgs.runCommand "build-all" {
@ -142,10 +167,6 @@
(osDerivation "hs")
(osDerivation "ks")
(homeDerivation "anvaure@Allegro23-12")
(homeDerivation "ant@hs")
(homeDerivation "ant@ks")
(homeDerivation "ant@basado")
(homeDerivation "ant@moon")
];
} ''
echo Build all derivations