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.
133 lines
2.8 KiB
133 lines
2.8 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";
|
|
};
|
|
|
|
ldap-sync = {
|
|
type = "git";
|
|
url = "https://gogs.informatik.hs-fulda.de/fooker/ldap-sync.git";
|
|
flake = false;
|
|
};
|
|
};
|
|
|
|
outputs = { nixpkgs, utils, disko, ... }@inputs: {
|
|
colmena = import ./deployment.nix inputs;
|
|
|
|
devShell = utils.lib.eachSystemMap utils.lib.allSystems (system:
|
|
let
|
|
pkgs = nixpkgs.legacyPackages.${system};
|
|
|
|
colmena = inputs.colmena.defaultPackage.${system}.overrideAttrs (final: prev: {
|
|
patches = (prev.patches or [ ]) ++ [
|
|
./patches/colmena-disable-ssh-master.patch
|
|
];
|
|
});
|
|
|
|
pre-commit-hooks = inputs.pre-commit-hooks.lib.${system}.run {
|
|
src = ./.;
|
|
hooks = {
|
|
nixpkgs-fmt.enable = true;
|
|
statix.enable = true;
|
|
shellcheck.enable = true;
|
|
};
|
|
};
|
|
|
|
sops-hooks = inputs.nixago.lib.${system}.make {
|
|
data = (pkgs.callPackage ./sops.nix { }).config;
|
|
output = ".sops.yaml";
|
|
format = "yaml";
|
|
};
|
|
|
|
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
|
|
mkdocs
|
|
]);
|
|
|
|
shellHook = ''
|
|
${pre-commit-hooks.shellHook}
|
|
${sops-hooks.shellHook}
|
|
'';
|
|
});
|
|
};
|
|
}
|
|
|