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

1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
  1. {
  2. inputs = {
  3. nixpkgs = {
  4. type = "github";
  5. owner = "NixOS";
  6. repo = "nixpkgs";
  7. ref = "nixos-23.05";
  8. };
  9. colmena = {
  10. type = "github";
  11. owner = "zhaofengli";
  12. repo = "colmena";
  13. inputs.nixpkgs.follows = "nixpkgs";
  14. };
  15. nixago = {
  16. type = "github";
  17. owner = "nix-community";
  18. repo = "nixago";
  19. inputs.nixpkgs.follows = "nixpkgs";
  20. inputs.flake-utils.follows = "utils";
  21. };
  22. pre-commit-hooks = {
  23. type = "github";
  24. owner = "cachix";
  25. repo = "pre-commit-hooks.nix";
  26. inputs.nixpkgs.follows = "nixpkgs";
  27. };
  28. sops = {
  29. type = "github";
  30. owner = "Mic92";
  31. repo = "sops-nix";
  32. inputs.nixpkgs.follows = "nixpkgs";
  33. inputs.nixpkgs-stable.follows = "nixpkgs";
  34. };
  35. utils = {
  36. type = "github";
  37. owner = "numtide";
  38. repo = "flake-utils";
  39. };
  40. disko = {
  41. type = "github";
  42. owner = "nix-community";
  43. repo = "disko";
  44. inputs.nixpkgs.follows = "nixpkgs";
  45. };
  46. gather = {
  47. type = "github";
  48. owner = "fooker";
  49. repo = "gather.nix";
  50. };
  51. };
  52. outputs = { nixpkgs, utils, ... }@inputs: {
  53. colmena = import ./machines.nix inputs;
  54. devShell = utils.lib.eachSystemMap utils.lib.allSystems (system:
  55. let
  56. pkgs = nixpkgs.legacyPackages.${system};
  57. colmena = inputs.colmena.defaultPackage.${system};
  58. pre-commit-hooks = inputs.pre-commit-hooks.lib.${system}.run {
  59. src = ./.;
  60. hooks = {
  61. nixpkgs-fmt.enable = true;
  62. statix.enable = true;
  63. shellcheck.enable = true;
  64. };
  65. };
  66. gather = pkgs.writeShellScript "gather" ''
  67. ROOT=${toString ./.}
  68. MACHINES=( "$(${colmena}/bin/colmena eval -E '{nodes, ...}: ')" )
  69. if [[ "$1" != "" ]]; then
  70. else
  71. mapfile -t MACHINES < <()
  72. fi
  73. '';
  74. in
  75. pkgs.mkShell {
  76. buildInputs = [
  77. colmena
  78. #gather
  79. ] ++ (with pkgs; [
  80. bash
  81. gitAndTools.git
  82. gnutar
  83. gzip
  84. nixUnstable
  85. openssh
  86. sops
  87. age
  88. ]);
  89. shellHook = ''
  90. ${pre-commit-hooks.shellHook}
  91. '';
  92. });
  93. };
  94. }