2022-11-13 21:45:50 +00:00
|
|
|
{
|
|
|
|
description = "hacc infra stuff";
|
|
|
|
|
|
|
|
inputs = {
|
2024-06-19 18:51:44 +00:00
|
|
|
nixpkgs.url = "nixpkgs/nixos-24.05-small";
|
2024-04-08 23:20:24 +00:00
|
|
|
nixpkgs-unstable.url = "nixpkgs/nixos-unstable-small";
|
2023-09-27 15:14:05 +00:00
|
|
|
nixpkgs-oldstable.url = "github:/NixOS/nixpkgs?rev=c4aec3c021620d98861639946123214207e98344";
|
2023-11-01 17:36:54 +00:00
|
|
|
|
2024-06-19 18:51:44 +00:00
|
|
|
nixos-mailserver.url = "gitlab:simple-nixos-mailserver/nixos-mailserver/nixos-24.05";
|
2023-01-22 01:25:07 +00:00
|
|
|
tracktrain.url = "git+https://stuebinm.eu/git/tracktrain?ref=main";
|
|
|
|
tracktrain.flake = false;
|
2022-11-13 22:04:55 +00:00
|
|
|
|
|
|
|
deploy-rs.url = "github:serokell/deploy-rs";
|
|
|
|
deploy-rs.inputs.nixpkgs.follows = "nixpkgs";
|
2023-04-19 18:08:45 +00:00
|
|
|
sops-nix.url = "github:Mic92/sops-nix";
|
|
|
|
sops-nix.inputs.nixpkgs-stable.follows = "nixpkgs";
|
2024-07-15 13:25:33 +00:00
|
|
|
sops-nix.inputs.nixpkgs.follows = "nixpkgs-unstable";
|
2022-11-25 21:48:27 +00:00
|
|
|
|
|
|
|
# these exist mostly to make the flake.lock somewhat more human-friendly
|
|
|
|
# note that in theory doing this might break things, but it seems fairly unlikely
|
|
|
|
nixos-mailserver.inputs = {
|
2024-06-19 18:51:44 +00:00
|
|
|
"nixpkgs-24_05".follows = "nixpkgs";
|
|
|
|
nixpkgs.follows = "nixpkgs-unstable";
|
2023-06-06 00:04:11 +00:00
|
|
|
utils.follows = "/deploy-rs/utils";
|
|
|
|
flake-compat.follows = "/deploy-rs/flake-compat";
|
2022-11-25 21:48:27 +00:00
|
|
|
};
|
2022-11-13 21:45:50 +00:00
|
|
|
};
|
|
|
|
|
2024-02-18 12:45:32 +00:00
|
|
|
outputs = { self, nixpkgs, deploy-rs, sops-nix, ... }@inputs:
|
|
|
|
let modules = {
|
2024-01-31 22:30:06 +00:00
|
|
|
bindMounts = import ./modules/bindmounts.nix;
|
|
|
|
nopersist = import ./modules/nopersist.nix;
|
2024-01-31 22:47:02 +00:00
|
|
|
encboot = import ./modules/encboot.nix;
|
2024-01-31 22:30:06 +00:00
|
|
|
};
|
2024-02-18 12:45:32 +00:00
|
|
|
profiles = {
|
2023-02-18 13:45:14 +00:00
|
|
|
container = import ./modules/container-profile.nix;
|
|
|
|
};
|
2022-11-13 21:45:50 +00:00
|
|
|
pkgs = import ./pkgs {
|
|
|
|
sources = inputs;
|
|
|
|
system = "x86_64-linux";
|
2023-11-30 16:43:48 +00:00
|
|
|
config.allowUnfree = true;
|
2024-07-01 12:47:37 +00:00
|
|
|
config.permittedInsecurePackages = [ "nextcloud-27.1.11" ];
|
2022-11-13 21:45:50 +00:00
|
|
|
};
|
|
|
|
in {
|
|
|
|
nixosConfigurations.parsons = nixpkgs.lib.nixosSystem {
|
|
|
|
system = "x86_64-linux";
|
|
|
|
modules = [
|
2024-01-11 21:53:02 +00:00
|
|
|
./parsons/configuration.nix
|
2024-04-06 21:05:17 +00:00
|
|
|
./modules/buildinfo.nix
|
2024-04-19 17:11:03 +00:00
|
|
|
./modules/containers.nix
|
2023-04-19 18:08:45 +00:00
|
|
|
sops-nix.nixosModules.sops
|
2022-11-13 21:45:50 +00:00
|
|
|
{ nixpkgs.pkgs = pkgs; }
|
|
|
|
];
|
|
|
|
specialArgs = {
|
|
|
|
sources = inputs;
|
2024-04-19 17:11:03 +00:00
|
|
|
inherit modules profiles;
|
|
|
|
inherit (nixpkgs.lib) nixosSystem;
|
2022-11-13 21:45:50 +00:00
|
|
|
};
|
|
|
|
};
|
2022-11-13 22:04:55 +00:00
|
|
|
|
|
|
|
deploy.nodes.parsons = {
|
|
|
|
hostname = "parsons";
|
|
|
|
profiles.system = {
|
|
|
|
user = "root";
|
2022-11-15 14:19:36 +00:00
|
|
|
autoRollback = false;
|
2022-11-13 22:04:55 +00:00
|
|
|
path = deploy-rs.lib.x86_64-linux.activate.nixos
|
|
|
|
self.nixosConfigurations.parsons;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
# This is highly advised, and will prevent many possible mistakes
|
|
|
|
checks = builtins.mapAttrs
|
|
|
|
(system: deployLib: deployLib.deployChecks self.deploy)
|
|
|
|
deploy-rs.lib;
|
2023-02-24 16:33:48 +00:00
|
|
|
|
2024-08-30 15:52:57 +00:00
|
|
|
apps.x86_64-linux =
|
2024-01-11 21:53:02 +00:00
|
|
|
let
|
2024-08-30 15:52:57 +00:00
|
|
|
mkApp = pkg: {
|
|
|
|
type = "app";
|
|
|
|
program = pkgs.lib.getExe pkg;
|
|
|
|
};
|
|
|
|
websites = pkgs.lib.mapAttrs (name: mkApp)
|
|
|
|
self.nixosConfigurations.parsons.config.hacc.websites.builders;
|
2024-01-11 21:53:02 +00:00
|
|
|
in
|
|
|
|
{ docs = websites."docs.hacc.space"; } // websites;
|
2024-08-30 15:56:10 +00:00
|
|
|
|
|
|
|
packages.x86_64-linux = {
|
2024-11-11 00:12:22 +00:00
|
|
|
inherit (pkgs) mattermost hacc-scripts;
|
2024-08-30 15:56:10 +00:00
|
|
|
};
|
2022-11-13 21:45:50 +00:00
|
|
|
};
|
2022-11-13 22:04:55 +00:00
|
|
|
|
2022-11-13 21:45:50 +00:00
|
|
|
}
|