Signed-off-by: Florian Brandes <florian.brandes@posteo.de>
This commit is contained in:
2024-07-12 16:14:40 +02:00
parent f59934cfd0
commit 9f4273163a
2 changed files with 16 additions and 47 deletions

View File

@@ -1,24 +1,10 @@
{ pkgs { pkgs, lib, config, inputs, ... }:
, lib
, config
, inputs
, ...
}:
let let req = pkgs.concatText "req" [ ./requirements.txt ./requirements-dev.txt ];
req = pkgs.concatText "req" [
./requirements.txt
./requirements-dev.txt
];
in
{ in {
# https://devenv.sh/packages/ # https://devenv.sh/packages/
packages = [ packages = [ pkgs.file pkgs.swig4 pkgs.openssl ];
pkgs.file
pkgs.swig4
pkgs.openssl
];
# https://devenv.sh/tests/ # https://devenv.sh/tests/
# enterTest = '' # enterTest = ''
@@ -41,7 +27,7 @@ in
# https://devenv.sh/pre-commit-hooks/ # https://devenv.sh/pre-commit-hooks/
pre-commit.hooks = { pre-commit.hooks = {
nixpkgs-fmt.enable = true; nixfmt.enable = true;
# remove unused imports # remove unused imports
autoflake.enable = true; autoflake.enable = true;
# formatter # formatter

View File

@@ -7,31 +7,14 @@
pre-commit-hooks.url = "github:cachix/pre-commit-hooks.nix"; pre-commit-hooks.url = "github:cachix/pre-commit-hooks.nix";
}; };
outputs = outputs = { self, nixpkgs, flake-utils, pre-commit-hooks, }:
{ self let supportedSystems = [ "x86_64-linux" "aarch64-darwin" ];
, nixpkgs in {
, flake-utils
, pre-commit-hooks
,
}:
let
supportedSystems = [
"x86_64-linux"
"aarch64-darwin"
];
in
{
overlays.default = import ./overlay.nix { inherit self; }; overlays.default = import ./overlay.nix { inherit self; };
} } // flake-utils.lib.eachSystem supportedSystems (system:
// flake-utils.lib.eachSystem supportedSystems ( let pkgs = import nixpkgs { inherit system; };
system: in {
let packages = { smtprd-ng = pkgs.callPackage ./. { }; };
pkgs = import nixpkgs { inherit system; };
in
{
packages = {
smtprd-ng = pkgs.callPackage ./. { };
};
packages.default = self.packages.${system}.smtprd-ng; packages.default = self.packages.${system}.smtprd-ng;
@@ -39,12 +22,13 @@
pre-commit-check = pre-commit-hooks.lib.${system}.run rec { pre-commit-check = pre-commit-hooks.lib.${system}.run rec {
src = ./.; src = ./.;
hooks = { hooks = {
nixpkgs-fmt.enable = true; nixfmt.enable = true;
autoflake.enable = true; autoflake.enable = true;
black.enable = true; black.enable = true;
isort.enable = true; isort.enable = true;
isort.settings.flags = "--profile black"; isort.settings.flags = "--profile black";
pylint.enable = false; # doesn't work correctly with module imports in flake pylint.enable =
false; # doesn't work correctly with module imports in flake
detect-private-keys.enable = true; detect-private-keys.enable = true;
detect-private-keys.excludes = [ "tests/" ]; detect-private-keys.excludes = [ "tests/" ];
}; };
@@ -56,6 +40,5 @@
type = "app"; type = "app";
program = "${self.packages.${system}.smtprd-ng}/bin/smtprd-ng"; program = "${self.packages.${system}.smtprd-ng}/bin/smtprd-ng";
}; };
} });
);
} }