aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpacien2022-11-15 01:40:05 +0100
committerpacien2022-11-15 01:40:05 +0100
commitc3f9daf4ec56276e040bc33e29c7eeaf1b99d91c (patch)
tree0fbb76a1bf910c61ca3f4cf42307549bff491b5c
parentbbfbcb9a43fde963e60a38094a577f25129bc619 (diff)
downloadflaky-utils-c3f9daf4ec56276e040bc33e29c7eeaf1b99d91c.tar.gz
lib/mkSandboxSystem: print network restriction status
-rw-r--r--lib/mk-sandbox-system.nix13
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/mk-sandbox-system.nix b/lib/mk-sandbox-system.nix
index e9866cf..3bbc488 100644
--- a/lib/mk-sandbox-system.nix
+++ b/lib/mk-sandbox-system.nix
@@ -39,6 +39,17 @@ let
39 ${shellLib.fmt.printSectionTitle "FORWARDED PORTS (host <-> guest)"} 39 ${shellLib.fmt.printSectionTitle "FORWARDED PORTS (host <-> guest)"}
40 ${pkgs.lib.concatMapStringsSep "\n" printForwardedPort portForwards} 40 ${pkgs.lib.concatMapStringsSep "\n" printForwardedPort portForwards}
41 ''; 41 '';
42
43 printNetworkRestricted = isRestricted:
44 if isRestricted then "Restricted" else "Unrestricted";
45 printNetworkAllowed = isRestricted:
46 if isRestricted then "disallowed" else "allowed";
47 printRestrictedNetwork = isRestricted: ''
48 ${shellLib.fmt.printSectionTitle "NETWORK ACCESS"}
49 echo -en ${shellLib.fmt.keyword (printNetworkRestricted isRestricted)}
50 echo -n ': local network and internet access '
51 echo ${printNetworkAllowed isRestricted}.
52 '';
42 }; 53 };
43 54
44in rec { 55in rec {
@@ -84,11 +95,11 @@ in rec {
84 interactiveShellInit = lib.mkBefore '' 95 interactiveShellInit = lib.mkBefore ''
85 ${shellLib.ifSomeAttrs envVars shellLib.printEnvVars} 96 ${shellLib.ifSomeAttrs envVars shellLib.printEnvVars}
86 ${shellLib.ifSomeList tools shellLib.printBins} 97 ${shellLib.ifSomeList tools shellLib.printBins}
87
88 ${shellLib.ifSomeAttrs config.virtualisation.sharedDirectories 98 ${shellLib.ifSomeAttrs config.virtualisation.sharedDirectories
89 print.printSharedDirs} 99 print.printSharedDirs}
90 ${shellLib.ifSomeList config.virtualisation.forwardPorts 100 ${shellLib.ifSomeList config.virtualisation.forwardPorts
91 print.printForwardedPorts} 101 print.printForwardedPorts}
102 ${print.printRestrictedNetwork restrictNetwork}
92 ''; 103 '';
93 }; 104 };
94 105