Loading doc/builders/testers.chapter.md +64 −0 Original line number Diff line number Diff line Loading @@ -35,6 +35,70 @@ passthru.tests.version = testers.testVersion { }; ``` ## `testBuildFailure` {#tester-testBuildFailure} Make sure that a build does not succeed. This is useful for testing testers. This returns a derivation with an override on the builder, with the following effects: - Fail the build when the original builder succeeds - Move `$out` to `$out/result`, if it exists (assuming `out` is the default output) - Save the build log to `$out/testBuildFailure.log` (same) Example: ```nix runCommand "example" { failed = testers.testBuildFailure (runCommand "fail" {} '' echo ok-ish >$out echo failing though exit 3 ''); } '' grep -F 'ok-ish' $failed/result grep -F 'failing though' $failed/testBuildFailure.log [[ 3 = $(cat $failed/testBuildFailure.exit) ]] touch $out ''; ``` While `testBuildFailure` is designed to keep changes to the original builder's environment to a minimum, some small changes are inevitable. - The file `$TMPDIR/testBuildFailure.log` is present. It should not be deleted. - `stdout` and `stderr` are a pipe instead of a tty. This could be improved. - One or two extra processes are present in the sandbox during the original builder's execution. - The derivation and output hashes are different, but not unusual. - The derivation includes a dependency on `buildPackages.bash` and `expect-failure.sh`, which is built to include a transitive dependency on `buildPackages.coreutils` and possibly more. These are not added to `PATH` or any other environment variable, so they should be hard to observe. ## `testEqualContents` {#tester-equalContents} Check that two paths have the same contents. Example: ```nix testers.testEqualContents { assertion = "sed -e performs replacement"; expected = writeText "expected" '' foo baz baz ''; actual = runCommand "actual" { # not really necessary for a package that's in stdenv nativeBuildInputs = [ gnused ]; base = writeText "base" '' foo bar baz ''; } '' sed -e 's/bar/baz/g' $base >$out ''; } ``` ## `testEqualDerivation` {#tester-testEqualDerivation} Checks that two packages produce the exact same build instructions. Loading maintainers/maintainer-list.nix +7 −0 Original line number Diff line number Diff line Loading @@ -4949,6 +4949,13 @@ githubId = 37017396; name = "gbtb"; }; gdamjan = { email = "gdamjan@gmail.com"; matrix = "@gdamjan:spodeli.org"; github = "gdamjan"; githubId = 81654; name = "Damjan Georgievski"; }; gdinh = { email = "nix@contact.dinh.ai"; github = "gdinh"; Loading nixos/modules/services/system/dbus.nix +32 −40 Original line number Diff line number Diff line # D-Bus configuration and system bus daemon. { config, lib, options, pkgs, ... }: with lib; { config, lib, pkgs, ... }: let Loading @@ -16,11 +14,11 @@ let serviceDirectories = cfg.packages; }; inherit (lib) mkOption types; in { ###### interface options = { services.dbus = { Loading Loading @@ -65,31 +63,13 @@ in ''; default = "disabled"; }; socketActivated = mkOption { type = types.nullOr types.bool; default = null; visible = false; description = lib.mdDoc '' Removed option, do not use. ''; }; }; }; ###### implementation config = mkIf cfg.enable { warnings = optional (cfg.socketActivated != null) ( let files = showFiles options.services.dbus.socketActivated.files; in "The option 'services.dbus.socketActivated' in ${files} no longer has" + " any effect and can be safely removed: the user D-Bus session is" + " now always socket activated." ); environment.systemPackages = [ pkgs.dbus.daemon pkgs.dbus ]; config = lib.mkIf cfg.enable { environment.systemPackages = [ pkgs.dbus ]; environment.etc."dbus-1".source = configDir; Loading @@ -102,10 +82,12 @@ in users.groups.messagebus.gid = config.ids.gids.messagebus; systemd.packages = [ pkgs.dbus.daemon ]; systemd.packages = [ pkgs.dbus ]; security.wrappers.dbus-daemon-launch-helper = { source = "${pkgs.dbus.daemon}/libexec/dbus-daemon-launch-helper"; source = "${pkgs.dbus}/libexec/dbus-daemon-launch-helper"; owner = "root"; group = "messagebus"; setuid = true; Loading @@ -114,26 +96,36 @@ in }; services.dbus.packages = [ pkgs.dbus.out pkgs.dbus config.system.path ]; systemd.services.dbus = { # Don't restart dbus-daemon. Bad things tend to happen if we do. reloadIfChanged = true; restartTriggers = [ configDir ]; environment = { LD_LIBRARY_PATH = config.system.nssModules.path; }; restartTriggers = [ configDir ]; environment = { LD_LIBRARY_PATH = config.system.nssModules.path; }; }; systemd.user = { services.dbus = { systemd.user.services.dbus = { # Don't restart dbus-daemon. Bad things tend to happen if we do. reloadIfChanged = true; restartTriggers = [ configDir ]; }; sockets.dbus.wantedBy = [ "sockets.target" ]; restartTriggers = [ configDir ]; }; environment.pathsToLink = [ "/etc/dbus-1" "/share/dbus-1" ]; systemd.user.sockets.dbus.wantedBy = [ "sockets.target" ]; environment.pathsToLink = [ "/etc/dbus-1" "/share/dbus-1" ]; }; } pkgs/applications/editors/notepadqq/default.nix +23 −5 Original line number Diff line number Diff line { mkDerivation, lib, fetchFromGitHub, pkg-config, which, qtbase, qtsvg, qttools, qtwebkit }: { mkDerivation , lib , fetchFromGitHub , pkg-config , which , libuchardet , qtbase , qtsvg , qttools , qtwebengine , qtwebsockets }: mkDerivation rec { pname = "notepadqq"; version = "1.4.8"; # shipping a beta build as there's no proper release which supports qtwebengine version = "2.0.0-beta"; src = fetchFromGitHub { owner = "notepadqq"; repo = "notepadqq"; rev = "v${version}"; sha256 = "0lbv4s7ng31dkznzbkmp2cvkqglmfj6lv4mbg3r410fif2nrva7k"; sha256 = "sha256-XA9Ay9kJApY+bDeOf0iPv+BWYFuTmIuqsLEPgRTCZCE="; }; nativeBuildInputs = [ pkg-config which qttools pkg-config which qttools ]; buildInputs = [ qtbase qtsvg qtwebkit libuchardet qtbase qtsvg qtwebengine qtwebsockets ]; preConfigure = '' Loading pkgs/applications/misc/lscolors/default.nix +3 −3 Original line number Diff line number Diff line Loading @@ -2,14 +2,14 @@ rustPlatform.buildRustPackage rec { pname = "lscolors"; version = "0.12.0"; version = "0.13.0"; src = fetchCrate { inherit version pname; sha256 = "sha256-1tLI+M2hpXWsiO/x27ncs8zn8dBDx18AgsSbN/YE2Ic="; sha256 = "sha256-rs/qv6zmSHy2FFiPSgGzxAV/r0SqK9vnfwnLj45WY4I="; }; cargoSha256 = "sha256-4bFzFztaD9jV3GXpZwCowAhvszedM5ion5/h3D26EY8="; cargoSha256 = "sha256-WDvflAb56l+UkrxeQQZrloxlaK/mZavT9sA+VOWDW5Q="; # setid is not allowed in the sandbox checkFlags = [ "--skip=tests::style_for_setid" ]; Loading Loading
doc/builders/testers.chapter.md +64 −0 Original line number Diff line number Diff line Loading @@ -35,6 +35,70 @@ passthru.tests.version = testers.testVersion { }; ``` ## `testBuildFailure` {#tester-testBuildFailure} Make sure that a build does not succeed. This is useful for testing testers. This returns a derivation with an override on the builder, with the following effects: - Fail the build when the original builder succeeds - Move `$out` to `$out/result`, if it exists (assuming `out` is the default output) - Save the build log to `$out/testBuildFailure.log` (same) Example: ```nix runCommand "example" { failed = testers.testBuildFailure (runCommand "fail" {} '' echo ok-ish >$out echo failing though exit 3 ''); } '' grep -F 'ok-ish' $failed/result grep -F 'failing though' $failed/testBuildFailure.log [[ 3 = $(cat $failed/testBuildFailure.exit) ]] touch $out ''; ``` While `testBuildFailure` is designed to keep changes to the original builder's environment to a minimum, some small changes are inevitable. - The file `$TMPDIR/testBuildFailure.log` is present. It should not be deleted. - `stdout` and `stderr` are a pipe instead of a tty. This could be improved. - One or two extra processes are present in the sandbox during the original builder's execution. - The derivation and output hashes are different, but not unusual. - The derivation includes a dependency on `buildPackages.bash` and `expect-failure.sh`, which is built to include a transitive dependency on `buildPackages.coreutils` and possibly more. These are not added to `PATH` or any other environment variable, so they should be hard to observe. ## `testEqualContents` {#tester-equalContents} Check that two paths have the same contents. Example: ```nix testers.testEqualContents { assertion = "sed -e performs replacement"; expected = writeText "expected" '' foo baz baz ''; actual = runCommand "actual" { # not really necessary for a package that's in stdenv nativeBuildInputs = [ gnused ]; base = writeText "base" '' foo bar baz ''; } '' sed -e 's/bar/baz/g' $base >$out ''; } ``` ## `testEqualDerivation` {#tester-testEqualDerivation} Checks that two packages produce the exact same build instructions. Loading
maintainers/maintainer-list.nix +7 −0 Original line number Diff line number Diff line Loading @@ -4949,6 +4949,13 @@ githubId = 37017396; name = "gbtb"; }; gdamjan = { email = "gdamjan@gmail.com"; matrix = "@gdamjan:spodeli.org"; github = "gdamjan"; githubId = 81654; name = "Damjan Georgievski"; }; gdinh = { email = "nix@contact.dinh.ai"; github = "gdinh"; Loading
nixos/modules/services/system/dbus.nix +32 −40 Original line number Diff line number Diff line # D-Bus configuration and system bus daemon. { config, lib, options, pkgs, ... }: with lib; { config, lib, pkgs, ... }: let Loading @@ -16,11 +14,11 @@ let serviceDirectories = cfg.packages; }; inherit (lib) mkOption types; in { ###### interface options = { services.dbus = { Loading Loading @@ -65,31 +63,13 @@ in ''; default = "disabled"; }; socketActivated = mkOption { type = types.nullOr types.bool; default = null; visible = false; description = lib.mdDoc '' Removed option, do not use. ''; }; }; }; ###### implementation config = mkIf cfg.enable { warnings = optional (cfg.socketActivated != null) ( let files = showFiles options.services.dbus.socketActivated.files; in "The option 'services.dbus.socketActivated' in ${files} no longer has" + " any effect and can be safely removed: the user D-Bus session is" + " now always socket activated." ); environment.systemPackages = [ pkgs.dbus.daemon pkgs.dbus ]; config = lib.mkIf cfg.enable { environment.systemPackages = [ pkgs.dbus ]; environment.etc."dbus-1".source = configDir; Loading @@ -102,10 +82,12 @@ in users.groups.messagebus.gid = config.ids.gids.messagebus; systemd.packages = [ pkgs.dbus.daemon ]; systemd.packages = [ pkgs.dbus ]; security.wrappers.dbus-daemon-launch-helper = { source = "${pkgs.dbus.daemon}/libexec/dbus-daemon-launch-helper"; source = "${pkgs.dbus}/libexec/dbus-daemon-launch-helper"; owner = "root"; group = "messagebus"; setuid = true; Loading @@ -114,26 +96,36 @@ in }; services.dbus.packages = [ pkgs.dbus.out pkgs.dbus config.system.path ]; systemd.services.dbus = { # Don't restart dbus-daemon. Bad things tend to happen if we do. reloadIfChanged = true; restartTriggers = [ configDir ]; environment = { LD_LIBRARY_PATH = config.system.nssModules.path; }; restartTriggers = [ configDir ]; environment = { LD_LIBRARY_PATH = config.system.nssModules.path; }; }; systemd.user = { services.dbus = { systemd.user.services.dbus = { # Don't restart dbus-daemon. Bad things tend to happen if we do. reloadIfChanged = true; restartTriggers = [ configDir ]; }; sockets.dbus.wantedBy = [ "sockets.target" ]; restartTriggers = [ configDir ]; }; environment.pathsToLink = [ "/etc/dbus-1" "/share/dbus-1" ]; systemd.user.sockets.dbus.wantedBy = [ "sockets.target" ]; environment.pathsToLink = [ "/etc/dbus-1" "/share/dbus-1" ]; }; }
pkgs/applications/editors/notepadqq/default.nix +23 −5 Original line number Diff line number Diff line { mkDerivation, lib, fetchFromGitHub, pkg-config, which, qtbase, qtsvg, qttools, qtwebkit }: { mkDerivation , lib , fetchFromGitHub , pkg-config , which , libuchardet , qtbase , qtsvg , qttools , qtwebengine , qtwebsockets }: mkDerivation rec { pname = "notepadqq"; version = "1.4.8"; # shipping a beta build as there's no proper release which supports qtwebengine version = "2.0.0-beta"; src = fetchFromGitHub { owner = "notepadqq"; repo = "notepadqq"; rev = "v${version}"; sha256 = "0lbv4s7ng31dkznzbkmp2cvkqglmfj6lv4mbg3r410fif2nrva7k"; sha256 = "sha256-XA9Ay9kJApY+bDeOf0iPv+BWYFuTmIuqsLEPgRTCZCE="; }; nativeBuildInputs = [ pkg-config which qttools pkg-config which qttools ]; buildInputs = [ qtbase qtsvg qtwebkit libuchardet qtbase qtsvg qtwebengine qtwebsockets ]; preConfigure = '' Loading
pkgs/applications/misc/lscolors/default.nix +3 −3 Original line number Diff line number Diff line Loading @@ -2,14 +2,14 @@ rustPlatform.buildRustPackage rec { pname = "lscolors"; version = "0.12.0"; version = "0.13.0"; src = fetchCrate { inherit version pname; sha256 = "sha256-1tLI+M2hpXWsiO/x27ncs8zn8dBDx18AgsSbN/YE2Ic="; sha256 = "sha256-rs/qv6zmSHy2FFiPSgGzxAV/r0SqK9vnfwnLj45WY4I="; }; cargoSha256 = "sha256-4bFzFztaD9jV3GXpZwCowAhvszedM5ion5/h3D26EY8="; cargoSha256 = "sha256-WDvflAb56l+UkrxeQQZrloxlaK/mZavT9sA+VOWDW5Q="; # setid is not allowed in the sandbox checkFlags = [ "--skip=tests::style_for_setid" ]; Loading