system-manager/nix/modules/tmpfiles.nix
r-vdp e51a1d3ed0
Provide an implementation for systemd-tmpfiles.
Co-authored-by: aanderse <aaron@fosslib.net>
Co-authored-by: jfroche <jfroche@pyxel.be>
2023-10-12 11:16:37 +02:00

27 lines
748 B
Nix
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{ 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}
'';
};
}