summaryrefslogtreecommitdiff
path: root/flake.nix
diff options
context:
space:
mode:
authorseth <[email protected]>2024-04-08 23:06:23 -0400
committerseth <[email protected]>2024-04-08 23:06:23 -0400
commit4d93e97d6aa9442d91ad34df1819f10dc8f0ed9c (patch)
treebaa5b81359774138c166706caa78efdca4705910 /flake.nix
parentd8a20e3032a0ce97b6ddc29840e135eda9b3f43c (diff)
disable markdownlint, use nixpkgs' corepack
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix101
1 files changed, 54 insertions, 47 deletions
diff --git a/flake.nix b/flake.nix
index 66dd943..65ee21f 100644
--- a/flake.nix
+++ b/flake.nix
@@ -25,62 +25,69 @@
};
outputs = inputs:
- inputs.flake-parts.lib.mkFlake { inherit inputs; } {
- imports = with inputs; [ treefmt-nix.flakeModule pre-commit.flakeModule ];
+ inputs.flake-parts.lib.mkFlake {inherit inputs;} {
+ imports = with inputs; [
+ treefmt-nix.flakeModule
+ pre-commit.flakeModule
+ ];
- systems =
- [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
+ systems = [
+ "x86_64-linux"
+ "aarch64-linux"
+ "x86_64-darwin"
+ "aarch64-darwin"
+ ];
- perSystem = { lib, pkgs, config, self', ... }:
- let
- nodejs-slim = pkgs.nodejs-slim_20; # this should be the current lts
+ perSystem = {
+ lib,
+ pkgs,
+ config,
+ self',
+ ...
+ }: let
+ nodejs-slim = pkgs.nodejs-slim_20; # this should be the current lts
+ corepack = pkgs.corepack_20;
- enableAll = lib.flip lib.genAttrs (lib.const { enable = true; });
- in {
- treefmt = {
- projectRootFile = ".git/config";
+ enableAll = lib.flip lib.genAttrs (lib.const {enable = true;});
+ in {
+ treefmt = {
+ projectRootFile = ".git/config";
- programs = enableAll [ "deadnix" "nixfmt" "prettier" ];
+ programs = enableAll ["alejandra" "deadnix" "prettier"];
- settings.global = {
- excludes = [
- "./node_modules/*"
- "./dist/*"
- "./.astro/*"
- "flake.lock"
- "pnpm-lock.yaml"
- ];
- };
- };
-
- pre-commit.settings = {
- settings.treefmt.package = config.treefmt.build.wrapper;
-
- hooks = enableAll [
- "actionlint"
- "eclint"
- "eslint"
- "markdownlint"
- "nil"
- "statix"
- "treefmt"
+ settings.global = {
+ excludes = [
+ "./node_modules/*"
+ "./dist/*"
+ "./.astro/*"
+ "flake.lock"
+ "pnpm-lock.yaml"
];
};
+ };
- devShells.default = pkgs.mkShellNoCC {
- shellHook = config.pre-commit.installationScript;
- packages = [
- self'.formatter
- nodejs-slim
- # use pnpm from package.json
- (pkgs.runCommand "corepack-enable" {
- nativeBuildInputs = [ nodejs-slim ];
- } ''
- mkdir -p $out/bin
- corepack enable --install-directory $out/bin
- '')
- ];
+ pre-commit.settings.hooks =
+ (enableAll [
+ "actionlint"
+ "eclint"
+ "eslint"
+ "nil"
+ "statix"
+ "treefmt"
+ ])
+ // {
+ treefmt.package = config.treefmt.build.wrapper;
};
+
+ devShells.default = pkgs.mkShellNoCC {
+ shellHook = config.pre-commit.installationScript;
+ packages = [
+ self'.formatter
+ nodejs-slim
+ # use pnpm from package.json
+ corepack
+ ];
};
+ };
};
}