diff --git a/.envrc b/.envrc index 44015bff..3550a30f 100644 --- a/.envrc +++ b/.envrc @@ -1,10 +1 @@ -HOST_XDG_DATA_DIRS="${XDG_DATA_DIRS:-}" -eval "$(lorri direnv)" -export XDG_DATA_DIRS="${XDG_DATA_DIRS}:${HOST_XDG_DATA_DIRS}" - -# Use system PKI -unset SSL_CERT_FILE -unset NIX_SSL_CERT_FILE - -# Install pre-commit hooks -eval "$shellHook" +use flake diff --git a/.gitignore b/.gitignore index 66b5d68c..b5f600c1 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,6 @@ result* # Generated by nix-pre-commit-hooks /.pre-commit-config.yaml + +# direnv +.direnv diff --git a/modules/hooks.nix b/modules/hooks.nix index 5e0cf65d..f5409196 100644 --- a/modules/hooks.nix +++ b/modules/hooks.nix @@ -349,6 +349,11 @@ in description = lib.mdDoc "Fail when warnings are present"; default = false; }; + offline = mkOption { + type = types.bool; + description = lib.mdDoc "Run clippy offline"; + default = true; + }; }; }; @@ -715,7 +720,7 @@ in { name = "clippy"; description = "Lint Rust code."; - entry = "${wrapper}/bin/cargo-clippy clippy ${cargoManifestPathArg} -- ${lib.optionalString settings.clippy.denyWarnings "-D warnings"}"; + entry = "${wrapper}/bin/cargo-clippy clippy ${cargoManifestPathArg} ${lib.optionalString settings.clippy.offline "--offline"} -- ${lib.optionalString settings.clippy.denyWarnings "-D warnings"}"; files = "\\.rs$"; pass_filenames = false; };