Fix SSH
This commit is contained in:
@@ -1,19 +1,10 @@
|
||||
{ config, lib, pkgs, ... }: let
|
||||
systemsDir = ../../../../../systems;
|
||||
systemNames = lib.attrNames (lib.filterAttrs
|
||||
(name: type: type == "directory" && builtins.pathExists (systemsDir + "/${name}/cfg.nix"))
|
||||
(builtins.readDir systemsDir));
|
||||
|
||||
# Use a helper to check if the attribute path exists safely
|
||||
# This prevents the "attribute 'net' missing" error
|
||||
isValidPeer = p:
|
||||
(p ? syscfg.net.wg.enable) &&
|
||||
(p.syscfg.net.wg.enable == true) &&
|
||||
(p.syscfg.net.wg.pubkey != config.syscfg.net.wg.pubkey);
|
||||
|
||||
importedConfigs = map (name: import (systemsDir + "/${name}/cfg.nix")) systemNames;
|
||||
|
||||
activePeers = builtins.filter isValidPeer importedConfigs;
|
||||
activePeers = builtins.filter isValidPeer config.syscfg.peers;
|
||||
in
|
||||
{
|
||||
imports = [ ./forwarding.nix ];
|
||||
|
||||
Reference in New Issue
Block a user