summary refs log tree commit diff
path: root/nixos/modules/config/sysctl.nix
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2013-11-26 18:17:12 +0100
committerEelco Dolstra <eelco.dolstra@logicblox.com>2013-11-26 18:19:45 +0100
commit2b1f21249445991940c9d3ebbc54ce41b1eaf9c0 (patch)
tree3c7f98ee825b69af81ba7215b6ef2489375e37b3 /nixos/modules/config/sysctl.nix
parentda093461a2ff09d6ea1071ff886866a1f85480c2 (diff)
downloadnixlib-2b1f21249445991940c9d3ebbc54ce41b1eaf9c0.tar
nixlib-2b1f21249445991940c9d3ebbc54ce41b1eaf9c0.tar.gz
nixlib-2b1f21249445991940c9d3ebbc54ce41b1eaf9c0.tar.bz2
nixlib-2b1f21249445991940c9d3ebbc54ce41b1eaf9c0.tar.lz
nixlib-2b1f21249445991940c9d3ebbc54ce41b1eaf9c0.tar.xz
nixlib-2b1f21249445991940c9d3ebbc54ce41b1eaf9c0.tar.zst
nixlib-2b1f21249445991940c9d3ebbc54ce41b1eaf9c0.zip
Disable various services when running inside a container
Diffstat (limited to 'nixos/modules/config/sysctl.nix')
-rw-r--r--nixos/modules/config/sysctl.nix5
1 files changed, 4 insertions, 1 deletions
diff --git a/nixos/modules/config/sysctl.nix b/nixos/modules/config/sysctl.nix
index f987c9c9e944..8f9b31dccff3 100644
--- a/nixos/modules/config/sysctl.nix
+++ b/nixos/modules/config/sysctl.nix
@@ -46,7 +46,10 @@ in
         before = [ "sysinit.target" "shutdown.target" ];
         wantedBy = [ "sysinit.target" "multi-user.target" ];
         restartTriggers = [ config.environment.etc."sysctl.d/nixos.conf".source ];
-        unitConfig.DefaultDependencies = false; # needed to prevent a cycle
+        unitConfig = {
+          DefaultDependencies = false; # needed to prevent a cycle
+          ConditionPathIsReadWrite = "/proc/sys/"; # prevent systemd-sysctl in containers
+        };
         serviceConfig = {
           Type = "oneshot";
           RemainAfterExit = true;