From ad65e807bd2870f64b3eb7137f1140a827732897 Mon Sep 17 00:00:00 2001 From: Peter Simons Date: Tue, 11 Sep 2012 18:44:37 +0200 Subject: [PATCH 1/2] Add new 'hardware.cpu.amd.updateMicrocode' option. --- modules/hardware/cpu/amd-microcode.nix | 29 ++++++++++++++++++++++++++ modules/module-list.nix | 1 + 2 files changed, 30 insertions(+) create mode 100644 modules/hardware/cpu/amd-microcode.nix diff --git a/modules/hardware/cpu/amd-microcode.nix b/modules/hardware/cpu/amd-microcode.nix new file mode 100644 index 000000000000..2b224e04f2d6 --- /dev/null +++ b/modules/hardware/cpu/amd-microcode.nix @@ -0,0 +1,29 @@ +{ config, pkgs, ... }: + +with pkgs.lib; + +{ + + ###### interface + + options = { + + hardware.cpu.amd.updateMicrocode = mkOption { + default = false; + type = types.bool; + description = '' + Update the CPU microcode for Amd processors. + ''; + }; + + }; + + + ###### implementation + + config = mkIf config.hardware.cpu.amd.updateMicrocode { + hardware.firmware = [ pkgs.amdUcode ]; + boot.kernelModules = [ "microcode" ]; + }; + +} diff --git a/modules/module-list.nix b/modules/module-list.nix index 08927d747ff2..1d40a4145ae0 100644 --- a/modules/module-list.nix +++ b/modules/module-list.nix @@ -16,6 +16,7 @@ ./config/users-groups.nix ./hardware/all-firmware.nix ./hardware/cpu/intel-microcode.nix + ./hardware/cpu/amd-microcode.nix ./hardware/network/b43.nix ./hardware/network/intel-2100bg.nix ./hardware/network/intel-2200bg.nix From 75583c7984ec2f45c3275f5fb753782f324244d1 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 14 Sep 2012 13:23:19 -0400 Subject: [PATCH 2/2] nixos-rebuild: Support --option --- modules/installer/tools/nixos-rebuild.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/modules/installer/tools/nixos-rebuild.sh b/modules/installer/tools/nixos-rebuild.sh index 72661cf47735..e21a34f996c1 100644 --- a/modules/installer/tools/nixos-rebuild.sh +++ b/modules/installer/tools/nixos-rebuild.sh @@ -36,10 +36,10 @@ Options: Various nix-build options are also accepted, in particular: --show-trace show a detailed stack trace for evaluation errors - + Environment variables affecting nixos-rebuild: - \$NIX_PATH Nix expression search path + \$NIX_PATH Nix expression search path \$NIXOS_CONFIG path to the NixOS system configuration specification EOF exit 1 @@ -85,6 +85,11 @@ while test "$#" -gt 0; do j="$1"; shift 1 extraBuildFlags="$extraBuildFlags $i $j" ;; + --option) + j="$1"; shift 1 + k="$1"; shift 1 + extraBuildFlags="$extraBuildFlags $i $j $k" + ;; --fast) buildNix= extraBuildFlags="$extraBuildFlags --show-trace" @@ -202,7 +207,7 @@ fi if test "$action" = switch -o "$action" = boot -o "$action" = test; then # Just in case the new configuration hangs the system, do a sync now. sync - + $pathToConfig/bin/switch-to-configuration "$action" fi