Moving home-manager into a seperate module to conditionally import it into host configs

This commit is contained in:
xqtc161 2024-02-22 18:24:08 +01:00
parent 9f7743716a
commit eda95098d4
4 changed files with 19 additions and 8 deletions

View file

@ -28,13 +28,13 @@
inherit system; inherit system;
modules = [ modules = [
./hosts/${host} ./hosts/${host}
home-manager.nixosModules.home-manager { #home-manager.nixosModules.home-manager {
home-manager.useGlobalPkgs = true; # home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true; # home-manager.useUserPackages = true;
home-manager.extraSpecialArgs = inputs; # home-manager.extraSpecialArgs = inputs;
home-manager.users.xqtc = {...}: {imports = [ ./home nixvim.homeManagerModules.nixvim ]; }; # home-manager.users.xqtc = {...}: {imports = [ ./home nixvim.homeManagerModules.nixvim ]; };
} #}
]; ];
specialArgs = { inherit inputs; }; specialArgs = { inherit inputs; };
}); });

View file

@ -1,4 +1,4 @@
{ config, pkgs, inputs, lib, ... }: { config, pkgs, inputs, ... }:
{ {
imports = [ imports = [
./modules/nixvim.nix ./modules/nixvim.nix

View file

@ -1,10 +1,11 @@
{ config, lib, inputs, pkgs, nixos-hardware, ... }: { config, lib, inputs, pkgs, ... }:
{ {
imports = imports =
[ # Include the results of the hardware scan. [ # Include the results of the hardware scan.
./hardware-configuration.nix ./hardware-configuration.nix
#../antivirus.nix #../antivirus.nix
../../modules/home-manager.nix
inputs.nixos-hardware.nixosModules.lenovo-thinkpad-t480 inputs.nixos-hardware.nixosModules.lenovo-thinkpad-t480
../gc.nix ../gc.nix
]; ];

10
modules/home-manager.nix Normal file
View file

@ -0,0 +1,10 @@
{lib, inputs, ...}: {
imports = [ inputs.home-manager.nixosModules.home-manager ];
config = {
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.extraSpecialArgs = inputs;
home-manager.users.xqtc = {...}: {imports = [ ../home inputs.nixvim.homeManagerModules.nixvim ]; };
};
}