From 0c9f91e92dd6a36e69bd912a33acd4fd39731d83 Mon Sep 17 00:00:00 2001 From: nyxerinys Date: Thu, 25 Jun 2026 09:29:34 -0500 Subject: [PATCH] change home manager into a proper module --- hosts/artemis/default.nix | 7 +++++++ modules/home/default.nix | 32 +++++++++++++++++++++--------- modules/home/nyxerinys/default.nix | 4 ++-- 3 files changed, 32 insertions(+), 11 deletions(-) diff --git a/hosts/artemis/default.nix b/hosts/artemis/default.nix index ee5cd82..1904e81 100644 --- a/hosts/artemis/default.nix +++ b/hosts/artemis/default.nix @@ -10,6 +10,13 @@ git ]; + nyxs-nix.services ={ + home ={ + enable = true; + isMacOS = true; + }; + }; + security.pam.services.sudo_local.touchIdAuth = true; ids.gids.nixbld = 350; programs.fish.enable = true; diff --git a/modules/home/default.nix b/modules/home/default.nix index 49c648c..3eebe3f 100644 --- a/modules/home/default.nix +++ b/modules/home/default.nix @@ -1,16 +1,30 @@ -{ inputs, ... }: - -{ +{ inputs, config, lib, ... }: +with lib; +let + cfg = config.nyxs-nix.services.home; +in { imports = [ inputs.home-manager.darwinModules.home-manager ]; - home-manager = { - useGlobalPkgs = true; - useUserPackages = true; - users = { - "nyxerinys" = import ./nyxerinys; + options.nyxs-nix.services.home = with types; { + enable = mkEnableOption "Enable the vrrp quotes service"; + + isMacOS = mkOption { + type = bool; + default = false; + description = "is this device running on macos"; + }; + }; + + config = mkIf cfg.enable { + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + users = { + "nyxerinys" = import ./nyxerinys; + }; + extraSpecialArgs = { inherit inputs; }; }; - extraSpecialArgs = { inherit inputs; }; }; } \ No newline at end of file diff --git a/modules/home/nyxerinys/default.nix b/modules/home/nyxerinys/default.nix index a3a9ba2..e6c0030 100644 --- a/modules/home/nyxerinys/default.nix +++ b/modules/home/nyxerinys/default.nix @@ -1,11 +1,11 @@ -{ config, pkgs, lib, ... }: +{ config, pkgs, lib, osConfig, ... }: { # Home Manager needs a bit of information about you and the # paths it should manage. home.username = "nyxerinys"; home.homeDirectory = ( - if pkgs.stdenv.isDarwin then + if osConfig.nyxs-nix.services.home.isMacOS then "/Users/nyxerinys" else "/home/nyxerinys"