forked from cleverca22/nixos-configs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcachecache.nix
More file actions
35 lines (33 loc) · 793 Bytes
/
cachecache.nix
File metadata and controls
35 lines (33 loc) · 793 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.services.cachecache;
sources = import ./nix/sources.nix;
in {
options = {
services.cachecache.enable = mkEnableOption "enable cachecache";
};
config = mkIf cfg.enable {
nixpkgs.overlays = [
(super: self: {
cachecache = pkgs.callPackage sources.cachecache {};
})
];
users.users.cachecache = {
home = "/var/lib/cachecache";
isSystemUser = true;
createHome = true;
};
systemd.services.cachecache = {
wantedBy = [ "multi-user.target" ];
path = [ pkgs.cachecache ];
script = ''
exec cachecache
'';
serviceConfig = {
User = "cachecache";
WorkingDirectory = config.users.users.cachecache.home;
};
};
};
}