photoprism-test-vm/flake.nix

68 lines
1.7 KiB
Nix

{
description = "Photo services test vm";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
colmena = {
url = "github:zhaofengli/colmena";
inputs = {
flake-utils.follows = "flake-utils";
nixpkgs.follows = "nixpkgs";
stable.follows = "nixpkgs";
};
};
flake-utils.url = "github:numtide/flake-utils";
disko = {
url = "github:nix-community/disko";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
{
self,
nixpkgs,
flake-utils,
colmena,
disko,
...
}@inputs:
let
lib = nixpkgs.lib;
in
{
nixosConfigurations = builtins.mapAttrs (
name: value:
nixpkgs.lib.nixosSystem {
lib = lib;
system = "x86_64-linux";
specialArgs = {
inherit inputs;
};
modules = [
value
disko.nixosModules.disko
];
extraModules = [ inputs.colmena.nixosModules.deploymentOptions ];
}
) { hashes = import ./configuration.nix; };
colmena = {
meta = {
nixpkgs = import inputs.nixpkgs { system = "x86_64-linux"; };
nodeSpecialArgs = builtins.mapAttrs (_: v: v._module.specialArgs) self.nixosConfigurations;
specialArgs.lib = lib;
};
} // builtins.mapAttrs (_: v: { imports = v._module.args.modules; }) self.nixosConfigurations;
}
// flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
{
devShell = pkgs.mkShell { buildInputs = with pkgs; [ colmena.packages.${system}.colmena ]; };
}
);
}