2022-12-07 22:13:28 +01:00
|
|
|
{
|
|
|
|
description = "PVV System flake";
|
|
|
|
|
|
|
|
inputs = {
|
2024-06-29 20:45:54 +02:00
|
|
|
nixpkgs.url = "nixpkgs/nixos-24.05-small";
|
2023-11-05 01:22:36 +01:00
|
|
|
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";
|
|
|
|
|
2023-11-05 03:12:35 +01:00
|
|
|
disko.url = "github:nix-community/disko";
|
|
|
|
disko.inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
|
2024-04-10 21:51:05 +02:00
|
|
|
pvv-nettsiden.url = "git+https://git.pvv.ntnu.no/Projects/nettsiden.git";
|
2024-03-28 10:52:59 +01:00
|
|
|
pvv-nettsiden.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";
|
|
|
|
|
2024-06-29 20:45:54 +02:00
|
|
|
matrix-next.url = "github:dali99/nixos-matrix-modules/v0.6.0";
|
2024-03-13 06:33:43 +01:00
|
|
|
matrix-next.inputs.nixpkgs.follows = "nixpkgs";
|
2023-09-03 01:06:48 +02:00
|
|
|
|
2024-04-09 01:52:57 +02:00
|
|
|
nix-gitea-themes.url = "git+https://git.pvv.ntnu.no/oysteikt/nix-gitea-themes.git";
|
|
|
|
nix-gitea-themes.inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
|
2023-09-03 01:06:48 +02:00
|
|
|
grzegorz.url = "github:Programvareverkstedet/grzegorz";
|
2023-11-05 01:22:36 +01:00
|
|
|
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";
|
2024-09-01 04:12:18 +02:00
|
|
|
|
|
|
|
minecraft-data.url = "git+https://git.pvv.ntnu.no/Drift/minecraft-data.git";
|
2022-12-07 22:13:28 +01:00
|
|
|
};
|
|
|
|
|
2024-07-18 16:24:42 +02:00
|
|
|
outputs = { self, nixpkgs, nixpkgs-unstable, sops-nix, disko, ... }@inputs:
|
2022-12-09 03:43:14 +01:00
|
|
|
let
|
2023-10-19 18:32:04 +02:00
|
|
|
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
|
|
|
];
|
2024-08-04 01:45:57 +02:00
|
|
|
forAllSystems = f: nixlib.genAttrs systems f;
|
2024-08-04 17:11:21 +02:00
|
|
|
allMachines = builtins.attrNames self.nixosConfigurations;
|
2023-10-19 18:32:04 +02:00
|
|
|
importantMachines = [
|
|
|
|
"bekkalokk"
|
|
|
|
"bicep"
|
|
|
|
"brzeczyszczykiewicz"
|
|
|
|
"georg"
|
|
|
|
"ildkule"
|
|
|
|
];
|
2022-12-09 03:43:14 +01:00
|
|
|
in {
|
2024-08-04 17:19:33 +02:00
|
|
|
inherit inputs;
|
|
|
|
|
2023-01-29 01:51:35 +01:00
|
|
|
nixosConfigurations = let
|
2024-03-29 01:39:59 +01:00
|
|
|
unstablePkgs = nixpkgs-unstable.legacyPackages.x86_64-linux;
|
2023-07-10 00:02:01 +02:00
|
|
|
nixosConfig = nixpkgs: name: config: nixpkgs.lib.nixosSystem (nixpkgs.lib.recursiveUpdate
|
2023-03-26 04:21:03 +02:00
|
|
|
rec {
|
2023-01-29 01:51:35 +01:00
|
|
|
system = "x86_64-linux";
|
|
|
|
specialArgs = {
|
2023-11-05 01:22:36 +01:00
|
|
|
inherit nixpkgs-unstable inputs;
|
2023-01-29 01:51:35 +01:00
|
|
|
values = import ./values.nix;
|
|
|
|
};
|
2023-05-31 11:04:38 +02:00
|
|
|
|
2023-01-29 01:51:35 +01:00
|
|
|
modules = [
|
|
|
|
./hosts/${name}/configuration.nix
|
|
|
|
sops-nix.nixosModules.sops
|
2024-03-24 02:20:44 +01:00
|
|
|
] ++ config.modules or [];
|
2023-05-31 11:04:38 +02:00
|
|
|
|
|
|
|
pkgs = import nixpkgs {
|
|
|
|
inherit system;
|
2024-04-11 21:20:25 +02:00
|
|
|
overlays = [
|
2024-05-13 07:04:00 +02:00
|
|
|
# Global overlays go here
|
2024-04-11 21:20:25 +02:00
|
|
|
] ++ config.overlays or [ ];
|
2023-05-31 11:04:38 +02:00
|
|
|
};
|
2023-05-23 04:43:39 +02:00
|
|
|
}
|
2024-03-24 02:20:44 +01:00
|
|
|
(removeAttrs config [ "modules" "overlays" ])
|
2023-05-23 04:43:39 +02:00
|
|
|
);
|
2022-12-07 22:13:28 +01:00
|
|
|
|
2023-07-10 00:02:01 +02:00
|
|
|
stableNixosConfig = nixosConfig nixpkgs;
|
2023-11-05 01:22:36 +01:00
|
|
|
unstableNixosConfig = nixosConfig nixpkgs-unstable;
|
2023-01-29 01:51:35 +01:00
|
|
|
in {
|
2023-07-10 00:02:01 +02:00
|
|
|
bicep = stableNixosConfig "bicep" {
|
2023-05-23 04:43:39 +02:00
|
|
|
modules = [
|
2023-11-05 10:54:50 +01:00
|
|
|
inputs.matrix-next.nixosModules.default
|
|
|
|
inputs.pvv-calendar-bot.nixosModules.default
|
2023-05-23 04:43:39 +02:00
|
|
|
];
|
2024-03-24 02:20:44 +01:00
|
|
|
overlays = [
|
|
|
|
inputs.pvv-calendar-bot.overlays.x86_64-linux.default
|
|
|
|
];
|
2023-05-23 04:26:36 +02:00
|
|
|
};
|
2024-03-29 01:39:59 +01:00
|
|
|
bekkalokk = stableNixosConfig "bekkalokk" {
|
|
|
|
overlays = [
|
|
|
|
(final: prev: {
|
|
|
|
heimdal = unstablePkgs.heimdal;
|
2024-03-28 14:24:58 +01:00
|
|
|
mediawiki-extensions = final.callPackage ./packages/mediawiki-extensions { };
|
2024-03-29 01:59:46 +01:00
|
|
|
simplesamlphp = final.callPackage ./packages/simplesamlphp { };
|
2024-09-01 04:12:18 +02:00
|
|
|
bluemap = final.callPackage ./packages/bluemap.nix { };
|
2024-03-29 01:39:59 +01:00
|
|
|
})
|
2024-04-09 01:52:57 +02:00
|
|
|
inputs.nix-gitea-themes.overlays.default
|
2024-03-28 10:52:59 +01:00
|
|
|
inputs.pvv-nettsiden.overlays.default
|
2024-04-09 01:52:57 +02:00
|
|
|
];
|
|
|
|
modules = [
|
|
|
|
inputs.nix-gitea-themes.nixosModules.default
|
2024-03-28 10:52:59 +01:00
|
|
|
inputs.pvv-nettsiden.nixosModules.default
|
2024-03-29 01:39:59 +01:00
|
|
|
];
|
|
|
|
};
|
2023-11-05 03:12:35 +01:00
|
|
|
bob = stableNixosConfig "bob" {
|
|
|
|
modules = [
|
|
|
|
disko.nixosModules.disko
|
|
|
|
{ disko.devices.disk.disk1.device = "/dev/vda"; }
|
|
|
|
];
|
|
|
|
};
|
2023-07-10 00:02:01 +02:00
|
|
|
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 = [
|
2023-09-17 01:41:59 +02:00
|
|
|
inputs.grzegorz.nixosModules.grzegorz-kiosk
|
|
|
|
inputs.grzegorz-clients.nixosModules.grzegorz-webui
|
|
|
|
];
|
|
|
|
};
|
|
|
|
georg = stableNixosConfig "georg" {
|
|
|
|
modules = [
|
2023-09-03 01:06:48 +02:00
|
|
|
inputs.grzegorz.nixosModules.grzegorz-kiosk
|
|
|
|
inputs.grzegorz-clients.nixosModules.grzegorz-webui
|
|
|
|
];
|
|
|
|
};
|
2024-03-24 02:20:44 +01:00
|
|
|
buskerud = stableNixosConfig "buskerud" { };
|
2022-12-07 22:13:28 +01:00
|
|
|
};
|
2023-01-29 01:51:35 +01:00
|
|
|
|
2024-08-04 16:48:21 +02:00
|
|
|
nixosModules = {
|
|
|
|
snakeoil-certs = ./modules/snakeoil-certs.nix;
|
|
|
|
snappymail = ./modules/snappymail.nix;
|
|
|
|
};
|
|
|
|
|
2022-12-09 03:43:14 +01:00
|
|
|
devShells = forAllSystems (system: {
|
|
|
|
default = nixpkgs.legacyPackages.${system}.callPackage ./shell.nix { };
|
|
|
|
});
|
2023-10-19 18:32:04 +02:00
|
|
|
|
|
|
|
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);
|
2024-03-29 01:40:43 +01:00
|
|
|
|
|
|
|
simplesamlphp = pkgs.callPackage ./packages/simplesamlphp { };
|
2024-04-15 01:38:25 +02:00
|
|
|
|
2024-05-26 02:17:48 +02:00
|
|
|
} //
|
|
|
|
(nixlib.pipe null [
|
|
|
|
(_: pkgs.callPackage ./packages/mediawiki-extensions { })
|
|
|
|
(nixlib.flip builtins.removeAttrs ["override" "overrideDerivation"])
|
|
|
|
(nixlib.mapAttrs' (name: nixlib.nameValuePair "mediawiki-${name}"))
|
|
|
|
])
|
|
|
|
// nixlib.genAttrs allMachines
|
|
|
|
(machine: self.nixosConfigurations.${machine}.config.system.build.toplevel);
|
2023-10-19 18:32:04 +02:00
|
|
|
};
|
2022-12-07 22:13:28 +01:00
|
|
|
};
|
|
|
|
}
|