Add package 'mailnix' for assisting in generation of dovecot/postfix files

This commit is contained in:
Thomas Preisner 2025-02-22 20:11:39 +01:00
parent ce2784e17d
commit 955a0ec8ba
9 changed files with 1136 additions and 2 deletions

View file

@ -7,6 +7,7 @@
flake-parts.inputs.nixpkgs-lib.follows = "nixpkgs";
treefmt-nix.url = "github:numtide/treefmt-nix";
treefmt-nix.inputs.nixpkgs.follows = "nixpkgs";
crane.url = "github:ipetkov/crane";
git-hooks-nix.url = "github:cachix/git-hooks.nix";
git-hooks-nix.inputs.nixpkgs.follows = "nixpkgs";
};
@ -23,6 +24,7 @@
"aarch64-linux"
];
imports = [
flake-parts.flakeModules.easyOverlay
inputs.treefmt-nix.flakeModule
inputs.git-hooks-nix.flakeModule
];
@ -34,7 +36,10 @@
pkgs,
system,
...
}: {
}: let
craneLib = inputs.crane.mkLib pkgs;
pkgs = nixpkgs.legacyPackages.${system}.extend self.overlays.default;
in {
checks = let
tests = ["internal" "basic" "aliases" "rspamd"];
genTest = testName: {
@ -44,9 +49,20 @@
in
pkgs.lib.listToAttrs (map genTest tests);
devShells.default = pkgs.mkShell {
packages = rec {
default = mailnix;
mailnix = craneLib.buildPackage {
src = craneLib.cleanCargoSource ./pkgs/mailnix;
};
};
overlayAttrs = {
mailnix = config.packages.mailnix;
};
devShells.default = craneLib.devShell {
packages = with pkgs; [
self'.formatter.outPath # Add all formatters to environment
mailnix
];
shellHook = ''
${config.pre-commit.installationScript}
@ -61,6 +77,7 @@
programs = {
actionlint.enable = true;
alejandra.enable = true;
rustfmt.enable = true;
};
settings.global.excludes = [
".envrc"