diff options
author | Artturin <Artturin@artturin.com> | 2022-10-03 16:56:51 +0300 |
---|---|---|
committer | Artturin <Artturin@artturin.com> | 2022-10-10 15:30:59 +0300 |
commit | f4ea1208ec732d423a784bbb2b882f997b6af902 (patch) | |
tree | cadc358926dfd142fb2c1ebf0dce6317b48474dc /nixos | |
parent | 8d32772702a4ebdf15c77e2e927787ae360a6bf6 (diff) |
treewide: *Flags convert to list from str
*Flags implies a list slightly relevant: > stdenv: start deprecating non-list configureFlags https://github.com/NixOS/nixpkgs/pull/173172 the makeInstalledTests function in `nixos/tests/installed-tests/default.nix` isn't available outside of nixpkgs so it's not a breaking change
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/modules/services/networking/ntp/chrony.nix | 4 | ||||
-rw-r--r-- | nixos/modules/services/networking/ntp/ntpd.nix | 4 | ||||
-rw-r--r-- | nixos/tests/installed-tests/default.nix | 4 | ||||
-rw-r--r-- | nixos/tests/installed-tests/flatpak-builder.nix | 2 | ||||
-rw-r--r-- | nixos/tests/installed-tests/flatpak.nix | 2 | ||||
-rw-r--r-- | nixos/tests/installed-tests/gdk-pixbuf.nix | 2 | ||||
-rw-r--r-- | nixos/tests/k3s/multi-node.nix | 41 | ||||
-rw-r--r-- | nixos/tests/k3s/single-node.nix | 17 |
8 files changed, 39 insertions, 37 deletions
diff --git a/nixos/modules/services/networking/ntp/chrony.nix b/nixos/modules/services/networking/ntp/chrony.nix index a89c7769152e6..7e3bb565d10bf 100644 --- a/nixos/modules/services/networking/ntp/chrony.nix +++ b/nixos/modules/services/networking/ntp/chrony.nix @@ -27,7 +27,7 @@ let ${cfg.extraConfig} ''; - chronyFlags = "-n -m -u chrony -f ${configFile} ${toString cfg.extraFlags}"; + chronyFlags = [ "-n" "-m" "-u" "chrony" "-f" "${configFile}" ] ++ cfg.extraFlags; in { options = { @@ -166,7 +166,7 @@ in unitConfig.ConditionCapability = "CAP_SYS_TIME"; serviceConfig = { Type = "simple"; - ExecStart = "${chronyPkg}/bin/chronyd ${chronyFlags}"; + ExecStart = "${chronyPkg}/bin/chronyd ${builtins.toString chronyFlags}"; ProtectHome = "yes"; ProtectSystem = "full"; diff --git a/nixos/modules/services/networking/ntp/ntpd.nix b/nixos/modules/services/networking/ntp/ntpd.nix index a9dae2c8667aa..036a8df635db0 100644 --- a/nixos/modules/services/networking/ntp/ntpd.nix +++ b/nixos/modules/services/networking/ntp/ntpd.nix @@ -25,7 +25,7 @@ let ${cfg.extraConfig} ''; - ntpFlags = "-c ${configFile} -u ntp:ntp ${toString cfg.extraFlags}"; + ntpFlags = [ "-c" "${configFile}" "-u" "ntp:ntp" ] ++ cfg.extraFlags; in @@ -137,7 +137,7 @@ in ''; serviceConfig = { - ExecStart = "@${ntp}/bin/ntpd ntpd -g ${ntpFlags}"; + ExecStart = "@${ntp}/bin/ntpd ntpd -g ${builtins.toString ntpFlags}"; Type = "forking"; }; }; diff --git a/nixos/tests/installed-tests/default.nix b/nixos/tests/installed-tests/default.nix index b2c1b43f90ee9..2eaa980052093 100644 --- a/nixos/tests/installed-tests/default.nix +++ b/nixos/tests/installed-tests/default.nix @@ -28,7 +28,7 @@ let , withX11 ? false # Extra flags to pass to gnome-desktop-testing-runner. - , testRunnerFlags ? "" + , testRunnerFlags ? [] # Extra attributes to pass to makeTest. # They will be recursively merged into the attrset created by this function. @@ -67,7 +67,7 @@ let '' + '' machine.succeed( - "gnome-desktop-testing-runner ${testRunnerFlags} -d '${tested.installedTests}/share'" + "gnome-desktop-testing-runner ${escapeShellArgs testRunnerFlags} -d '${tested.installedTests}/share'" ) ''; } diff --git a/nixos/tests/installed-tests/flatpak-builder.nix b/nixos/tests/installed-tests/flatpak-builder.nix index 41f4060fb69e5..d5e04fcf975ce 100644 --- a/nixos/tests/installed-tests/flatpak-builder.nix +++ b/nixos/tests/installed-tests/flatpak-builder.nix @@ -11,5 +11,5 @@ makeInstalledTest { virtualisation.diskSize = 2048; }; - testRunnerFlags = "--timeout 3600"; + testRunnerFlags = [ "--timeout" "3600" ]; } diff --git a/nixos/tests/installed-tests/flatpak.nix b/nixos/tests/installed-tests/flatpak.nix index c7fe9cf458822..9524d890c4025 100644 --- a/nixos/tests/installed-tests/flatpak.nix +++ b/nixos/tests/installed-tests/flatpak.nix @@ -13,5 +13,5 @@ makeInstalledTest { virtualisation.diskSize = 3072; }; - testRunnerFlags = "--timeout 3600"; + testRunnerFlags = [ "--timeout" "3600" ]; } diff --git a/nixos/tests/installed-tests/gdk-pixbuf.nix b/nixos/tests/installed-tests/gdk-pixbuf.nix index 3d0011a427a44..110efdbf710f2 100644 --- a/nixos/tests/installed-tests/gdk-pixbuf.nix +++ b/nixos/tests/installed-tests/gdk-pixbuf.nix @@ -9,5 +9,5 @@ makeInstalledTest { virtualisation.memorySize = if pkgs.stdenv.isi686 then 2047 else 4096; }; - testRunnerFlags = "--timeout 1800"; + testRunnerFlags = [ "--timeout" "1800" ]; } diff --git a/nixos/tests/k3s/multi-node.nix b/nixos/tests/k3s/multi-node.nix index ce7e4b6ead148..2a3aa22b96bf9 100644 --- a/nixos/tests/k3s/multi-node.nix +++ b/nixos/tests/k3s/multi-node.nix @@ -54,15 +54,15 @@ import ../make-test-python.nix ({ pkgs, lib, ... }: role = "server"; package = pkgs.k3s; clusterInit = true; - extraFlags = '' - --disable coredns \ - --disable local-storage \ - --disable metrics-server \ - --disable servicelb \ - --disable traefik \ - --node-ip 192.168.1.1 \ - --pause-image test.local/pause:local - ''; + extraFlags = builtins.toString [ + "--disable" "coredns" + "--disable" "local-storage" + "--disable" "metrics-server" + "--disable" "servicelb" + "--disable" "traefik" + "--node-ip" "192.168.1.1" + "--pause-image" "test.local/pause:local" + ]; }; networking.firewall.allowedTCPPorts = [ 2379 2380 6443 ]; networking.firewall.allowedUDPPorts = [ 8472 ]; @@ -84,15 +84,15 @@ import ../make-test-python.nix ({ pkgs, lib, ... }: enable = true; serverAddr = "https://192.168.1.1:6443"; clusterInit = false; - extraFlags = '' - --disable coredns \ - --disable local-storage \ - --disable metrics-server \ - --disable servicelb \ - --disable traefik \ - --node-ip 192.168.1.3 \ - --pause-image test.local/pause:local - ''; + extraFlags = builtins.toString [ + "--disable" "coredns" + "--disable" "local-storage" + "--disable" "metrics-server" + "--disable" "servicelb" + "--disable" "traefik" + "--node-ip" "192.168.1.3" + "--pause-image" "test.local/pause:local" + ]; }; networking.firewall.allowedTCPPorts = [ 2379 2380 6443 ]; networking.firewall.allowedUDPPorts = [ 8472 ]; @@ -112,7 +112,10 @@ import ../make-test-python.nix ({ pkgs, lib, ... }: enable = true; role = "agent"; serverAddr = "https://192.168.1.3:6443"; - extraFlags = "--pause-image test.local/pause:local --node-ip 192.168.1.2"; + extraFlags = lib.toString [ + "--pause-image" "test.local/pause:local" + "--node-ip" "192.168.1.2" + ]; }; networking.firewall.allowedTCPPorts = [ 6443 ]; networking.firewall.allowedUDPPorts = [ 8472 ]; diff --git a/nixos/tests/k3s/single-node.nix b/nixos/tests/k3s/single-node.nix index ab562500f5d21..a95fa4a031e3f 100644 --- a/nixos/tests/k3s/single-node.nix +++ b/nixos/tests/k3s/single-node.nix @@ -40,15 +40,14 @@ import ../make-test-python.nix ({ pkgs, lib, ... }: services.k3s.role = "server"; services.k3s.package = pkgs.k3s; # Slightly reduce resource usage - services.k3s.extraFlags = '' - --disable coredns \ - --disable local-storage \ - --disable metrics-server \ - --disable servicelb \ - --disable traefik \ - --pause-image \ - test.local/pause:local - ''; + services.k3s.extraFlags = builtins.toString [ + "--disable" "coredns" + "--disable" "local-storage" + "--disable" "metrics-server" + "--disable" "servicelb" + "--disable" "traefik" + "--pause-image" "test.local/pause:local" + ]; users.users = { noprivs = { |