xdg-autostart: allow empty readonly autostart

Create the readonly autostart link even when no managed entries are
present, so the option behavior matches its documentation and stays
covered by a focused regression test.
This commit is contained in:
Austin Horstman
2026-04-20 09:01:34 -05:00
parent 56b4526cfd
commit c81775b640
3 changed files with 12 additions and 1 deletions

View File

@@ -51,7 +51,7 @@ in
};
};
config = mkIf (cfg.enable && cfg.entries != [ ]) {
config = mkIf (cfg.enable && (cfg.readOnly || cfg.entries != [ ])) {
xdg.configFile.autostart = {
source = linkedDesktopEntries;
recursive = !cfg.readOnly;

View File

@@ -0,0 +1,10 @@
{
xdg.autostart = {
enable = true;
readOnly = true;
};
nmt.script = ''
assertLinkExists home-files/.config/autostart
'';
}

View File

@@ -4,6 +4,7 @@
xdg-mime-disabled = ./mime-disabled.nix;
xdg-autostart = ./autostart.nix;
xdg-autostart-readonly = ./autostart-readonly.nix;
xdg-autostart-readonly-empty = ./autostart-readonly-empty.nix;
xdg-local-bin-in-path = ./local-bin-in-path.nix;
xdg-local-bin-not-in-path = ./local-bin-not-in-path.nix;
xdg-user-dirs-mixed = ./user-dirs-mixed.nix;