diff options
author | Mx Kookie <kookie@spacekookie.de> | 2021-01-01 00:55:51 +0100 |
---|---|---|
committer | Mx Kookie <kookie@spacekookie.de> | 2021-01-01 00:55:51 +0100 |
commit | af8b681b5ef80871e6586061568b8ab8af2d85e3 (patch) | |
tree | 4f3d66f0afbea6c947cc4dff32fa4c25e70329d4 /infra/corenix/flake.nix | |
parent | 51970440a767f3906bcb69cc3d00185391c5d595 (diff) | |
parent | 53a9f091f8cf9362a95c12130daa1f69ddff036c (diff) |
Add 'infra/corenix/' from commit '53a9f091f8cf9362a95c12130daa1f69ddff036c'
git-subtree-dir: infra/corenix
git-subtree-mainline: 51970440a767f3906bcb69cc3d00185391c5d595
git-subtree-split: 53a9f091f8cf9362a95c12130daa1f69ddff036c
Diffstat (limited to 'infra/corenix/flake.nix')
-rw-r--r-- | infra/corenix/flake.nix | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/infra/corenix/flake.nix b/infra/corenix/flake.nix new file mode 100644 index 000000000000..6864f3840909 --- /dev/null +++ b/infra/corenix/flake.nix @@ -0,0 +1,49 @@ +{ + inputs.nixpkgs = { + type = "github"; + owner = "nixos"; + repo = "nixpkgs"; + ref = "master"; + }; + + description = "A collections of derivations for coreboot and payloads"; + outputs = { self, nixpkgs }: + let + nixpkgsOptions = { + system = "x86_64-linux"; + overlays = [ (import ./pkgs/overlay.nix) ]; + }; + pkgs = import nixpkgs nixpkgsOptions; + inherit (pkgs) lib; + + makeDevice = configFile: + (lib.evalModules { + modules = [ + ({ ... }: { nixpkgs = nixpkgsOptions; }) + ("${nixpkgs}/nixos/modules/misc/assertions.nix") + ("${nixpkgs}/nixos/modules/misc/nixpkgs.nix") + ./modules + configFile + ]; + }).config.corenix.rom; + + exportedPkgs = { + inherit (pkgs) + coreboot coreboot-payload-grub2 coreboot-payload-tianocore + coreboot-payload-seabios coreboot-payload-tint + coreboot-payload-nvramcui coreboot-payload-coreinfo; + + milan-x1c = makeDevice ./configs/milan/milan-x1c.nix; + milan-x230t = makeDevice ./configs/milan/milan-x230t.nix; + milan-x230-fhd = makeDevice ./configs/milan/milan-x230-fhd.nix; + }; + + in { + lib = { inherit makeDevice; }; + + packages.x86_64-linux = exportedPkgs; + + # shortcut for use with flake-compat + pkgs = exportedPkgs; + }; +} |