Skip to content
Snippets Groups Projects
Commit 33e25a1d authored by Jens Nolte's avatar Jens Nolte
Browse files

Set some vpn-related options

parent 3064a265
No related branches found
No related tags found
No related merge requests found
...@@ -32,7 +32,7 @@ fi ...@@ -32,7 +32,7 @@ fi
hostname=$1 hostname=$1
readonly config_file_path="$MACHINES_PATH/external/$hostname/wg_gateway.json" readonly config_file_path="$MACHINES_PATH/external/$hostname/qnet.json"
if [[ ! -f $config_file_path ]] if [[ ! -f $config_file_path ]]
then then
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
{ name, path, channel, isIso, extraLayersDir, flakeInputs, flakeOutputs, system, extraOverlays }: { name, path, channel, isIso, extraLayersDir, flakeInputs, flakeOutputs, system, extraOverlays }:
{ lib, config, pkgs, ... }: { lib, config, pkgs, ... }:
with lib;
let let
installResult = builtins.fromJSON (builtins.readFile (path + "/install-result.json")); installResult = builtins.fromJSON (builtins.readFile (path + "/install-result.json"));
...@@ -83,4 +84,17 @@ in ...@@ -83,4 +84,17 @@ in
# Default hostname ist machine directory name # Default hostname ist machine directory name
networking.hostName = lib.mkDefault name; networking.hostName = lib.mkDefault name;
queezle.qnet =
let
qnetFile = path + "/qnet.json";
exists = builtins.pathExists qnetFile;
qnet = if exists then builtins.fromJSON (builtins.readFile qnetFile) else null;
in if exists then {
enable = mkDefault true;
address = mkDefault qnet.address;
allowedIPs = mkDefault qnet.allowedIPs;
peerEndpoint = mkDefault qnet.peerEndpoint;
publicKey = mkDefault qnet.publicKey;
} else {};
} }
# applied by this repositories flake # applied by this repositories flake
{ flakeInputs, flakeOutputs }: { flakeInputs, flakeOutputs }:
# applied by outer flake # applied by outer flake
{ extraFlakeInputs, extraFlakeOutputs, machinesDir, extraLayersDir, extraOverlays ? [] }: { extraFlakeInputs, extraFlakeOutputs, machinesDir, extraModules, extraLayersDir, extraOverlays ? [] }:
with builtins; with builtins;
with flakeInputs.nixpkgs.lib; with flakeInputs.nixpkgs.lib;
...@@ -35,6 +35,7 @@ let ...@@ -35,6 +35,7 @@ let
flakeOutputs = finalFlakeOutputs; flakeOutputs = finalFlakeOutputs;
channel = machineChannels.${name}; channel = machineChannels.${name};
}) })
extraModules
] ++ optional isMobileNixos (import "${flakeInputs.mobile-nixos}/lib/configuration.nix" { device = mobileNixosDevice; }); ] ++ optional isMobileNixos (import "${flakeInputs.mobile-nixos}/lib/configuration.nix" { device = mobileNixosDevice; });
_module.args.flakeInputs = finalFlakeInputs; _module.args.flakeInputs = finalFlakeInputs;
_module.args.flakeOutputs = finalFlakeOutputs; _module.args.flakeOutputs = finalFlakeOutputs;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment