-
Notifications
You must be signed in to change notification settings - Fork 23
/
commit.nix
56 lines (47 loc) · 1.18 KB
/
commit.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
{ pkgs, lib }:
with pkgs;
pkgs.mkShell {
# this will make all the build inputs from hello and gnutar
# available to the shell environment
nativeBuildInputs = [
shellcheck
shfmt
git
coreutils
findutils
nixpkgs-fmt
gcc
# write rustfmt first to ensure we are using nightly rustfmt
rust-bin.nightly."2024-01-01".rustfmt
rust-bin.stable.latest.default
binutils-unwrapped
# perl
# gnumake
];
shellHook = ''
set -e
find . -path ./target -prune -false -o -type f -name '*.sh' -exec shellcheck {} +
find . -path ./target -prune -false -o -type f -name '*.sh' -exec shfmt -w {} +
find . -path ./target -prune -false -o -type f -name '*.nix' -exec nixpkgs-fmt {} +
nix flake update
cargo update
cargo fmt -- --check
cargo build
cargo test
cargo clippy
cargo bench --no-run
echo -n "Adding to git..."
git add --all
echo "Done."
git status
read -n 1 -s -r -p "Press any key to continue"
echo "Commiting..."
echo "Enter commit message: "
read -r commitMessage
git commit -m "$commitMessage"
echo "Done."
echo -n "Pushing..."
git push
echo "Done."
'';
}