about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--modules/private-wireguard.nix (renamed from nix/private-wireguard.nix)6
-rw-r--r--nix/mkSystem.nix2
2 files changed, 4 insertions, 4 deletions
diff --git a/nix/private-wireguard.nix b/modules/private-wireguard.nix
index 8e5d74c..d4ad676 100644
--- a/nix/private-wireguard.nix
+++ b/modules/private-wireguard.nix
@@ -1,12 +1,12 @@
-{ lib, hostname, config, ... }:
+{ lib, hostname, config, self, ... }:
 
 let
   inherit (lib) mkEnableOption mkOption mkIf types;
-  inherit (builtins) readFile fromTOML fromJSON;
+  inherit (builtins) readFile fromTOML;
   secrets = config.age.secrets;
   cfg = config.networking.private-wireguard;
   port = 51871;
-  wgcfg = fromTOML (readFile ./../configs/wireguard.toml);
+  wgcfg = fromTOML (readFile "${self}/configs/wireguard.toml");
   allPeers = wgcfg.peers;
   thisPeer = allPeers."${hostname}" or null;
   otherPeers = lib.filterAttrs (n: v: n != hostname) allPeers;
diff --git a/nix/mkSystem.nix b/nix/mkSystem.nix
index 1403538..d2e7ebf 100644
--- a/nix/mkSystem.nix
+++ b/nix/mkSystem.nix
@@ -10,7 +10,7 @@ inputs.nixpkgs.lib.nixosSystem {
     "${self}/modules"
     "${self}/hosts/${hostname}"
     "${self}/modules/homelab"
-    ./private-wireguard.nix
+    "${self}/modules/private-wireguard.nix"
     {
       networking.hostName = hostname;
       nixpkgs = {