NixOS configuration for HPC cluster https://docs.hpc.informatik.hs-fulda.de/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

115 lines
2.3 KiB

{
inputs = {
nixpkgs = {
type = "github";
owner = "NixOS";
repo = "nixpkgs";
ref = "nixos-23.05";
};
colmena = {
type = "github";
owner = "zhaofengli";
repo = "colmena";
inputs.nixpkgs.follows = "nixpkgs";
};
nixago = {
type = "github";
owner = "nix-community";
repo = "nixago";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "utils";
};
pre-commit-hooks = {
type = "github";
owner = "cachix";
repo = "pre-commit-hooks.nix";
inputs.nixpkgs.follows = "nixpkgs";
};
sops = {
type = "github";
owner = "Mic92";
repo = "sops-nix";
inputs.nixpkgs.follows = "nixpkgs";
inputs.nixpkgs-stable.follows = "nixpkgs";
};
utils = {
type = "github";
owner = "numtide";
repo = "flake-utils";
};
disko = {
type = "github";
owner = "nix-community";
repo = "disko";
inputs.nixpkgs.follows = "nixpkgs";
};
gather = {
type = "github";
owner = "fooker";
repo = "gather.nix";
};
};
outputs = { nixpkgs, utils, ... }@inputs: {
colmena = import ./machines.nix inputs;
devShell = utils.lib.eachSystemMap utils.lib.allSystems (system:
let
pkgs = nixpkgs.legacyPackages.${system};
colmena = inputs.colmena.defaultPackage.${system};
pre-commit-hooks = inputs.pre-commit-hooks.lib.${system}.run {
src = ./.;
hooks = {
nixpkgs-fmt.enable = true;
statix.enable = true;
shellcheck.enable = true;
};
};
gather = pkgs.writeShellScript "gather" ''
ROOT=${toString ./.}
MACHINES=( "$(${colmena}/bin/colmena eval -E '{nodes, ...}: ')" )
if [[ "$1" != "" ]]; then
else
mapfile -t MACHINES < <()
fi
'';
in
pkgs.mkShell {
buildInputs = [
colmena
#gather
] ++ (with pkgs; [
bash
gitAndTools.git
gnutar
gzip
nixUnstable
openssh
sops
age
]);
shellHook = ''
${pre-commit-hooks.shellHook}
'';
});
};
}