Files
home-manager/tests/modules/programs/pet/layer-settings.nix
Austin Horstman fae6e9e42c treewide: standardize mutable configuration option names
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.
2026-10-06 12:16:19 -05:00

45 lines
1.5 KiB
Nix

{ config, ... }:
let
configHome = "${config.xdg.configHome}/pet";
layerDir = "${configHome}/home-manager-snippets";
in
{
home.stateVersion = "21.11";
programs.pet = {
enable = true;
mutableSnippets = true;
package = null;
snippets = [
{
description = "declarative";
command = "echo declarative";
}
];
};
assertions = [
{
assertion = config.home.sessionVariables.PET_CONFIG_DIR == configHome;
message = "Mutable Pet snippets must use the configured PET_CONFIG_DIR.";
}
{
assertion = config.home.activation.pet-user-snippets.after == [ "linkGeneration" ];
message = "Mutable Pet snippets must activate after linkGeneration.";
}
{
assertion = config.programs.pet.settings.General.snippetdirs == [ layerDir ];
message = "Pet must prepend its declarative layer and retain user snippet directories.";
}
];
nmt.script = ''
assertFileContent "home-files/.config/pet/home-manager-snippets/snippet.toml" ${./layer-snippet.toml}
assertPathNotExists "home-files/.config/pet/snippet.toml"
assertFileContent "home-files/.config/pet/config.toml" ${./layer-config.toml}
assertFileContains activate '${config.home.homeDirectory}/.config/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}
'';
}