-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdefault.nix
60 lines (53 loc) · 1.41 KB
/
default.nix
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
{
inputs,
self,
lib,
...
}: {
imports = [];
perSystem = {
self',
pkgs,
lib,
system,
inputs',
...
}: let
skopeo-push = pkgs.writeShellScriptBin "skopeo-push" ''
set -euo pipefail
# copy an image to a docker registry
# 1. image - Given as a path to an image archive
# 2. registry - The registry to push to
${pkgs.skopeo}/bin/skopeo copy --insecure-policy "docker-archive:$1" "docker://$2"
'';
paperless-base = pkgs.dockerTools.pullImage {
imageName = "paperlessngx/paperless-ngx";
imageDigest = "sha256:9948208107c66a63ca6ea987197a20a3d49bddd28cebf768be53b191dc54a9b7";
sha256 = "sha256-w8189iaojdptL4JItHhCFVdTEX+A02TrKpzqCxXOB60=";
finalImageTag = "paperless-base";
finalImageName = "paperless";
};
in {
apps = {
skopeo-push = {
type = "app";
program = "${skopeo-push}/bin/skopeo-push";
};
};
packages = {
"scripts/skopeo-push" = skopeo-push;
"image/paperless" = pkgs.dockerTools.buildImage {
name = "paperless";
tag = "latest";
fromImage = paperless-base;
copyToRoot = pkgs.buildEnv {
name = "image-root";
paths = [pkgs.redis];
pathsToLink = ["/bin"];
};
config.Cmd = ["/usr/local/bin/paperless_cmd.sh"];
};
"image/conduit" = inputs'.conduit.packages."image/conduit";
};
};
}