1
0
Fork 0
pvv-nixos-config/flake.nix

141 lines
4.3 KiB
Nix
Raw Permalink Normal View History

2022-12-07 22:13:28 +01:00
{
description = "PVV System flake";
inputs = {
nixpkgs.url = "nixpkgs/nixos-23.05-small";
nixpkgs-unstable.url = "nixpkgs/nixos-unstable-small";
2022-12-07 22:13:28 +01:00
sops-nix.url = "github:Mic92/sops-nix";
sops-nix.inputs.nixpkgs.follows = "nixpkgs";
disko.url = "github:nix-community/disko";
disko.inputs.nixpkgs.follows = "nixpkgs";
2023-09-08 02:23:59 +02:00
pvv-calendar-bot.url = "git+https://git.pvv.ntnu.no/Projects/calendar-bot.git";
2023-08-27 02:36:01 +02:00
pvv-calendar-bot.inputs.nixpkgs.follows = "nixpkgs";
# Last release compatible with 23.05
matrix-next.url = "github:dali99/nixos-matrix-modules/e09814657187c8ed1a5fe1646df6d8da1eb2dee9";
2023-09-03 01:06:48 +02:00
grzegorz.url = "github:Programvareverkstedet/grzegorz";
grzegorz.inputs.nixpkgs.follows = "nixpkgs-unstable";
2023-09-03 01:06:48 +02:00
grzegorz-clients.url = "github:Programvareverkstedet/grzegorz-clients";
grzegorz-clients.inputs.nixpkgs.follows = "nixpkgs";
2022-12-07 22:13:28 +01:00
};
outputs = { self, nixpkgs, nixpkgs-unstable, sops-nix, disko, ... }@inputs:
2022-12-09 03:43:14 +01:00
let
nixlib = nixpkgs.lib;
2022-12-09 03:43:14 +01:00
systems = [
"x86_64-linux"
"aarch64-linux"
2023-08-17 22:05:09 +02:00
"aarch64-darwin"
2022-12-09 03:43:14 +01:00
];
forAllSystems = f: nixlib.genAttrs systems (system: f system);
allMachines = nixlib.mapAttrsToList (name: _: name) self.nixosConfigurations;
importantMachines = [
"bekkalokk"
"bicep"
"brzeczyszczykiewicz"
"georg"
"ildkule"
];
2022-12-09 03:43:14 +01:00
in {
nixosConfigurations = let
nixosConfig = nixpkgs: name: config: nixpkgs.lib.nixosSystem (nixpkgs.lib.recursiveUpdate
2023-03-26 04:21:03 +02:00
rec {
system = "x86_64-linux";
specialArgs = {
inherit nixpkgs-unstable inputs;
values = import ./values.nix;
};
2023-05-31 11:04:38 +02:00
modules = [
./hosts/${name}/configuration.nix
sops-nix.nixosModules.sops
];
2023-05-31 11:04:38 +02:00
pkgs = import nixpkgs {
inherit system;
overlays = [
(final: prev: {
mx-puppet-discord = prev.mx-puppet-discord.override { nodejs_14 = final.nodejs_18; };
})
inputs.pvv-calendar-bot.overlays.${system}.default
2023-05-31 11:04:38 +02:00
];
};
2023-05-23 04:43:39 +02:00
}
config
);
2022-12-07 22:13:28 +01:00
stableNixosConfig = nixosConfig nixpkgs;
unstableNixosConfig = nixosConfig nixpkgs-unstable;
in {
bicep = stableNixosConfig "bicep" {
2023-05-23 04:43:39 +02:00
modules = [
./hosts/bicep/configuration.nix
sops-nix.nixosModules.sops
inputs.matrix-next.nixosModules.default
inputs.pvv-calendar-bot.nixosModules.default
2023-05-23 04:43:39 +02:00
];
2023-05-23 04:26:36 +02:00
};
bekkalokk = stableNixosConfig "bekkalokk" { };
bob = stableNixosConfig "bob" {
modules = [
./hosts/bob/configuration.nix
sops-nix.nixosModules.sops
disko.nixosModules.disko
{ disko.devices.disk.disk1.device = "/dev/vda"; }
];
};
ildkule = stableNixosConfig "ildkule" { };
2023-09-13 05:03:57 +02:00
#ildkule-unstable = unstableNixosConfig "ildkule" { };
2023-09-08 02:10:40 +02:00
shark = stableNixosConfig "shark" { };
2023-09-03 01:06:48 +02:00
brzeczyszczykiewicz = stableNixosConfig "brzeczyszczykiewicz" {
modules = [
./hosts/brzeczyszczykiewicz/configuration.nix
sops-nix.nixosModules.sops
2023-09-17 01:41:59 +02:00
inputs.grzegorz.nixosModules.grzegorz-kiosk
inputs.grzegorz-clients.nixosModules.grzegorz-webui
];
};
georg = stableNixosConfig "georg" {
modules = [
./hosts/georg/configuration.nix
sops-nix.nixosModules.sops
2023-09-03 01:06:48 +02:00
inputs.grzegorz.nixosModules.grzegorz-kiosk
inputs.grzegorz-clients.nixosModules.grzegorz-webui
];
};
buskerud = stableNixosConfig "buskerud" {
modules = [
./hosts/buskerud/configuration.nix
sops-nix.nixosModules.sops
];
};
2022-12-07 22:13:28 +01:00
};
2022-12-09 03:43:14 +01:00
devShells = forAllSystems (system: {
default = nixpkgs.legacyPackages.${system}.callPackage ./shell.nix { };
});
packages = {
"x86_64-linux" = let
pkgs = nixpkgs.legacyPackages."x86_64-linux";
in rec {
default = important-machines;
important-machines = pkgs.linkFarm "important-machines"
(nixlib.getAttrs importantMachines self.packages.x86_64-linux);
all-machines = pkgs.linkFarm "all-machines"
(nixlib.getAttrs allMachines self.packages.x86_64-linux);
} // nixlib.genAttrs allMachines
(machine: self.nixosConfigurations.${machine}.config.system.build.toplevel);
};
2022-12-07 22:13:28 +01:00
};
}