summary refs log tree commit diff
path: root/nixos/modules/tasks
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/tasks
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/tasks')
-rw-r--r--nixos/modules/tasks/cpu-freq.nix2
-rw-r--r--nixos/modules/tasks/network-interfaces.nix2
-rw-r--r--nixos/modules/tasks/scsi-link-power-management.nix2
3 files changed, 6 insertions, 0 deletions
diff --git a/nixos/modules/tasks/cpu-freq.nix b/nixos/modules/tasks/cpu-freq.nix
index ce36a8bab096..705ec93a1360 100644
--- a/nixos/modules/tasks/cpu-freq.nix
+++ b/nixos/modules/tasks/cpu-freq.nix
@@ -33,6 +33,8 @@ with pkgs.lib;
         after = [ "systemd-modules-load.service" ];
         wantedBy = [ "multi-user.target" ];
 
+        unitConfig.ConditionPathIsReadWrite = "/sys/devices/";
+
         path = [ pkgs.cpufrequtils ];
 
         preStart = ''
diff --git a/nixos/modules/tasks/network-interfaces.nix b/nixos/modules/tasks/network-interfaces.nix
index d8522b6abba0..b1ab989f130f 100644
--- a/nixos/modules/tasks/network-interfaces.nix
+++ b/nixos/modules/tasks/network-interfaces.nix
@@ -270,6 +270,8 @@ in
             before = [ "network.target" ];
             wantedBy = [ "network.target" ];
 
+            unitConfig.ConditionCapability = "CAP_NET_ADMIN";
+
             path = [ pkgs.iproute ];
 
             serviceConfig.Type = "oneshot";
diff --git a/nixos/modules/tasks/scsi-link-power-management.nix b/nixos/modules/tasks/scsi-link-power-management.nix
index 4927952080f6..071a80865983 100644
--- a/nixos/modules/tasks/scsi-link-power-management.nix
+++ b/nixos/modules/tasks/scsi-link-power-management.nix
@@ -31,6 +31,8 @@ with pkgs.lib;
 
         task = true;
 
+        unitConfig.ConditionPathIsReadWrite = "/sys/class/scsi_host";
+
         script = ''
           shopt -s nullglob
           for x in /sys/class/scsi_host/host*/link_power_management_policy; do