Skip to content

Commit b61dc19

Browse files
committed
fix(template): Pull in a change from stackabletech/opa-operator#622
Otherwise it gets removed, like stackabletech/opa-operator#641
1 parent 9006de6 commit b61dc19

File tree

1 file changed

+29
-22
lines changed

1 file changed

+29
-22
lines changed

template/default.nix

Lines changed: 29 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{ sources ? import ./nix/sources.nix # managed by https://github.com/nmattia/niv
22
, nixpkgs ? sources.nixpkgs
3-
, pkgs ? import nixpkgs {}
3+
, pkgs ? import nixpkgs { }
44
, cargo ? import ./Cargo.nix {
55
inherit nixpkgs pkgs; release = false;
66
defaultCrateOverrides = pkgs.defaultCrateOverrides // {
@@ -16,6 +16,10 @@
1616
stackable-secret-operator = attrs: {
1717
buildInputs = [ pkgs.protobuf pkgs.rustfmt ];
1818
};
19+
stackable-opa-user-info-fetcher = attrs: {
20+
# TODO: why is this not pulled in via libgssapi-sys?
21+
buildInputs = [ pkgs.krb5 ];
22+
};
1923
krb5-sys = attrs: {
2024
nativeBuildInputs = [ pkgs.pkg-config ];
2125
buildInputs = [ pkgs.krb5 ];
@@ -42,18 +46,20 @@
4246
rec {
4347
inherit cargo sources pkgs meta;
4448
build = cargo.allWorkspaceMembers;
45-
entrypoint = build+"/bin/stackable-${meta.operator.name}";
46-
crds = pkgs.runCommand "${meta.operator.name}-crds.yaml" {}
47-
''
48-
${entrypoint} crd > $out
49-
'';
49+
entrypoint = build + "/bin/stackable-${meta.operator.name}";
50+
crds = pkgs.runCommand "${meta.operator.name}-crds.yaml" { }
51+
''
52+
${entrypoint} crd > $out
53+
'';
5054

5155
dockerImage = pkgs.dockerTools.streamLayeredImage {
5256
name = dockerName;
5357
tag = dockerTag;
5458
contents = [
5559
# Common debugging tools
56-
pkgs.bashInteractive pkgs.coreutils pkgs.util-linuxMinimal
60+
pkgs.bashInteractive
61+
pkgs.coreutils
62+
pkgs.util-linuxMinimal
5763
# Kerberos 5 must be installed globally to load plugins correctly
5864
pkgs.krb5
5965
# Make the whole cargo workspace available on $PATH
@@ -65,7 +71,8 @@ rec {
6571
fileRefVars = {
6672
PRODUCT_CONFIG = deploy/config-spec/properties.yaml;
6773
};
68-
in pkgs.lib.concatLists (pkgs.lib.mapAttrsToList (env: path: pkgs.lib.optional (pkgs.lib.pathExists path) "${env}=${path}") fileRefVars);
74+
in
75+
pkgs.lib.concatLists (pkgs.lib.mapAttrsToList (env: path: pkgs.lib.optional (pkgs.lib.pathExists path) "${env}=${path}") fileRefVars);
6976
Entrypoint = [ entrypoint ];
7077
Cmd = [ "run" ];
7178
};
@@ -94,22 +101,22 @@ rec {
94101
];
95102

96103
# need to use vendored crate2nix because of https://github.com/kolloch/crate2nix/issues/264
97-
crate2nix = import sources.crate2nix {};
104+
crate2nix = import sources.crate2nix { };
98105
tilt = pkgs.tilt;
99106

100107
regenerateNixLockfiles = pkgs.writeScriptBin "regenerate-nix-lockfiles"
101-
''
102-
#!/usr/bin/env bash
103-
set -euo pipefail
104-
echo Running crate2nix
105-
${crate2nix}/bin/crate2nix generate
108+
''
109+
#!/usr/bin/env bash
110+
set -euo pipefail
111+
echo Running crate2nix
112+
${crate2nix}/bin/crate2nix generate
106113
107-
# crate2nix adds a trailing newline (see
108-
# https://github.com/nix-community/crate2nix/commit/5dd04e6de2fbdbeb067ab701de8ec29bc228c389).
109-
# The pre-commit hook trailing-whitespace wants to remove it again
110-
# (see https://github.com/pre-commit/pre-commit-hooks?tab=readme-ov-file#trailing-whitespace).
111-
# So, remove the trailing newline already here to avoid that an
112-
# unnecessary change is shown in Git.
113-
sed -i '$d' Cargo.nix
114-
'';
114+
# crate2nix adds a trailing newline (see
115+
# https://github.com/nix-community/crate2nix/commit/5dd04e6de2fbdbeb067ab701de8ec29bc228c389).
116+
# The pre-commit hook trailing-whitespace wants to remove it again
117+
# (see https://github.com/pre-commit/pre-commit-hooks?tab=readme-ov-file#trailing-whitespace).
118+
# So, remove the trailing newline already here to avoid that an
119+
# unnecessary change is shown in Git.
120+
sed -i '$d' Cargo.nix
121+
'';
115122
}

0 commit comments

Comments
 (0)