-
-
Notifications
You must be signed in to change notification settings - Fork 18
/
flake.nix
67 lines (56 loc) · 1.93 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
63
64
65
66
67
{
description = "Build OpenWRT images in Nix derivations";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
systems.url = "github:nix-systems/x86_64-linux";
flake-parts = {
url = "github:hercules-ci/flake-parts";
inputs.nixpkgs-lib.follows = "nixpkgs";
};
};
outputs = inputs@{ flake-parts, systems, ... }: flake-parts.lib.mkFlake { inherit inputs; } ({ config, self, ... }: {
systems = import systems;
perSystem = { pkgs, ... }: rec {
packages = rec {
profiles-list = pkgs.callPackage ./profiles-list.nix { };
generate-latest-release = pkgs.callPackage ./generate-latest-release.nix { };
generate-hashes = pkgs.callPackage ./generate-hashes.nix { };
generate-all-hashes = pkgs.callPackage ./generate-all-hashes.nix { inherit generate-hashes; };
cached-profiles = pkgs.callPackage ./cached-profiles.nix { };
example-image =
let
image = import ./example.nix rec {
inherit pkgs;
profiles = self.lib.profiles {
inherit pkgs;
};
inherit (self.lib) build;
};
in
# Wrap `image` once to avoid `nix flake show` breaking on IFD
pkgs.runCommand "example-image" { } ''
ln -s ${image} $out
'';
example-x86-64-image =
let
image = import ./example-x86-64.nix {
inherit pkgs;
inherit (self.lib) build;
};
in
# Wrap `image` once to avoid `nix flake show` breaking on IFD
pkgs.runCommand "example-x86-64-image" { } ''
ln -s ${image} $out
'';
};
checks = packages;
};
flake = {
lib = {
build = import ./builder.nix;
profiles = import ./profiles.nix;
};
hydraJobs = { inherit (self.packages.x86_64-linux) example-image; };
};
});
}