Provide an implementation for systemd-tmpfiles.
Co-authored-by: aanderse <aaron@fosslib.net> Co-authored-by: jfroche <jfroche@pyxel.be>
This commit is contained in:
parent
549bc38339
commit
e51a1d3ed0
6 changed files with 88 additions and 3 deletions
|
|
@ -9,6 +9,7 @@
|
|||
./environment.nix
|
||||
./etc.nix
|
||||
./systemd.nix
|
||||
./tmpfiles.nix
|
||||
./upstream/nixpkgs
|
||||
];
|
||||
|
||||
|
|
|
|||
27
nix/modules/tmpfiles.nix
Normal file
27
nix/modules/tmpfiles.nix
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
{ config, lib, ... }:
|
||||
let
|
||||
inherit (lib) types;
|
||||
in
|
||||
{
|
||||
options = {
|
||||
systemd.tmpfiles.rules = lib.mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = [ ];
|
||||
example = [ "d /tmp 1777 root root 10d" ];
|
||||
description = lib.mdDoc ''
|
||||
Rules for creation, deletion and cleaning of volatile and temporary files
|
||||
automatically. See
|
||||
{manpage}`tmpfiles.d(5)`
|
||||
for the exact format.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
environment.etc."tmpfiles.d/00-system-manager.conf".text = ''
|
||||
# This file is created automatically and should not be modified.
|
||||
# Please change the option ‘systemd.tmpfiles.rules’ instead.
|
||||
${lib.concatStringsSep "\n" config.systemd.tmpfiles.rules}
|
||||
'';
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue