mirror of
https://github.com/nix-community/home-manager.git
synced 2026-12-06 04:40:17 +00:00
Allow application settings and Vencord settings to remain writable while applying declared values. Restore byte-identical immutable links through the shared cleanup helper and retain changed files for ordinary collision handling.
69 lines
2.2 KiB
Nix
69 lines
2.2 KiB
Nix
{
|
|
config,
|
|
lib,
|
|
pkgs,
|
|
...
|
|
}:
|
|
let
|
|
relativeDir =
|
|
if pkgs.stdenv.hostPlatform.isDarwin then
|
|
"Library/Application Support/vesktop"
|
|
else
|
|
"custom-config/vesktop";
|
|
cleanup = config.home.activation.vesktopImmutableSettings;
|
|
in
|
|
{
|
|
xdg.configHome = "${config.home.homeDirectory}/custom-config";
|
|
programs.vesktop = {
|
|
enable = true;
|
|
package = null;
|
|
mutableSettings = true;
|
|
settings = {
|
|
tray = false;
|
|
spellCheckLanguages = [ "en-US" ];
|
|
};
|
|
vencord = {
|
|
settings = {
|
|
plugins.FakeNitro.enabled = true;
|
|
enabledThemes = [ ];
|
|
};
|
|
extraQuickCss = "body { color: red; }";
|
|
};
|
|
};
|
|
|
|
assertions = [
|
|
{
|
|
assertion = config.home.activation ? vesktopImmutableSettings;
|
|
message = "Vesktop immutable cleanup must follow configured, enabled immutable files.";
|
|
}
|
|
{
|
|
assertion = cleanup.after == [ "writeBoundary" ] && cleanup.before == [ "linkGeneration" ];
|
|
message = "Vesktop immutable cleanup must precede link generation after writeBoundary.";
|
|
}
|
|
{
|
|
assertion = !config.programs.vesktop.vencord.mutableSettings;
|
|
message = "Vencord mutability must match the configured mode.";
|
|
}
|
|
{
|
|
assertion = lib.all (package: !(lib.hasInfix "vesktop" (lib.getName package))) config.home.packages;
|
|
message = "A null Vesktop package must not be installed.";
|
|
}
|
|
{
|
|
assertion = (config.home.activation ? vesktopSettings);
|
|
message = "Vesktop activation must follow module enablement.";
|
|
}
|
|
{
|
|
assertion = config.home.activation.vesktopSettings.after == [ "linkGeneration" ];
|
|
message = "Vesktop mutable activation must follow link generation.";
|
|
}
|
|
];
|
|
nmt.script = ''
|
|
assertPathNotExists "home-files/${relativeDir}/settings.json"
|
|
settings="$(grep -o '/nix/store/[^ ]*-vesktop-settings.json' "$TESTED/activate" | head -n1)" \
|
|
|| fail "settings input is missing from activation"
|
|
assertFileContent "$settings" ${./settings-expected.json}
|
|
assertFileContent "home-files/${relativeDir}/settings/settings.json" ${./vencord-expected.json}
|
|
assertFileContains "home-files/${relativeDir}/settings/quickCss.css" "body { color: red; }"
|
|
'';
|
|
}
|