77 lines
1.8 KiB
Nix
77 lines
1.8 KiB
Nix
{
|
|
description = "An opinionated Nixos Mailsystem";
|
|
|
|
inputs = {
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11";
|
|
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";
|
|
git-hooks-nix.url = "github:cachix/git-hooks.nix";
|
|
git-hooks-nix.inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
|
|
outputs = {
|
|
self,
|
|
nixpkgs,
|
|
flake-parts,
|
|
...
|
|
} @ inputs:
|
|
flake-parts.lib.mkFlake {inherit inputs;} {
|
|
systems = [
|
|
"x86_64-linux"
|
|
"aarch64-linux"
|
|
];
|
|
imports = [
|
|
inputs.treefmt-nix.flakeModule
|
|
inputs.git-hooks-nix.flakeModule
|
|
];
|
|
|
|
perSystem = {
|
|
config,
|
|
self',
|
|
inputs',
|
|
pkgs,
|
|
system,
|
|
...
|
|
}: {
|
|
checks = let
|
|
tests = ["internal" "basic" "aliases" "rspamd"];
|
|
genTest = testName: {
|
|
"name" = testName;
|
|
"value" = import (./tests + "/${testName}.nix") {inherit pkgs;};
|
|
};
|
|
in
|
|
pkgs.lib.listToAttrs (map genTest tests);
|
|
|
|
devShells.default = pkgs.mkShell {
|
|
packages = with pkgs; [
|
|
self'.formatter.outPath # Add all formatters to environment
|
|
];
|
|
shellHook = ''
|
|
${config.pre-commit.installationScript}
|
|
'';
|
|
};
|
|
|
|
pre-commit.settings.hooks = {
|
|
treefmt.enable = true;
|
|
};
|
|
|
|
treefmt = {
|
|
programs = {
|
|
actionlint.enable = true;
|
|
alejandra.enable = true;
|
|
};
|
|
settings.global.excludes = [
|
|
".envrc"
|
|
"*.sieve"
|
|
];
|
|
};
|
|
};
|
|
|
|
flake.nixosModules = rec {
|
|
default = mailsystem;
|
|
mailsystem = import ./mailsystem;
|
|
};
|
|
};
|
|
}
|