From eda95098d4cab7c99daa785a97a58438766c9334 Mon Sep 17 00:00:00 2001 From: xqtc161 Date: Thu, 22 Feb 2024 18:24:08 +0100 Subject: [PATCH] Moving home-manager into a seperate module to conditionally import it into host configs --- flake.nix | 12 ++++++------ home/default.nix | 2 +- hosts/lilith/default.nix | 3 ++- modules/home-manager.nix | 10 ++++++++++ 4 files changed, 19 insertions(+), 8 deletions(-) create mode 100644 modules/home-manager.nix diff --git a/flake.nix b/flake.nix index c4ef0e1..3905ef7 100644 --- a/flake.nix +++ b/flake.nix @@ -28,13 +28,13 @@ inherit system; modules = [ ./hosts/${host} - home-manager.nixosModules.home-manager { - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; + #home-manager.nixosModules.home-manager { + # home-manager.useGlobalPkgs = true; + # home-manager.useUserPackages = true; - home-manager.extraSpecialArgs = inputs; - home-manager.users.xqtc = {...}: {imports = [ ./home nixvim.homeManagerModules.nixvim ]; }; - } + # home-manager.extraSpecialArgs = inputs; + # home-manager.users.xqtc = {...}: {imports = [ ./home nixvim.homeManagerModules.nixvim ]; }; + #} ]; specialArgs = { inherit inputs; }; }); diff --git a/home/default.nix b/home/default.nix index 36d7e41..d7d9580 100644 --- a/home/default.nix +++ b/home/default.nix @@ -1,4 +1,4 @@ -{ config, pkgs, inputs, lib, ... }: +{ config, pkgs, inputs, ... }: { imports = [ ./modules/nixvim.nix diff --git a/hosts/lilith/default.nix b/hosts/lilith/default.nix index e5d176b..e0080a4 100644 --- a/hosts/lilith/default.nix +++ b/hosts/lilith/default.nix @@ -1,10 +1,11 @@ -{ config, lib, inputs, pkgs, nixos-hardware, ... }: +{ config, lib, inputs, pkgs, ... }: { imports = [ # Include the results of the hardware scan. ./hardware-configuration.nix #../antivirus.nix + ../../modules/home-manager.nix inputs.nixos-hardware.nixosModules.lenovo-thinkpad-t480 ../gc.nix ]; diff --git a/modules/home-manager.nix b/modules/home-manager.nix new file mode 100644 index 0000000..f1aafa5 --- /dev/null +++ b/modules/home-manager.nix @@ -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 ]; }; + }; +}