mirror of
https://github.com/nix-community/home-manager.git
synced 2026-01-11 17:39:37 +08:00
Revert "tmpfiles: add option to purge rules' targets on change"
This reverts commit b4350d54c2.
Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
This commit is contained in:
@@ -28,7 +28,7 @@ in
|
||||
uid = 1000;
|
||||
};
|
||||
|
||||
systemd.tmpfiles.settings.age.rules."/home/alice/age-key".f = {
|
||||
systemd.tmpfiles.settings.age."/home/alice/age-key".f = {
|
||||
mode = "400";
|
||||
user = "alice";
|
||||
group = "users";
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
imports = [ ./common-stubs.nix ];
|
||||
|
||||
systemd.user.tmpfiles.settings = {
|
||||
cache.rules."%C".d.age = "4 weeks";
|
||||
myTool.rules."%h/.config/myTool.conf"."f+" = {
|
||||
cache."%C".d.age = "4 weeks";
|
||||
myTool."%h/.config/myTool.conf"."f+" = {
|
||||
mode = "0644";
|
||||
user = "alice";
|
||||
group = "users";
|
||||
@@ -12,8 +12,6 @@
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertPathNotExists home-files/.config/user-tmpfiles.d/home-manager-purge-on-change.conf
|
||||
|
||||
cacheRulesFile=home-files/.config/user-tmpfiles.d/home-manager-cache.conf
|
||||
assertFileExists $cacheRulesFile
|
||||
assertFileRegex $cacheRulesFile "^'d' '%C' '-' '-' '-' '4 weeks' $"
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
{
|
||||
tmpfiles-no-rules = ./no-rules.nix;
|
||||
tmpfiles-basic-rules = ./basic-rules.nix;
|
||||
tmpfiles-rules-with-purging = ./rules-with-purging.nix;
|
||||
|
||||
tmpfiles-escaped-argument-warning = ./escaped-argument-warning.nix;
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
{
|
||||
imports = [ ./common-stubs.nix ];
|
||||
|
||||
systemd.user.tmpfiles.settings.foo.rules.path.f.argument = "my\\x20unescaped\\x20config";
|
||||
systemd.user.tmpfiles.settings.foo.path.f.argument = "my\\x20unescaped\\x20config";
|
||||
|
||||
test.asserts.warnings.expected = [
|
||||
''
|
||||
The 'systemd.user.tmpfiles.settings.foo.rules.path.f.argument' option
|
||||
The 'systemd.user.tmpfiles.settings.foo.path.f.argument' option
|
||||
appears to contain escape sequences, which will be escaped again.
|
||||
Unescape them if this is not intended. The assigned string is:
|
||||
"my\x20unescaped\x20config"
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
{
|
||||
imports = [ ./common-stubs.nix ];
|
||||
|
||||
systemd.user.tmpfiles.settings = {
|
||||
cache.rules."%C".d.age = "4 weeks";
|
||||
myTool = {
|
||||
rules = {
|
||||
"%h/.config/myTool.conf"."f+".argument = "my_config";
|
||||
"%h/.config/myToolPurged.conf"."f+$".argument = "my_config_purged";
|
||||
};
|
||||
purgeOnChange = true;
|
||||
};
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
cacheRulesFile=home-files/.config/user-tmpfiles.d/home-manager-cache.conf
|
||||
assertFileExists $cacheRulesFile
|
||||
assertFileRegex $cacheRulesFile "^'d' '%C' '-' '-' '-' '4 weeks' $"
|
||||
|
||||
assertPathNotExists home-files/.config/user-tmpfiles.d/home-manager-myTool.conf
|
||||
myToolRulesFile=home-files/.config/user-tmpfiles.d/home-manager-purge-on-change.conf
|
||||
assertFileExists $myToolRulesFile
|
||||
assertFileRegex $myToolRulesFile \
|
||||
"^'f+' '%h/.config/myTool.conf' '-' '-' '-' '-' my_config$"
|
||||
assertFileRegex $myToolRulesFile \
|
||||
"^'f+$' '%h/.config/myToolPurged.conf' '-' '-' '-' '-' my_config_purged$"
|
||||
'';
|
||||
}
|
||||
Reference in New Issue
Block a user