Skip to content

Commit 750d6a4

Browse files
Generated commit to update templated files based on rev f9389cc in stackabletech/operator-templating repo. (#283)
Triggered by: Manual run triggered by: siegfriedweber with message [Use Rust 1.71.1 in the Nix build]
1 parent d86f601 commit 750d6a4

File tree

3 files changed

+71
-59
lines changed

3 files changed

+71
-59
lines changed

default.nix

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,20 @@
1010
tonic-reflection = attrs: {
1111
buildInputs = [ pkgs.rustfmt ];
1212
};
13+
csi-grpc = attrs: {
14+
nativeBuildInputs = [ pkgs.protobuf ];
15+
};
1316
stackable-secret-operator = attrs: {
1417
buildInputs = [ pkgs.protobuf pkgs.rustfmt ];
1518
};
1619
krb5-sys = attrs: {
1720
nativeBuildInputs = [ pkgs.pkg-config ];
18-
buildInputs = [ (pkgs.enableDebugging pkgs.krb5) ];
21+
buildInputs = [ pkgs.krb5 ];
22+
LIBCLANG_PATH = "${pkgs.libclang.lib}/lib";
23+
BINDGEN_EXTRA_CLANG_ARGS = "-I${pkgs.glibc.dev}/include -I${pkgs.clang.cc.lib}/lib/clang/${pkgs.lib.getVersion pkgs.clang.cc}/include";
24+
};
25+
libgssapi-sys = attrs: {
26+
buildInputs = [ pkgs.krb5 ];
1927
LIBCLANG_PATH = "${pkgs.libclang.lib}/lib";
2028
BINDGEN_EXTRA_CLANG_ARGS = "-I${pkgs.glibc.dev}/include -I${pkgs.clang.cc.lib}/lib/clang/${pkgs.lib.getVersion pkgs.clang.cc}/include";
2129
};

nix/sources.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@
1717
"homepage": "",
1818
"owner": "NixOS",
1919
"repo": "nixpkgs",
20-
"rev": "747927516efcb5e31ba03b7ff32f61f6d47e7d87",
21-
"sha256": "1s4xabv59r99z8vd74w3r84kkxwqggqir3b0nh3ma04mni0m40gf",
20+
"rev": "676fe5e01b9a41fa14aaa48d87685677664104b1",
21+
"sha256": "0afm0dvqrjzdxhilhg0x9rbw8apfd5yg79f4qpdmdfzd8h68h72i",
2222
"type": "tarball",
23-
"url": "https://github.com/NixOS/nixpkgs/archive/747927516efcb5e31ba03b7ff32f61f6d47e7d87.tar.gz",
23+
"url": "https://github.com/NixOS/nixpkgs/archive/676fe5e01b9a41fa14aaa48d87685677664104b1.tar.gz",
2424
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
2525
}
2626
}

nix/sources.nix

Lines changed: 59 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -10,49 +10,50 @@ let
1010
let
1111
name' = sanitizeName name + "-src";
1212
in
13-
if spec.builtin or true then
14-
builtins_fetchurl { inherit (spec) url sha256; name = name'; }
15-
else
16-
pkgs.fetchurl { inherit (spec) url sha256; name = name'; };
13+
if spec.builtin or true then
14+
builtins_fetchurl { inherit (spec) url sha256; name = name'; }
15+
else
16+
pkgs.fetchurl { inherit (spec) url sha256; name = name'; };
1717

1818
fetch_tarball = pkgs: name: spec:
1919
let
2020
name' = sanitizeName name + "-src";
2121
in
22-
if spec.builtin or true then
23-
builtins_fetchTarball { name = name'; inherit (spec) url sha256; }
24-
else
25-
pkgs.fetchzip { name = name'; inherit (spec) url sha256; };
22+
if spec.builtin or true then
23+
builtins_fetchTarball { name = name'; inherit (spec) url sha256; }
24+
else
25+
pkgs.fetchzip { name = name'; inherit (spec) url sha256; };
2626

2727
fetch_git = name: spec:
2828
let
2929
ref =
30-
if spec ? ref then spec.ref else
30+
spec.ref or (
3131
if spec ? branch then "refs/heads/${spec.branch}" else
32-
if spec ? tag then "refs/tags/${spec.tag}" else
33-
abort "In git source '${name}': Please specify `ref`, `tag` or `branch`!";
34-
submodules = if spec ? submodules then spec.submodules else false;
32+
if spec ? tag then "refs/tags/${spec.tag}" else
33+
abort "In git source '${name}': Please specify `ref`, `tag` or `branch`!"
34+
);
35+
submodules = spec.submodules or false;
3536
submoduleArg =
3637
let
3738
nixSupportsSubmodules = builtins.compareVersions builtins.nixVersion "2.4" >= 0;
3839
emptyArgWithWarning =
39-
if submodules == true
40+
if submodules
4041
then
4142
builtins.trace
4243
(
4344
"The niv input \"${name}\" uses submodules "
4445
+ "but your nix's (${builtins.nixVersion}) builtins.fetchGit "
4546
+ "does not support them"
4647
)
47-
{}
48-
else {};
48+
{ }
49+
else { };
4950
in
50-
if nixSupportsSubmodules
51-
then { inherit submodules; }
52-
else emptyArgWithWarning;
51+
if nixSupportsSubmodules
52+
then { inherit submodules; }
53+
else emptyArgWithWarning;
5354
in
54-
builtins.fetchGit
55-
({ url = spec.repo; inherit (spec) rev; inherit ref; } // submoduleArg);
55+
builtins.fetchGit
56+
({ url = spec.repo; inherit (spec) rev; inherit ref; } // submoduleArg);
5657

5758
fetch_local = spec: spec.path;
5859

@@ -86,16 +87,16 @@ let
8687
hasNixpkgsPath = builtins.any (x: x.prefix == "nixpkgs") builtins.nixPath;
8788
hasThisAsNixpkgsPath = <nixpkgs> == ./.;
8889
in
89-
if builtins.hasAttr "nixpkgs" sources
90-
then sourcesNixpkgs
91-
else if hasNixpkgsPath && ! hasThisAsNixpkgsPath then
92-
import <nixpkgs> {}
93-
else
94-
abort
95-
''
96-
Please specify either <nixpkgs> (through -I or NIX_PATH=nixpkgs=...) or
97-
add a package called "nixpkgs" to your sources.json.
98-
'';
90+
if builtins.hasAttr "nixpkgs" sources
91+
then sourcesNixpkgs
92+
else if hasNixpkgsPath && ! hasThisAsNixpkgsPath then
93+
import <nixpkgs> { }
94+
else
95+
abort
96+
''
97+
Please specify either <nixpkgs> (through -I or NIX_PATH=nixpkgs=...) or
98+
add a package called "nixpkgs" to your sources.json.
99+
'';
99100

100101
# The actual fetching function.
101102
fetch = pkgs: name: spec:
@@ -115,13 +116,13 @@ let
115116
# the path directly as opposed to the fetched source.
116117
replace = name: drv:
117118
let
118-
saneName = stringAsChars (c: if isNull (builtins.match "[a-zA-Z0-9]" c) then "_" else c) name;
119+
saneName = stringAsChars (c: if (builtins.match "[a-zA-Z0-9]" c) == null then "_" else c) name;
119120
ersatz = builtins.getEnv "NIV_OVERRIDE_${saneName}";
120121
in
121-
if ersatz == "" then drv else
122-
# this turns the string into an actual Nix path (for both absolute and
123-
# relative paths)
124-
if builtins.substring 0 1 ersatz == "/" then /. + ersatz else /. + builtins.getEnv "PWD" + "/${ersatz}";
122+
if ersatz == "" then drv else
123+
# this turns the string into an actual Nix path (for both absolute and
124+
# relative paths)
125+
if builtins.substring 0 1 ersatz == "/" then /. + ersatz else /. + builtins.getEnv "PWD" + "/${ersatz}";
125126

126127
# Ports of functions for older nix versions
127128

@@ -132,7 +133,7 @@ let
132133
);
133134

134135
# https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/lists.nix#L295
135-
range = first: last: if first > last then [] else builtins.genList (n: first + n) (last - first + 1);
136+
range = first: last: if first > last then [ ] else builtins.genList (n: first + n) (last - first + 1);
136137

137138
# https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/strings.nix#L257
138139
stringToCharacters = s: map (p: builtins.substring p 1 s) (range 0 (builtins.stringLength s - 1));
@@ -143,43 +144,46 @@ let
143144
concatStrings = builtins.concatStringsSep "";
144145

145146
# https://github.com/NixOS/nixpkgs/blob/8a9f58a375c401b96da862d969f66429def1d118/lib/attrsets.nix#L331
146-
optionalAttrs = cond: as: if cond then as else {};
147+
optionalAttrs = cond: as: if cond then as else { };
147148

148149
# fetchTarball version that is compatible between all the versions of Nix
149150
builtins_fetchTarball = { url, name ? null, sha256 }@attrs:
150151
let
151152
inherit (builtins) lessThan nixVersion fetchTarball;
152153
in
153-
if lessThan nixVersion "1.12" then
154-
fetchTarball ({ inherit url; } // (optionalAttrs (!isNull name) { inherit name; }))
155-
else
156-
fetchTarball attrs;
154+
if lessThan nixVersion "1.12" then
155+
fetchTarball ({ inherit url; } // (optionalAttrs (name != null) { inherit name; }))
156+
else
157+
fetchTarball attrs;
157158

158159
# fetchurl version that is compatible between all the versions of Nix
159160
builtins_fetchurl = { url, name ? null, sha256 }@attrs:
160161
let
161162
inherit (builtins) lessThan nixVersion fetchurl;
162163
in
163-
if lessThan nixVersion "1.12" then
164-
fetchurl ({ inherit url; } // (optionalAttrs (!isNull name) { inherit name; }))
165-
else
166-
fetchurl attrs;
164+
if lessThan nixVersion "1.12" then
165+
fetchurl ({ inherit url; } // (optionalAttrs (name != null) { inherit name; }))
166+
else
167+
fetchurl attrs;
167168

168169
# Create the final "sources" from the config
169170
mkSources = config:
170-
mapAttrs (
171-
name: spec:
172-
if builtins.hasAttr "outPath" spec
173-
then abort
174-
"The values in sources.json should not have an 'outPath' attribute"
175-
else
176-
spec // { outPath = replace name (fetch config.pkgs name spec); }
177-
) config.sources;
171+
mapAttrs
172+
(
173+
name: spec:
174+
if builtins.hasAttr "outPath" spec
175+
then
176+
abort
177+
"The values in sources.json should not have an 'outPath' attribute"
178+
else
179+
spec // { outPath = replace name (fetch config.pkgs name spec); }
180+
)
181+
config.sources;
178182

179183
# The "config" used by the fetchers
180184
mkConfig =
181185
{ sourcesFile ? if builtins.pathExists ./sources.json then ./sources.json else null
182-
, sources ? if isNull sourcesFile then {} else builtins.fromJSON (builtins.readFile sourcesFile)
186+
, sources ? if sourcesFile == null then { } else builtins.fromJSON (builtins.readFile sourcesFile)
183187
, system ? builtins.currentSystem
184188
, pkgs ? mkPkgs sources system
185189
}: rec {
@@ -191,4 +195,4 @@ let
191195
};
192196

193197
in
194-
mkSources (mkConfig {}) // { __functor = _: settings: mkSources (mkConfig settings); }
198+
mkSources (mkConfig { }) // { __functor = _: settings: mkSources (mkConfig settings); }

0 commit comments

Comments
 (0)