2023-07-04 14:43:31 +00:00
|
|
|
{
|
|
|
|
description = "Dependencies to deploy a clan";
|
|
|
|
|
2024-04-12 13:40:27 +00:00
|
|
|
#nixConfig = {
|
|
|
|
# extra-substituters = [ "https://cache.clan.lol" ];
|
|
|
|
# extra-trusted-public-keys = [ "cache.clan.lol-1:3KztgSAB5R1M+Dz7vzkBGzXdodizbgLXGXKXlcQLA28=" ];
|
|
|
|
#};
|
2023-07-05 15:27:07 +00:00
|
|
|
|
2023-07-04 14:43:31 +00:00
|
|
|
inputs = {
|
2023-08-22 11:18:39 +00:00
|
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
2024-06-10 09:21:00 +00:00
|
|
|
flake-utils.url = "github:numtide/flake-utils";
|
|
|
|
flake-compat.url = "github:edolstra/flake-compat";
|
2023-07-04 14:43:31 +00:00
|
|
|
flake-parts.url = "github:hercules-ci/flake-parts";
|
|
|
|
flake-parts.inputs.nixpkgs-lib.follows = "nixpkgs";
|
2024-07-01 12:24:08 +00:00
|
|
|
treefmt-nix.url = "github:numtide/treefmt-nix/opentofu";
|
2023-07-04 14:43:31 +00:00
|
|
|
treefmt-nix.inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
|
2024-06-10 09:21:00 +00:00
|
|
|
nixos-mailserver = {
|
|
|
|
url = "gitlab:simple-nixos-mailserver/nixos-mailserver";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
2024-07-01 12:15:33 +00:00
|
|
|
inputs.nixpkgs-24_05.follows = "";
|
2024-06-10 09:21:00 +00:00
|
|
|
inputs.flake-compat.follows = "flake-compat";
|
|
|
|
};
|
|
|
|
|
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-26 16:29:57 +00:00
|
|
|
|
2024-06-10 13:25:33 +00:00
|
|
|
clan-core.url = "https://git.clan.lol/clan/clan-core/archive/main.tar.gz";
|
2023-07-26 16:29:57 +00:00
|
|
|
clan-core.inputs.flake-parts.follows = "flake-parts";
|
|
|
|
clan-core.inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
clan-core.inputs.treefmt-nix.follows = "treefmt-nix";
|
2024-04-30 11:17:19 +00:00
|
|
|
|
2024-05-03 11:02:36 +00:00
|
|
|
buildbot-nix.url = "github:Mic92/buildbot-nix";
|
2024-04-30 11:17:19 +00:00
|
|
|
buildbot-nix.inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
buildbot-nix.inputs.flake-parts.follows = "flake-parts";
|
|
|
|
buildbot-nix.inputs.treefmt-nix.follows = "treefmt-nix";
|
2023-07-04 14:43:31 +00:00
|
|
|
};
|
|
|
|
|
2024-06-06 15:52:20 +00:00
|
|
|
outputs =
|
|
|
|
inputs@{ flake-parts, ... }:
|
|
|
|
flake-parts.lib.mkFlake { inherit inputs; } (
|
|
|
|
{ self, ... }:
|
|
|
|
{
|
|
|
|
systems = [
|
|
|
|
"x86_64-linux"
|
|
|
|
"aarch64-linux"
|
|
|
|
];
|
|
|
|
imports = [
|
|
|
|
inputs.treefmt-nix.flakeModule
|
|
|
|
./devShells/flake-module.nix
|
|
|
|
./targets/flake-module.nix
|
|
|
|
./modules/flake-module.nix
|
|
|
|
./pkgs/flake-module.nix
|
|
|
|
];
|
|
|
|
perSystem = (
|
|
|
|
{
|
|
|
|
lib,
|
|
|
|
self',
|
|
|
|
system,
|
2024-07-01 13:29:43 +00:00
|
|
|
pkgs,
|
2024-06-06 15:52:20 +00:00
|
|
|
...
|
|
|
|
}:
|
|
|
|
{
|
|
|
|
treefmt = {
|
2024-07-01 13:29:43 +00:00
|
|
|
package = pkgs.treefmt.overrideAttrs (_old: {
|
|
|
|
# https://github.com/numtide/treefmt/pull/325
|
|
|
|
patches = [ ./treefmt-config.patch ];
|
|
|
|
});
|
2024-06-06 15:52:20 +00:00
|
|
|
projectRootFile = ".git/config";
|
2024-07-01 12:24:08 +00:00
|
|
|
programs.terraform.enable = true;
|
2024-07-01 12:49:41 +00:00
|
|
|
programs.shellcheck.enable = true;
|
|
|
|
|
|
|
|
programs.deno.enable = true;
|
2024-07-01 13:29:43 +00:00
|
|
|
settings.global.excludes = [
|
2024-07-01 12:49:41 +00:00
|
|
|
# generated files
|
|
|
|
"sops/*"
|
|
|
|
"terraform.tfstate"
|
|
|
|
"*.tfvars.sops.json"
|
|
|
|
"*nixos-vars.json"
|
|
|
|
"secrets.yaml"
|
|
|
|
];
|
|
|
|
|
2024-06-06 15:52:20 +00:00
|
|
|
programs.nixfmt-rfc-style.enable = true;
|
|
|
|
settings.formatter.nixfmt-rfc-style.excludes = [
|
|
|
|
# generated files
|
|
|
|
"node-env.nix"
|
|
|
|
"node-packages.nix"
|
|
|
|
"composition.nix"
|
|
|
|
];
|
|
|
|
};
|
|
|
|
checks =
|
|
|
|
let
|
|
|
|
nixosMachines = lib.mapAttrs' (
|
|
|
|
name: config: lib.nameValuePair "nixos-${name}" config.config.system.build.toplevel
|
|
|
|
) ((lib.filterAttrs (_: config: config.pkgs.system == system)) self.nixosConfigurations);
|
|
|
|
packages = lib.mapAttrs' (n: lib.nameValuePair "package-${n}") self'.packages;
|
|
|
|
devShells = lib.mapAttrs' (n: lib.nameValuePair "devShell-${n}") self'.devShells;
|
|
|
|
homeConfigurations = lib.mapAttrs' (
|
|
|
|
name: config: lib.nameValuePair "home-manager-${name}" config.activation-script
|
|
|
|
) (self'.legacyPackages.homeConfigurations or { });
|
|
|
|
in
|
|
|
|
nixosMachines // packages // devShells // homeConfigurations;
|
|
|
|
}
|
|
|
|
);
|
|
|
|
}
|
|
|
|
);
|
2023-07-04 14:43:31 +00:00
|
|
|
}
|