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.
45 lines
1.5 KiB
Nix
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}
|
|
'';
|
|
}
|