-
Notifications
You must be signed in to change notification settings - Fork 0
/
Justfile
49 lines (41 loc) · 1.92 KB
/
Justfile
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
set allow-duplicate-recipes
set allow-duplicate-variables
_default:
just --list
import "blog/Justfile" # recipe relate to blog
import "source/Justfile"
# Nix [un]install operation
# --------------------------------------------------
# Install Single-User Nix into your system
install-nix:
@if ! command -v nix >/dev/null 2>&1; then \
echo "Installing Nix...";\
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install;\
else \
echo "You have already installed Nix.";\
fi
@# ref:
@# https://nixos.org/download.html
@# https://www.reddit.com/r/NixOS/comments/wyw7pa/multi_user_vs_single_user_installation/
@# sh <(curl -L https://nixos.org/nix/install) --no-daemon;\
# Uninstall Single-User Nix
uninstall-nix:
@echo "will removing nix single user installing in 5 seconds... <using Ctrl + C to stop it>";
@sleep 1 && echo "will removing nix single user installing in 4 seconds... <using Ctrl + C to stop it>";
@sleep 1 && echo "will removing nix single user installing in 3 seconds... <using Ctrl + C to stop it>";
@sleep 1 && echo "will removing nix single user installing in 2 seconds... <using Ctrl + C to stop it>";
@sleep 1 && echo "will removing nix single user installing in 1 seconds... <using Ctrl + C to stop it>";
/nix/nix-installer uninstall
@# ref:
@# https://nixos.org/download.html#nix-install-linux
@# https://github.com/NixOS/nix/pull/8334
# A simple monitor to watch modify when install-nix
monitor:
inotifywait --event=create --event=modify --event=moved_to --exclude='/(dev|nix|proc|run|sys|tmp|var)/.*' --monitor --no-dereference --quiet --recursive /
@# ref:
@# https://github.com/NixOS/nix/pull/8334
# Git Operation
# --------------------------------------------------
# git log with more information
git-log:
git log --graph --abbrev-commit --decorate --date=relative --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset'