71 lines
1.6 KiB
Nix
71 lines
1.6 KiB
Nix
{
|
|
description = "Metanix core flake (meta.nix-driven outputs)";
|
|
|
|
inputs = {
|
|
# Base system
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
|
|
|
# Tooling we integrate with
|
|
deploy-rs.url = "github:serokell/deploy-rs";
|
|
disko.url = "github:nix-community/disko";
|
|
};
|
|
|
|
outputs = { self, nixpkgs, deploy-rs, disko, ... }:
|
|
let
|
|
lib = nixpkgs.lib;
|
|
|
|
systems = [ "x86_64-linux" "aarch64-linux" ];
|
|
|
|
forAllSystems = f:
|
|
lib.genAttrs systems (system: f {
|
|
inherit system;
|
|
pkgs = import nixpkgs { inherit system; };
|
|
});
|
|
|
|
metanixLib = import ./lib {
|
|
inherit nixpkgs deploy-rs disko;
|
|
};
|
|
|
|
# Build the "world" view from meta.nix
|
|
world = metanixLib.fromMeta {
|
|
metaFile = ./meta.nix;
|
|
inherit nixpkgs deploy-rs disko;
|
|
};
|
|
|
|
in
|
|
{
|
|
|
|
# So other flakes *can* depend on Metanix as a library if needed.
|
|
lib = metanixLib;
|
|
|
|
# For nixos-rebuild / nixos-anywhere / deploy-rs
|
|
nixosConfigurations = world.nixosConfigurations;
|
|
|
|
# For deploy-rs
|
|
deploy = {
|
|
nodes = world.deployNodes;
|
|
};
|
|
|
|
# For disko-based installs (either as bare configs or modules)
|
|
diskoConfigurations = world.diskoConfigurations;
|
|
|
|
checks = forAllSystems ({ pkgs, ... }: {
|
|
meta-validate = metanixLib.checkMeta {
|
|
inherit pkgs;
|
|
metaFile = ./meta.nix;
|
|
};
|
|
});
|
|
|
|
devShells = forAllSystems ({ system, pkgs }: {
|
|
default = pkgs.mkShell {
|
|
name = "metanix-dev";
|
|
buildInputs = [
|
|
pkgs.nix
|
|
pkgs.git
|
|
deploy-rs.packages.${system}.default
|
|
disko.packages.${system}.default
|
|
];
|
|
};
|
|
});
|
|
}
|
|
}
|