summaryrefslogtreecommitdiffstats
path: root/krebs/3modules/repo-sync.nix
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2016-06-13 02:04:22 +0200
committertv <tv@krebsco.de>2016-06-13 02:10:02 +0200
commita16f4383142403eab145a8d147e5c9c93309ba4f (patch)
tree160727b414ea864b2a5018e940952ff10c95f3af /krebs/3modules/repo-sync.nix
parentfb226f349843c080d6c81b60301a3a93977b99a4 (diff)
sprinkle with some write{B,D}ash
Diffstat (limited to 'krebs/3modules/repo-sync.nix')
-rw-r--r--krebs/3modules/repo-sync.nix11
1 files changed, 5 insertions, 6 deletions
diff --git a/krebs/3modules/repo-sync.nix b/krebs/3modules/repo-sync.nix
index 7a7c80a75..c5c806cdf 100644
--- a/krebs/3modules/repo-sync.nix
+++ b/krebs/3modules/repo-sync.nix
@@ -1,12 +1,12 @@
{ config, lib, pkgs, ... }:
-with lib;
+with config.krebs.lib;
let
cfg = config.krebs.repo-sync;
out = {
options.krebs.repo-sync = api;
- config = mkIf cfg.enable imp;
+ config = lib.mkIf cfg.enable imp;
};
api = {
@@ -70,7 +70,7 @@ let
imp = {
users.users.repo-sync = {
name = "repo-sync";
- uid = config.krebs.lib.genid "repo-sync";
+ uid = genid "repo-sync";
description = "repo-sync user";
home = cfg.stateDir;
createHome = true;
@@ -95,9 +95,8 @@ let
serviceConfig = {
Type = "simple";
PermissionsStartOnly = true;
- ExecStartPre = pkgs.writeScript "prepare-repo-sync-user" ''
- #! /bin/sh
- cp -v ${config.krebs.lib.shell.escape cfg.privateKeyFile} ${cfg.stateDir}/ssh.priv
+ ExecStartPre = pkgs.writeDash "prepare-repo-sync-user" ''
+ cp -v ${shell.escape cfg.privateKeyFile} ${cfg.stateDir}/ssh.priv
chown repo-sync ${cfg.stateDir}/ssh.priv
'';
ExecStart = "${pkgs.repo-sync}/bin/repo-sync ${repo-sync-config}";