diff options
author | Pol Dellaiera <pol.dellaiera@protonmail.com> | 2023-06-08 18:42:38 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-08 18:42:38 +0200 |
commit | f0fc9fe22deea71cb1c07ae7e42e8ef431cf9e91 (patch) | |
tree | 75098a36d8d58193e1db05810496de751ed4f91f /nixos | |
parent | c4146925c7d2d6878905fc76920b8f905bc54c5a (diff) | |
parent | 8deaa732a8a4521d81fbaf956a9039a42412b9ab (diff) |
Merge pull request #236567 from l0b0/fix-activate-lints
nixos/modules: Fix ShellCheck lints
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/modules/config/users-groups.nix | 2 | ||||
-rw-r--r-- | nixos/modules/system/activation/activation-script.nix | 9 | ||||
-rw-r--r-- | nixos/modules/system/boot/binfmt.nix | 3 |
3 files changed, 9 insertions, 5 deletions
diff --git a/nixos/modules/config/users-groups.nix b/nixos/modules/config/users-groups.nix index d1e9c8072eac..4640a0f3d6be 100644 --- a/nixos/modules/config/users-groups.nix +++ b/nixos/modules/config/users-groups.nix @@ -652,7 +652,7 @@ in { deps = [ "users" ]; text = '' users=() - while IFS=: read -r user hash tail; do + while IFS=: read -r user hash _; do if [[ "$hash" = "$"* && ! "$hash" =~ ^\''$${cryptSchemeIdPatternGroup}\$ ]]; then users+=("$user") fi 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 != {}) { |