forked from pogobanane/doctor-cluster-config
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
81 lines (72 loc) · 2.8 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
{
description = "NixOS configuration with flakes";
# To update all inputs:
# $ nix flake update --recreate-lock-file
inputs = {
flake-modules-core.url = "github:hercules-ci/flake-parts";
flake-modules-core.inputs.nixpkgs.follows = "nixpkgs";
# TODO Switch to nixos release as soon as it comes out
nixpkgs.url = "github:NixOS/nixpkgs/release-22.05";
# In case we need backports, we can use our fork
#nixpkgs.url = "github:TUM-DSE/nixpkgs/release-22.05-backports";
nixpkgs-unstable.url = "github:Mic92/nixpkgs/main";
nixos-hardware.url = "github:NixOS/nixos-hardware";
nur.url = "github:nix-community/NUR";
home-manager.url = "github:rycee/home-manager/release-22.05";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
sops-nix.url = "github:Mic92/sops-nix";
sops-nix.inputs.nixpkgs.follows = "nixpkgs";
retiolum.url = "git+https://git.thalheim.io/Mic92/retiolum";
flake-registry.url = "github:NixOS/flake-registry";
flake-registry.flake = false;
nix-ld.url = "github:Mic92/nix-ld";
nix-ld.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = {
self,
nixpkgs,
flake-modules-core,
...
} @ inputs:
(flake-modules-core.lib.evalFlakeModule
{ inherit self; }
{
systems = ["x86_64-linux" "aarch64-linux" "aarch64-darwin"];
imports = [
./configurations.nix
./modules/monitoring/flake-module.nix
];
perSystem = {system, self', pkgs, ...}: {
devShells.default = pkgs.mkShellNoCC {
buildInputs = [
pkgs.python3.pkgs.invoke
pkgs.ipmitool
pkgs.age
pkgs.sops
(pkgs.writeScriptBin "nix2yaml" ''
echo "# AUTOMATICALLY GENERATED WITH:"
echo "# nix2yaml $*"
nix eval --json -f "$@" | ${pkgs.yq-go}/bin/yq e -P -
'')
] ++ pkgs.lib.optional (pkgs.stdenv.isLinux) pkgs.mkpasswd;
};
packages = {
netboot = pkgs.callPackage ./modules/netboot/netboot.nix {
# this nixosSystem is built for x86_64 machines regardless of the host machine
pkgs = nixpkgs.legacyPackages.x86_64-linux;
inherit (nixpkgs.lib) nixosSystem;
extraModules = [
self.inputs.nur.nixosModules.nur
{_module.args.inputs = self.inputs;}
];
};
netboot-pixie-core = pkgs.callPackage ./modules/netboot/netboot-pixie-core.nix {
inherit (self'.packages) netboot;
};
};
};
flake = {
hydraJobs = nixpkgs.lib.mapAttrs' (name: config: nixpkgs.lib.nameValuePair "nixos-${name}" config.config.system.build.toplevel) self.nixosConfigurations;
};
}).config.flake;
}