···
129
-
system.activationScripts.gitConfig = let
131
-
if cfg.motdFile != null && cfg.motd != null
132
-
then throw "motdFile and motd cannot be both set"
134
-
${optionalString (cfg.motdFile != null) "cat ${cfg.motdFile} > ${cfg.stateDir}/motd"}
135
-
${optionalString (cfg.motd != null) ''printf "${cfg.motd}" > ${cfg.stateDir}/motd''}
138
-
mkdir -p "${cfg.repo.scanPath}"
139
-
chown -R ${cfg.gitUser}:${cfg.gitUser} "${cfg.repo.scanPath}"
141
-
mkdir -p "${cfg.stateDir}/.config/git"
142
-
cat > "${cfg.stateDir}/.config/git/config" << EOF
145
-
email = git@example.com
147
-
advertisePushOptions = true
150
-
chown -R ${cfg.gitUser}:${cfg.gitUser} "${cfg.stateDir}"
users.users.${cfg.gitUser} = {
···
description = "knot service";
after = ["network.target" "sshd.service"];
wantedBy = ["multi-user.target"];
164
+
enableStrictShellChecks = true;
168
+
if cfg.motdFile != null && cfg.motd != null
169
+
then throw "motdFile and motd cannot be both set"
171
+
${optionalString (cfg.motdFile != null) "cat ${cfg.motdFile} > ${cfg.stateDir}/motd"}
172
+
${optionalString (cfg.motd != null) ''printf "${cfg.motd}" > ${cfg.stateDir}/motd''}
175
+
mkdir -p "${cfg.repo.scanPath}"
176
+
chown -R ${cfg.gitUser}:${cfg.gitUser} "${cfg.repo.scanPath}"
178
+
mkdir -p "${cfg.stateDir}/.config/git"
179
+
cat > "${cfg.stateDir}/.config/git/config" << EOF
182
+
email = git@example.com
184
+
advertisePushOptions = true
187
+
chown -R ${cfg.gitUser}:${cfg.gitUser} "${cfg.stateDir}"
192
+
PermissionsStartOnly = true;
WorkingDirectory = cfg.stateDir;
"KNOT_REPO_SCAN_PATH=${cfg.repo.scanPath}"