Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

treewide: tmpfiles.rules -> tmpfiles.settings #343796

Open
wants to merge 64 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
c69e1e3
nixos/dolibarr: tmpfiles.rules -> tmpfiles.settings
h7x4 Sep 22, 2024
b22c09e
nixos/jackett: tmpfiles.rules -> tmpfiles.settings
h7x4 Sep 22, 2024
bafb26a
nixos/collectd: tmpfiles.rules -> tmpfiles.settings
h7x4 Sep 22, 2024
4a18ab0
nixos/mediawiki: tmpfiles.rules -> tmpfiles.settings
h7x4 Sep 22, 2024
a455a1c
nixos/soft-serve: tmpfiles.rules -> tmpfiles.settings
h7x4 Sep 22, 2024
b451bb3
nixos/bee: tmpfiles.rules -> tmpfiles.settings
h7x4 Sep 22, 2024
f72f401
nixos/sonarr: tmpfiles.rules -> tmpfiles.settings
h7x4 Sep 22, 2024
48c9450
nixos/akkoma: tmpfiles.rules -> tmpfiles.settings
h7x4 Sep 22, 2024
9883191
nixos/ombi: tmpfiles.rules -> tmpfiles.settings
h7x4 Sep 22, 2024
4d4db68
nixos/moonraker: tmpfiles.rules -> tmpfiles.settings
h7x4 Sep 22, 2024
79477d3
nixos/tautulli: tmpfiles.rules -> tmpfiles.settings
h7x4 Sep 22, 2024
9e0755d
nixos/zookeeper: tmpfiles.rules -> tmpfiles.settings
h7x4 Sep 22, 2024
b06e0ed
nixos/redmine: tmpfiles.rules -> tmpfiles.settings
h7x4 Sep 22, 2024
6c99e92
nixos/gollum: tmpfiles.rules -> tmpfiles.settings
h7x4 Sep 22, 2024
06936b3
nixos/octoprint: tmpfiles.rules -> tmpfiles.settings
h7x4 Sep 22, 2024
11504ed
nixos/etebase-server: tmpfiles.rules -> tmpfiles.settings
h7x4 Sep 22, 2024
6fb8e05
nixos/apache-kafka: tmpfiles.rules -> tmpfiles.settings
h7x4 Sep 22, 2024
3f2574e
nixos/nzbhydra2: tmpfiles.rules -> tmpfiles.settings
h7x4 Sep 22, 2024
a210eed
nixos/sane: tmpfiles.rules -> tmpfiles.settings
h7x4 Sep 22, 2024
801cf9d
nixos/tcsd: tmpfiles.rules -> tmpfiles.settings
h7x4 Sep 22, 2024
6198015
nixos/vdr: tmpfiles.rules -> tmpfiles.settings
h7x4 Sep 22, 2024
4c7e175
nixos/graylog: tmpfiles.rules -> tmpfiles.settings
h7x4 Sep 22, 2024
6e712c2
nixos/heartbeat: tmpfiles.rules -> tmpfiles.settings
h7x4 Sep 22, 2024
801fd82
nixos/weblate: tmpfiles.rules -> tmpfiles.settings
h7x4 Sep 22, 2024
6b97b3b
nixos/btrbk: tmpfiles.rules -> tmpfiles.settings
h7x4 Sep 22, 2024
67014ad
nixos/yarn: tmpfiles.rules -> tmpfiles.settings
h7x4 Sep 22, 2024
868d8e3
nixos/jitsi-meet: tmpfiles.rules -> tmpfiles.settings
h7x4 Sep 22, 2024
f40a915
nixos/limesurvey: tmpfiles.rules -> tmpfiles.settings
h7x4 Sep 22, 2024
15013f8
nixos/slimserver: tmpfiles.rules -> tmpfiles.settings
h7x4 Sep 22, 2024
1a0c1b6
nixos/quassel: tmpfiles.rules -> tmpfiles.settings
h7x4 Sep 22, 2024
b7a2403
nixos/trilium: tmpfiles.rules -> tmpfiles.settings
h7x4 Sep 22, 2024
fd82e6f
nixos/ntopng: tmpfiles.rules -> tmpfiles.settings
h7x4 Sep 22, 2024
f59bd9c
nixos/wasabibackend: tmpfiles.rules -> tmpfiles.settings
h7x4 Sep 22, 2024
9e55a72
nixos/peerflix: tmpfiles.rules -> tmpfiles.settings
h7x4 Sep 22, 2024
33db31a
nixos/confluence: tmpfiles.rules -> tmpfiles.settings
h7x4 Sep 22, 2024
49a48b8
nixos/ccache: tmpfiles.rules -> tmpfiles.settings
h7x4 Sep 22, 2024
bd209e9
nixos/nncp: tmpfiles.rules -> tmpfiles.settings
h7x4 Sep 22, 2024
d27866e
nixos/singularity: tmpfiles.rules -> tmpfiles.settings
h7x4 Sep 22, 2024
7335f0b
nixos/lxd: tmpfiles.rules -> tmpfiles.settings
h7x4 Sep 22, 2024
f580256
nixos/incus: tmpfiles.rules -> tmpfiles.settings
h7x4 Sep 22, 2024
17c32f3
nixos/lxc: tmpfiles.rules -> tmpfiles.settings
h7x4 Sep 22, 2024
949b37f
nixos/waydroid: tmpfiles.rules -> tmpfiles.settings
h7x4 Sep 22, 2024
886360a
nixos/libvirtd: tmpfiles.rules -> tmpfiles.settings
h7x4 Sep 22, 2024
ee250ef
nixos/xe-guest-utilities: tmpfiles.rules -> tmpfiles.settings
h7x4 Sep 22, 2024
963d06b
nixos/nginx: tmpfiles.rules -> tmpfiles.settings
h7x4 Sep 22, 2024
4fd8709
nixos/avahi-daemon: tmpfiles.rules -> tmpfiles.settings
h7x4 Sep 22, 2024
40ed67a
nixos/gitea: tmpfiles.rules -> tmpfiles.settings
h7x4 Sep 22, 2024
b0ff8f8
nixos/nullmailer: tmpfiles.rules -> tmpfiles.settings
h7x4 Sep 22, 2024
cee5087
nixos/opendkim: tmpfiles.rules -> tmpfiles.settings
h7x4 Sep 22, 2024
eb6d66e
nixos/opensmtpd: tmpfiles.rules -> tmpfiles.settings
h7x4 Sep 22, 2024
6210723
nixos/traefik: tmpfiles.rules -> tmpfiles.settings
h7x4 Sep 22, 2024
c0c2908
nixos/filesystems: tmpfiles.rules -> tmpfiles.settings
h7x4 Sep 22, 2024
3a5058d
nixos/postgresql-backup: tmpfiles.rules -> tmpfiles.settings
h7x4 Sep 22, 2024
4190c3c
nixos/aria2: tmpfiles.rules -> tmpfiles.settings
h7x4 Sep 22, 2024
a22d270
nixos/uwsgi: tmpfiles.rules -> tmpfiles.settings
h7x4 Sep 22, 2024
3f1cf3e
nixos/coturn: tmpfiles.rules -> tmpfiles.settings
h7x4 Sep 22, 2024
e542fdf
nixos/nextcloud: tmpfiles.rules -> tmpfiles.settings
h7x4 Sep 22, 2024
c2061c1
nixos/pixelfed: tmpfiles.rules -> tmpfiles.settings
h7x4 Sep 28, 2024
4dcf314
nixos/cloudlog: tmpfiles.rules -> tmpfiles.settings
h7x4 Sep 28, 2024
3b07065
nixos/kavita: tmpfiles.rules -> tmpfiles.settings
h7x4 Sep 28, 2024
f265171
nixos/teamspeak3: tmpfiles.rules -> tmpfiles.settings
h7x4 Sep 28, 2024
ac5ec87
nixos/firebird: tmpfiles.rules -> tmpfiles.settings
h7x4 Sep 28, 2024
7aedfd9
nixos/duplicity: tmpfiles.rules -> tmpfiles.settings
h7x4 Sep 28, 2024
8d4e84a
nixos/rutorrent: tmpfiles.rules -> tmpfiles.settings
h7x4 Sep 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion nixos/modules/programs/ccache.nix
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@ in {
config = lib.mkMerge [
# host configuration
(lib.mkIf cfg.enable {
systemd.tmpfiles.rules = [ "d ${cfg.cacheDir} 0770 ${cfg.owner} ${cfg.group} -" ];
systemd.tmpfiles.settings."10-ccache".${cfg.cacheDir}.d = {
user = cfg.owner;
inherit (cfg) group;
mode = "0770";
};

# "nix-ccache --show-stats" and "nix-ccache --clear"
security.wrappers.nix-ccache = {
Expand Down
16 changes: 12 additions & 4 deletions nixos/modules/programs/nncp.nix
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,18 @@ in {
log = lib.mkDefault "/var/spool/nncp/log";
};

systemd.tmpfiles.rules = [
"d ${programCfg.settings.spool} 0770 root ${programCfg.group}"
"f ${programCfg.settings.log} 0770 root ${programCfg.group}"
];
systemd.tmpfiles.settings."10-nncp" = {
${programCfg.settings.spool}.d = {
user = "root";
inherit (programCfg) group;
mode = "0770";
};
${programCfg.settings.log}.f = {
user = "root";
inherit (programCfg) group;
mode = "0770";
};
};

systemd.services.nncp-config = {
path = [ pkg ];
Expand Down
10 changes: 7 additions & 3 deletions nixos/modules/programs/singularity.nix
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,12 @@ in
group = "root";
source = "${cfg.packageOverriden}/libexec/${cfg.packageOverriden.projectName}/bin/starter-suid.orig";
};
systemd.tmpfiles.rules = lib.mkIf cfg.enableExternalLocalStateDir [
"d /var/lib/${cfg.packageOverriden.projectName}/mnt/session 0770 root root -"
];
systemd.tmpfiles.settings."10-singularity" = lib.mkIf cfg.enableExternalLocalStateDir {
"/var/lib/${cfg.packageOverriden.projectName}/mnt/session".d = {
user = "root";
group = "root";
mode = "0770";
};
};
};
}
7 changes: 4 additions & 3 deletions nixos/modules/services/audio/slimserver.nix
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,10 @@ in {

config = mkIf cfg.enable {

systemd.tmpfiles.rules = [
"d '${cfg.dataDir}' - slimserver slimserver - -"
];
systemd.tmpfiles.settings."10-slimserver".${cfg.dataDir}.d = {
user = "slimserver";
group = "slimserver";
};

systemd.services.slimserver = {
after = [ "network.target" ];
Expand Down
23 changes: 18 additions & 5 deletions nixos/modules/services/backup/btrbk.nix
Original file line number Diff line number Diff line change
Expand Up @@ -252,11 +252,24 @@ in
cfg.sshAccess;
};
users.groups.btrbk = { };
systemd.tmpfiles.rules = [
"d /var/lib/btrbk 0750 btrbk btrbk"
"d /var/lib/btrbk/.ssh 0700 btrbk btrbk"
"f /var/lib/btrbk/.ssh/config 0700 btrbk btrbk - StrictHostKeyChecking=accept-new"
];
systemd.tmpfiles.settings."10-btrbk" = {
"/var/lib/btrbk".d = {
user = "btrbk";
group = "btrbk";
mode = "0750";
};
"/var/lib/btrbk/.ssh".d = {
user = "btrbk";
group = "btrbk";
mode = "0700";
};
"/var/lib/btrbk/.ssh/config".f = {
user = "btrbk";
group = "btrbk";
mode = "0700";
argument = "StrictHostKeyChecking=accept-new";
};
};
environment.etc = mapAttrs'
(
name: instance: {
Expand Down
6 changes: 5 additions & 1 deletion nixos/modules/services/backup/duplicity.nix
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,11 @@ in
startAt = cfg.frequency;
};

tmpfiles.rules = optional (localTarget != null) "d ${localTarget} 0700 root root -";
tmpfiles.settings."10-duplicity".${localTarget}.d = {
user = "root";
group = "root";
mode = "0700";
};
};

assertions = singleton {
Expand Down
7 changes: 4 additions & 3 deletions nixos/modules/services/backup/postgresql-backup.nix
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,10 @@ in {
];
}
(lib.mkIf cfg.enable {
systemd.tmpfiles.rules = [
"d '${cfg.location}' 0700 postgres - - -"
];
systemd.tmpfiles.settings."10-postgresql-backup".${cfg.location}.d = {
user = "postgres";
mode = "0700";
};
})
(lib.mkIf (cfg.enable && cfg.backupAll) {
systemd.services.postgresqlBackup =
Expand Down
6 changes: 3 additions & 3 deletions nixos/modules/services/cluster/hadoop/yarn.nix
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,9 @@ in
(mkIf cfg.yarn.nodemanager.enable {
# Needed because yarn hardcodes /bin/bash in container start scripts
# These scripts can't be patched, they are generated at runtime
systemd.tmpfiles.rules = [
(mkIf cfg.yarn.nodemanager.addBinBash "L /bin/bash - - - - /run/current-system/sw/bin/bash")
];
systemd.tmpfiles.settings."10-yarn" = mkIf cfg.yarn.nodemanager.addBinBash {
"/bin/bash".L.argument = "/run/current-system/sw/bin/bash";
};

systemd.services.yarn-nodemanager = {
description = "Hadoop YARN NodeManager";
Expand Down
14 changes: 10 additions & 4 deletions nixos/modules/services/databases/firebird.nix
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,16 @@ in

environment.systemPackages = [cfg.package];

systemd.tmpfiles.rules = [
"d '${dataDir}' 0700 ${cfg.user} - - -"
"d '${systemDir}' 0700 ${cfg.user} - - -"
];
systemd.tmpfiles.settings."10-firebird" = {
${dataDir}.d = {
inherit (cfg) user;
mode = "0700";
};
${systemDir}.d = {
inherit (cfg) user;
mode = "0700";
};
};

systemd.services.firebird =
{ description = "Firebird Super-Server";
Expand Down
8 changes: 5 additions & 3 deletions nixos/modules/services/hardware/sane.nix
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,11 @@ in
users.groups.scanner.gid = config.ids.gids.scanner;
networking.firewall.allowedUDPPorts = lib.mkIf config.hardware.sane.openFirewall [ 8612 ];

systemd.tmpfiles.rules = [
"d /var/lock/sane 0770 root scanner - -"
];
systemd.tmpfiles.settings."10-sane"."/var/lock/sane".d = {
user = "root";
group = "scanner";
mode = "0770";
};
})

(lib.mkIf config.services.saned.enable {
Expand Down
8 changes: 4 additions & 4 deletions nixos/modules/services/hardware/tcsd.nix
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,10 @@ in
ACTION=="add", KERNEL=="tpm[0-9]*", TAG+="systemd"
'';

systemd.tmpfiles.rules = [
# Initialise the state directory
"d ${cfg.stateDir} 0770 ${cfg.user} ${cfg.group} - -"
];
systemd.tmpfiles.settings."10-tcsd".${cfg.stateDir}.d = {
inherit (cfg) user group;
mode = "0770";
};

systemd.services.tcsd = {
description = "Manager for Trusted Computing resources";
Expand Down
13 changes: 9 additions & 4 deletions nixos/modules/services/hardware/vdr.nix
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,15 @@ in

config = mkIf cfg.enable {

systemd.tmpfiles.rules = [
"d ${cfg.videoDir} 0755 ${cfg.user} ${cfg.group} -"
"Z ${cfg.videoDir} - ${cfg.user} ${cfg.group} -"
];
systemd.tmpfiles.settings."10-vdr".${cfg.videoDir} = {
d = {
inherit (cfg) user group;
mode = "0755";
};
Z = {
inherit (cfg) user group;
};
};

systemd.services.vdr = {
description = "VDR";
Expand Down
6 changes: 3 additions & 3 deletions nixos/modules/services/logging/graylog.nix
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,9 @@ in
};
users.groups = lib.mkIf (cfg.user == "graylog") { graylog = {}; };

systemd.tmpfiles.rules = [
"d '${cfg.messageJournalDir}' - ${cfg.user} - - -"
];
systemd.tmpfiles.settings."10-graylog".${cfg.messageJournalDir}.d = {
inherit (cfg) user;
};

systemd.services.graylog = {
description = "Graylog Server";
Expand Down
7 changes: 4 additions & 3 deletions nixos/modules/services/logging/heartbeat.nix
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,10 @@ in

config = lib.mkIf cfg.enable {

systemd.tmpfiles.rules = [
"d '${cfg.stateDir}' - nobody nogroup - -"
];
systemd.tmpfiles.settings."10-heartbeat".${cfg.stateDir}.d = {
user = "nobody";
group = "nogroup";
};

systemd.services.heartbeat = with pkgs; {
description = "heartbeat log shipper";
Expand Down
17 changes: 11 additions & 6 deletions nixos/modules/services/mail/nullmailer.nix
Original file line number Diff line number Diff line change
Expand Up @@ -207,12 +207,17 @@
groups.${cfg.group} = { };
};

systemd.tmpfiles.rules = [
"d /var/spool/nullmailer - ${cfg.user} ${cfg.group} - -"
"d /var/spool/nullmailer/failed 770 ${cfg.user} ${cfg.group} - -"
"d /var/spool/nullmailer/queue 770 ${cfg.user} ${cfg.group} - -"
"d /var/spool/nullmailer/tmp 770 ${cfg.user} ${cfg.group} - -"
];
systemd.tmpfiles.settings."10-nullmailer" = let
defaultConfig = {
inherit (cfg) user group;
mode = "0770";
};
in {
"/var/spool/nullmailer".d = defaultConfig;
"/var/spool/nullmailer/failed".d = defaultConfig;
"/var/spool/nullmailer/queue".d = defaultConfig;
"/var/spool/nullmailer/tmp".d = defaultConfig;
};

systemd.services.nullmailer = {
description = "nullmailer";
Expand Down
6 changes: 3 additions & 3 deletions nixos/modules/services/mail/opendkim.nix
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@ in {

environment.systemPackages = [ pkgs.opendkim ];

systemd.tmpfiles.rules = [
"d '${cfg.keyPath}' - ${cfg.user} ${cfg.group} - -"
];
systemd.tmpfiles.settings."10-opendkim".${cfg.keyPath}.d = {
inherit (cfg) user group;
};

systemd.services.opendkim = {
description = "OpenDKIM signing and verification daemon";
Expand Down
21 changes: 16 additions & 5 deletions nixos/modules/services/mail/opensmtpd.nix
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,22 @@ in {
services.mail.sendmailSetuidWrapper = lib.mkIf cfg.setSendmail
(security.wrappers.smtpctl // { program = "sendmail"; });

systemd.tmpfiles.rules = [
"d /var/spool/smtpd 711 root - - -"
"d /var/spool/smtpd/offline 770 root smtpq - -"
"d /var/spool/smtpd/purge 700 smtpq root - -"
];
systemd.tmpfiles.settings."10-opensmtpd" = {
"/var/spool/smtpd".d = {
user = "root";
mode = "0711";
};
"/var/spool/smtpd/offline" = {
user = "root";
group = "smtpq";
mode = "0770";
};
"/var/spool/smtpd/purge" = {
user = "smtpq";
group = "root";
mode = "0700";
};
};

systemd.services.opensmtpd = let
procEnv = pkgs.buildEnv {
Expand Down
7 changes: 6 additions & 1 deletion nixos/modules/services/misc/apache-kafka.nix
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,12 @@ in {
};
users.groups.apache-kafka = {};

systemd.tmpfiles.rules = map (logDir: "d '${logDir}' 0700 apache-kafka - - -") cfg.settings."log.dirs";
systemd.tmpfiles.settings."10-apache-kafka" = lib.genAttrs (_: {
d = {
user = "apache-kafka";
mode = "0700";
};
}) cfg.settings."log.dirs";

systemd.services.apache-kafka = {
description = "Apache Kafka Daemon";
Expand Down
16 changes: 11 additions & 5 deletions nixos/modules/services/misc/etebase-server.nix
Original file line number Diff line number Diff line change
Expand Up @@ -172,11 +172,17 @@ in
'')
];

systemd.tmpfiles.rules = [
"d '${cfg.dataDir}' - ${cfg.user} ${config.users.users.${cfg.user}.group} - -"
] ++ lib.optionals (cfg.unixSocket != null) [
"d '${builtins.dirOf cfg.unixSocket}' - ${cfg.user} ${config.users.users.${cfg.user}.group} - -"
];
systemd.tmpfiles.settings."10-etebase-server" = {
${cfg.dataDir}.d = {
inherit (cfg) user;
inherit (config.users.users.${cfg.user}) group;
};
} // (lib.optionalAttrs (cfg.unixSocket != null) {
${builtins.dirOf cfg.unixSocket}.d = {
inherit (cfg) user;
inherit (config.users.users.${cfg.user}) group;
};
});

systemd.services.etebase-server = {
description = "An Etebase (EteSync 2.0) server";
Expand Down
53 changes: 30 additions & 23 deletions nixos/modules/services/misc/gitea.nix
Original file line number Diff line number Diff line change
Expand Up @@ -492,33 +492,40 @@ in
];
};

systemd.tmpfiles.rules = [
"d '${cfg.dump.backupDir}' 0750 ${cfg.user} ${cfg.group} - -"
"z '${cfg.dump.backupDir}' 0750 ${cfg.user} ${cfg.group} - -"
"d '${cfg.repositoryRoot}' 0750 ${cfg.user} ${cfg.group} - -"
"z '${cfg.repositoryRoot}' 0750 ${cfg.user} ${cfg.group} - -"
"d '${cfg.stateDir}' 0750 ${cfg.user} ${cfg.group} - -"
"d '${cfg.stateDir}/conf' 0750 ${cfg.user} ${cfg.group} - -"
"d '${cfg.customDir}' 0750 ${cfg.user} ${cfg.group} - -"
"d '${cfg.customDir}/conf' 0750 ${cfg.user} ${cfg.group} - -"
"d '${cfg.stateDir}/data' 0750 ${cfg.user} ${cfg.group} - -"
"d '${cfg.stateDir}/log' 0750 ${cfg.user} ${cfg.group} - -"
"z '${cfg.stateDir}' 0750 ${cfg.user} ${cfg.group} - -"
"z '${cfg.stateDir}/.ssh' 0700 ${cfg.user} ${cfg.group} - -"
"z '${cfg.stateDir}/conf' 0750 ${cfg.user} ${cfg.group} - -"
"z '${cfg.customDir}' 0750 ${cfg.user} ${cfg.group} - -"
"z '${cfg.customDir}/conf' 0750 ${cfg.user} ${cfg.group} - -"
"z '${cfg.stateDir}/data' 0750 ${cfg.user} ${cfg.group} - -"
"z '${cfg.stateDir}/log' 0750 ${cfg.user} ${cfg.group} - -"
systemd.tmpfiles.settings."10-gitea" = let
defaultConfig = {
inherit (cfg) user group;
mode = "0750";
};
in {
${cfg.dump.backupDir}.d = defaultConfig;
${cfg.dump.backupDir}.z = defaultConfig;
${cfg.repositoryRoot}.d = defaultConfig;
${cfg.repositoryRoot}.z = defaultConfig;

${cfg.stateDir}.d = defaultConfig;
"${cfg.stateDir}/conf".d = defaultConfig;
${cfg.customDir}.d = defaultConfig;
"${cfg.customDir}/conf".d = defaultConfig;
"${cfg.stateDir}/data".d = defaultConfig;
"${cfg.stateDir}/log".d = defaultConfig;
${cfg.stateDir}.z = defaultConfig;
"${cfg.stateDir}/.ssh".z = defaultConfig // { mode = "0700"; };
"${cfg.stateDir}/conf".z = defaultConfig;
${cfg.customDir}.z = defaultConfig;
"${cfg.customDir}/conf".z = defaultConfig;
"${cfg.stateDir}/data".z = defaultConfig;
"${cfg.stateDir}/log".z = defaultConfig;

# If we have a folder or symlink with gitea locales, remove it
# And symlink the current gitea locales in place
"L+ '${cfg.stateDir}/conf/locale' - - - - ${cfg.package.out}/locale"
"${cfg.stateDir}/conf/locale"."L+".argument = "${cfg.package.out}/locale";

] ++ lib.optionals cfg.lfs.enable [
"d '${cfg.lfs.contentDir}' 0750 ${cfg.user} ${cfg.group} - -"
"z '${cfg.lfs.contentDir}' 0750 ${cfg.user} ${cfg.group} - -"
];
${cfg.lfs.contentDir} = lib.mkIf cfg.lfs.enable {
d = defaultConfig;
z = defaultConfig;
};
};

systemd.services.gitea = {
description = "gitea";
Expand Down
Loading