about summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorMartin Weinelt <hexa@darmstadt.ccc.de>2023-03-14 08:14:07 +0100
committerMartin Weinelt <hexa@darmstadt.ccc.de>2023-03-14 08:14:26 +0100
commit6b67186fe9a8c05ba3dca00cd7f3434e97c5c0f3 (patch)
treec40727f67b4ac1f249ee61aee61db419b1b27341 /nixos
parent08d2b1131869e00946d351050f1b92f259f25cff (diff)
parentdb8d5902ad3666208236a685c82e50bc8bc47706 (diff)
downloadnixlib-6b67186fe9a8c05ba3dca00cd7f3434e97c5c0f3.tar
nixlib-6b67186fe9a8c05ba3dca00cd7f3434e97c5c0f3.tar.gz
nixlib-6b67186fe9a8c05ba3dca00cd7f3434e97c5c0f3.tar.bz2
nixlib-6b67186fe9a8c05ba3dca00cd7f3434e97c5c0f3.tar.lz
nixlib-6b67186fe9a8c05ba3dca00cd7f3434e97c5c0f3.tar.xz
nixlib-6b67186fe9a8c05ba3dca00cd7f3434e97c5c0f3.tar.zst
nixlib-6b67186fe9a8c05ba3dca00cd7f3434e97c5c0f3.zip
Merge remote-tracking branch 'origin/master' into staging-next
Conflicts:
- pkgs/development/python-modules/crownstone-cloud/default.nix
- pkgs/development/python-modules/exrex/default.nix
- pkgs/development/python-modules/mkdocs-minify/default.nix
- pkgs/development/python-modules/myjwt/default.nix
- pkgs/development/tools/analysis/checkov/default.nix
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/installer/tools/nixos-generate-config.pl15
-rw-r--r--nixos/modules/programs/atop.nix2
-rw-r--r--nixos/modules/services/monitoring/grafana.nix2
-rw-r--r--nixos/modules/services/monitoring/prometheus/default.nix2
-rw-r--r--nixos/tests/garage/default.nix2
5 files changed, 13 insertions, 10 deletions
diff --git a/nixos/modules/installer/tools/nixos-generate-config.pl b/nixos/modules/installer/tools/nixos-generate-config.pl
index 212b2b3cd23a..db530533e428 100644
--- a/nixos/modules/installer/tools/nixos-generate-config.pl
+++ b/nixos/modules/installer/tools/nixos-generate-config.pl
@@ -127,9 +127,6 @@ if (-e "/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors") {
 push @kernelModules, "kvm-intel" if hasCPUFeature "vmx";
 push @kernelModules, "kvm-amd" if hasCPUFeature "svm";
 
-push @attrs, "hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;" if cpuManufacturer "AuthenticAMD";
-push @attrs, "hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;" if cpuManufacturer "GenuineIntel";
-
 
 # Look at the PCI devices and add necessary modules.  Note that most
 # modules are auto-detected so we don't need to list them here.
@@ -324,11 +321,15 @@ if ($virt eq "systemd-nspawn") {
 }
 
 
-# Provide firmware for devices that are not detected by this script,
-# unless we're in a VM/container.
-push @imports, "(modulesPath + \"/installer/scan/not-detected.nix\")"
-    if $virt eq "none";
+# Check if we're on bare metal, not in a VM/container.
+if ($virt eq "none") {
+    # Provide firmware for devices that are not detected by this script.
+    push @imports, "(modulesPath + \"/installer/scan/not-detected.nix\")";
 
+    # Update the microcode.
+    push @attrs, "hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;" if cpuManufacturer "AuthenticAMD";
+    push @attrs, "hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;" if cpuManufacturer "GenuineIntel";
+}
 
 # For a device name like /dev/sda1, find a more stable path like
 # /dev/disk/by-uuid/X or /dev/disk/by-label/Y.
diff --git a/nixos/modules/programs/atop.nix b/nixos/modules/programs/atop.nix
index 49d40ce7513a..9d5843bd670e 100644
--- a/nixos/modules/programs/atop.nix
+++ b/nixos/modules/programs/atop.nix
@@ -151,6 +151,8 @@ in
                   if ! ${pkgs.diffutils}/bin/cmp -s "$logfile" "$logfile".new
                   then
                     ${pkgs.coreutils}/bin/mv -v -f "$logfile".new "$logfile"
+                  else
+                    ${pkgs.coreutils}/bin/rm -f "$logfile".new
                   fi
                 done
               '';
diff --git a/nixos/modules/services/monitoring/grafana.nix b/nixos/modules/services/monitoring/grafana.nix
index ba3f89e24dd4..5a8c65b9dc3f 100644
--- a/nixos/modules/services/monitoring/grafana.nix
+++ b/nixos/modules/services/monitoring/grafana.nix
@@ -1300,7 +1300,7 @@ in {
         SystemCallFilter = [
           "@system-service"
           "~@privileged"
-        ] ++ lib.optional (cfg.settings.server.protocol == "socket") [ "@chown" ];
+        ] ++ lib.optionals (cfg.settings.server.protocol == "socket") [ "@chown" ];
         UMask = "0027";
       };
       preStart = ''
diff --git a/nixos/modules/services/monitoring/prometheus/default.nix b/nixos/modules/services/monitoring/prometheus/default.nix
index 4f197b9b5820..fb3bab7963ea 100644
--- a/nixos/modules/services/monitoring/prometheus/default.nix
+++ b/nixos/modules/services/monitoring/prometheus/default.nix
@@ -31,7 +31,7 @@ let
     if checkConfigEnabled then
       pkgs.runCommandLocal
         "${name}-${replaceStrings [" "] [""] what}-checked"
-        { buildInputs = [ cfg.package ]; } ''
+        { buildInputs = [ cfg.package.cli ]; } ''
         ln -s ${file} $out
         promtool ${what} $out
       '' else file;
diff --git a/nixos/tests/garage/default.nix b/nixos/tests/garage/default.nix
index 4c38ea1bc898..0a1ccde056b2 100644
--- a/nixos/tests/garage/default.nix
+++ b/nixos/tests/garage/default.nix
@@ -49,5 +49,5 @@ in
   })
   {}
   [
-    "0_8_0"
+    "0_8"
   ]