-
Notifications
You must be signed in to change notification settings - Fork 1
/
flake.nix
57 lines (46 loc) · 1.41 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
{
description = "NixOS support for clockworkPi uConsole";
inputs.nixpkgs.url = "nixpkgs/release-23.11";
inputs.nixos-hardware.url = "github:NixOS/nixos-hardware/master";
outputs = {
self,
nixpkgs,
nixos-hardware,
}: let
system = "aarch64-linux";
overlays = [
(final: super: {
makeModulesClosure = x:
super.makeModulesClosure (x // {allowMissing = true;});
})
# (final: super: {zfs = super.zfs.overrideAttrs (_: {meta.platforms = [];});}) # disable zfs
];
pkgs = import nixpkgs {inherit system overlays;};
base-module = import ./module.nix {inherit nixpkgs;};
kernels = import ./kernels/default.nix;
base-system-cm4 = kernel:
nixpkgs.lib.nixosSystem {
inherit system pkgs;
specialArgs = {
inherit nixpkgs nixos-hardware;
};
modules = [base-module kernel];
};
images =
pkgs.lib.attrsets.mapAttrs' (name: value: {
name = "sd-image-cm4-${name}";
value = (base-system-cm4 value).config.system.build.sdImage;
})
kernels;
in {
packages."aarch64-linux" = images;
nixosConfigurations.uconsole = base-system-cm4 kernels."6.1-potatomania-cross-build";
nixosModules =
{default = base-module;}
// (pkgs.lib.attrsets.mapAttrs' (name: value: {
name = "kernel-${name}";
inherit value;
})
kernels);
};
}