1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-11-08 19:46:05 +01:00

home-manager: re-enable gcroot handling for NixOS module

It was a bit too ambitious to also remove production of the gcroot, we
need it to keep track of the currently active Home Manager
configuration.

Fixes #7583
This commit is contained in:
Robert Helgesson 2025-07-31 00:31:48 +02:00
parent 0630790b31
commit bd82507edd
2 changed files with 5 additions and 12 deletions

View file

@ -36,12 +36,6 @@ in
# Inherit glibcLocales setting from NixOS. # Inherit glibcLocales setting from NixOS.
i18n.glibcLocales = lib.mkDefault config.i18n.glibcLocales; i18n.glibcLocales = lib.mkDefault config.i18n.glibcLocales;
# Legacy profile management is when the activation script
# generates GC root and home-manager profile. The modern way
# simply relies on the GC root that the system maintains, which
# should also protect the Home Manager activation package outputs.
home.activationGenerateGcRoot = cfg.enableLegacyProfileManagement;
}; };
} }
]; ];

View file

@ -82,16 +82,15 @@
logout_alice() logout_alice()
with subtest("no GC root and profile"): with subtest("no profile management"):
# There should be no GC root and Home Manager profile since we are not # There should be no Home Manager profile since we are not
# using legacy profile management. # using legacy profile management.
hmState = "/home/alice/.local/state/home-manager"
machine.succeed(f"test ! -e {hmState}")
hmProfile = "/home/alice/.local/state/nix/profiles/home-manager" hmProfile = "/home/alice/.local/state/nix/profiles/home-manager"
machine.succeed(f"test ! -e {hmProfile}") machine.succeed(f"test ! -e {hmProfile}")
# There should be a gcroot, however since we want to keep track of which
# generation is currently enabled.
hmGcroot = "/home/alice/.local/state/home-manager/gcroots/current-home" hmGcroot = "/home/alice/.local/state/home-manager/gcroots/current-home"
machine.succeed(f"test ! -e {hmGcroot}") machine.succeed(f"test -e {hmGcroot}")
''; '';
} }