-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathflake.nix
33 lines (27 loc) · 1.08 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
{
description = "A flake for building NixOS installers that work on T2 Macs";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
nixos-hardware.url = "github:NixOS/nixos-hardware";
};
nixConfig = {
extra-trusted-substituters = [ "https://cache.soopy.moe" ];
extra-substituters = [ "https://cache.soopy.moe" ];
extra-trusted-public-keys = [ "cache.soopy.moe-1:0RZVsQeR+GOh0VQI9rvnHz55nVXkFardDqfm4+afjPo=" ];
};
outputs = { self, nixpkgs, nixos-hardware }:
let
system = "x86_64-linux";
inherit (nixpkgs) lib;
mergeMap = fn: list: lib.lists.foldr (a: b: a // b) {} (map fn list);
in
mergeMap (config: {
${lib.strings.removeSuffix ".nix" (builtins.baseNameOf config)} = (lib.nixosSystem {
inherit system;
modules = [ config ];
specialArgs = {
inherit nixos-hardware;
};
}).config.system.build.isoImage;
}) (builtins.filter (x: x != null) (lib.attrsets.mapAttrsToList (key: value: if value == "regular" && lib.strings.hasInfix "iso" key then ./nix/${key} else null) (builtins.readDir ./nix)));
}