mirror of
https://github.com/nix-community/home-manager.git
synced 2026-06-05 21:02:51 +00:00
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:
@@ -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;
|
||||
|
||||
10
tests/modules/misc/xdg/autostart-readonly-empty.nix
Normal file
10
tests/modules/misc/xdg/autostart-readonly-empty.nix
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
xdg.autostart = {
|
||||
enable = true;
|
||||
readOnly = true;
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertLinkExists home-files/.config/autostart
|
||||
'';
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user