-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
43 lines (43 loc) · 1.35 KB
/
flake.nix
File metadata and controls
43 lines (43 loc) · 1.35 KB
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
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs";
flake-utils.url = "github:numtide/flake-utils";
marlowe-cardano.url = "github:input-output-hk/marlowe-cardano";
};
outputs = { self, nixpkgs, flake-utils, marlowe-cardano }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
marlowe-cli = marlowe-cardano.packages.${system}.marlowe-cli;
loopScript = pkgs.writeTextDir "app/loop.sh" (builtins.readFile ./loop.sh);
activeScript = pkgs.writeTextDir "app/active.sql" (builtins.readFile ./active.sql);
image = pkgs.dockerTools.buildImage {
name = "marlowe-clean";
tag = "latest";
copyToRoot = pkgs.buildEnv {
name = "image-root";
pathsToLink = [ "/bin" "/app" ];
paths = [
loopScript
activeScript
marlowe-cli
pkgs.bash
pkgs.coreutils
pkgs.curl
pkgs.jq
pkgs.postgresql
];
};
config = {
Cmd = [ "${pkgs.bash}/bin/bash" "loop.sh" ];
WorkingDir = "/app";
Volumes = { "/ipc" = { }; "/keys" = { }; };
};
};
in
{
defaultPackage = image;
packages = { marlowe-clean = image; };
}
);
}