Skip to content

Commit 1289304

Browse files
committed
move image building into default.nix
1 parent 50711f0 commit 1289304

4 files changed

Lines changed: 12 additions & 45 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,18 @@ jobs:
3333

3434
- name: Build and push environments
3535
run: |
36-
nix build --file default.nix push --out-link nix-envs
36+
nix build --file . push --out-link nix-envs
3737
./nix-envs/bin/push
3838
3939
# Build and push all components sequentially to reuse Nix store
4040
- name: Build and push Lix image
4141
run: |
42-
nix build --file liximage.nix push --out-link nix-images
42+
nix build --file . lixImage.push --out-link nix-images
4343
./nix-images/bin/push
4444
4545
- name: Build and push scratch image
4646
run: |
47-
nix build --file scratchimage.nix push --out-link nix-scratches
47+
nix build --file . scratchImage.push --out-link nix-scratches
4848
./nix-scratches/bin/push
4949
5050
test-kind-cache:

default.nix

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,4 +188,6 @@ rec {
188188
cp --no-preserve=mode ${optionsDocs.optionsCommonMark} $GIT_ROOT/doc/options.md
189189
'';
190190

191+
lixImage = pkgs.callPackage ./liximage.nix { };
192+
scratchImage = pkgs.callPackage ./scratchimage.nix { };
191193
}

liximage.nix

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,12 @@
1-
let
2-
inputs =
3-
(
4-
let
5-
lockFile = builtins.readFile ./flake.lock;
6-
lockAttrs = builtins.fromJSON lockFile;
7-
fcLockInfo = lockAttrs.nodes.flake-compatish.locked;
8-
fcSrc = builtins.fetchTree fcLockInfo;
9-
flake-compatish = import fcSrc;
10-
in
11-
flake-compatish ./.
12-
).inputs;
13-
pkgs = import inputs.nixpkgs {
14-
overlays = [
15-
(import ./pkgs)
16-
];
17-
};
18-
inherit (pkgs) lib;
19-
server = "ghcr.io";
20-
repo = "${server}/lillecarl/nix-csi";
21-
in
22-
rec {
23-
inherit inputs pkgs;
1+
{
2+
pkgs,
3+
lib,
4+
}:
5+
{
246
images = lib.genAttrs [ "aarch64-linux" "x86_64-linux" ] (
257
system:
268
let
27-
sysPkgs = import inputs.nixpkgs { inherit system; };
9+
sysPkgs = import pkgs.path { inherit system; };
2810
inherit (sysPkgs) lib;
2911

3012
fakeNss = sysPkgs.dockerTools.fakeNss.override {

scratchimage.nix

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,5 @@
1+
{ pkgs }:
12
let
2-
inputs =
3-
(
4-
let
5-
lockFile = builtins.readFile ./flake.lock;
6-
lockAttrs = builtins.fromJSON lockFile;
7-
fcLockInfo = lockAttrs.nodes.flake-compatish.locked;
8-
fcSrc = builtins.fetchTree fcLockInfo;
9-
flake-compatish = import fcSrc;
10-
in
11-
flake-compatish ./.
12-
).inputs;
13-
14-
pkgs = import inputs.nixpkgs {
15-
overlays = [
16-
(import ./pkgs)
17-
];
18-
};
19-
203
version = "1.0.1";
214

225
mkEmptyImage =

0 commit comments

Comments
 (0)