From 3c28f1145f1474b64f72068760b45e3cc7b0822b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Fri, 16 Dec 2022 13:44:26 +0100 Subject: [PATCH] add images also to flake --- flake.lock | 44 ++++++++++++++++++++++++++++++++++++++++++++ flake.nix | 25 +++++++++++++++++++++++-- 2 files changed, 67 insertions(+), 2 deletions(-) create mode 100644 flake.lock diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..5ff73c6 --- /dev/null +++ b/flake.lock @@ -0,0 +1,44 @@ +{ + "nodes": { + "nixos-2211": { + "locked": { + "lastModified": 1659446231, + "narHash": "sha256-hekabNdTdgR/iLsgce5TGWmfIDZ86qjPhxDg/8TlzhE=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "eabc38219184cc3e04a974fe31857d8e0eac098d", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "release-21.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixos-unstable": { + "locked": { + "lastModified": 1671179347, + "narHash": "sha256-EaGqNC5HtvhXi+LVg2dW3EhKomVz4TijyylCTSwEel8=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "f0c1df314b7b5fc64603bb07a50759267b285149", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable-small", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixos-2211": "nixos-2211", + "nixos-unstable": "nixos-unstable" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix index 850f547..1957a51 100644 --- a/flake.nix +++ b/flake.nix @@ -1,7 +1,28 @@ { description = "NixOS images"; - outputs = { self }: { - nixosModules.kexec-installer = ./nix/kexec-installer/module.nix; + inputs.nixos-unstable.url = "github:NixOS/nixpkgs/nixos-unstable-small"; + inputs.nixos-2211.url = "github:NixOS/nixpkgs/release-21.11"; + + nixConfig.extra-substituters = [ + "https://cache.garnix.io" + ]; + nixConfig.extra-trusted-public-keys = [ + "cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g=" + ]; + + outputs = { self, nixos-unstable, nixos-2211 }: { + packages.x86_64-linux = let + netboot = nixpkgs: (import (nixpkgs + "/nixos/release.nix") {}).netboot.x86_64-linux; + in { + netboot-unstable = netboot nixos-unstable; + netboot-2211 = netboot nixos-2211; + }; + nixosModules.kexec-installer = import ./nix/kexec-installer/module.nix; + checks.x86_64-linux = { + kexec-installer-unstable = nixos-unstable.legacyPackages.x86_64-linux.callPackage ./nix/kexec-installer/test.nix {}; + # FIXME: broken + #kexec-installer-2211 = nixos-2211.legacyPackages.x86_64-linux.callPackage ./nix/kexec-installer/test.nix {}; + }; }; }