From b02719a29c19500e4d93f8394eab0fec6e28708c Mon Sep 17 00:00:00 2001 From: Klemens Nanni Date: Thu, 5 Nov 2020 02:12:48 +0100 Subject: nixos-help: Do $PATH lookup in nixos-manual.desktop instead of hardcoding derivation See db236e588de "steam: Do $PATH lookup in steam.desktop [...]". tl;dr: Otherwise widget/panel/desktop icons in DEs like KDE break. --- nixos/modules/misc/documentation.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'nixos') diff --git a/nixos/modules/misc/documentation.nix b/nixos/modules/misc/documentation.nix index 71a40b4f4d6e..906e9f05063e 100644 --- a/nixos/modules/misc/documentation.nix +++ b/nixos/modules/misc/documentation.nix @@ -64,7 +64,7 @@ let desktopName = "NixOS Manual"; genericName = "View NixOS documentation in a web browser"; icon = "nix-snowflake"; - exec = "${helpScript}/bin/nixos-help"; + exec = "nixos-help"; categories = "System"; }; -- cgit v1.2.3 From 3560f0d913a1d1b2c6f0a650d3a4f3ab5419baa2 Mon Sep 17 00:00:00 2001 From: Andreas Rammhold Date: Thu, 5 Nov 2020 11:47:14 +0100 Subject: nixos-help: use writeShellScriptBin and drop custom shebang line --- nixos/modules/misc/documentation.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'nixos') diff --git a/nixos/modules/misc/documentation.nix b/nixos/modules/misc/documentation.nix index 906e9f05063e..0a8b1a313efb 100644 --- a/nixos/modules/misc/documentation.nix +++ b/nixos/modules/misc/documentation.nix @@ -40,9 +40,8 @@ let in scrubbedEval.options; }; - helpScript = pkgs.writeScriptBin "nixos-help" + helpScript = pkgs.writeShellScriptBin "nixos-help" '' - #! ${pkgs.runtimeShell} -e # Finds first executable browser in a colon-separated list. # (see how xdg-open defines BROWSER) browser="$( -- cgit v1.2.3 From 9a01e978244c2d7e20b97533309f02ba93933a8c Mon Sep 17 00:00:00 2001 From: Andreas Rammhold Date: Thu, 5 Nov 2020 11:51:02 +0100 Subject: nixos-help: bundle the desktop item with the script This is to ensure that whenever we install the desktop item we also have the script installed. Prior to b02719a we always had the reference to the script in the desktop item. Since desktop items are being copied to home directories and thus "bit rod" over time that absolute path was removed. --- nixos/modules/misc/documentation.nix | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) (limited to 'nixos') diff --git a/nixos/modules/misc/documentation.nix b/nixos/modules/misc/documentation.nix index 0a8b1a313efb..bc43cc33b5d4 100644 --- a/nixos/modules/misc/documentation.nix +++ b/nixos/modules/misc/documentation.nix @@ -40,8 +40,9 @@ let in scrubbedEval.options; }; - helpScript = pkgs.writeShellScriptBin "nixos-help" - '' + + nixos-help = let + helpScript = pkgs.writeShellScriptBin "nixos-help" '' # Finds first executable browser in a colon-separated list. # (see how xdg-open defines BROWSER) browser="$( @@ -58,14 +59,22 @@ let exec "$browser" ${manual.manualHTMLIndex} ''; - desktopItem = pkgs.makeDesktopItem { - name = "nixos-manual"; - desktopName = "NixOS Manual"; - genericName = "View NixOS documentation in a web browser"; - icon = "nix-snowflake"; - exec = "nixos-help"; - categories = "System"; - }; + desktopItem = pkgs.makeDesktopItem { + name = "nixos-manual"; + desktopName = "NixOS Manual"; + genericName = "View NixOS documentation in a web browser"; + icon = "nix-snowflake"; + exec = "nixos-help"; + categories = "System"; + }; + + in pkgs.symlinkJoin { + name = "nixos-help"; + paths = [ + helpScript + desktopItem + ]; + }; in @@ -249,8 +258,8 @@ in environment.systemPackages = [] ++ optional cfg.man.enable manual.manpages - ++ optionals cfg.doc.enable ([ manual.manualHTML helpScript ] - ++ optionals config.services.xserver.enable [ desktopItem pkgs.nixos-icons ]); + ++ optionals cfg.doc.enable ([ manual.manualHTML nixos-help ] + ++ optionals config.services.xserver.enable [ pkgs.nixos-icons ]); services.mingetty.helpLine = mkIf cfg.doc.enable ( "\nRun 'nixos-help' for the NixOS manual." -- cgit v1.2.3 From 74d354a3973d3963280d5c6433f104343d749310 Mon Sep 17 00:00:00 2001 From: WilliButz Date: Fri, 13 Nov 2020 16:14:41 +0100 Subject: nixos/codimd: add package option, refactor prettyJSON This adds a `package` option to allow for easier overriding of the used CodiMD version and `runCommandLocal` with `nativeBuildInputs` is now used to pretty print the configuration. --- nixos/modules/services/web-apps/codimd.nix | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'nixos') diff --git a/nixos/modules/services/web-apps/codimd.nix b/nixos/modules/services/web-apps/codimd.nix index c787c36b877c..0fbc9ee820e6 100644 --- a/nixos/modules/services/web-apps/codimd.nix +++ b/nixos/modules/services/web-apps/codimd.nix @@ -6,8 +6,10 @@ let cfg = config.services.codimd; prettyJSON = conf: - pkgs.runCommand "codimd-config.json" { preferLocalBuild = true; } '' - echo '${builtins.toJSON conf}' | ${pkgs.jq}/bin/jq \ + pkgs.runCommandLocal "codimd-config.json" { + nativeBuildInputs = [ pkgs.jq ]; + } '' + echo '${builtins.toJSON conf}' | jq \ '{production:del(.[]|nulls)|del(.[][]?|nulls)}' > $out ''; in @@ -878,7 +880,6 @@ in }; }; - environmentFile = mkOption { type = with types; nullOr path; default = null; @@ -908,6 +909,14 @@ in CodiMD is running. ''; }; + + package = mkOption { + type = types.package; + default = pkgs.codimd; + description = '' + Package that provides CodiMD. + ''; + }; }; config = mkIf cfg.enable { @@ -938,7 +947,7 @@ in ''; serviceConfig = { WorkingDirectory = cfg.workDir; - ExecStart = "${pkgs.codimd}/bin/codimd"; + ExecStart = "${cfg.package}/bin/codimd"; EnvironmentFile = mkIf (cfg.environmentFile != null) [ cfg.environmentFile ]; Environment = [ "CMD_CONFIG_FILE=${cfg.workDir}/config.json" -- cgit v1.2.3 From 8ac3a1503af31ed444b6997ff9eea781c2507348 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Sat, 14 Nov 2020 14:40:32 +0100 Subject: nixos/lvm2-activation-generator: fix warnings on activation --- nixos/modules/tasks/lvm.nix | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'nixos') diff --git a/nixos/modules/tasks/lvm.nix b/nixos/modules/tasks/lvm.nix index 2c3cc4c5467d..98a0e2ddef90 100644 --- a/nixos/modules/tasks/lvm.nix +++ b/nixos/modules/tasks/lvm.nix @@ -21,6 +21,10 @@ in { }; config = mkMerge [ + ({ + # minimal configuration file to make lvmconfig/lvm2-activation-generator happy + environment.etc."lvm/lvm.conf".text = "config {}"; + }) (mkIf (!config.boot.isContainer) { systemd.tmpfiles.packages = [ cfg.package.out ]; environment.systemPackages = [ cfg.package ]; -- cgit v1.2.3 From 13be37662d7e05c2e950ff849cb3745f14632925 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Mon, 16 Nov 2020 13:02:48 +0100 Subject: kernel config: explicitly enable CONFIG_IPV6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We currently build CONFIG_IPV6=m. This seems to be not really well-supported in mainline kernels - see https://lore.kernel.org/netdev/20201115224509.2020651-1-flokli@flokli.de/T/#u Compiling it as a module doesn't give too much benefit - even for people who did explicitly set `enableIPv6` to false, the `ipv6` module was still loaded, as soon as another module was loaded that requires it (bridge,br_netfilter,wireguard,ip6table_mangle,sctp,…). By compiling it in, we only loose the possibility to not add it to `boot.kernelModules` anymore (as it's part of the kernel directly). The space savings are negligible. People wanting to disable IPv6 still get the appropriate sysctls and options set (while having the kernel code loaded), nothing is really changing here. --- nixos/modules/tasks/network-interfaces.nix | 1 - 1 file changed, 1 deletion(-) (limited to 'nixos') diff --git a/nixos/modules/tasks/network-interfaces.nix b/nixos/modules/tasks/network-interfaces.nix index e5bd57753683..53c54c2e3980 100644 --- a/nixos/modules/tasks/network-interfaces.nix +++ b/nixos/modules/tasks/network-interfaces.nix @@ -1062,7 +1062,6 @@ in ]; boot.kernelModules = [ ] - ++ optional cfg.enableIPv6 "ipv6" ++ optional hasVirtuals "tun" ++ optional hasSits "sit" ++ optional hasBonds "bonding"; -- cgit v1.2.3 From 0338f728c01329427c407ccd0bf6e527eee2358c Mon Sep 17 00:00:00 2001 From: Tim Steinbach Date: Mon, 16 Nov 2020 13:59:36 -0500 Subject: nano: Add test --- nixos/release-combined.nix | 1 + nixos/tests/all-tests.nix | 1 + nixos/tests/nano.nix | 44 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 46 insertions(+) create mode 100644 nixos/tests/nano.nix (limited to 'nixos') diff --git a/nixos/release-combined.nix b/nixos/release-combined.nix index 384ae5765b8c..d8b9a5f9b4bc 100644 --- a/nixos/release-combined.nix +++ b/nixos/release-combined.nix @@ -97,6 +97,7 @@ in rec { (onFullSupported "nixos.tests.login") (onFullSupported "nixos.tests.misc") (onFullSupported "nixos.tests.mutableUsers") + (onFullSupported "nixos.tests.nano") (onFullSupported "nixos.tests.nat.firewall-conntrack") (onFullSupported "nixos.tests.nat.firewall") (onFullSupported "nixos.tests.nat.standalone") diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index 868f15a1da37..485b298662be 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -225,6 +225,7 @@ in mysql-backup = handleTest ./mysql/mysql-backup.nix {}; mysql-replication = handleTest ./mysql/mysql-replication.nix {}; nagios = handleTest ./nagios.nix {}; + nano = handleTest ./nano.nix {}; nar-serve = handleTest ./nar-serve.nix {}; nat.firewall = handleTest ./nat.nix { withFirewall = true; }; nat.firewall-conntrack = handleTest ./nat.nix { withFirewall = true; withConntrackHelpers = true; }; diff --git a/nixos/tests/nano.nix b/nixos/tests/nano.nix new file mode 100644 index 000000000000..9e0a9e147f2c --- /dev/null +++ b/nixos/tests/nano.nix @@ -0,0 +1,44 @@ +import ./make-test-python.nix ({ pkgs, ...} : { + name = "nano"; + meta = with pkgs.stdenv.lib.maintainers; { + maintainers = [ nequissimus ]; + }; + + machine = { lib, ... }: { + environment.systemPackages = [ pkgs.nano ]; + }; + + testScript = { ... }: '' + start_all() + + with subtest("Create user and log in"): + machine.wait_for_unit("multi-user.target") + machine.wait_until_succeeds("pgrep -f 'agetty.*tty1'") + machine.succeed("useradd -m alice") + machine.succeed("(echo foobar; echo foobar) | passwd alice") + machine.wait_until_tty_matches(1, "login: ") + machine.send_chars("alice\n") + machine.wait_until_tty_matches(1, "login: alice") + machine.wait_until_succeeds("pgrep login") + machine.wait_until_tty_matches(1, "Password: ") + machine.send_chars("foobar\n") + machine.wait_until_succeeds("pgrep -u alice bash") + machine.screenshot("prompt") + + with subtest("Use nano"): + machine.send_chars("nano /tmp/foo") + machine.send_key("ret") + machine.sleep(2) + machine.send_chars("42") + machine.sleep(1) + machine.send_key("ctrl-x") + machine.sleep(1) + machine.send_key("y") + machine.sleep(1) + machine.screenshot("nano") + machine.sleep(1) + machine.send_key("ret") + machine.wait_for_file("/tmp/foo") + assert "42" in machine.succeed("cat /tmp/foo") + ''; +}) -- cgit v1.2.3 From 61e56265c24ed24527962f2b3d5d049983749c8c Mon Sep 17 00:00:00 2001 From: Tim Steinbach Date: Mon, 16 Nov 2020 22:13:13 -0500 Subject: xterm: Add test --- nixos/tests/all-tests.nix | 1 + nixos/tests/xterm.nix | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 nixos/tests/xterm.nix (limited to 'nixos') diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index 868f15a1da37..478d1b1a8d15 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -388,6 +388,7 @@ in xmonad = handleTest ./xmonad.nix {}; xrdp = handleTest ./xrdp.nix {}; xss-lock = handleTest ./xss-lock.nix {}; + xterm = handleTest ./xterm.nix {}; yabar = handleTest ./yabar.nix {}; yggdrasil = handleTest ./yggdrasil.nix {}; zfs = handleTest ./zfs.nix {}; diff --git a/nixos/tests/xterm.nix b/nixos/tests/xterm.nix new file mode 100644 index 000000000000..9f30543bf385 --- /dev/null +++ b/nixos/tests/xterm.nix @@ -0,0 +1,23 @@ +import ./make-test-python.nix ({ pkgs, ...} : { + name = "xterm"; + meta = with pkgs.stdenv.lib.maintainers; { + maintainers = [ nequissimus ]; + }; + + machine = { pkgs, ... }: + { + imports = [ ./common/x11.nix ]; + services.xserver.desktopManager.xterm.enable = false; + }; + + testScript = + '' + machine.wait_for_x() + machine.succeed("DISPLAY=:0 xterm -title testterm -class testterm -fullscreen &") + machine.sleep(2) + machine.send_chars("echo $XTERM_VERSION >> /tmp/xterm_version\n") + machine.wait_for_file("/tmp/xterm_version") + assert "${pkgs.xterm.version}" in machine.succeed("cat /tmp/xterm_version") + machine.screenshot("window") + ''; +}) -- cgit v1.2.3 From 512c3c0a059cd420aa557317955a46e1cb233169 Mon Sep 17 00:00:00 2001 From: Oleksii Filonenko Date: Tue, 17 Nov 2020 13:02:06 +0200 Subject: maintainers: rename filalex77 -> Br1ght0ne --- nixos/modules/programs/bandwhich.nix | 2 +- nixos/tests/caddy.nix | 2 +- nixos/tests/riak.nix | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'nixos') diff --git a/nixos/modules/programs/bandwhich.nix b/nixos/modules/programs/bandwhich.nix index 5413044f4614..1cffb5fa2765 100644 --- a/nixos/modules/programs/bandwhich.nix +++ b/nixos/modules/programs/bandwhich.nix @@ -4,7 +4,7 @@ with lib; let cfg = config.programs.bandwhich; in { - meta.maintainers = with maintainers; [ filalex77 ]; + meta.maintainers = with maintainers; [ Br1ght0ne ]; options = { programs.bandwhich = { diff --git a/nixos/tests/caddy.nix b/nixos/tests/caddy.nix index f2de34ff2da2..a21dbec248ab 100644 --- a/nixos/tests/caddy.nix +++ b/nixos/tests/caddy.nix @@ -1,7 +1,7 @@ import ./make-test-python.nix ({ pkgs, ... }: { name = "caddy"; meta = with pkgs.stdenv.lib.maintainers; { - maintainers = [ xfix filalex77 ]; + maintainers = [ xfix Br1ght0ne ]; }; nodes = { diff --git a/nixos/tests/riak.nix b/nixos/tests/riak.nix index 6915779e7e9c..3dd4e333d669 100644 --- a/nixos/tests/riak.nix +++ b/nixos/tests/riak.nix @@ -1,7 +1,7 @@ import ./make-test-python.nix ({ lib, pkgs, ... }: { name = "riak"; meta = with lib.maintainers; { - maintainers = [ filalex77 ]; + maintainers = [ Br1ght0ne ]; }; machine = { -- cgit v1.2.3 From e61ef63e4e4644a451a4ed66f2f2ac7b48f2c26a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Thu, 12 Nov 2020 19:04:12 +0100 Subject: kresd service: switch .listenDoH to new implementation Beware: extraFeatures are not needed *for this* anymore, but their removal may still cause a regression in some configs (example: prefill module). --- nixos/modules/services/networking/kresd.nix | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'nixos') diff --git a/nixos/modules/services/networking/kresd.nix b/nixos/modules/services/networking/kresd.nix index ccb34163d5f3..6f1c4c48b430 100644 --- a/nixos/modules/services/networking/kresd.nix +++ b/nixos/modules/services/networking/kresd.nix @@ -23,18 +23,14 @@ let ''; configFile = pkgs.writeText "kresd.conf" ( - optionalString (cfg.listenDoH != []) '' - modules.load('http') - '' + "" + concatMapStrings (mkListen "dns") cfg.listenPlain + concatMapStrings (mkListen "tls") cfg.listenTLS - + concatMapStrings (mkListen "doh") cfg.listenDoH + + concatMapStrings (mkListen "doh2") cfg.listenDoH + cfg.extraConfig ); - package = if cfg.listenDoH == [] - then pkgs.knot-resolver # never force `extraFeatures = false` - else pkgs.knot-resolver.override { extraFeatures = true; }; + package = pkgs.knot-resolver; in { meta.maintainers = [ maintainers.vcunat /* upstream developer */ ]; @@ -92,7 +88,7 @@ in { default = []; example = [ "198.51.100.1:443" "[2001:db8::1]:443" "443" ]; description = '' - Addresses and ports on which kresd should provide DNS over HTTPS (see RFC 8484). + Addresses and ports on which kresd should provide DNS over HTTPS/2 (see RFC 8484). For detailed syntax see ListenStream in man systemd.socket. ''; }; -- cgit v1.2.3 From 7e25b7113271cf80eb0f950da2e1aa7b382eb268 Mon Sep 17 00:00:00 2001 From: Emery Hemingway Date: Wed, 18 Nov 2020 13:58:24 +0100 Subject: nixos: use nativeBuildInputs in make- iso9660-image and system-tarball The tools used to create iso9660 images and tarballs are independent of the platform of the closure contained within. --- nixos/lib/make-iso9660-image.nix | 2 +- nixos/lib/make-system-tarball.nix | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'nixos') diff --git a/nixos/lib/make-iso9660-image.nix b/nixos/lib/make-iso9660-image.nix index 6a0e0e7c635a..549530965f6e 100644 --- a/nixos/lib/make-iso9660-image.nix +++ b/nixos/lib/make-iso9660-image.nix @@ -48,7 +48,7 @@ assert usbBootable -> isohybridMbrImage != ""; stdenv.mkDerivation { name = isoName; builder = ./make-iso9660-image.sh; - buildInputs = [ xorriso syslinux zstd libossp_uuid ]; + nativeBuildInputs = [ xorriso syslinux zstd libossp_uuid ]; inherit isoName bootable bootImage compressImage volumeID efiBootImage efiBootable isohybridMbrImage usbBootable; diff --git a/nixos/lib/make-system-tarball.nix b/nixos/lib/make-system-tarball.nix index dee91a6ce3f4..dab168f4a481 100644 --- a/nixos/lib/make-system-tarball.nix +++ b/nixos/lib/make-system-tarball.nix @@ -37,7 +37,7 @@ in stdenv.mkDerivation { name = "tarball"; builder = ./make-system-tarball.sh; - buildInputs = extraInputs; + nativeBuildInputs = extraInputs; inherit fileName extraArgs extraCommands compressCommand; -- cgit v1.2.3