diff --git a/devenv.nix b/devenv.nix index fc5c50b..a736435 100644 --- a/devenv.nix +++ b/devenv.nix @@ -1,24 +1,10 @@ -{ pkgs -, lib -, config -, inputs -, ... -}: +{ pkgs, lib, config, inputs, ... }: -let - req = pkgs.concatText "req" [ - ./requirements.txt - ./requirements-dev.txt - ]; -in +let req = pkgs.concatText "req" [ ./requirements.txt ./requirements-dev.txt ]; -{ +in { # https://devenv.sh/packages/ - packages = [ - pkgs.file - pkgs.swig4 - pkgs.openssl - ]; + packages = [ pkgs.file pkgs.swig4 pkgs.openssl ]; # https://devenv.sh/tests/ # enterTest = '' @@ -41,7 +27,7 @@ in # https://devenv.sh/pre-commit-hooks/ pre-commit.hooks = { - nixpkgs-fmt.enable = true; + nixfmt.enable = true; # remove unused imports autoflake.enable = true; # formatter diff --git a/flake.nix b/flake.nix index 3620b7c..113008d 100644 --- a/flake.nix +++ b/flake.nix @@ -7,31 +7,14 @@ pre-commit-hooks.url = "github:cachix/pre-commit-hooks.nix"; }; - outputs = - { self - , nixpkgs - , flake-utils - , pre-commit-hooks - , - }: - let - supportedSystems = [ - "x86_64-linux" - "aarch64-darwin" - ]; - in - { + outputs = { self, nixpkgs, flake-utils, pre-commit-hooks, }: + let supportedSystems = [ "x86_64-linux" "aarch64-darwin" ]; + in { overlays.default = import ./overlay.nix { inherit self; }; - } - // flake-utils.lib.eachSystem supportedSystems ( - system: - let - pkgs = import nixpkgs { inherit system; }; - in - { - packages = { - smtprd-ng = pkgs.callPackage ./. { }; - }; + } // flake-utils.lib.eachSystem supportedSystems (system: + let pkgs = import nixpkgs { inherit system; }; + in { + packages = { smtprd-ng = pkgs.callPackage ./. { }; }; packages.default = self.packages.${system}.smtprd-ng; @@ -39,12 +22,13 @@ pre-commit-check = pre-commit-hooks.lib.${system}.run rec { src = ./.; hooks = { - nixpkgs-fmt.enable = true; + nixfmt.enable = true; autoflake.enable = true; black.enable = true; isort.enable = true; 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.excludes = [ "tests/" ]; }; @@ -56,6 +40,5 @@ type = "app"; program = "${self.packages.${system}.smtprd-ng}/bin/smtprd-ng"; }; - } - ); + }); }