From 1912870a6eebd287a4065bf5dfa2b5b4469c68b9 Mon Sep 17 00:00:00 2001 From: Matthieu Coudron Date: Sat, 17 Feb 2018 15:47:33 +0900 Subject: [PATCH] nixos/boot: allow kernel.printk override (#34958) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit At one point in my configuration I had: boot.kernel.sysctl = { # https://unix.stackexchange.com/questions/13019/description-of-kernel-printk-values "kernel.printk" = "4 4 1 7"; }; which triggered: error: The unique option `boot.kernel.sysctl.kernel.printk' is defined multiple times, in `/home/teto/dotfiles/nixpkgs/mptcp-unstable.nix' and `/home/teto/nixpkgs/nixos/modules/system/boot/kernel.nix'. (use ‘--show-trace’ to show detailed location information) Traceback (most recent call last): File "/home/teto/nixops/scripts/nixops", line 984, in args.op() File "/home/teto/nixops/scripts/nixops", line 406, in op_deploy max_concurrent_activate=args.max_concurrent_activate) File "/home/teto/nixops/nixops/deployment.py", line 1045, in deploy self.run_with_notify('deploy', lambda: self._deploy(**kwargs)) File "/home/teto/nixops/nixops/deployment.py", line 1034, in run_with_notify f() File "/home/teto/nixops/nixops/deployment.py", line 1045, in self.run_with_notify('deploy', lambda: self._deploy(**kwargs)) File "/home/teto/nixops/nixops/deployment.py", line 985, in _deploy self.configs_path = self.build_configs(dry_run=dry_run, repair=repair, include=include, exclude=exclude) File "/home/teto/nixops/nixops/deployment.py", line 653, in build_configs raise Exception("unable to build all machine configurations") Exception: unable to build all machine configurations This simple addition allows to override it. --- nixos/modules/system/boot/kernel.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/modules/system/boot/kernel.nix b/nixos/modules/system/boot/kernel.nix index d78f9d9389c6..3bd7d3558269 100644 --- a/nixos/modules/system/boot/kernel.nix +++ b/nixos/modules/system/boot/kernel.nix @@ -184,7 +184,7 @@ in [ "loglevel=${toString config.boot.consoleLogLevel}" ] ++ optionals config.boot.vesa [ "vga=0x317" ]; - boot.kernel.sysctl."kernel.printk" = config.boot.consoleLogLevel; + boot.kernel.sysctl."kernel.printk" = mkDefault config.boot.consoleLogLevel; boot.kernelModules = [ "loop" "atkbd" ];