Unverified Commit 09fd75dd authored by nixpkgs-ci[bot]'s avatar nixpkgs-ci[bot] Committed by GitHub
Browse files

Merge master into staging-nixos

parents 8d77d21c 4d0e985d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -10607,7 +10607,7 @@
  };
  hekazu = {
    name = "Henri Peurasaari";
    email = "henri.peurasaari@helsinki.fi";
    email = "henri.peurasaari@alumni.helsinki.fi";
    github = "hekazu";
    githubId = 16819092;
  };
+218 −0
Original line number Diff line number Diff line
@@ -60,6 +60,14 @@ in
        environment.systemPackages = [ pkgs.socat ]; # for the socket activation stuff
        users.mutableUsers = false;

        # A lingering user so the user systemd instance is running and
        # switch-to-configuration can exercise the user-unit path.
        users.users.usertest = {
          isNormalUser = true;
          uid = 1001;
          linger = true;
        };

        # Test that no boot loader still switches, e.g. in the ISO
        boot.loader.grub.enable = false;

@@ -647,6 +655,90 @@ in
              '';
            };

          simpleUserService.configuration = {
            systemd.user.services.usertest = {
              wantedBy = [ "default.target" ];
              serviceConfig = {
                Type = "oneshot";
                RemainAfterExit = true;
                ExecStart = "${pkgs.coreutils}/bin/true";
                ExecReload = "${pkgs.coreutils}/bin/true";
              };
            };
          };

          simpleUserServiceModified.configuration = {
            imports = [ simpleUserService.configuration ];
            systemd.user.services.usertest.serviceConfig.X-Test = "1";
          };

          simpleUserServiceNostop.configuration = {
            imports = [ simpleUserService.configuration ];
            systemd.user.services.usertest.stopIfChanged = false;
          };

          simpleUserServiceReload.configuration = {
            imports = [ simpleUserService.configuration ];
            systemd.user.services.usertest = {
              reloadIfChanged = true;
              serviceConfig.X-Test = "1";
            };
          };

          simpleUserServiceReloadTrigger.configuration = {
            imports = [ simpleUserService.configuration ];
            systemd.user.services.usertest.reloadTriggers = [ "/dev/null" ];
          };

          simpleUserServiceFailing.configuration = {
            imports = [ simpleUserService.configuration ];
            systemd.user.services.usertest.serviceConfig.ExecStart = lib.mkForce "${pkgs.coreutils}/bin/false";
          };

          # A unit that NixOS defines while a copy already exists in
          # ~/.config/systemd/user (e.g. home-manager). The home copy shadows
          # /etc, so switch-to-configuration must leave it alone.
          userServiceMigratedShadowed.configuration = {
            systemd.user.services.migrated = {
              wantedBy = [ "default.target" ];
              serviceConfig = {
                Type = "oneshot";
                RemainAfterExit = true;
                ExecStart = "${pkgs.runtimeShell} -c 'echo nixos > %t/migrated-owner'";
              };
            };
          };

          # As above, but the per-user activation removes the home copy and
          # stops the unit (mimicking home-manager/sd-switch dropping it).
          # switch-to-configuration must then start the now-unmasked
          # /etc/systemd/user copy in a second pass.
          userServiceMigratedToNixos.configuration = {
            imports = [ userServiceMigratedShadowed.configuration ];
            system.userActivationScripts.fakeSdSwitch = ''
              if [ -e "$HOME/.config/systemd/user/migrated.service" ]; then
                rm -f "$HOME/.config/systemd/user/migrated.service"
                rm -f "$HOME/.config/systemd/user/default.target.wants/migrated.service"
                ${pkgs.systemd}/bin/systemctl --user daemon-reload
                ${pkgs.systemd}/bin/systemctl --user stop migrated.service || true
              fi
            '';
          };

          # As above, but the previous manager leaves the unit running instead
          # of stopping it. switch-to-configuration must restart it so the
          # /etc definition takes effect.
          userServiceMigratedToNixosNoStop.configuration = {
            imports = [ userServiceMigratedShadowed.configuration ];
            system.userActivationScripts.fakeSdSwitch = ''
              if [ -e "$HOME/.config/systemd/user/migrated.service" ]; then
                rm -f "$HOME/.config/systemd/user/migrated.service"
                rm -f "$HOME/.config/systemd/user/default.target.wants/migrated.service"
                ${pkgs.systemd}/bin/systemctl --user daemon-reload
              fi
            '';
          };

          no_inhibitors.configuration.system.switch.inhibitors = lib.mkForce { };

          inhibitors.configuration.system.switch.inhibitors = lib.mkForce {
@@ -709,6 +801,15 @@ in
          "broker" = "dbus-broker.service";
        }
        .${nodes.machine.services.dbus.implementation};

      # Unit file placed in ~/.config/systemd/user to simulate a unit managed
      # by home-manager (see the userServiceMigrated* specialisations).
      homeMigratedUnit = pkgs.writeText "migrated.service" ''
        [Service]
        Type=oneshot
        RemainAfterExit=true
        ExecStart=${pkgs.runtimeShell} -c 'echo home > %t/migrated-owner'
      '';
    in
    # python
    ''
@@ -1615,5 +1716,122 @@ in
          out = switch_to_specialisation("${machine}", "")
          # Assert switching to a different generation doesn't touch units created by generators
          machine.succeed("systemctl is-active simple-generated.service")

      with subtest("user services"):
          machine.wait_for_unit("user@1001.service")
          user_env = "XDG_RUNTIME_DIR=/run/user/1001"

          def user_systemctl(args):
              return machine.succeed(f"sudo -u usertest {user_env} systemctl --user {args}")

          # Add a user service — starting default.target should pull it in via
          # the WantedBy dependency.
          out = switch_to_specialisation("${machine}", "simpleUserService")
          user_systemctl("is-active usertest.service")

          # No-op switch does nothing
          out = switch_to_specialisation("${machine}", "simpleUserService")
          assert_lacks(out, "user units:")

          # Modifying the unit stop-starts it (default stopIfChanged=true)
          out = switch_to_specialisation("${machine}", "simpleUserServiceModified")
          assert_contains(out, "stopping the following user units: usertest.service")
          assert_contains(out, "starting the following user units: usertest.service")
          user_systemctl("is-active usertest.service")

          # stopIfChanged=false restarts instead
          out = switch_to_specialisation("${machine}", "simpleUserServiceNostop")
          assert_lacks(out, "stopping the following user units:")
          assert_contains(out, "restarting the following user units: usertest.service")
          user_systemctl("is-active usertest.service")

          # reloadIfChanged=true reloads instead
          out = switch_to_specialisation("${machine}", "simpleUserServiceReload")
          assert_lacks(out, "stopping the following user units:")
          assert_lacks(out, "restarting the following user units:")
          assert_contains(out, "reloading the following user units: usertest.service")
          user_systemctl("is-active usertest.service")

          # reloadTriggers change triggers a reload
          switch_to_specialisation("${machine}", "simpleUserService")
          user_systemctl("is-active usertest.service")
          out = switch_to_specialisation("${machine}", "simpleUserServiceReloadTrigger")
          assert_contains(out, "reloading the following user units: usertest.service")
          user_systemctl("is-active usertest.service")

          # A failing user unit propagates a non-zero exit to the parent so
          # the overall switch reports failure.
          out = switch_to_specialisation("${machine}", "simpleUserServiceFailing", fail=True)
          assert_contains(out, "stopping the following user units: usertest.service")
          assert_contains(out, "Failed to start user unit usertest.service")
          assert_contains(out, "warning: the following user units failed: usertest.service")
          assert_contains(out, "warning: user activation for usertest failed")
          # Recover for the removal assertion below.
          switch_to_specialisation("${machine}", "simpleUserService")
          user_systemctl("is-active usertest.service")

          # Removing the unit stops it
          out = switch_to_specialisation("${machine}", "")
          assert_contains(out, "stopping the following user units: usertest.service")
          machine.fail(f"sudo -u usertest {user_env} systemctl --user is-active usertest.service")

          # Migration from a home-directory manager to NixOS: pre-seed a unit
          # in ~/.config/systemd/user and start it, then switch to a config
          # that defines the same unit in /etc/systemd/user and whose user
          # activation removes the ~/.config copy (mimicking sd-switch).
          def seed_home_unit():
              machine.succeed(
                  "sudo -u usertest mkdir -p ~usertest/.config/systemd/user/default.target.wants",
                  "sudo -u usertest cp ${homeMigratedUnit} ~usertest/.config/systemd/user/migrated.service",
                  "sudo -u usertest ln -sfn ../migrated.service ~usertest/.config/systemd/user/default.target.wants/migrated.service",
              )
              user_systemctl("daemon-reload")
              user_systemctl("start migrated.service")
              user_systemctl("is-active migrated.service")
              out = machine.succeed(f"sudo -u usertest {user_env} cat /run/user/1001/migrated-owner")
              assert_contains(out, "home")
              out = user_systemctl("show -p FragmentPath migrated.service")
              assert_contains(out, "/.config/systemd/user/migrated.service")

          seed_home_unit()
          out = switch_to_specialisation("${machine}", "userServiceMigratedToNixos")
          # Pass 1 must not touch it (still owned by ~/.config at that point)
          assert_lacks(out, "stopping the following user units: migrated.service")
          # Pass 2 starts the now-unmasked /etc copy after sd-switch stopped it
          assert_contains(out, "starting (post-activation) the following user units: migrated.service")
          user_systemctl("is-active migrated.service")
          out = user_systemctl("show -p FragmentPath migrated.service")
          assert_contains(out, "/etc/systemd/user/migrated.service")
          out = machine.succeed(f"sudo -u usertest {user_env} cat /run/user/1001/migrated-owner")
          assert_contains(out, "nixos")

          # Reset and test the variant where the previous manager leaves the
          # unit running: pass 2 must restart it.
          switch_to_specialisation("${machine}", "")
          machine.fail(f"sudo -u usertest {user_env} systemctl --user is-active migrated.service")
          seed_home_unit()
          out = switch_to_specialisation("${machine}", "userServiceMigratedToNixosNoStop")
          assert_contains(out, "restarting (post-activation) the following user units: migrated.service")
          user_systemctl("is-active migrated.service")
          out = user_systemctl("show -p FragmentPath migrated.service")
          assert_contains(out, "/etc/systemd/user/migrated.service")
          out = machine.succeed(f"sudo -u usertest {user_env} cat /run/user/1001/migrated-owner")
          assert_contains(out, "nixos")

          # Units that remain shadowed by ~/.config must be left alone in both
          # passes even though /etc now also defines them.
          switch_to_specialisation("${machine}", "")
          seed_home_unit()
          out = switch_to_specialisation("${machine}", "userServiceMigratedShadowed")
          assert_lacks(out, "migrated.service")
          out = user_systemctl("show -p FragmentPath migrated.service")
          assert_contains(out, "/.config/systemd/user/migrated.service")
          out = machine.succeed(f"sudo -u usertest {user_env} cat /run/user/1001/migrated-owner")
          assert_contains(out, "home")
          # Clean up
          machine.succeed("sudo -u usertest rm -rf ~usertest/.config/systemd")
          user_systemctl("daemon-reload")
          user_systemctl("stop migrated.service")
          switch_to_specialisation("${machine}", "")
    '';
}
+4 −4
Original line number Diff line number Diff line
@@ -3898,8 +3898,8 @@ let
        mktplcRef = {
          publisher = "redhat";
          name = "vscode-yaml";
          version = "1.21.0";
          hash = "sha256-55PBCTV6NJL+JVH+19vIoA5GKMDD8uB7z9OCOb+GjZM=";
          version = "1.22.0";
          hash = "sha256-Xsy2350zAxSEhJgCl5/bVwWEwaXgmnN0Y/orDjwNuw4=";
        };
        meta = {
          description = "YAML Language Support by Red Hat, with built-in Kubernetes syntax support";
@@ -5196,8 +5196,8 @@ let
        mktplcRef = {
          name = "volar";
          publisher = "Vue";
          version = "3.2.6";
          hash = "sha256-1R5N3JjJUZ/KPYXGq/VOzbMmQj1fzrK9HrAjA8Ja2a4=";
          version = "3.2.7";
          hash = "sha256-KLPb4XTm1lD44D4ajdH1Gr0J0JaN5TpaGp+bCpSuo3U=";
        };
        meta = {
          changelog = "https://github.com/vuejs/language-tools/blob/master/CHANGELOG.md";
+2 −2
Original line number Diff line number Diff line
@@ -4,8 +4,8 @@ vscode-utils.buildVscodeMarketplaceExtension {
  mktplcRef = {
    name = "explorer";
    publisher = "vitest";
    version = "1.50.1";
    hash = "sha256-qMUslEBzYK7nH9k+UBygEt+PjOHwDg/hLvfmbYR++tc=";
    version = "1.50.2";
    hash = "sha256-9AmJa3vMXBx2VC20j7bGyIoascQd7SvvFTgfyBi7SLU=";
  };
  meta = {
    changelog = "https://github.com/vitest-dev/vscode/releases";
+3 −3
Original line number Diff line number Diff line
@@ -5,13 +5,13 @@
}:
mkLibretroCore {
  core = "gpsp";
  version = "0-unstable-2026-03-31";
  version = "0-unstable-2026-04-20";

  src = fetchFromGitHub {
    owner = "libretro";
    repo = "gpsp";
    rev = "6373ff347a07ac17c50a00f20aa63d29c080abcf";
    hash = "sha256-1aLSJ0oB8WJnIfKHHdwBQ52uVPs1XiFZvgFgrF9zUoA=";
    rev = "eca3bee1e2d2043d42f0480012c1e7ec85498f88";
    hash = "sha256-GvS9HoHzT1Dr3OGLJFwMdB6+lw3vyKMRHzHuLdMxpY8=";
  };

  makefile = "Makefile";
Loading