nixos-anywhere/flake.nix

45 lines
1.5 KiB
Nix
Raw Normal View History

2022-12-09 16:04:16 +03:00
{
description = "A universal nixos installer, just needs ssh access to the target system";
2022-12-09 16:56:06 +03:00
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
2022-12-09 16:04:16 +03:00
inputs.disko.url = "github:nix-community/disko/master";
inputs.disko.inputs.nixpkgs.follows = "nixpkgs";
2022-12-23 13:20:55 +03:00
# used for testing
inputs.nixos-images.url = "github:nix-community/nixos-images";
2022-12-09 16:04:16 +03:00
2022-12-23 13:20:55 +03:00
outputs = { self, disko, nixpkgs, nixos-images, ... }:
2022-12-21 21:34:34 +03:00
let
supportedSystems = [
"x86_64-linux"
"i686-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
in
{
packages = forAllSystems (system:
let pkgs = nixpkgs.legacyPackages.${system}; in
{
default = self.packages.${system}.nixos-remote;
docs = pkgs.callPackage ./docs { };
nixos-remote = pkgs.callPackage ./src { };
2022-12-21 21:34:34 +03:00
});
checks.x86_64-linux =
let
pkgs = nixpkgs.legacyPackages.x86_64-linux;
inputs = {
2022-12-21 21:34:34 +03:00
inherit pkgs;
inherit (disko.nixosModules) disko;
nixos-remote = self.packages.x86_64-linux.nixos-remote;
2022-12-24 23:27:07 +03:00
kexec-installer = "${nixos-images.packages.${pkgs.system}.kexec-installer-nixos-unstable}/nixos-kexec-installer-${pkgs.stdenv.hostPlatform.system}.tar.gz";
2022-12-21 21:34:34 +03:00
};
in
{
from-nixos = import ./tests/from-nixos.nix inputs;
2022-12-30 20:51:46 +03:00
from-nixos-with-sudo = import ./tests/from-nixos-with-sudo.nix inputs;
2022-12-21 21:34:34 +03:00
};
2022-12-09 16:04:16 +03:00
};
}