From c7ba15d42a9e0e883e02513f45f6c4f41ad86cb5 Mon Sep 17 00:00:00 2001 From: autumn-the-kitty-cat <147276465+autumn-the-kitty-cat@users.noreply.github.com> Date: Fri, 28 Nov 2025 18:06:06 -0500 Subject: [PATCH] fix: refactor flake.nix, home-manager/home.nix, nixos/configuration.nix to avoid home-manager.useGlobalPkgs conflict error --- flake.nix | 36 ++++++------------------------------ home-manager/home.nix | 11 ++++++++++- nixos/configuration.nix | 14 +++++++++++++- 3 files changed, 29 insertions(+), 32 deletions(-) diff --git a/flake.nix b/flake.nix index 0c1ede4..ff70aab 100644 --- a/flake.nix +++ b/flake.nix @@ -31,40 +31,16 @@ { ... }@inputs: let system = "x86_64-linux"; - pkgs = import inputs.nixpkgs { - inherit system; - config.allowUnfree = true; - }; + #pkgs = import inputs.nixpkgs { + # inherit system; + #}; hostName = "january"; + userName = "autumn"; in { nixosConfigurations.${hostName} = inputs.nixpkgs.lib.nixosSystem { - inherit system; - inherit pkgs; - specialArgs = { - inherit hostName; - }; - modules = [ - ./nixos/configuration.nix - - inputs.home-manager.nixosModules.home-manager - { - home-manager.backupFileExtension = "hm-bak"; - - home-manager.extraSpecialArgs = { inherit inputs; }; - - home-manager.sharedModules = [ - inputs.nixvim.homeModules.nixvim - inputs.stylix.homeModules.stylix - inputs.zen-browser.homeModules.default - ]; - - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; - - home-manager.users."autumn" = ./home-manager/home.nix; - } - ]; + specialArgs = { inherit inputs; inherit hostName; }; + modules = [ ./nixos/configuration.nix ]; }; }; } diff --git a/home-manager/home.nix b/home-manager/home.nix index e6c1317..8a67d7f 100644 --- a/home-manager/home.nix +++ b/home-manager/home.nix @@ -1,6 +1,10 @@ -{ pkgs, ... }: +{ inputs, pkgs, ... }: { imports = [ + inputs.nixvim.homeModules.nixvim + inputs.stylix.homeModules.stylix + inputs.zen-browser.homeModules.default + ./programs ./clangd.nix @@ -14,6 +18,11 @@ home.homeDirectory = "/home/autumn"; home.stateVersion = "25.05"; + nixpkgs.config = { + allowUnfree = true; + allowUnfreePredicate = _: true; + }; + home.pointerCursor = { name = "Adwaita"; package = pkgs.adwaita-icon-theme; diff --git a/nixos/configuration.nix b/nixos/configuration.nix index 90072cc..ecddbbf 100644 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -1,20 +1,25 @@ -{ pkgs, hostName, ... }: +{ inputs, hostName, pkgs, ... }: { imports = [ ./hardware-configuration.nix + inputs.home-manager.nixosModules.home-manager ]; boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; boot.tmp.cleanOnBoot = true; + nix.package = pkgs.lixPackageSets.latest.lix; + networking.hostName = "${hostName}"; hardware.graphics.enable = true; networking.networkmanager.enable = true; + nixpkgs.config.allowUnfree = true; + time.timeZone = "America/Toronto"; i18n.defaultLocale = "en_CA.UTF-8"; @@ -24,6 +29,13 @@ KERNEL=="hidraw*", SUBSYSTEM=="hidraw", MODE="0660", GROUP="users", TAG+="uaccess", TAG+="udev-acl" ''; + home-manager = { + extraSpecialArgs = { inherit inputs; }; + users = { + autumn = import ../home-manager/home.nix; + }; + }; + services.gnome.glib-networking.enable = true; programs.hyprland = {