simplify
This commit is contained in:
parent
69165bbbf7
commit
441a6b68d6
7 changed files with 2 additions and 189 deletions
10
.envrc
10
.envrc
|
@ -1,9 +1 @@
|
||||||
watch_file flake.nix
|
use flake
|
||||||
watch_file flake.lock
|
|
||||||
|
|
||||||
DEVENV_ROOT_FILE="$(mktemp)"
|
|
||||||
printf %s "$PWD" > "$DEVENV_ROOT_FILE"
|
|
||||||
if ! use flake . --override-input devenv-root "file+file://$DEVENV_ROOT_FILE"
|
|
||||||
then
|
|
||||||
echo "devenv could not be built. The devenv environment was not loaded. Make the necessary changes to devenv.nix and hit enter to try again." >&2
|
|
||||||
fi
|
|
||||||
|
|
14
flake.nix
14
flake.nix
|
@ -7,11 +7,6 @@
|
||||||
weave.url = "git+https://codeberg.org/helvetica/weave.git";
|
weave.url = "git+https://codeberg.org/helvetica/weave.git";
|
||||||
};
|
};
|
||||||
|
|
||||||
nixConfig = {
|
|
||||||
extra-trusted-public-keys = "devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw=";
|
|
||||||
extra-substituters = "https://devenv.cachix.org";
|
|
||||||
};
|
|
||||||
|
|
||||||
outputs = {
|
outputs = {
|
||||||
nixpkgs,
|
nixpkgs,
|
||||||
flake-parts,
|
flake-parts,
|
||||||
|
@ -23,15 +18,8 @@
|
||||||
perSystem = {
|
perSystem = {
|
||||||
system,
|
system,
|
||||||
pkgs,
|
pkgs,
|
||||||
self',
|
|
||||||
lib,
|
|
||||||
...
|
...
|
||||||
}: {
|
}: {
|
||||||
packages = lib.packagesFromDirectoryRecursive {
|
|
||||||
inherit (pkgs) callPackage;
|
|
||||||
directory = ./packages;
|
|
||||||
};
|
|
||||||
|
|
||||||
devShells.default = pkgs.mkShellNoCC {
|
devShells.default = pkgs.mkShellNoCC {
|
||||||
packages = [
|
packages = [
|
||||||
inputs.weave.packages.${system}.default
|
inputs.weave.packages.${system}.default
|
||||||
|
@ -41,7 +29,7 @@
|
||||||
root=$(git rev-parse --show-toplevel)
|
root=$(git rev-parse --show-toplevel)
|
||||||
|
|
||||||
export WEAVE_FROM=$root/home
|
export WEAVE_FROM=$root/home
|
||||||
export WEAVE_HIST=$root/.weavecache
|
export WEAVE_HIST=$root/.weavehist
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,6 +0,0 @@
|
||||||
{
|
|
||||||
"workbench.colorTheme": "Orbi Blue",
|
|
||||||
"files.insertFinalNewline": true,
|
|
||||||
"nix.enableLanguageServer": true,
|
|
||||||
"php.suggest.basic": false
|
|
||||||
}
|
|
|
@ -1,29 +0,0 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
set -o errexit
|
|
||||||
set -o nounset
|
|
||||||
set -o pipefail
|
|
||||||
|
|
||||||
extensions=(
|
|
||||||
anishde12020.orbi
|
|
||||||
jnoortheen.nix-ide
|
|
||||||
llvm-vs-code-extensions.vscode-clangd
|
|
||||||
mkhl.direnv
|
|
||||||
phpactor.vscode-phpactor
|
|
||||||
rust-lang.rust-analyzer
|
|
||||||
tamasfe.even-better-toml
|
|
||||||
vscodevim.vim
|
|
||||||
xdebug.php-debug
|
|
||||||
"$@"
|
|
||||||
)
|
|
||||||
|
|
||||||
if ! hash codium; then
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
args=()
|
|
||||||
for ext in "${extensions[@]}"; do
|
|
||||||
args+=(--install-extension "$ext")
|
|
||||||
done
|
|
||||||
|
|
||||||
codium "${args[@]}"
|
|
|
@ -1,6 +0,0 @@
|
||||||
{writeShellApplication}:
|
|
||||||
writeShellApplication {
|
|
||||||
name = "codeinit";
|
|
||||||
|
|
||||||
text = builtins.readFile ./codeinit.bash;
|
|
||||||
}
|
|
|
@ -1,6 +0,0 @@
|
||||||
{writeShellApplication}:
|
|
||||||
writeShellApplication {
|
|
||||||
name = "plow";
|
|
||||||
|
|
||||||
text = builtins.readFile ./plow.bash;
|
|
||||||
}
|
|
|
@ -1,120 +0,0 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
set -o errexit
|
|
||||||
set -o nounset
|
|
||||||
set -o pipefail
|
|
||||||
|
|
||||||
progname="$0"
|
|
||||||
|
|
||||||
error() {
|
|
||||||
local line
|
|
||||||
for line in "$@"; do
|
|
||||||
echo "$progname: $line" 1>&2
|
|
||||||
done
|
|
||||||
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
shopt -s nullglob globstar
|
|
||||||
|
|
||||||
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" \
|
|
||||||
-- "$@"
|
|
||||||
)
|
|
||||||
|
|
||||||
eval set -- "$args"
|
|
||||||
|
|
||||||
from=${PLOW_FROM:-$PWD}
|
|
||||||
to=${PLOW_TO:-$HOME}
|
|
||||||
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
|
|
||||||
done
|
|
||||||
|
|
||||||
from=$(realpath --strip -- "$from")
|
|
||||||
to=$(realpath --strip -- "$to")
|
|
||||||
|
|
||||||
if (($# > 0)); then
|
|
||||||
choices=("$@")
|
|
||||||
else
|
|
||||||
choices=()
|
|
||||||
for dir in "$from"/*/; do
|
|
||||||
choices+=("$(basename -- "$dir")")
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
|
|
||||||
shopt -s dotglob
|
|
||||||
|
|
||||||
cache=()
|
|
||||||
if [[ -n $PLOW_CACHE ]]; then
|
|
||||||
if [[ -r $PLOW_CACHE ]]; then
|
|
||||||
while IFS= read -r link; do
|
|
||||||
cache+=("$link")
|
|
||||||
done <"$PLOW_CACHE"
|
|
||||||
fi
|
|
||||||
|
|
||||||
: >"$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
|
|
||||||
done
|
|
||||||
|
|
||||||
for link in "${cache[@]}"; do
|
|
||||||
if [[ -L "$link" && ! -f "$link" ]]; then
|
|
||||||
rm "${rmflags[@]}" -- "$link"
|
|
||||||
fi
|
|
||||||
done
|
|
Loading…
Add table
Add a link
Reference in a new issue