diff options
author | Victor Engmark <victor@engmark.name> | 2023-06-08 15:07:07 +1200 |
---|---|---|
committer | Victor Engmark <victor@engmark.name> | 2023-06-08 15:55:40 +1200 |
commit | 8deaa732a8a4521d81fbaf956a9039a42412b9ab (patch) | |
tree | e9c2717df35eddd531177b55527ec56bb8555dfe /nixos | |
parent | b0a9abedea509018d76ef25312f18253eee4fd48 (diff) |
refactor: Split `mkdir -m …` into `mkdir` + `chmod`
As recommended by ShellCheck
<https://www.shellcheck.net/wiki/SC2174>.
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/modules/system/activation/activation-script.nix | 9 | ||||
-rw-r--r-- | nixos/modules/system/boot/binfmt.nix | 3 |
2 files changed, 8 insertions, 4 deletions
diff --git a/nixos/modules/system/activation/activation-script.nix b/nixos/modules/system/activation/activation-script.nix index ddb165a76cc8..f23d4809e356 100644 --- a/nixos/modules/system/activation/activation-script.nix +++ b/nixos/modules/system/activation/activation-script.nix @@ -217,7 +217,8 @@ in '' # Various log/runtime directories. - mkdir -m 1777 -p /var/tmp + mkdir -p /var/tmp + chmod 1777 /var/tmp # Empty, immutable home directory of many system accounts. mkdir -p /var/empty @@ -231,7 +232,8 @@ in system.activationScripts.usrbinenv = if config.environment.usrbinenv != null then '' - mkdir -m 0755 -p /usr/bin + mkdir -p /usr/bin + chmod 0755 /usr/bin ln -sfn ${config.environment.usrbinenv} /usr/bin/.env.tmp mv /usr/bin/.env.tmp /usr/bin/env # atomically replace /usr/bin/env '' @@ -251,7 +253,8 @@ in if mountpoint -q "$mountPoint"; then local options="remount,$options" else - mkdir -m 0755 -p "$mountPoint" + mkdir -p "$mountPoint" + chmod 0755 "$mountPoint" fi mount -t "$fsType" -o "$options" "$device" "$mountPoint" } diff --git a/nixos/modules/system/boot/binfmt.nix b/nixos/modules/system/boot/binfmt.nix index b003d983d2be..bf1688feb19e 100644 --- a/nixos/modules/system/boot/binfmt.nix +++ b/nixos/modules/system/boot/binfmt.nix @@ -317,7 +317,8 @@ in { environment.etc."binfmt.d/nixos.conf".source = builtins.toFile "binfmt_nixos.conf" (lib.concatStringsSep "\n" (lib.mapAttrsToList makeBinfmtLine config.boot.binfmt.registrations)); system.activationScripts.binfmt = stringAfter [ "specialfs" ] '' - mkdir -p -m 0755 /run/binfmt + mkdir -p /run/binfmt + chmod 0755 /run/binfmt ${lib.concatStringsSep "\n" (lib.mapAttrsToList activationSnippet config.boot.binfmt.registrations)} ''; systemd = lib.mkIf (config.boot.binfmt.registrations != {}) { |