infra/flake.nix

62 lines
1.4 KiB
Nix
Raw Normal View History

2023-03-21 13:38:03 +01:00
# flake.nix
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-22.11";
flake-parts.url = "github:hercules-ci/flake-parts";
get-flake.url = "github:ursi/get-flake";
colmena.url = "github:zhaofengli/colmena";
# colmena.url = "/home/steveej/src/others/colmena";
2023-03-21 13:38:03 +01:00
};
outputs = inputs @ {
2023-03-21 13:38:03 +01:00
self,
flake-parts,
nixpkgs,
...
}: let
inherit (nixpkgs) lib;
systems = [
"x86_64-linux"
"aarch64-linux"
];
in
flake-parts.lib.mkFlake {inherit inputs;} {
flake.colmena =
lib.lists.foldl (sum: cur: lib.attrsets.recursiveUpdate sum cur)
{
meta.nixpkgs = import inputs.nixpkgs.outPath {
system = builtins.elemAt systems 0;
};
}
(builtins.map (nodeName:
import ./nix/os/devices/${nodeName} {
repoFlake = self;
}) [
"steveej-t14"
"elias-e525"
"vmd102066.contaboserver.net"
"sj-vps-htz0.infra.stefanjunker.de"
]);
inherit systems;
perSystem = {
inputs',
system,
config,
lib,
pkgs,
...
}: {
imports = [
./nix/modules/flake-parts/perSystem/default.nix
];
formatter = pkgs.alejandra;
devShells.default = import ./nix/devShells.nix {inherit inputs' pkgs;};
};
};
2023-03-21 13:38:03 +01:00
}