From e5d25d27a92586cf319d05f4d71f24c21b7427ce Mon Sep 17 00:00:00 2001 From: aaron Date: Fri, 12 Dec 2025 14:23:51 +0100 Subject: [PATCH] refactor(home-manager): separate configuration.nix and home.nix by adding home-manager as a module --- flake.nix | 35 ++++++++++++++++++----------------- hosts/neon/configuration.nix | 6 ------ hosts/neon/home.nix | 7 ++++--- 3 files changed, 22 insertions(+), 26 deletions(-) diff --git a/flake.nix b/flake.nix index 1505170..05ef7d3 100644 --- a/flake.nix +++ b/flake.nix @@ -1,41 +1,35 @@ { - description = "0x29a NixOS flake config"; + description = "0x29a ecosystem NixOS flake"; inputs = { - # the main nix package collection nixpkgs = { url = "github:nixos/nixpkgs/nixos-unstable"; }; - # home manager for dotfiles home-manager = { url = "github:nix-community/home-manager"; inputs.nixpkgs.follows = "nixpkgs"; }; - # noctalia shell noctalia = { url = "github:noctalia-dev/noctalia-shell"; inputs.nixpkgs.follows = "nixpkgs"; }; - }; - outputs = inputs@{ self, nixpkgs, home-manager, ... }: - let - lib = nixpkgs.lib; - system = "x86_64-linux"; - pkgs = nixpkgs.legacyPackages.${system}; - in { + outputs = inputs@{self, nixpkgs, home-manager, ... }: let + lib = nixpkgs.lib; + system = "x86_64-linux"; + pkgs = nixpkgs.legacyPackages.${system}; + in { nixosConfigurations = { - # default config default = nixpkgs.lib.nixosSystem { inherit system; - specialArgs = { + specialArgs = { inherit inputs; - }; + }; modules = [ # import host specific configs ./hosts/default/configuration.nix @@ -47,9 +41,9 @@ # laptop neon neon = nixpkgs.lib.nixosSystem { inherit system; - specialArgs = { + specialArgs = { inherit inputs; - }; + }; modules = [ # import host specific configs ./hosts/neon/configuration.nix @@ -57,9 +51,16 @@ ./hosts/neon/hardware-configuration.nix # import noctalia shell configs ./hosts/neon/noctalia.nix + # Add home-manager form my user as a module + home-manager.nixosModules.home-manager + { + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.users.aaron = import ./hosts/neon/home.nix; + home-manager.extraSpecialArgs = { inherit inputs; }; + } ]; }; - }; }; } diff --git a/hosts/neon/configuration.nix b/hosts/neon/configuration.nix index 872453a..65c553c 100644 --- a/hosts/neon/configuration.nix +++ b/hosts/neon/configuration.nix @@ -1,12 +1,9 @@ -# 0x29a nixos conifg - { pkgs, lib, inputs, ... }: { imports = [ ./hardware-configuration.nix - inputs.home-manager.nixosModules.home-manager ]; # use flakes @@ -149,9 +146,6 @@ home-manager.useUserPackages = true; home-manager.backupFileExtension = "backup"; - # Add the user's home-manager configuration - home-manager.users.aaron = import ./home.nix; - # install state version system.stateVersion = "25.11"; # Don't change } diff --git a/hosts/neon/home.nix b/hosts/neon/home.nix index a6415e4..3bd24c7 100644 --- a/hosts/neon/home.nix +++ b/hosts/neon/home.nix @@ -8,7 +8,6 @@ # user packages home.packages = with pkgs; [ discord - #teamspeak3 # unmaintained qtwebkit fastfetch screenfetch zip @@ -44,6 +43,7 @@ usbutils powerline-fonts powerline-symbols + nerd-fonts.sauce-code-pro ]; # configure git @@ -52,7 +52,7 @@ userName = "aaron"; userEmail = "aaron@0x29a.ch"; }; - + # configure zsh theme programs.zsh = { enable = true; @@ -61,6 +61,7 @@ oh-my-zsh = { enable = true; theme = "agnoster"; + #plugins = [ "git" "ssh-agent" ]; }; }; @@ -74,7 +75,7 @@ gtk3.extraConfig.gtk-application-prefer-dark-theme = 1; gtk4.extraConfig.gtk-application-prefer-dark-theme = 1; }; - + # set qt theme qt = { enable = true;