photoprism-test-vm/flake.nix

51 lines
1.6 KiB
Nix
Raw Normal View History

2024-10-08 23:50:47 +02:00
{
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";
};
};
2024-10-09 17:07:27 +02:00
outputs = { self, nixpkgs, flake-utils, colmena, disko, ... }@inputs:
let lib = nixpkgs.lib;
in {
2024-10-08 23:50:47 +02:00
2024-10-09 17:07:27 +02:00
nixosConfigurations = builtins.mapAttrs (name: value:
2024-10-08 23:50:47 +02:00
nixpkgs.lib.nixosSystem {
lib = lib;
system = "x86_64-linux";
2024-10-09 17:07:27 +02:00
specialArgs = { inherit inputs; };
modules = [ value disko.nixosModules.disko ];
2024-10-08 23:50:47 +02:00
extraModules = [ inputs.colmena.nixosModules.deploymentOptions ];
2024-10-09 17:07:27 +02:00
}) { photoprism = import ./configuration.nix; };
2024-10-08 23:50:47 +02:00
colmena = {
meta = {
nixpkgs = import inputs.nixpkgs { system = "x86_64-linux"; };
2024-10-09 17:07:27 +02:00
nodeSpecialArgs = builtins.mapAttrs (_: v: v._module.specialArgs)
self.nixosConfigurations;
2024-10-08 23:50:47 +02:00
specialArgs.lib = lib;
};
2024-10-09 17:07:27 +02:00
} // builtins.mapAttrs (_: v: { imports = v._module.args.modules; })
self.nixosConfigurations;
} // flake-utils.lib.eachDefaultSystem (system:
let pkgs = nixpkgs.legacyPackages.${system};
in {
devShell = pkgs.mkShell {
2024-10-14 14:53:27 +02:00
buildInputs = [ colmena.packages.${system}.colmena ];
2024-10-09 17:07:27 +02:00
};
});
2024-10-08 23:50:47 +02:00
}