pluh 🗣
This commit is contained in:
parent
fa30c4d826
commit
92f097cb82
|
@ -2,13 +2,7 @@
|
|||
|
||||
My dotfiles.
|
||||
|
||||
## Installing packages
|
||||
|
||||
```shell
|
||||
pacman --sync - < packages.txt
|
||||
```
|
||||
|
||||
## Installing dotfiles
|
||||
## Usage
|
||||
|
||||
```shell
|
||||
plow --force --verbose
|
||||
|
|
65
flake.lock
65
flake.lock
|
@ -14,11 +14,11 @@
|
|||
"nixpkgs": "nixpkgs"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1728672398,
|
||||
"narHash": "sha256-KxuGSoVUFnQLB2ZcYODW7AVPAh9JqRlD5BrfsC/Q4qs=",
|
||||
"lastModified": 1737621947,
|
||||
"narHash": "sha256-8HFvG7fvIFbgtaYAY2628Tb89fA55nPm2jSiNs0/Cws=",
|
||||
"owner": "cachix",
|
||||
"repo": "cachix",
|
||||
"rev": "aac51f698309fd0f381149214b7eee213c66ef0a",
|
||||
"rev": "f65a3cd5e339c223471e64c051434616e18cc4f5",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -37,11 +37,11 @@
|
|||
"nixpkgs": "nixpkgs_3"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1735241861,
|
||||
"narHash": "sha256-n8Ww/v5eCKi0+zGe+5nfAPpxGsYu4MRWokWyzryswS4=",
|
||||
"lastModified": 1740851740,
|
||||
"narHash": "sha256-urr8VnD7dXWd6io9DmwVlboa0Or9ygsahx1UAft7ZxY=",
|
||||
"owner": "cachix",
|
||||
"repo": "devenv",
|
||||
"rev": "991abff153b995192bf36655394246fc97ba8627",
|
||||
"rev": "56e488989b3d72cd8e30ddd419e879658609bf88",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -65,11 +65,11 @@
|
|||
"flake-compat": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1696426674,
|
||||
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
|
||||
"lastModified": 1733328505,
|
||||
"narHash": "sha256-NeCCThCEP3eCl2l/+27kNNK7QrwZB1IJCrXfrbv5oqU=",
|
||||
"owner": "edolstra",
|
||||
"repo": "flake-compat",
|
||||
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
|
||||
"rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -105,11 +105,11 @@
|
|||
"nixpkgs-lib": "nixpkgs-lib"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1733312601,
|
||||
"narHash": "sha256-4pDvzqnegAfRkPwO3wmwBhVi/Sye1mzps0zHWYnP88c=",
|
||||
"lastModified": 1738453229,
|
||||
"narHash": "sha256-7H9XgNiGLKN1G1CgRh0vUL4AheZSYzPm+zmZ7vxbJdo=",
|
||||
"owner": "hercules-ci",
|
||||
"repo": "flake-parts",
|
||||
"rev": "205b12d8b7cd4802fbcb8e8ef6a0f1408781a4f9",
|
||||
"rev": "32ea77a06711b758da0ad9bd6a844c5740a87abd",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -127,17 +127,14 @@
|
|||
"nixpkgs": [
|
||||
"devenv",
|
||||
"nixpkgs"
|
||||
],
|
||||
"nixpkgs-stable": [
|
||||
"devenv"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1730302582,
|
||||
"narHash": "sha256-W1MIJpADXQCgosJZT8qBYLRuZls2KSiKdpnTVdKBuvU=",
|
||||
"lastModified": 1740849354,
|
||||
"narHash": "sha256-oy33+t09FraucSZ2rZ6qnD1Y1c8azKKmQuCvF2ytUko=",
|
||||
"owner": "cachix",
|
||||
"repo": "git-hooks.nix",
|
||||
"rev": "af8a16fe5c264f5e9e18bcee2859b40a656876cf",
|
||||
"rev": "4a709a8ce9f8c08fa7ddb86761fe488ff7858a07",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -203,11 +200,11 @@
|
|||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1727438425,
|
||||
"narHash": "sha256-X8ES7I1cfNhR9oKp06F6ir4Np70WGZU5sfCOuNBEwMg=",
|
||||
"lastModified": 1734114420,
|
||||
"narHash": "sha256-n52PUzub5jZWc8nI/sR7UICOheU8rNA+YZ73YaHeCBg=",
|
||||
"owner": "domenkozar",
|
||||
"repo": "nix",
|
||||
"rev": "f6c5ae4c1b2e411e6b1e6a8181cc84363d6a7546",
|
||||
"rev": "bde6a1a0d1f2af86caa4d20d23eca019f3d57eee",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -219,11 +216,11 @@
|
|||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1730531603,
|
||||
"narHash": "sha256-Dqg6si5CqIzm87sp57j5nTaeBbWhHFaVyG7V6L8k3lY=",
|
||||
"lastModified": 1733212471,
|
||||
"narHash": "sha256-M1+uCoV5igihRfcUKrr1riygbe73/dzNnzPsmaLCmpo=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "7ffd9ae656aec493492b44d0ddfb28e79a1ea25d",
|
||||
"rev": "55d15ad12a74eb7d4646254e13638ad0c4128776",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -235,14 +232,14 @@
|
|||
},
|
||||
"nixpkgs-lib": {
|
||||
"locked": {
|
||||
"lastModified": 1733096140,
|
||||
"narHash": "sha256-1qRH7uAUsyQI7R1Uwl4T+XvdNv778H0Nb5njNrqvylY=",
|
||||
"lastModified": 1738452942,
|
||||
"narHash": "sha256-vJzFZGaCpnmo7I6i416HaBLpC+hvcURh/BQwROcGIp8=",
|
||||
"type": "tarball",
|
||||
"url": "https://github.com/NixOS/nixpkgs/archive/5487e69da40cbd611ab2cadee0b4637225f7cfae.tar.gz"
|
||||
"url": "https://github.com/NixOS/nixpkgs/archive/072a6db25e947df2f31aab9eccd0ab75d5b2da11.tar.gz"
|
||||
},
|
||||
"original": {
|
||||
"type": "tarball",
|
||||
"url": "https://github.com/NixOS/nixpkgs/archive/5487e69da40cbd611ab2cadee0b4637225f7cfae.tar.gz"
|
||||
"url": "https://github.com/NixOS/nixpkgs/archive/072a6db25e947df2f31aab9eccd0ab75d5b2da11.tar.gz"
|
||||
}
|
||||
},
|
||||
"nixpkgs_2": {
|
||||
|
@ -263,11 +260,11 @@
|
|||
},
|
||||
"nixpkgs_3": {
|
||||
"locked": {
|
||||
"lastModified": 1716977621,
|
||||
"narHash": "sha256-Q1UQzYcMJH4RscmpTkjlgqQDX5yi1tZL0O345Ri6vXQ=",
|
||||
"lastModified": 1733477122,
|
||||
"narHash": "sha256-qamMCz5mNpQmgBwc8SB5tVMlD5sbwVIToVZtSxMph9s=",
|
||||
"owner": "cachix",
|
||||
"repo": "devenv-nixpkgs",
|
||||
"rev": "4267e705586473d3e5c8d50299e71503f16a6fb6",
|
||||
"rev": "7bd9e84d0452f6d2e63b6e6da29fe73fac951857",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -279,11 +276,11 @@
|
|||
},
|
||||
"nixpkgs_4": {
|
||||
"locked": {
|
||||
"lastModified": 1735291276,
|
||||
"narHash": "sha256-NYVcA06+blsLG6wpAbSPTCyLvxD/92Hy4vlY9WxFI1M=",
|
||||
"lastModified": 1740695751,
|
||||
"narHash": "sha256-D+R+kFxy1KsheiIzkkx/6L63wEHBYX21OIwlFV8JvDs=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "634fd46801442d760e09493a794c4f15db2d0cbb",
|
||||
"rev": "6313551cd05425cd5b3e63fe47dbc324eabb15e4",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
|
@ -13,6 +13,11 @@
|
|||
devenv.url = "github:cachix/devenv";
|
||||
};
|
||||
|
||||
nixConfig = {
|
||||
extra-trusted-public-keys = "devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw=";
|
||||
extra-substituters = "https://devenv.cachix.org";
|
||||
};
|
||||
|
||||
outputs = {
|
||||
nixpkgs,
|
||||
flake-parts,
|
||||
|
|
5
home/codium/.config/VSCodium/User/settings.json
Normal file
5
home/codium/.config/VSCodium/User/settings.json
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"workbench.colorTheme": "Orbi Blue",
|
||||
"files.insertFinalNewline": true,
|
||||
"nix.enableLanguageServer": true
|
||||
}
|
|
@ -12,10 +12,10 @@ if status is-interactive
|
|||
set fish_cursor_replace_one underscore blink
|
||||
set fish_cursor_visual block
|
||||
|
||||
if set -q XDG_CONFIG_HOME
|
||||
set -x RIPGREP_CONFIG_PATH $XDG_CONFIG_HOME/ripgrep/ripgreprc
|
||||
else
|
||||
set -x RIPGREP_CONFIG_PATH ~/.config/ripgrep/ripgreprc
|
||||
begin
|
||||
set --local parent $XDG_CONFIG_HOME
|
||||
test -z $parent && set parent ~/.config
|
||||
set --export RIPGREP_CONFIG_PATH $parent/ripgrep/ripgreprc
|
||||
end
|
||||
|
||||
if type -q direnv
|
||||
|
@ -27,9 +27,13 @@ if status is-interactive
|
|||
end
|
||||
|
||||
if type -q nix
|
||||
fish_add_path ~/.local/state/nix/profile/bin
|
||||
set --local parent $XDG_STATE_HOME
|
||||
test -z $parent && set parent ~/.local/state
|
||||
fish_add_path $parent/nix/profile/bin
|
||||
end
|
||||
|
||||
fish_add_path ~/.local/bin
|
||||
|
||||
abbr --add l ls
|
||||
abbr --add lsa ls -a
|
||||
abbr --add la ls -a
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
auto-optimise-store = true
|
||||
experimental-features = nix-command flakes
|
||||
use-xdg-base-directories = true
|
||||
substituters = https://cache.nixos.org https://fossar.cachix.org
|
||||
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= fossar.cachix.org-1:Zv6FuqIboeHPWQS7ysLCJ7UT7xExb4OE8c4LyGb5AsE=
|
||||
|
|
12
packages.txt
12
packages.txt
|
@ -1,12 +0,0 @@
|
|||
bash
|
||||
direnv
|
||||
fd
|
||||
fish
|
||||
git
|
||||
gitui
|
||||
helix
|
||||
nix
|
||||
ripgrep
|
||||
starship
|
||||
wl-clipboard
|
||||
zellij
|
148
plow/plow.bash
148
plow/plow.bash
|
@ -7,26 +7,26 @@ set -o pipefail
|
|||
progname="$0"
|
||||
|
||||
error() {
|
||||
local line
|
||||
for line in "$@"; do
|
||||
echo "$progname: $line" 1>&2
|
||||
done
|
||||
local line
|
||||
for line in "$@"; do
|
||||
echo "$progname: $line" 1>&2
|
||||
done
|
||||
|
||||
exit 1
|
||||
exit 1
|
||||
}
|
||||
|
||||
shopt -s nullglob globstar
|
||||
|
||||
if [[ ! -v PLOW_CACHE ]]; then
|
||||
PLOW_CACHE=.plowcache
|
||||
if [[ ! -v PLOW_CACHE || -z $PLOW_CACHE ]]; then
|
||||
PLOW_CACHE=.plowcache
|
||||
fi
|
||||
|
||||
args=$(
|
||||
getopt \
|
||||
--options f:t:Fivm: \
|
||||
--longoptions from:,to:,force,interactive,verbose,directory-mode: \
|
||||
--name "$0" \
|
||||
-- "$@"
|
||||
getopt \
|
||||
--options f:t:Fivm: \
|
||||
--longoptions from:,to:,force,interactive,verbose,directory-mode: \
|
||||
--name "$0" \
|
||||
-- "$@"
|
||||
)
|
||||
|
||||
eval set -- "$args"
|
||||
|
@ -37,84 +37,84 @@ lnflags=()
|
|||
mkdirflags=()
|
||||
rmflags=()
|
||||
while true; do
|
||||
case "$1" in
|
||||
-f | --from)
|
||||
from=$2
|
||||
shift 2
|
||||
;;
|
||||
-t | --to)
|
||||
to=$2
|
||||
shift 2
|
||||
;;
|
||||
-F | --force)
|
||||
lnflags+=(--force)
|
||||
rmflags+=(--force)
|
||||
shift
|
||||
;;
|
||||
-i | --interactive)
|
||||
lnflags+=(--interactive)
|
||||
rmflags+=(--interactive)
|
||||
shift
|
||||
;;
|
||||
-v | --verbose)
|
||||
lnflags+=(--verbose)
|
||||
mkdirflags+=(--verbose)
|
||||
rmflags+=(--verbose)
|
||||
shift
|
||||
;;
|
||||
-m | --directory-mode)
|
||||
mkdirflags+=(--mode "$2")
|
||||
shift 2
|
||||
;;
|
||||
--)
|
||||
shift
|
||||
break
|
||||
;;
|
||||
esac
|
||||
case "$1" in
|
||||
-f | --from)
|
||||
from=$2
|
||||
shift 2
|
||||
;;
|
||||
-t | --to)
|
||||
to=$2
|
||||
shift 2
|
||||
;;
|
||||
-F | --force)
|
||||
lnflags+=(--force)
|
||||
rmflags+=(--force)
|
||||
shift
|
||||
;;
|
||||
-i | --interactive)
|
||||
lnflags+=(--interactive)
|
||||
rmflags+=(--interactive)
|
||||
shift
|
||||
;;
|
||||
-v | --verbose)
|
||||
lnflags+=(--verbose)
|
||||
mkdirflags+=(--verbose)
|
||||
rmflags+=(--verbose)
|
||||
shift
|
||||
;;
|
||||
-m | --directory-mode)
|
||||
mkdirflags+=(--mode "$2")
|
||||
shift 2
|
||||
;;
|
||||
--)
|
||||
shift
|
||||
break
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
from=$(realpath --strip -- "$from")
|
||||
to=$(realpath --strip -- "$to")
|
||||
|
||||
if (( $# > 0 )); then
|
||||
choices=("$@")
|
||||
if (($# > 0)); then
|
||||
choices=("$@")
|
||||
else
|
||||
choices=()
|
||||
for dir in "$from"/*/; do
|
||||
choices+=("$(basename -- "$dir")")
|
||||
done
|
||||
choices=()
|
||||
for dir in "$from"/*/; do
|
||||
choices+=("$(basename -- "$dir")")
|
||||
done
|
||||
fi
|
||||
|
||||
shopt -s dotglob
|
||||
|
||||
cache=()
|
||||
if [[ -n "$PLOW_CACHE" ]]; then
|
||||
if [[ -e "$PLOW_CACHE" ]]; then
|
||||
while IFS= read -r link; do
|
||||
cache+=("$link")
|
||||
done < "$PLOW_CACHE"
|
||||
fi
|
||||
if [[ -n $PLOW_CACHE ]]; then
|
||||
if [[ -r $PLOW_CACHE ]]; then
|
||||
while IFS= read -r link; do
|
||||
cache+=("$link")
|
||||
done <"$PLOW_CACHE"
|
||||
fi
|
||||
|
||||
: > "$PLOW_CACHE"
|
||||
: >"$PLOW_CACHE"
|
||||
fi
|
||||
|
||||
for choice in "${choices[@]}"; do
|
||||
prefix=$from/$choice
|
||||
for target in "$prefix"/**/*; do
|
||||
if [[ -f "$target" ]]; then
|
||||
link=$to${target#"$prefix"}
|
||||
parent=$(dirname -- "$link")
|
||||
mkdir --parents "${mkdirflags[@]}" -- "$parent"
|
||||
ln --symbolic "${lnflags[@]}" -- "$target" "$link"
|
||||
if [[ -n "$PLOW_CACHE" ]]; then
|
||||
echo "$link" >> "$PLOW_CACHE"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
prefix=$from/$choice
|
||||
for target in "$prefix"/**/*; do
|
||||
if [[ -f $target ]]; then
|
||||
link=$to${target#"$prefix"}
|
||||
parent=$(dirname -- "$link")
|
||||
mkdir --parents "${mkdirflags[@]}" -- "$parent"
|
||||
ln --symbolic "${lnflags[@]}" -- "$target" "$link"
|
||||
if [[ -n "$PLOW_CACHE" ]]; then
|
||||
echo "$link" >>"$PLOW_CACHE"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
||||
for link in "${cache[@]}"; do
|
||||
if [[ -L "$link" && ! -f "$link" ]]; then
|
||||
rm "${rmflags[@]}" -- "$link"
|
||||
fi
|
||||
if [[ -L "$link" && ! -f "$link" ]]; then
|
||||
rm "${rmflags[@]}" -- "$link"
|
||||
fi
|
||||
done
|
||||
|
|
Loading…
Reference in a new issue