summaryrefslogtreecommitdiffstats
path: root/nixos
diff options
context:
space:
mode:
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/installer/cd-dvd/sd-image.nix3
-rw-r--r--nixos/modules/services/hardware/thermald.nix11
-rw-r--r--nixos/tests/cloud-init.nix20
3 files changed, 14 insertions, 20 deletions
diff --git a/nixos/modules/installer/cd-dvd/sd-image.nix b/nixos/modules/installer/cd-dvd/sd-image.nix
index d9799aa69c95..c8c5a46dfb87 100644
--- a/nixos/modules/installer/cd-dvd/sd-image.nix
+++ b/nixos/modules/installer/cd-dvd/sd-image.nix
@@ -223,9 +223,10 @@ in
# Figure out device names for the boot device and root filesystem.
rootPart=$(${pkgs.util-linux}/bin/findmnt -n -o SOURCE /)
bootDevice=$(lsblk -npo PKNAME $rootPart)
+ partNum=$(lsblk -npo MAJ:MIN $rootPart | awk -F: '{print $2}')
# Resize the root partition and the filesystem to fit the disk
- echo ",+," | sfdisk -N2 --no-reread $bootDevice
+ echo ",+," | sfdisk -N$partNum --no-reread $bootDevice
${pkgs.parted}/bin/partprobe
${pkgs.e2fsprogs}/bin/resize2fs $rootPart
diff --git a/nixos/modules/services/hardware/thermald.nix b/nixos/modules/services/hardware/thermald.nix
index b7be0e89d0c6..241490c5aae7 100644
--- a/nixos/modules/services/hardware/thermald.nix
+++ b/nixos/modules/services/hardware/thermald.nix
@@ -23,15 +23,6 @@ in {
default = null;
description = "the thermald manual configuration file.";
};
-
- adaptive = mkOption {
- type = types.bool;
- default = false;
- description = ''
- Whether to enable adaptive mode, only working on kernel versions greater than 5.8.
- Thermald will detect this itself, safe to enable on kernel versions below 5.8.
- '';
- };
};
};
@@ -48,8 +39,8 @@ in {
--no-daemon \
${optionalString cfg.debug "--loglevel=debug"} \
${optionalString (cfg.configFile != null) "--config-file ${cfg.configFile}"} \
- ${optionalString cfg.adaptive "--adaptive"} \
--dbus-enable
+ --adaptive
'';
};
};
diff --git a/nixos/tests/cloud-init.nix b/nixos/tests/cloud-init.nix
index a127be6dd85f..d59d222974b5 100644
--- a/nixos/tests/cloud-init.nix
+++ b/nixos/tests/cloud-init.nix
@@ -51,29 +51,31 @@ in makeTest {
networking.hostName = "";
};
testScript = ''
- machine.wait_for_unit("cloud-init.service")
- machine.succeed("cat /tmp/cloudinit-write-file | grep -q 'cloudinit'")
+ # To wait until cloud-init terminates its run
+ unnamed.wait_for_unit("cloud-final.service")
+
+ unnamed.succeed("cat /tmp/cloudinit-write-file | grep -q 'cloudinit'")
# install snakeoil ssh key and provision .ssh/config file
- machine.succeed("mkdir -p ~/.ssh")
- machine.succeed(
+ unnamed.succeed("mkdir -p ~/.ssh")
+ unnamed.succeed(
"cat ${snakeOilPrivateKey} > ~/.ssh/id_snakeoil"
)
- machine.succeed("chmod 600 ~/.ssh/id_snakeoil")
+ unnamed.succeed("chmod 600 ~/.ssh/id_snakeoil")
- machine.wait_for_unit("sshd.service")
+ unnamed.wait_for_unit("sshd.service")
# we should be able to log in as the root user, as well as the created nixos user
- machine.succeed(
+ unnamed.succeed(
"ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o IdentityFile=~/.ssh/id_snakeoil root@localhost 'true'"
)
- machine.succeed(
+ unnamed.succeed(
"ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o IdentityFile=~/.ssh/id_snakeoil nixos@localhost 'true'"
)
# test changing hostname via cloud-init worked
assert (
- machine.succeed(
+ unnamed.succeed(
"ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o IdentityFile=~/.ssh/id_snakeoil nixos@localhost 'hostname'"
).strip()
== "test"