refactor(home-manager): separate configuration.nix and home.nix by adding home-manager as a module

This commit is contained in:
2025-12-12 14:23:51 +01:00
parent 434901d813
commit e5d25d27a9
3 changed files with 22 additions and 26 deletions

View File

@@ -1,35 +1,29 @@
{ {
description = "0x29a NixOS flake config"; description = "0x29a ecosystem NixOS flake";
inputs = { inputs = {
# the main nix package collection # the main nix package collection
nixpkgs = { nixpkgs = {
url = "github:nixos/nixpkgs/nixos-unstable"; url = "github:nixos/nixpkgs/nixos-unstable";
}; };
# home manager for dotfiles # home manager for dotfiles
home-manager = { home-manager = {
url = "github:nix-community/home-manager"; url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
# noctalia shell # noctalia shell
noctalia = { noctalia = {
url = "github:noctalia-dev/noctalia-shell"; url = "github:noctalia-dev/noctalia-shell";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
}; };
outputs = inputs@{ self, nixpkgs, home-manager, ... }: outputs = inputs@{self, nixpkgs, home-manager, ... }: let
let
lib = nixpkgs.lib; lib = nixpkgs.lib;
system = "x86_64-linux"; system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system}; pkgs = nixpkgs.legacyPackages.${system};
in { in {
nixosConfigurations = { nixosConfigurations = {
# default config # default config
default = nixpkgs.lib.nixosSystem { default = nixpkgs.lib.nixosSystem {
inherit system; inherit system;
@@ -57,9 +51,16 @@
./hosts/neon/hardware-configuration.nix ./hosts/neon/hardware-configuration.nix
# import noctalia shell configs # import noctalia shell configs
./hosts/neon/noctalia.nix ./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; };
}
]; ];
}; };
}; };
}; };
} }

View File

@@ -1,12 +1,9 @@
# 0x29a nixos conifg
{ pkgs, lib, inputs, ... }: { pkgs, lib, inputs, ... }:
{ {
imports = imports =
[ [
./hardware-configuration.nix ./hardware-configuration.nix
inputs.home-manager.nixosModules.home-manager
]; ];
# use flakes # use flakes
@@ -149,9 +146,6 @@
home-manager.useUserPackages = true; home-manager.useUserPackages = true;
home-manager.backupFileExtension = "backup"; home-manager.backupFileExtension = "backup";
# Add the user's home-manager configuration
home-manager.users.aaron = import ./home.nix;
# install state version # install state version
system.stateVersion = "25.11"; # Don't change system.stateVersion = "25.11"; # Don't change
} }

View File

@@ -8,7 +8,6 @@
# user packages # user packages
home.packages = with pkgs; [ home.packages = with pkgs; [
discord discord
#teamspeak3 # unmaintained qtwebkit
fastfetch fastfetch
screenfetch screenfetch
zip zip
@@ -44,6 +43,7 @@
usbutils usbutils
powerline-fonts powerline-fonts
powerline-symbols powerline-symbols
nerd-fonts.sauce-code-pro
]; ];
# configure git # configure git
@@ -61,6 +61,7 @@
oh-my-zsh = { oh-my-zsh = {
enable = true; enable = true;
theme = "agnoster"; theme = "agnoster";
#plugins = [ "git" "ssh-agent" ];
}; };
}; };