Fediversity/flake.nix

49 lines
1.5 KiB
Nix
Raw Normal View History

{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
2024-11-07 17:10:05 +01:00
flake-parts.url = "github:hercules-ci/flake-parts";
snf.url = "git+https://git.fediversity.eu/fediversity/simple-nixos-fediverse.git";
2024-10-01 13:56:15 +02:00
disko.url = "github:nix-community/disko";
};
2024-11-07 17:10:05 +01:00
outputs = inputs@{ self, flake-parts, nixpkgs, snf, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
2024-11-07 17:10:05 +01:00
systems = [ "x86_64-linux" "aarch64-linux" "aarch64-darwin" "x86_64-darwin" ];
2024-10-01 13:56:15 +02:00
2024-11-07 17:10:05 +01:00
perSystem = { config, self', inputs', pkgs, system, ... }: {
devShells.default = pkgs.mkShell {
packages = [ inputs'.nixops4.packages.default ];
};
};
2024-11-07 17:10:05 +01:00
flake.allVmIds = ["101" "102" "103" "104" "105" "106" "107" "108" "109" "110"];
flake.nixosConfigurations.provisioning =
let
inherit (builtins) map listToAttrs;
makeProvisioningConfiguration = vmid: nixpkgs.lib.nixosSystem {
modules = [
{ procolix.vmid = vmid; }
./procolixVm.nix
inputs.disko.nixosModules.default
];
};
in
listToAttrs
(map
(vmid: {
name = "fedi${vmid}";
value = makeProvisioningConfiguration vmid; })
self.allVmIds);
flake.isoInstallers.provisioning =
let inherit (builtins) mapAttrs; in
mapAttrs
(_: snf.mkInstaller nixpkgs)
self.nixosConfigurations.provisioning;
};
}