Skip to content

Commit 4934b3e

Browse files
committed
fix pod.nix demo
1 parent 34346cc commit 4934b3e

1 file changed

Lines changed: 19 additions & 16 deletions

File tree

demo/pod.nix

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,15 @@
11
# SPDX-License-Identifier: MIT
22

33
let
4-
inputs =
5-
(
6-
let
7-
lockFile = builtins.readFile ../flake.lock;
8-
lockAttrs = builtins.fromJSON lockFile;
9-
fcLockInfo = lockAttrs.nodes.flake-compatish.locked;
10-
fcSrc = builtins.fetchTree fcLockInfo;
11-
flake-compatish = import fcSrc;
12-
in
13-
flake-compatish ../.
14-
).inputs;
4+
system = builtins.currentSystem;
5+
inputs = (import ../. { }).inputs;
156

16-
pkgs = import inputs.nixpkgs { };
177
sysMap = {
188
"x86_64-linux" = "aarch64-linux";
199
"aarch64-linux" = "x86_64-linux";
2010
};
21-
pkgsCross = import pkgs.path { system = sysMap.${builtins.currentSystem}; };
11+
pkgs = import inputs.nixpkgs { inherit system; };
12+
pkgsCross = import pkgs.path { system = sysMap.${system}; };
2213

2314
package =
2415
pkgs:
@@ -29,7 +20,7 @@ let
2920
pkgs.fishMinimal
3021
pkgs.coreutils
3122
pkgs.moreutils
32-
pkgs.lruLix
23+
pkgs.lix
3324
];
3425
};
3526

@@ -38,10 +29,19 @@ let
3829
inherit pkgs;
3930
modules = [
4031
(
41-
{ lib, ... }:
32+
{ config, lib, ... }:
4233
{
4334
kluctl = {
4435
discriminator = "demodeploy"; # Used for kluctl pruning (removing resources not in generated manifests)
36+
preDeployScript = # bash
37+
''
38+
nix copy \
39+
--substitute-on-destination \
40+
--no-check-sigs \
41+
--to ssh-ng://nix@nixcache.lillecarl.com?port=2222 \
42+
${config.kluctl.projectDir} \
43+
-v || true
44+
'';
4545
};
4646
# Will go into the default namespace
4747
kubernetes.resources.none.Pod.hello.spec = {
@@ -54,7 +54,10 @@ let
5454
"hello;sleep infinity"
5555
];
5656
volumeMounts = lib.mkNamedList {
57-
nix.mountPath = "/nix";
57+
nix = {
58+
mountPath = "/nix";
59+
subPath = "nix";
60+
};
5861
};
5962
};
6063
};

0 commit comments

Comments
 (0)