aboutsummaryrefslogtreecommitdiff
path: root/src/x509-info/nix/check.nix
diff options
context:
space:
mode:
authorFranck Cuny <franck@fcuny.net>2023-07-05 11:02:11 -0700
committerFranck Cuny <franck@fcuny.net>2023-07-05 11:02:11 -0700
commit8790ea90d279f4437b0467f54f84d0bbc1a1ccdd (patch)
tree4a6856178d0151fac94e2c939a67e8de61af5524 /src/x509-info/nix/check.nix
parentremove configuration for drone (diff)
downloadx-8790ea90d279f4437b0467f54f84d0bbc1a1ccdd.tar.gz
replace rust-overlay with naersk
This is mostly coming from https://github.com/DeterminateSystems/nix-installer/blob/main/flake.nix
Diffstat (limited to 'src/x509-info/nix/check.nix')
-rw-r--r--src/x509-info/nix/check.nix44
1 files changed, 44 insertions, 0 deletions
diff --git a/src/x509-info/nix/check.nix b/src/x509-info/nix/check.nix
new file mode 100644
index 0000000..4d7743c
--- /dev/null
+++ b/src/x509-info/nix/check.nix
@@ -0,0 +1,44 @@
+{ pkgs, toolchain }:
+
+let
+ inherit (pkgs) writeShellApplication;
+in
+{
+
+ # Format
+ check-rustfmt = (writeShellApplication {
+ name = "check-rustfmt";
+ runtimeInputs = [ toolchain ];
+ text = "cargo fmt --check";
+ });
+
+ # Spelling
+ check-spelling = (writeShellApplication {
+ name = "check-spelling";
+ runtimeInputs = with pkgs; [ git codespell ];
+ text = ''
+ codespell \
+ --ignore-words-list="crate" \
+ --skip="./target,.git" \
+ .
+ '';
+ });
+
+ # NixFormatting
+ check-nixpkgs-fmt = (writeShellApplication {
+ name = "check-nixpkgs-fmt";
+ runtimeInputs = with pkgs; [ git nixpkgs-fmt findutils ];
+ text = ''
+ nixpkgs-fmt --check .
+ '';
+ });
+
+ # Semver
+ check-semver = (writeShellApplication {
+ name = "check-semver";
+ runtimeInputs = with pkgs; [ cargo-semver-checks ];
+ text = ''
+ cargo-semver-checks semver-checks check-release
+ '';
+ });
+}