From 3e1b60d7c3dc9a33f2dc72bca5714d53dee7610d Mon Sep 17 00:00:00 2001
From: NullBite <me@nullbite.com>
Date: Mon, 22 Apr 2024 16:48:40 -0400
Subject: [PATCH] home: add option for location of nixfiles repo

This is used by the flake registry as well as a shortcut for editing
Hyprland config
---
 home/common/nix.nix | 2 +-
 home/default.nix    | 7 +++++++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/home/common/nix.nix b/home/common/nix.nix
index bb55912..5afecae 100644
--- a/home/common/nix.nix
+++ b/home/common/nix.nix
@@ -14,7 +14,7 @@ in {
           };
           to = {
             type = "git";
-            url = "file://${config.home.homeDirectory}/nixfiles";
+            url = "file://${config.nixfiles.path}";
           };
         };
       };
diff --git a/home/default.nix b/home/default.nix
index 3bb425d..333f850 100644
--- a/home/default.nix
+++ b/home/default.nix
@@ -61,5 +61,12 @@ in
       default = (lib.hasAttrByPath [ "nixfiles" "meta" "wayland" ] osConfig) && osConfig.nixfiles.meta.wayland;
       example = true;
     };
+    path = lib.mkOption {
+      description = "The absolute path of the nixfiles flake";
+      type = lib.types.str;
+      default = "${config.home.homeDirectory}/nixfiles";
+      defaultText = "\${config.home.homeDirectory}/nixfiles";
+      example = "/etc/nixos";
+    };
   };
 }