diff --git a/flake.nix b/flake.nix index fd2681a5..de93d1f6 100644 --- a/flake.nix +++ b/flake.nix @@ -14,60 +14,66 @@ inherit (sources) git-hooks agenix; nixpkgs = import-flake sources.nixpkgs; in - flake-parts.lib.mkFlake { inputs = inputs // { inherit nixpkgs; }; } { - systems = [ - "x86_64-linux" - "aarch64-linux" - "x86_64-darwin" - "aarch64-darwin" - ]; - - imports = [ - (import "${git-hooks}/flake-module.nix") - inputs.nixops4.modules.flake.default - - ./deployment/flake-part.nix - ./infra/flake-part.nix - ]; - - perSystem = - { - pkgs, - lib, - inputs', - ... - }: - { - formatter = pkgs.nixfmt-rfc-style; - - pre-commit.settings.hooks = - let - ## Add a directory here if pre-commit hooks shouldn't apply to it. - optout = [ "npins" ]; - excludes = map (dir: "^${dir}/") optout; - addExcludes = lib.mapAttrs (_: c: c // { inherit excludes; }); - in - addExcludes { - nixfmt-rfc-style.enable = true; - deadnix.enable = true; - trim-trailing-whitespace.enable = true; - shellcheck.enable = true; - }; - - devShells.default = pkgs.mkShell { - packages = [ - pkgs.npins - pkgs.nil - (pkgs.callPackage "${agenix}/pkgs/agenix.nix" { }) - pkgs.openssh - pkgs.httpie - pkgs.jq - # exposing this env var as a hack to pass info in from form - (inputs'.nixops4.packages.default.overrideAttrs { - impureEnvVars = [ "DEPLOYMENT" ]; - }) - ]; - }; + flake-parts.lib.mkFlake + { + inputs = inputs // { + inherit nixpkgs; }; - }; + } + { + systems = [ + "x86_64-linux" + "aarch64-linux" + "x86_64-darwin" + "aarch64-darwin" + ]; + + imports = [ + (import "${git-hooks}/flake-module.nix") + inputs.nixops4.modules.flake.default + + ./deployment/flake-part.nix + ./infra/flake-part.nix + ]; + + perSystem = + { + pkgs, + lib, + inputs', + ... + }: + { + formatter = pkgs.nixfmt-rfc-style; + + pre-commit.settings.hooks = + let + ## Add a directory here if pre-commit hooks shouldn't apply to it. + optout = [ "npins" ]; + excludes = map (dir: "^${dir}/") optout; + addExcludes = lib.mapAttrs (_: c: c // { inherit excludes; }); + in + addExcludes { + nixfmt-rfc-style.enable = true; + deadnix.enable = true; + trim-trailing-whitespace.enable = true; + shellcheck.enable = true; + }; + + devShells.default = pkgs.mkShell { + packages = [ + pkgs.npins + pkgs.nil + (pkgs.callPackage "${agenix}/pkgs/agenix.nix" { }) + pkgs.openssh + pkgs.httpie + pkgs.jq + # exposing this env var as a hack to pass info in from form + (inputs'.nixops4.packages.default.overrideAttrs { + impureEnvVars = [ "DEPLOYMENT" ]; + }) + ]; + }; + }; + }; }