nixos-t2-iso: init

This commit is contained in:
kekrby 2022-08-25 18:45:47 +03:00
commit 18b206807a
6 changed files with 146 additions and 0 deletions

27
flake.nix Normal file
View file

@ -0,0 +1,27 @@
{
description = "A flake for NixOS iso's that work on T2 Macs";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
nixos-hardware.url = "github:kekrby/nixos-hardware";
};
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" then ./nix/${key} else null) (builtins.readDir ./nix)));
}