mirror of
https://github.com/nix-community/home-manager
synced 2024-12-24 10:49:48 +01:00
parent
69f8e47e9e
commit
0fe984d575
3 changed files with 52 additions and 0 deletions
2
.github/CODEOWNERS
vendored
2
.github/CODEOWNERS
vendored
|
@ -18,6 +18,8 @@
|
||||||
|
|
||||||
/modules/misc/submodule-support.nix @rycee
|
/modules/misc/submodule-support.nix @rycee
|
||||||
|
|
||||||
|
/modules/misc/tmpfiles.nix @dawidsowa
|
||||||
|
|
||||||
/modules/misc/xdg-mime-apps.nix @pacien
|
/modules/misc/xdg-mime-apps.nix @pacien
|
||||||
|
|
||||||
/modules/misc/xdg-user-dirs.nix @pacien
|
/modules/misc/xdg-user-dirs.nix @pacien
|
||||||
|
|
49
modules/misc/tmpfiles.nix
Normal file
49
modules/misc/tmpfiles.nix
Normal file
|
@ -0,0 +1,49 @@
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
|
||||||
|
cfg = config.systemd.user.tmpfiles;
|
||||||
|
|
||||||
|
in {
|
||||||
|
meta.maintainers = [ maintainers.dawidsowa ];
|
||||||
|
|
||||||
|
options.systemd.user.tmpfiles.rules = mkOption {
|
||||||
|
type = types.listOf types.str;
|
||||||
|
default = [ ];
|
||||||
|
example = [ "L /home/user/Documents - - - - /mnt/data/Documents" ];
|
||||||
|
description = ''
|
||||||
|
Rules for creating and cleaning up temporary files
|
||||||
|
automatically. See
|
||||||
|
<citerefentry>
|
||||||
|
<refentrytitle>tmpfiles.d</refentrytitle>
|
||||||
|
<manvolnum>5</manvolnum>
|
||||||
|
</citerefentry>
|
||||||
|
for the exact format.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf (cfg.rules != [ ]) {
|
||||||
|
xdg = {
|
||||||
|
dataFile."user-tmpfiles.d/home-manager.conf" = {
|
||||||
|
text = ''
|
||||||
|
# This file is created automatically and should not be modified.
|
||||||
|
# Please change the option ‘systemd.user.tmpfiles.rules’ instead.
|
||||||
|
${concatStringsSep "\n" cfg.rules}
|
||||||
|
'';
|
||||||
|
onChange = "${pkgs.systemd}/bin/systemd-tmpfiles --user --create";
|
||||||
|
};
|
||||||
|
configFile = {
|
||||||
|
"systemd/user/basic.target.wants/systemd-tmpfiles-setup.service".source =
|
||||||
|
"${pkgs.systemd}/example/systemd/user/systemd-tmpfiles-setup.service";
|
||||||
|
"systemd/user/systemd-tmpfiles-setup.service".source =
|
||||||
|
"${pkgs.systemd}/example/systemd/user/systemd-tmpfiles-setup.service";
|
||||||
|
"systemd/user/timers.target.wants/systemd-tmpfiles-clean.timer".source =
|
||||||
|
"${pkgs.systemd}/example/systemd/user/systemd-tmpfiles-clean.timer";
|
||||||
|
"systemd/user/systemd-tmpfiles-clean.service".source =
|
||||||
|
"${pkgs.systemd}/example/systemd/user/systemd-tmpfiles-clean.service";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -36,6 +36,7 @@ let
|
||||||
(loadModule ./misc/pam.nix { })
|
(loadModule ./misc/pam.nix { })
|
||||||
(loadModule ./misc/qt.nix { })
|
(loadModule ./misc/qt.nix { })
|
||||||
(loadModule ./misc/submodule-support.nix { })
|
(loadModule ./misc/submodule-support.nix { })
|
||||||
|
(loadModule ./misc/tmpfiles.nix { condition = hostPlatform.isLinux; })
|
||||||
(loadModule ./misc/version.nix { })
|
(loadModule ./misc/version.nix { })
|
||||||
(loadModule ./misc/xdg-mime.nix { condition = hostPlatform.isLinux; })
|
(loadModule ./misc/xdg-mime.nix { condition = hostPlatform.isLinux; })
|
||||||
(loadModule ./misc/xdg-mime-apps.nix { condition = hostPlatform.isLinux; })
|
(loadModule ./misc/xdg-mime-apps.nix { condition = hostPlatform.isLinux; })
|
||||||
|
|
Loading…
Reference in a new issue