From 71a4f49fb7cd98f2eddac540187fc0a171390cb4 Mon Sep 17 00:00:00 2001 From: Crony Akatsuki Date: Wed, 29 Jan 2025 21:36:15 +0100 Subject: [PATCH] Move home manager setup to flake.nix --- flake.nix | 16 ++++++++++++++++ hosts/nixos/configuration.nix | 9 --------- modules/home-manager/default.nix | 1 + 3 files changed, 17 insertions(+), 9 deletions(-) create mode 100644 modules/home-manager/default.nix diff --git a/flake.nix b/flake.nix index 70fc387..41e6437 100644 --- a/flake.nix +++ b/flake.nix @@ -30,9 +30,25 @@ nixosConfigurations.nixos = nixpkgs.lib.nixosSystem { specialArgs = {inherit inputs;}; modules = [ + # Get the system config ./hosts/nixos/configuration.nix + # Enable stylix inputs.stylix.nixosModules.stylix + # Load my modules ./modules/nixos + # Setup home manager for my user + home-manager.nixosModules.home-manager + { + home-manager.useGlobalPkgs = true; + home-manager.extraSpecialArgs = {inherit inputs;}; + home-manager.backupFileExtension = "backup"; + home-manager.users.crony = { + imports = [ + ./hosts/nixos/home.nix + ./modules/home-manager + ]; + }; + } ]; }; }; diff --git a/hosts/nixos/configuration.nix b/hosts/nixos/configuration.nix index 9ba1bea..a26f02d 100644 --- a/hosts/nixos/configuration.nix +++ b/hosts/nixos/configuration.nix @@ -73,15 +73,6 @@ extraGroups = ["networkmanager" "wheel" "video" "input" "audio" "libvirtd"]; }; - # Setup home manager - home-manager = { - extraSpecialArgs = {inherit inputs;}; - backupFileExtension = "backup"; - users = { - crony = import ./home.nix; - }; - }; - # Allow unfree packages nixpkgs.config.allowUnfree = true; diff --git a/modules/home-manager/default.nix b/modules/home-manager/default.nix new file mode 100644 index 0000000..6462967 --- /dev/null +++ b/modules/home-manager/default.nix @@ -0,0 +1 @@ +{...}: {}