-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
62 lines (53 loc) · 1.77 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
{
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
inputs.homelab-config.url = "github:jali-clarke/homelab-config/weedle-known-good";
inputs.dotfiles.url = "github:jali-clarke/dotfiles";
inputs.dotfiles.inputs.nixpkgs.follows = "nixpkgs";
outputs = { self, nixpkgs, homelab-config, dotfiles }:
let
cacheHostname = "cache.nix-cache";
outputs' = system:
let
overlay = final: previous: {
writeShellScriptBin = name: text:
previous.writeScriptBin name ''
#!${final.runtimeShell} -xe
${text}
'';
};
pkgs = import nixpkgs {
inherit system;
overlays = [
homelab-config.overlays.${system}
overlay
];
};
# assertion will fail if the source tree is not clean
builtImage = assert self.sourceInfo ? rev; import ./dev-env.nix {
inherit pkgs cacheHostname;
tag = self.sourceInfo.rev;
homeManagerConfig = { username, homeDirectory }:
dotfiles.lib.builtHomeManagerModule {
inherit system username homeDirectory;
configuration = import ./home.nix;
};
};
in
{
defaultPackage.${system} = self.packages.${system}.deployer;
packages.${system}.deployer = import ./deployer.nix {
inherit pkgs;
dev-env-image = builtImage;
};
devShell.${system} = pkgs.mkShell {
name = "dev-env-dev-shell";
buildInputs = [
pkgs.diffutils
pkgs.kubectl
pkgs.nixpkgs-fmt
];
};
};
in
outputs' "x86_64-linux";
}