mirror of
https://github.com/nix-community/home-manager.git
synced 2026-12-06 04:40:17 +00:00
Use mutableSettings for Mise and Vicinae, and mutableSnippets for Pet. These controls follow the same naming pattern as existing mutable options, regardless of whether configuration uses merging or a read-only layer. Keep Mise's existing name as a deprecated alias. Rename the freshly introduced Pet and Vicinae options directly before the next stable release, and update their tests and user-facing documentation. Defaults and configuration behavior remain unchanged.
35 lines
1.2 KiB
Nix
35 lines
1.2 KiB
Nix
{ config, ... }:
|
|
{
|
|
home.stateVersion = "21.11";
|
|
programs.pet = {
|
|
enable = true;
|
|
mutableSnippets = true;
|
|
package = null;
|
|
};
|
|
|
|
assertions = [
|
|
{
|
|
assertion = config.home.sessionVariables.PET_CONFIG_DIR == "${config.xdg.configHome}/pet";
|
|
message = "Empty mutable Pet snippets must still set PET_CONFIG_DIR.";
|
|
}
|
|
{
|
|
assertion = config.home.activation.pet-user-snippets.after == [ "linkGeneration" ];
|
|
message = "Empty mutable Pet snippets must activate after linkGeneration.";
|
|
}
|
|
{
|
|
assertion = !(config.programs.pet.settings.General ? snippetdirs);
|
|
message = "Empty Pet snippets must not add a declarative snippet directory.";
|
|
}
|
|
];
|
|
|
|
nmt.script = ''
|
|
assertPathNotExists "home-files/.config/pet/home-manager-snippets"
|
|
assertPathNotExists "home-files/.config/pet/snippet.toml"
|
|
assertFileContent "home-files/.config/pet/config.toml" ${./empty-config.toml}
|
|
assertFileContains activate '${config.xdg.configHome}/pet/snippet.toml'
|
|
seed="$(grep -o '/nix/store/[^ ]*-pet-empty-snippets' "$TESTED/activate")" \
|
|
|| fail "Pet empty snippets input is missing from activation"
|
|
assertFileContent "$seed" ${./empty-snippets.toml}
|
|
'';
|
|
}
|