From 9e044d2e8ac6d5d993ac35c2db2dae7d7bb9277d Mon Sep 17 00:00:00 2001 From: Reboot-Codes Date: Fri, 24 Jan 2025 08:57:13 -0700 Subject: [PATCH] Refactor non-nixos home manager config to common --- .../home/configs/external.nix | 8 ++------ {hosts => common/modules}/default-config.nix | 0 common/modules/default.nix | 3 +++ flake.nix | 7 ++----- hosts/home-manager.nix | 16 ++++++++++++++++ hosts/nixos.nix | 2 +- 6 files changed, 24 insertions(+), 12 deletions(-) rename hosts/generic-amd64-linux-gui/default.nix => common/home/configs/external.nix (69%) mode change 100755 => 100644 rename {hosts => common/modules}/default-config.nix (100%) create mode 100644 common/modules/default.nix create mode 100644 hosts/home-manager.nix diff --git a/hosts/generic-amd64-linux-gui/default.nix b/common/home/configs/external.nix old mode 100755 new mode 100644 similarity index 69% rename from hosts/generic-amd64-linux-gui/default.nix rename to common/home/configs/external.nix index b784e5b..40894d0 --- a/hosts/generic-amd64-linux-gui/default.nix +++ b/common/home/configs/external.nix @@ -1,8 +1,4 @@ -{ config, pkgs, pkgs-stable, home-manager, ...}: { - imports = [ ../../common/home ]; - - # TODO: packages to package sets in common/home/packages - +{ pkgs, ... }: { home = { stateVersion = "24.11"; username = "reboot"; @@ -23,4 +19,4 @@ services.gpg-agent = { pinentryPackage = pkgs.pinentry.qt; }; -} +} \ No newline at end of file diff --git a/hosts/default-config.nix b/common/modules/default-config.nix similarity index 100% rename from hosts/default-config.nix rename to common/modules/default-config.nix diff --git a/common/modules/default.nix b/common/modules/default.nix new file mode 100644 index 0000000..eca4844 --- /dev/null +++ b/common/modules/default.nix @@ -0,0 +1,3 @@ +{ hostConfig, pkgs, pkgs-stable, ... }: { + imports = [ ./default-config.nix ]; +} \ No newline at end of file diff --git a/flake.nix b/flake.nix index 94014cc..a1b1572 100755 --- a/flake.nix +++ b/flake.nix @@ -51,11 +51,8 @@ }; # For *nix systems that are not NixOS or macOS - homeConfigurations = { - "reboot" = home-manager.lib.homeManagerConfiguration { - pkgs = nixpkgs.legacyPackages."x86_64-linux"; - modules = [ ./hosts/generic-amd64-linux-gui/default.nix ]; - }; + homeConfigurations = import ./hosts/home-manager.nix { + inherit nixpkgs nixpkgs-stable home-manager flatpaks rust-overlay nur chaotic aagl nixGL; }; }; } diff --git a/hosts/home-manager.nix b/hosts/home-manager.nix new file mode 100644 index 0000000..2d41059 --- /dev/null +++ b/hosts/home-manager.nix @@ -0,0 +1,16 @@ +{ nixpkgs, nixpkgs-stable, home-manager, flatpaks, rust-overlay, nur, chaotic, aagl, nixGL, ... }: let + defaultDesktop = { + username = "reboot"; + system = "x86_64-linux"; + systemType = "external"; + }; +in { + "${hostConfig.username}" = let + hostConfig = defaultDesktop; + in home-manager.lib.homeManagerConfiguration rec { + pkgs = nixpkgs.legacyPackages."${hostConfig.system}"; + modules = [ + ../common/home + ]; + }; +} \ No newline at end of file diff --git a/hosts/nixos.nix b/hosts/nixos.nix index 8ed6dd4..9e5920c 100644 --- a/hosts/nixos.nix +++ b/hosts/nixos.nix @@ -62,7 +62,7 @@ in nixpkgs.lib.nixosSystem rec { }; } - ./default-config.nix + ../common/modules ../common/home (./. + "/${hostname}") # Our Configs ]; -- 2.51.2