Compare commits
12 commits
7d7d1316d9
...
b9d005821b
Author | SHA1 | Date | |
---|---|---|---|
b9d005821b | |||
f5f94acc8f | |||
4e7bb134df | |||
c9682172dd | |||
f3c7582486 | |||
ffb1d56723 | |||
e16fca13b5 | |||
b7945c13d6 | |||
b8b4759f17 | |||
9bcb314408 | |||
d5aee6eb5a | |||
2e5e6d0394 |
15 changed files with 632 additions and 44 deletions
6
Justfile
6
Justfile
|
@ -1,13 +1,17 @@
|
|||
default:
|
||||
@just --list
|
||||
|
||||
alias dh := deployhome
|
||||
[group('home')]
|
||||
deployhome:
|
||||
# Impure is required for NixGL with proprietary Nvidia drivers :(
|
||||
home-manager switch --impure -b bak --flake .
|
||||
|
||||
deployhomefr:
|
||||
[group('home')]
|
||||
refreshhome:
|
||||
home-manager switch --refresh --impure -b bak --flake .
|
||||
|
||||
alias up := update
|
||||
update:
|
||||
nix flake update
|
||||
|
||||
|
|
56
derivations/figlet-with-fonts.nix
Normal file
56
derivations/figlet-with-fonts.nix
Normal file
|
@ -0,0 +1,56 @@
|
|||
{
|
||||
lib,
|
||||
stdenv,
|
||||
fetchurl,
|
||||
fetchpatch,
|
||||
fetchFromGitHub,
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "figlet";
|
||||
version = "2.2.5";
|
||||
|
||||
# some tools can be found here ftp://ftp.figlet.org/pub/figlet/util/
|
||||
src = fetchurl {
|
||||
url = "ftp://ftp.figlet.org/pub/figlet/program/unix/figlet-${version}.tar.gz";
|
||||
sha256 = "0za1ax15x7myjl8jz271ybly8ln9kb9zhm1gf6rdlxzhs07w925z";
|
||||
};
|
||||
|
||||
contributed = fetchFromGitHub {
|
||||
owner = "xero";
|
||||
repo = "figlet-fonts";
|
||||
rev = "a6d2db1a3ee88bec3518214e851825fc4495ac84";
|
||||
hash = "sha256-dAs7N66D2Fpy4/UB5Za1r2qb1iSAJR6TMmau1asxgtY";
|
||||
};
|
||||
|
||||
patches = [
|
||||
(fetchpatch {
|
||||
url = "https://git.alpinelinux.org/aports/plain/main/figlet/musl-fix-cplusplus-decls.patch?h=3.4-stable&id=71776c73a6f04b6f671430f702bcd40b29d48399";
|
||||
name = "musl-fix-cplusplus-decls.patch";
|
||||
sha256 = "1720zgrfk9makznqkbjrnlxm7nnhk6zx7g458fv53337n3g3zn7j";
|
||||
})
|
||||
(fetchpatch {
|
||||
url = "https://github.com/cmatsuoka/figlet/commit/9a50c1795bc32e5a698b855131ee87c8d7762c9e.patch";
|
||||
name = "unistd-on-darwin.patch";
|
||||
sha256 = "hyfY87N+yuAwjsBIjpgvcdJ1IbzlR4A2yUJQSzShCRI=";
|
||||
})
|
||||
];
|
||||
|
||||
makeFlags = [
|
||||
"prefix=$(out)"
|
||||
"CC:=$(CC)"
|
||||
"LD:=$(CC)"
|
||||
];
|
||||
|
||||
postInstall = "cp -ar ${contributed}/* $out/share/figlet/";
|
||||
|
||||
doCheck = true;
|
||||
|
||||
meta = {
|
||||
description = "Program for making large letters out of ordinary text";
|
||||
homepage = "http://www.figlet.org/";
|
||||
license = lib.licenses.afl21;
|
||||
maintainers = with lib.maintainers; [ ehmry ];
|
||||
platforms = lib.platforms.unix;
|
||||
};
|
||||
}
|
20
flake.lock
20
flake.lock
|
@ -7,11 +7,11 @@
|
|||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1730490306,
|
||||
"narHash": "sha256-AvCVDswOUM9D368HxYD25RsSKp+5o0L0/JHADjLoD38=",
|
||||
"lastModified": 1730837930,
|
||||
"narHash": "sha256-0kZL4m+bKBJUBQse0HanewWO0g8hDdCvBhudzxgehqc=",
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"rev": "1743615b61c7285976f85b303a36cdf88a556503",
|
||||
"rev": "2f607e07f3ac7e53541120536708e824acccfaa8",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -22,11 +22,11 @@
|
|||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1730200266,
|
||||
"narHash": "sha256-l253w0XMT8nWHGXuXqyiIC/bMvh1VRszGXgdpQlfhvU=",
|
||||
"lastModified": 1730785428,
|
||||
"narHash": "sha256-Zwl8YgTVJTEum+L+0zVAWvXAGbWAuXHax3KzuejaDyo=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "807e9154dcb16384b1b765ebe9cd2bba2ac287fd",
|
||||
"rev": "4aa36568d413aca0ea84a1684d2d46f55dbabad7",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -47,11 +47,11 @@
|
|||
},
|
||||
"rose-pine": {
|
||||
"locked": {
|
||||
"lastModified": 1730612146,
|
||||
"narHash": "sha256-hwOcMTXH6Cx2C8lDllpuB7eFd2qvteyLINRYaG0ELTA=",
|
||||
"lastModified": 1730861233,
|
||||
"narHash": "sha256-38Ajq/7qktffqfpukMk9TLCm49tX5/D7ZVHAinPbZag=",
|
||||
"ref": "refs/heads/main",
|
||||
"rev": "6a751d43f8c53dd922403a12d43cb74da7e25d79",
|
||||
"revCount": 376,
|
||||
"rev": "14b2e2c3f3e1721adb6e8e44f1385b1e9b0d0453",
|
||||
"revCount": 382,
|
||||
"type": "git",
|
||||
"url": "https://git.punkfairie.net/punkfairie/rose-pine-nix"
|
||||
},
|
||||
|
|
|
@ -45,12 +45,6 @@
|
|||
# Autostart wanted systemd services.
|
||||
systemd.user.startServices = true;
|
||||
|
||||
home.packages = with pkgs; [
|
||||
nixfmt-rfc-style
|
||||
nil
|
||||
just
|
||||
];
|
||||
|
||||
imports = [
|
||||
./appearance
|
||||
./languages
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
imports = [
|
||||
./javascript.nix
|
||||
./go.nix
|
||||
./nix.nix
|
||||
./php.nix
|
||||
];
|
||||
}
|
||||
|
|
7
home/languages/nix.nix
Normal file
7
home/languages/nix.nix
Normal file
|
@ -0,0 +1,7 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
home.packages = with pkgs; [
|
||||
nixfmt-rfc-style
|
||||
nil
|
||||
];
|
||||
}
|
|
@ -7,15 +7,20 @@
|
|||
./cava.nix
|
||||
./curl.nix
|
||||
./eza.nix
|
||||
./figlet.nix
|
||||
./fish.nix
|
||||
./fzf.nix
|
||||
./gh.nix
|
||||
./git.nix
|
||||
./hyfetch.nix
|
||||
./just.nix
|
||||
./lazygit.nix
|
||||
./less.nix
|
||||
./man.nix
|
||||
./ncmpcpp.nix
|
||||
./neofetch.nix
|
||||
./rbw.nix
|
||||
./ripgrep.nix
|
||||
./starship.nix
|
||||
./tmux.nix
|
||||
./topgrade.nix
|
||||
|
|
22
home/programs/figlet.nix
Normal file
22
home/programs/figlet.nix
Normal file
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
{
|
||||
home.packages = with pkgs; [
|
||||
# Could not get overlays or overrides to work.
|
||||
(callPackage ./../../derivations/figlet-with-fonts.nix { })
|
||||
];
|
||||
|
||||
programs.fish.functions = lib.mkIf config.programs.fish.enable {
|
||||
figlet = {
|
||||
wraps = "figlet";
|
||||
body = # fish
|
||||
''
|
||||
command figlet -f "ANSI Shadow" $argv
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
|
@ -2,6 +2,13 @@
|
|||
{
|
||||
home.packages = with pkgs; [
|
||||
babelfish
|
||||
gnutar
|
||||
bzip2
|
||||
bzip3
|
||||
gzip
|
||||
unzip
|
||||
pax
|
||||
unrar-free
|
||||
];
|
||||
|
||||
programs.fish = {
|
||||
|
@ -36,29 +43,68 @@
|
|||
'';
|
||||
|
||||
shellAbbrs = {
|
||||
cp = {
|
||||
position = "command";
|
||||
expansion = "cp -iv";
|
||||
};
|
||||
cp = "cp -iv";
|
||||
mkdir = "mkdir -pv";
|
||||
mv = "mv -iv";
|
||||
rm = "rm -r";
|
||||
grep = "grep --color=auto";
|
||||
};
|
||||
|
||||
mkdir = {
|
||||
position = "command";
|
||||
expansion = "mkdir -pv";
|
||||
};
|
||||
functions = {
|
||||
extract = {
|
||||
argumentNames = "file";
|
||||
body = # fish
|
||||
''
|
||||
set --erase argv[1]
|
||||
|
||||
mv = {
|
||||
position = "command";
|
||||
expansion = "mv -iv";
|
||||
};
|
||||
if test -f "$file"
|
||||
switch "$file"
|
||||
case "*.tar.bz2"
|
||||
tar -jxvf $argv $file
|
||||
|
||||
rm = {
|
||||
position = "command";
|
||||
expansion = "rm -r";
|
||||
};
|
||||
case "*.tar.gz"
|
||||
tar -zxvf $argv $file
|
||||
|
||||
grep = {
|
||||
position = "command";
|
||||
expansion = "grep --color=auto";
|
||||
case "*.bz2"
|
||||
bunzip2 $argv $file
|
||||
|
||||
case "*.bz3"
|
||||
bunzip3 $argv $file
|
||||
|
||||
case "*.gz"
|
||||
gunzip $argv $file
|
||||
|
||||
case "*.tar"
|
||||
tar -xvf $argv $file
|
||||
|
||||
case "*.tbz2"
|
||||
tar -jxvf $argv $file
|
||||
|
||||
case "*.tgz"
|
||||
tar -zxvf $argv $file
|
||||
|
||||
case "*.zip" "*.ZIP"
|
||||
unzip $argv $file
|
||||
|
||||
case "*pax"
|
||||
cat $file | pax -r $argv
|
||||
|
||||
case "*.pax.Z"
|
||||
uncompress $file --stdout | pax -r $argv
|
||||
|
||||
case "*.rar"
|
||||
unrar-free $file
|
||||
|
||||
case "*.Z"
|
||||
uncompress $argv $file
|
||||
|
||||
case "*"
|
||||
echo "'$file' cannot be extracted via extract()."
|
||||
end
|
||||
else
|
||||
echo "'$file' is not a valid file."
|
||||
end
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
425
home/programs/git.nix
Normal file
425
home/programs/git.nix
Normal file
|
@ -0,0 +1,425 @@
|
|||
{
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
{
|
||||
home.packages = with pkgs; [
|
||||
gum
|
||||
clipboard-jh
|
||||
];
|
||||
|
||||
# ██████╗ ██╗████████╗
|
||||
# ██╔════╝ ██║╚══██╔══╝
|
||||
# ██║ ███╗██║ ██║
|
||||
# ██║ ██║██║ ██║
|
||||
# ╚██████╔╝██║ ██║
|
||||
# ╚═════╝ ╚═╝ ╚═╝
|
||||
|
||||
programs.git = {
|
||||
enable = true;
|
||||
|
||||
userName = "punkfairie";
|
||||
userEmail = "marley@punkfairie.net";
|
||||
|
||||
signing = {
|
||||
signByDefault = true;
|
||||
key = null;
|
||||
};
|
||||
|
||||
lfs.enable = true;
|
||||
|
||||
ignores = [
|
||||
"tags*"
|
||||
"gems.tags"
|
||||
];
|
||||
|
||||
attributes = [
|
||||
# Auto-normalize line endings.
|
||||
"* text=auto"
|
||||
|
||||
"*.png binary"
|
||||
"*.jpg binary"
|
||||
"*.jpeg binary"
|
||||
"*.bmp binary"
|
||||
];
|
||||
|
||||
# ██████╗ ███████╗██╗ ████████╗ █████╗
|
||||
# ██╔══██╗██╔════╝██║ ╚══██╔══╝██╔══██╗
|
||||
# ██║ ██║█████╗ ██║ ██║ ███████║
|
||||
# ██║ ██║██╔══╝ ██║ ██║ ██╔══██║
|
||||
# ██████╔╝███████╗███████╗██║ ██║ ██║
|
||||
# ╚═════╝ ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═╝
|
||||
|
||||
delta = {
|
||||
enable = true;
|
||||
|
||||
options = {
|
||||
navigate = true;
|
||||
# TODO: Add to rose-pine-nix
|
||||
syntax-theme = "rose-pine";
|
||||
features = "mellow-barbet";
|
||||
true-color = "always";
|
||||
hyperlinks = true;
|
||||
};
|
||||
};
|
||||
|
||||
# ██████╗ ██████╗ ███╗ ██╗███████╗██╗ ██████╗
|
||||
# ██╔════╝██╔═══██╗████╗ ██║██╔════╝██║██╔════╝
|
||||
# ██║ ██║ ██║██╔██╗ ██║█████╗ ██║██║ ███╗
|
||||
# ██║ ██║ ██║██║╚██╗██║██╔══╝ ██║██║ ██║
|
||||
# ╚██████╗╚██████╔╝██║ ╚████║██║ ██║╚██████╔╝
|
||||
# ╚═════╝ ╚═════╝ ╚═╝ ╚═══╝╚═╝ ╚═╝ ╚═════╝
|
||||
|
||||
extraConfig = {
|
||||
core = {
|
||||
# Whitespace types to treat as errors.
|
||||
# blank-at-eol: looks for spaces at EOL.
|
||||
# -blank-at-eof: allows blank lines at EOF.
|
||||
# space-before-tab: looks for spaces immediately before tabs at the
|
||||
# beginning of the line.
|
||||
whitespace = "blank-at-eol,-blank-at-eof,space-before-tab";
|
||||
|
||||
# Prevent showing files whose names contain non-ASCII symbols as
|
||||
# unversioned.
|
||||
precomposeunicode = false;
|
||||
|
||||
# Speed up commands involving untracked files such as `git status`.
|
||||
untrackedCache = true;
|
||||
};
|
||||
|
||||
# Do not guess the user's identity.
|
||||
user.useConfigOnly = true;
|
||||
|
||||
color.diff = "always";
|
||||
|
||||
pretty = {
|
||||
lo = "tformat:%C(auto)%h%C(reset)%C(auto)%d%C(reset) %s %C(italic blue)%ad%C(reset) %C(241)%aN%C(reset)";
|
||||
lc = "format:%C(auto)%h%C(reset) %C(white)-%C(reset) %C(italic blue)%ad%C(reset) %C(italic cyan)(%ar)%C(reset)%C(auto)%d%C(reset)%n %C(white)⤷%C(reset) %s %C(241)- %aN <%aE>%C(reset)%n";
|
||||
lt = "format:%C(auto)%h%C(reset) %C(white)-%C(reset) %C(italic blue)%ad%C(reset) %C(italic cyan)(%ar)%C(reset)%C(auto)%d%C(reset)%n %C(white)⤷%C(reset) %s %C(241)- %aN <%aE>%C(reset)%n%w(0,7,7)%+(trailers:only,unfold)";
|
||||
lf = "format:%C(auto)%h%C(reset)%C(auto)%d%C(reset) %C(italic 239)[P: %p] [T: %t]%C(reset)%n%C(white)Author:%C(reset) %aN %C(241)<%aE>%C(reset)%n %C(italic blue)%ad%C(reset) %C(italic cyan)(%ar)%C(reset)%n%C(white)Commit:%C(reset) %cN %C(241)<%cE>%C(reset) %C(italic 239)[GPG: %G?% GK]%C(reset)%n %C(italic blue)%cd%C(reset) %C(italic cyan)(%cr)%C(reset)%w(0,4,4)%n%n%C(bold)%s%C(reset)%n%n%-b%n%n%-N%n";
|
||||
rlo = "tformat:%C(auto)%h%C(reset) %C(bold yellow)(%C(magenta)%gd%C(bold yellow))%C(reset)%C(auto)%d%C(reset) %gs %C(italic blue)%ad%C(reset) %C(241)%aN%C(reset)";
|
||||
rlc = "format:%C(auto)%h%C(reset) %C(white)-%C(reset) %C(italic blue)%ad%C(reset) %C(italic cyan)(%ar)%C(reset)%C(auto)%d%C(reset)%n %C(white)⤷%C(reset) %s %C(241)- %aN <%aE>%C(reset)%n %C(white)⤷%C(reset) %C(bold yellow)(%C(magenta)%gd%C(bold yellow))%C(reset) %gs %C(241)- %gN <%gE>%C(reset)%n";
|
||||
rlt = "format:%C(auto)%h%C(reset) %C(white)-%C(reset) %C(italic blue)%ad%C(reset) %C(italic cyan)(%ar)%C(reset)%C(auto)%d%C(reset)%n %C(white)⤷%C(reset) %s %C(241)- %aN <%aE>%C(reset)%n %C(white)⤷%C(reset) %C(bold yellow)(%C(magenta)%gd%C(bold yellow))%C(reset) %gs %C(241)- %gN <%gE>%C(reset)%n%w(0,7,7)%+(trailers:only,unfold)";
|
||||
rlf = "format:%C(auto)%h%C(reset) %C(bold yellow)(%C(magenta)%gd%C(bold yellow))%C(reset)%C(auto)%d%C(reset) %C(italic 239)[P: %p] [T: %t]%C(reset)%n%C(white)Author:%C(reset) %aN %C(241)<%aE>%C(reset)%n %C(italic blue)%ad%C(reset) %C(italic cyan)(%ar)%C(reset)%n%C(white)Commit:%C(reset) %cN %C(241)<%cE>%C(reset) %C(italic 239)[GPG: %G?% GK]%C(reset)%n %C(italic blue)%cd%C(reset) %C(italic cyan)(%cr)%C(reset)%n%C(white)Reflog:%C(reset) %gN %C(241)<%gE>%C(reset)%n %C(italic)%gs%C(reset)%w(0,4,4)%n%n%C(bold)%s%C(reset)%n%n%-b%n%n%-N%n";
|
||||
};
|
||||
|
||||
init.defaultBranch = "main";
|
||||
|
||||
status.showstash = true;
|
||||
|
||||
push = {
|
||||
autoSetupRemote = true;
|
||||
|
||||
# Push tags automatically.
|
||||
followTags = true;
|
||||
};
|
||||
|
||||
rebase.autosquash = true;
|
||||
|
||||
merge = {
|
||||
# Use nvim for merging, specifically the view showing LOCAL, MERGED,
|
||||
# REMOTE.
|
||||
tool = "nvimdiff2";
|
||||
|
||||
# Include summaries of merged commits in merge commit messages.
|
||||
log = true;
|
||||
|
||||
# delta.
|
||||
conflictstyle = "diff3";
|
||||
};
|
||||
|
||||
mergetool = {
|
||||
keepBackup = false;
|
||||
hideResolved = true;
|
||||
};
|
||||
|
||||
diff = {
|
||||
# Detect when files are copied as well as renamed.
|
||||
renames = "copies";
|
||||
|
||||
# delta
|
||||
colorMoved = "default";
|
||||
};
|
||||
|
||||
# Fix whitespace errors when applying a patch, as specified in
|
||||
# core.whitespace.
|
||||
apply.whitespace = "fix";
|
||||
|
||||
branch = {
|
||||
# Show most recently changed branches first.
|
||||
sort = "-committerdate";
|
||||
|
||||
autoSetupMerge = "simple";
|
||||
};
|
||||
|
||||
credential.helper = "store";
|
||||
};
|
||||
|
||||
# █████╗ ██╗ ██╗ █████╗ ███████╗███████╗███████╗
|
||||
# ██╔══██╗██║ ██║██╔══██╗██╔════╝██╔════╝██╔════╝
|
||||
# ███████║██║ ██║███████║███████╗█████╗ ███████╗
|
||||
# ██╔══██║██║ ██║██╔══██║╚════██║██╔══╝ ╚════██║
|
||||
# ██║ ██║███████╗██║██║ ██║███████║███████╗███████║
|
||||
# ╚═╝ ╚═╝╚══════╝╚═╝╚═╝ ╚═╝╚══════╝╚══════╝╚══════╝
|
||||
|
||||
aliases =
|
||||
let
|
||||
fish_fns = config.programs.fish.functions;
|
||||
in
|
||||
{
|
||||
### Staging ###
|
||||
|
||||
a = "add";
|
||||
aa = "add --all";
|
||||
|
||||
# Interactively stage parts of a file.
|
||||
apa = "add --patch";
|
||||
|
||||
da = "diff";
|
||||
das = "diff --staged";
|
||||
daw = "diff --word-diff"; # Show diff by word.
|
||||
dasw = "diff --staged --word-diff";
|
||||
|
||||
d = "!f() { git diff \"$@\" ':(exclude)package-lock.json' ':(exclude)*.lock'; }; f";
|
||||
ds = "!f() { git diff --staged \"$@\" ':(exclude)package-lock.json' ':(exclude)*.lock'; }; f";
|
||||
dw = "!f() { git diff --word-diff \"$@\" ':(exclude)package-lock.json' ':(exclude)*.lock'; }; f";
|
||||
dsw = "!f() { git diff --staged --word-diff \"$@\" ':(exclude)package-lock.json' ':(exclude)*.lock'; }; f";
|
||||
|
||||
st = "status --short --branch";
|
||||
stu = "status --short --branch --untracked-files";
|
||||
stl = "status";
|
||||
|
||||
### Committing ###
|
||||
|
||||
c = "commit";
|
||||
ce = "commit --amend";
|
||||
cen = "commit --amend --no-edit --no-verify";
|
||||
ca = "!git add --alll && git commit";
|
||||
cae = "!git add --all && git commit --amend";
|
||||
caen = "!git add --all && git commit --amend --no-edit --no-verify";
|
||||
cfu = "commit --fixup";
|
||||
|
||||
rev = "revert";
|
||||
|
||||
### Working Dir & Index Manipulation ###
|
||||
|
||||
co = "checkout";
|
||||
|
||||
rt = "reset";
|
||||
|
||||
rts = "reset --soft"; # undo commits & stage their changes
|
||||
|
||||
rs = "restore --worktree"; # revert local changes
|
||||
rst = "restore --staged"; # unstage things
|
||||
rsa = "restore --worktree --staged";
|
||||
|
||||
rss = "restore --worktree --source"; # specify a commit to revert to
|
||||
rsts = "restore --staged --source";
|
||||
rsas = "restore --worktree --staged --source";
|
||||
|
||||
rmc = "rm --cached"; # leave worktree copy alone
|
||||
|
||||
sta = "stash push";
|
||||
stam = "stash push --message";
|
||||
staa = "stash push --include-untracted";
|
||||
staam = "stash push --include-untracted --message";
|
||||
|
||||
stap = "stash pop";
|
||||
stal = "stash list";
|
||||
stas = "stash show --text";
|
||||
|
||||
cl = "clean -force"; # remove untracked & unignored files
|
||||
cldr = "clean --dry-run";
|
||||
|
||||
### Branches ###
|
||||
|
||||
b = "branch";
|
||||
cb = "checkout -b";
|
||||
cm = lib.mkIf (fish_fns ? git_main_branch) "!git checkout $(git_main_branch)";
|
||||
cd = lib.mkIf (fish_fns ? git_develop_branch) "!git checkout $(git_develop_branch)";
|
||||
|
||||
m = "merge";
|
||||
mtl = "mergetool --no-prompt";
|
||||
ma = "merge --abort";
|
||||
|
||||
cp = "cherry-pick";
|
||||
cpa = "cherry-pick --abort";
|
||||
cpc = "cherry-pick --continue";
|
||||
cpq = "cherry-pick --quit";
|
||||
|
||||
### Remotes ###
|
||||
|
||||
p = "push";
|
||||
pv = "push --verbose";
|
||||
pdr = "push --dry-run";
|
||||
pf = "push --force-with-lease --force-if-includes";
|
||||
pfv = "push --verbose --force-with-lease --force-if-includes";
|
||||
pff = "push --force";
|
||||
pffv = "push --verbose --force";
|
||||
|
||||
f = "fetch";
|
||||
fa = "fetch --all --prune";
|
||||
|
||||
pl = "pull";
|
||||
plr = "pull --rebase";
|
||||
|
||||
sub = "submodule";
|
||||
subu = "submodule update --init --recursive";
|
||||
|
||||
r = "remote";
|
||||
rv = "remote --verbose";
|
||||
ra = "remote add";
|
||||
rrm = "remote remove";
|
||||
rmv = "remote rename";
|
||||
rset = "remote set-url";
|
||||
rup = "remote update";
|
||||
|
||||
### Logs ###
|
||||
|
||||
# Current branch.
|
||||
l = "log --pretty=lc --graph";
|
||||
lo = "log --pretty=lo --graph --date=human";
|
||||
ls = "log --pretty=lo --graph --date=human --simplify-by-decoration";
|
||||
lf = "log --pretty=lf --graph";
|
||||
ld = "log --pretty=lf --graph --cc --stat";
|
||||
lp = "log --pretty=lf --graph --cc --patch";
|
||||
|
||||
lr = "log -5 --pretty=lc --graph";
|
||||
lro = "log -5 --pretty=lo --graph --date=human";
|
||||
lrs = "log -5 --pretty=lo --graph --date=human --simplify-by-decoration";
|
||||
lrf = "log -5 --pretty=lf --graph";
|
||||
lrd = "log -5 --pretty=lf --graph --cc --stat";
|
||||
lrp = "log -5 --pretty=lf --graph --cc --patch";
|
||||
|
||||
# All branches on all remotes.
|
||||
la = "log --pretty=lc --graph --all";
|
||||
lao = "log --pretty=lo --graph --all --date=human";
|
||||
las = "log --pretty=lo --graph --all --date=human --simplify-by-decoration";
|
||||
laf = "log --pretty=lf --graph --all";
|
||||
lad = "log --pretty=lf --graph --all --cc --stat";
|
||||
lap = "log --pretty=lf --graph --all --cc --patch";
|
||||
|
||||
lar = "log -5 --pretty=lc --graph --all";
|
||||
laro = "log -5 --pretty=lo --graph --all --date=human";
|
||||
lars = "log -5 --pretty=lo --graph --all --date=human --simplify-by-decoration";
|
||||
larf = "log -5 --pretty=lf --graph --all";
|
||||
lard = "log -5 --pretty=lf --graph --all --cc --stat";
|
||||
larp = "log -5 --pretty=lf --graph --all --cc --patch";
|
||||
|
||||
### Shortcuts ###
|
||||
|
||||
nevermind = "!git reset --hard head && git clean -df";
|
||||
|
||||
open = lib.mkIf (config.programs.fish.enable && (fish_fns ? git_open)) "!fish -c git_open";
|
||||
|
||||
chash = "!git log --oneline | gum filter --height 10 | cut -d' ' -f1 | cb &>/dev/null";
|
||||
};
|
||||
};
|
||||
|
||||
# ███╗ ███╗██╗███████╗ ██████╗
|
||||
# ████╗ ████║██║██╔════╝██╔════╝
|
||||
# ██╔████╔██║██║███████╗██║
|
||||
# ██║╚██╔╝██║██║╚════██║██║
|
||||
# ██║ ╚═╝ ██║██║███████║╚██████╗
|
||||
# ╚═╝ ╚═╝╚═╝╚══════╝ ╚═════╝
|
||||
|
||||
home.shellAbbrs = {
|
||||
g = "git";
|
||||
};
|
||||
|
||||
programs.fish.functions = lib.mkIf config.programs.fish.enable {
|
||||
git_develop_branch = # fish
|
||||
''
|
||||
command git rev-parse --git-dir &>/dev/null || return
|
||||
set -l branch
|
||||
|
||||
for branch in dev devel develop development
|
||||
if command git show-ref -q --verify refs/heads/$branch
|
||||
echo $branch
|
||||
return 0
|
||||
end
|
||||
end
|
||||
|
||||
echo develop
|
||||
return 1
|
||||
'';
|
||||
|
||||
git_main_branch = # fish
|
||||
''
|
||||
command git rev-parse --git-dir &>/dev/null || return
|
||||
set -l ref
|
||||
|
||||
for ref in
|
||||
refs/{heads,remotes/{origin,upstream}}/{main,trunk,mainline,default,master}
|
||||
if command git show-ref -q --verify $ref
|
||||
echo (basename $ref)
|
||||
return 0
|
||||
end
|
||||
end
|
||||
|
||||
echo main
|
||||
return 1
|
||||
'';
|
||||
|
||||
git_current_branch = # fish
|
||||
''
|
||||
set -l ref (git symbolic-ref --quiet HEAD 2>/dev/null)
|
||||
set -l ret $status
|
||||
|
||||
if [ $ret -ne 0 ]
|
||||
[ $ret -eq 128 ] && return # no git repo
|
||||
set ref (git rev-parse --short HEAD 2>/dev/null) || return
|
||||
end
|
||||
|
||||
echo (string replace "refs/heads/" "" $ref)
|
||||
'';
|
||||
|
||||
git_open = # fish
|
||||
''
|
||||
set -f origin "$(git remote get-url origin)"
|
||||
|
||||
switch "$origin"
|
||||
case "*github*"
|
||||
if command -v gh &>/dev/null
|
||||
gh repo view --web &>/dev/null
|
||||
else
|
||||
set_color red
|
||||
echo "[ERROR] Install gh-cli to open Github repos." >&2
|
||||
set_color normal
|
||||
return 1
|
||||
end
|
||||
case "https://*"
|
||||
open '$origin' >/dev/null &
|
||||
case "*"
|
||||
set_color red
|
||||
printf "[ERROR] Unrecognized origin %s" "$origin" >&2
|
||||
return 1
|
||||
end
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
||||
# ███╗ ██╗ ██████╗ ████████╗███████╗███████╗
|
||||
# ████╗ ██║██╔═══██╗╚══██╔══╝██╔════╝██╔════╝
|
||||
# ██╔██╗ ██║██║ ██║ ██║ █████╗ ███████╗
|
||||
# ██║╚██╗██║██║ ██║ ██║ ██╔══╝ ╚════██║
|
||||
# ██║ ╚████║╚██████╔╝ ██║ ███████╗███████║
|
||||
# ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚══════╝╚══════╝
|
||||
|
||||
# PATH VALUES:
|
||||
# :/ - all files within the root of the working tree, so all files in the
|
||||
# repo, a la git add's --all option.
|
||||
|
||||
# A note on reset, restore, and revert, paraphrased from `man git`, plus my
|
||||
# own on `rm`:
|
||||
#
|
||||
# revert - make a new commit that reverts a previous commit.
|
||||
# restore - undo uncommitted changes in the working tree.
|
||||
# reset - update the branch and change commit history.
|
||||
# rm - same as system rm; remove files, either from git's knowledge, the
|
||||
# working directory, or both.
|
||||
#
|
||||
# These are not a description of the *possible* uses, rather a narrowing of
|
||||
# the *intended* uses.
|
6
home/programs/just.nix
Normal file
6
home/programs/just.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
home.packages = with pkgs; [
|
||||
just
|
||||
];
|
||||
}
|
9
home/programs/rbw.nix
Normal file
9
home/programs/rbw.nix
Normal file
|
@ -0,0 +1,9 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
programs.rbw = {
|
||||
enable = true;
|
||||
|
||||
settings.email = "bitwarden@punkfairie.net";
|
||||
settings.pinentry = pkgs.pinentry-rofi;
|
||||
};
|
||||
}
|
6
home/programs/ripgrep.nix
Normal file
6
home/programs/ripgrep.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
{ ... }:
|
||||
{
|
||||
programs.ripgrep = {
|
||||
enable = true;
|
||||
};
|
||||
}
|
|
@ -142,4 +142,9 @@
|
|||
bind -T copy-mode-vi Escape if-shell -F '#{selection_present}' 'send -X clear-selection' 'send -X cancel'
|
||||
'';
|
||||
};
|
||||
|
||||
home.shellAbbrs = {
|
||||
tmain = "tmux new -s main -A";
|
||||
tmobile = "tmux new -s mobile -A";
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,14 +1,16 @@
|
|||
{ ... }:
|
||||
{
|
||||
home.shellAbbrs = {
|
||||
jf = {
|
||||
position = "command";
|
||||
expansion = "sudo journalctl --follow --unit";
|
||||
};
|
||||
je = {
|
||||
position = "command";
|
||||
expansion = "sudo journalctl --pager-end --unit";
|
||||
};
|
||||
jctlf = "sudo journalctl --follow --unit";
|
||||
jctle = "sudo journalctl --pager-end --unit";
|
||||
|
||||
sctl = "sudo systemctl";
|
||||
sctls = "sudo systemctl status";
|
||||
sctle = "sudo systemctl enable --now";
|
||||
sctld = "sudo systemctl disable --now";
|
||||
sctlr = "sudo systemctl restart";
|
||||
sctla = "sudo systemctl start";
|
||||
sctlo = "sudo systemctl stop";
|
||||
};
|
||||
|
||||
imports = [
|
||||
|
|
Loading…
Reference in a new issue