Skip to content

Commit c45a77f

Browse files
committed
build: use output hash instead of git rev
1 parent dd1c4ac commit c45a77f

File tree

2 files changed

+28
-14
lines changed

2 files changed

+28
-14
lines changed

nix/jormungandr/containers.nix

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,24 @@
77
l = nixpkgs.lib // builtins;
88

99
mkOCI = namespace: let
10-
rev =
11-
if (inputs.self ? rev)
12-
then inputs.self.rev
13-
else "dirty";
14-
in
15-
std.lib.ops.mkStandardOCI {
10+
# TODO: fix git rev
11+
# rev =
12+
# if (inputs.self ? rev)
13+
# then inputs.self.rev
14+
# else "dirty";
15+
image = std.lib.ops.mkStandardOCI {
1616
name = "${constants.registry}/jormungandr";
17-
tag = "${rev}-${namespace}";
17+
#tag = "${rev}-${namespace}";
1818
operable = cell.operables."jormungandr-${namespace}";
1919
debug = true;
2020
};
21+
in
22+
image
23+
// {
24+
imageTag = let
25+
hash = l.head (l.strings.splitString "-" (baseNameOf image.outPath));
26+
in "${hash}-${namespace}";
27+
};
2128
in
2229
{}
2330
// lib.mapToNamespaces "jormungandr" mkOCI

nix/vit-servicing-station/containers.nix

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,24 @@
77
l = nixpkgs.lib // builtins;
88

99
mkOCI = namespace: let
10-
rev =
11-
if (inputs.self ? rev)
12-
then inputs.self.rev
13-
else "dirty";
14-
in
15-
std.lib.ops.mkStandardOCI {
10+
# TODO: fix git rev
11+
# rev =
12+
# if (inputs.self ? rev)
13+
# then inputs.self.rev
14+
# else "dirty";
15+
image = std.lib.ops.mkStandardOCI {
1616
name = "${constants.registry}/vit-servicing-station-server";
17-
tag = "${rev}-${namespace}";
17+
#tag = "${rev}-${namespace}";
1818
operable = cell.operables."vit-servicing-station-server-${namespace}";
1919
debug = true;
2020
};
21+
in
22+
image
23+
// {
24+
imageTag = let
25+
hash = l.head (l.strings.splitString "-" (baseNameOf image.outPath));
26+
in "${hash}-${namespace}";
27+
};
2128
in
2229
{}
2330
// lib.mapToNamespaces "vit-servicing-station-server" mkOCI

0 commit comments

Comments
 (0)