clan-infra/flake.nix

85 lines
2.6 KiB
Nix
Raw Normal View History

2023-07-04 14:43:31 +00:00
{
description = "Dependencies to deploy a clan";
2023-07-05 15:27:07 +00:00
nixConfig = {
extra-substituters = [ "https://cache.clan.lol" ];
extra-trusted-public-keys = [ "cache.clan.lol-1:j83TYLUVsrSXZvQdMoY+Ms81Xd/nO8GNuQQHqphzRSg=" ];
};
2023-07-04 14:43:31 +00:00
inputs = {
switch to native nix gitea action gitea: check runner label flake.lock: Update Flake lock file updates: • Updated input 'disko': 'github:nix-community/disko/15c4d57b41b6b57024aec015e5d30a4ed4713034' (2023-07-04) → 'github:nix-community/disko/68eb09b1833301d729ae6e89583173b6ceaade1c' (2023-07-13) • Updated input 'homepage': 'git+https://git.clan.lol/clan/clan-homepage?ref=refs/heads/main&rev=ffe31cffbdcc22fbf92bde02beda9b17aebe6a82' (2023-07-05) → 'git+https://git.clan.lol/clan/clan-homepage?ref=refs/heads/main&rev=b1573761fd03b6d6ae2170211953e08a2f430b8c' (2023-07-11) • Updated input 'nixpkgs': 'github:Mic92/nixpkgs/9e9bef88786414db7178ad610e7874730d21c5bb' (2023-07-13) → 'github:Mic92/nixpkgs/76873846521e9f2eacc3d2db7c3643b222e22a59' (2023-07-13) • Updated input 'sops-nix': 'github:Mic92/sops-nix/5ed3c22c1fa0515e037e36956a67fe7e32c92957' (2023-07-02) → 'github:Mic92/sops-nix/88b964df6981e4844c07be8c192aa6bdca768a10' (2023-07-12) • Updated input 'srvos': 'github:numtide/srvos/c9fa5cf4b6014807655bf8356b3cddc86f741b7a' (2023-07-03) → 'github:numtide/srvos/e8ae8c0ac816b6388199a475bd6188943e47f5b9' (2023-07-13) • Updated input 'treefmt-nix': 'github:numtide/treefmt-nix/df3f32b0cc253dfc7009b7317e8f0e7ccd70b1cf' (2023-06-29) → 'github:numtide/treefmt-nix/f1dca68b908f3dd656b923b9fb62f7d755133662' (2023-07-13) flake.lock: Update Flake lock file updates: • Updated input 'nixpkgs': 'github:Mic92/nixpkgs/76873846521e9f2eacc3d2db7c3643b222e22a59' (2023-07-13) → 'github:Mic92/nixpkgs/21d75bf07c3cd8c10aea2e86e7d683e12b8bc5c4' (2023-07-13) flake.lock: Update Flake lock file updates: • Updated input 'nixpkgs': 'github:Mic92/nixpkgs/21d75bf07c3cd8c10aea2e86e7d683e12b8bc5c4' (2023-07-13) → 'github:Mic92/nixpkgs/dc54601ce60a6e7b427d124550d43067ee605b53' (2023-07-13)
2023-07-13 10:01:23 +00:00
# https://github.com/NixOS/nixpkgs/pull/243252
nixpkgs.url = "github:Mic92/nixpkgs/daemon";
2023-07-04 14:43:31 +00:00
flake-parts.url = "github:hercules-ci/flake-parts";
flake-parts.inputs.nixpkgs-lib.follows = "nixpkgs";
treefmt-nix.url = "github:numtide/treefmt-nix";
treefmt-nix.inputs.nixpkgs.follows = "nixpkgs";
disko.url = "github:nix-community/disko";
disko.inputs.nixpkgs.follows = "nixpkgs";
homepage.url = "git+https://git.clan.lol/clan/clan-homepage";
homepage.inputs.nixpkgs.follows = "nixpkgs";
homepage.inputs.flake-parts.follows = "flake-parts";
2023-07-05 15:19:22 +00:00
sops-nix.url = "github:Mic92/sops-nix";
sops-nix.inputs.nixpkgs.follows = "nixpkgs";
sops-nix.inputs.nixpkgs-stable.follows = "";
2023-07-04 14:43:31 +00:00
srvos.url = "github:numtide/srvos";
# Use the version of nixpkgs that has been tested to work with SrvOS
srvos.inputs.nixpkgs.follows = "nixpkgs";
2023-07-13 09:05:07 +00:00
nix.url = "github:/nixos/nix?ref=2.16.1";
nix.inputs.nixpkgs.follows = "nixpkgs";
nix.inputs.nixpkgs-regression.follows = "";
nix.inputs.flake-compat.follows = "";
2023-07-04 14:43:31 +00:00
};
outputs = inputs@{ flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } ({ lib, ... }: {
2023-07-13 09:29:07 +00:00
systems = [
"x86_64-linux"
"aarch64-linux"
"aarch64-darwin"
"x86_64-darwin"
];
2023-07-04 14:43:31 +00:00
imports = [
inputs.treefmt-nix.flakeModule
./targets/flake-module.nix
./modules/flake-module.nix
];
perSystem = { config, pkgs, inputs', ... }: {
treefmt = {
projectRootFile = "flake.nix";
programs.terraform.enable = true;
programs.nixpkgs-fmt.enable = true;
2023-07-14 13:42:38 +00:00
settings.formatter.nixpkgs-fmt.excludes = [
# generated files
"node-env.nix"
"node-packages.nix"
"composition.nix"
];
2023-07-04 14:43:31 +00:00
};
2023-07-13 09:29:07 +00:00
packages = {
default = pkgs.mkShell {
packages = [
pkgs.bashInteractive
pkgs.sops
(pkgs.terraform.withPlugins (p: [
2023-07-13 16:37:14 +00:00
p.hetznerdns
2023-07-13 09:29:07 +00:00
p.hcloud
p.null
p.external
p.local
]))
];
};
homepage = inputs'.homepage.packages.default;
2023-07-14 13:37:07 +00:00
inherit (pkgs.callPackage ./pkgs/renovate { }) renovate;
2023-07-13 09:29:07 +00:00
} // lib.optionalAttrs (!pkgs.stdenv.isDarwin) {
gitea = pkgs.callPackage ./pkgs/gitea { };
2023-07-04 14:43:31 +00:00
};
};
});
}