This commit is contained in:
Lukas Wurzinger 2025-03-25 18:48:52 +01:00
parent 92f097cb82
commit 64596a073c
No known key found for this signature in database
13 changed files with 192 additions and 404 deletions

View file

@ -3,9 +3,7 @@
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
devenv-root = {
url = "file+file:///dev/null";
flake = false;
@ -33,9 +31,13 @@
perSystem = {
pkgs,
self',
lib,
...
}: {
packages.plow = pkgs.callPackage ./plow {};
packages = lib.packagesFromDirectoryRecursive {
inherit (pkgs) callPackage;
directory = ./packages;
};
devenv.shells.default = {
devenv.root = let
@ -52,6 +54,7 @@
packages = [
self'.packages.plow
self'.packages.codeinit
];
};
};

View file

@ -1,8 +1,29 @@
# shellcheck shell=bash
shopt -s autocd globstar nullglob extglob checkwinsize
for rc in /etc/bashrc /etc/*.bashrc; do
if [[ -e $rc ]]; then
# shellcheck disable=SC1090
source "$rc"
fi
done
if hash direnv 2>/dev/null; then
eval "$(direnv hook bash)"
fi
if hash starship 2>/dev/null; then
eval "$(starship init bash)"
fi
if hash nix 2>/dev/null; then
export PATH=${XDG_STATE_HOME:-~/.local/state}/nix/profile/bin:$PATH
fi
if hash hx 2>/dev/null; then
export EDITOR=hx
export VISUAL=hx
fi
export PATH=~/.local/bin:$PATH

View file

@ -1,5 +1,6 @@
{
"workbench.colorTheme": "Orbi Blue",
"files.insertFinalNewline": true,
"nix.enableLanguageServer": true
"nix.enableLanguageServer": true,
"php.suggest.basic": false
}

View file

@ -32,6 +32,11 @@ if status is-interactive
fish_add_path $parent/nix/profile/bin
end
if type -q hx
set --export EDITOR hx
set --export VISUAL hx
end
fish_add_path ~/.local/bin
abbr --add l ls

View file

@ -1,12 +1,123 @@
[user]
name = Lukas Wurzinger
email = lukas@wrz.one
signingkey = ~/.ssh/id_ed25519.pub
# Error when the user has not explicitly been configured
useConfigOnly = true
[core]
# Global gitignore
excludesFile = ~/.config/git/ignore
# Don't paginate output by default
pager = cat
# Use Codium as default editor
editor = codium --wait
# Don't consider trailing space change as a cause for merge conflicts
whitespace = -trailing-space
[init]
defaultBranch = main
[gpg]
# Use SSH keys for signing
format = ssh
[commit]
# Sign commits
gpgsign = true
[push]
# Avoid having to manually set up remote branches
autoSetupRemote = true
[help]
# Only display suggestions
autoCorrect = 0
[color]
# Pretty
ui = auto
[diff]
# Use better, descriptive initials (c, i, w) instead of a/b.
mnemonicPrefix = true
# Show renames/moves as such
renames = true
# When using --word-diff, assume --word-diff-regex=.
wordRegex = .
# Display submodule-related information (commit listings)
submodule = log
# Use VSCode as default diff tool when running `git difftool`
tool = codium
[difftool]
prompt = false
[difftool "codium"]
cmd = codium --wait --diff -- "$LOCAL" "$REMOTE"
[fetch]
# Auto-fetch submodule changes (won't auto-update)
recurseSubmodules = on-demand
[grep]
break = true
heading = true
lineNumber = true
# Consider most regexes to be ERE
extendedRegexp = true
[log]
# Use abbrev SHAs whenever possible/relevant instead of full 40 chars
abbrevCommit = true
# Automatically --follow when given a single path
follow = true
[merge]
# Display common-ancestor blocks in conflict hunks
conflictStyle = diff3
# Disable fast-forward merges as default merge strategy
ff = false
[mergetool]
# Clean up backup files created by merge tools on tool exit
keepBackup = false
# Clean up temp files created by merge tools on tool exit
keepTemporaries = false
# Put the temp files in a dedicated dir anyway
writeToTemp = true
# Auto-accept file prompts when launching merge tools
prompt = false
[push]
# Default push should only push the current branch to its push target, regardless of its remote name
default = upstream
# When pushing, also push tags whose commit-ishs are now reachable upstream
followTags = true
[rebase]
# Automatically stash CWD and stage when running rebase
autoStash = true
[status]
# Display submodule rev change summaries in status
submoduleSummary = true
# Recursively traverse untracked directories to display all contents
showUntrackedFiles = all
[tag]
# Sort tags as version numbers whenever applicable
sort = version:refname
[alias]
# List available aliases
aliases = !git config --get-regexp '^alias\\.' | sed -E 's/^alias\\.//'
# Command shortcuts
ci = commit
co = checkout
st = status
sw = switch
rs = restore
# Update last commit with staged files without editing the commit message
oops = commit --amend --no-edit
# Ensure that force-pushing won't lose someone else's work (only mine)
push-with-lease = push --force-with-lease
# Replay each commit during rebase with the standard commit command which will trigger hooks
rebase-with-hooks = rebase --exec 'git reset --soft HEAD~1 && git commit -C HEAD@{1}'
# Review commit log
review = log --graph
# List local commits that were not pushed to remote repository
log-local = log @{push}..
review-local = review @{push}..
# Edit last commit message
reword = commit --amend
# Undo last commit but keep changed files in stage
uncommit = reset --soft HEAD~1
# Remove file(s) from Git but not from disk
untrack = rm --cached --
[includeIf "gitdir:~/Personal/"]
path = config-personal
[includeIf "gitdir:~/Work/"]
path = config-work
[include]
path = config-local

View file

@ -0,0 +1,4 @@
[user]
name = Lukas Wurzinger
email = lukas@wrz.one
signingkey = ~/.ssh/id_ed25519.pub

View file

@ -47,5 +47,9 @@ zig-cache/
zig-out/
.devenv*
devenv.local.nix
.direnv/
.devenv/
.pre-commit-config.yaml

View file

@ -1,191 +0,0 @@
# : Manager {{{
[manager]
cwd = { fg = "#94e2d5" }
# Hovered
hovered = { reversed = true }
preview_hovered = { underline = true }
# Find
find_keyword = { fg = "#f9e2af", bold = true, italic = true, underline = true }
find_position = { fg = "#f5c2e7", bg = "reset", bold = true, italic = true }
# Marker
marker_copied = { fg = "#a6e3a1", bg = "#a6e3a1" }
marker_cut = { fg = "#f38ba8", bg = "#f38ba8" }
marker_marked = { fg = "#94e2d5", bg = "#94e2d5" }
marker_selected = { fg = "#f9e2af", bg = "#f9e2af" }
# Tab
tab_active = { reversed = true }
tab_inactive = {}
tab_width = 1
# Count
count_copied = { fg = "#1e1e2e", bg = "#a6e3a1" }
count_cut = { fg = "#1e1e2e", bg = "#f38ba8" }
count_selected = { fg = "#1e1e2e", bg = "#f9e2af" }
# Border
border_symbol = "│"
border_style = { fg = "#7f849c" }
# : }}}
# : Mode {{{
[mode]
normal_main = { fg = "#1e1e2e", bg = "#89b4fa", bold = true }
normal_alt = { fg = "#89b4fa", bg = "#313244" }
# Select mode
select_main = { fg = "#1e1e2e", bg = "#a6e3a1", bold = true }
select_alt = { fg = "#a6e3a1", bg = "#313244" }
# Unset mode
unset_main = { fg = "#1e1e2e", bg = "#f2cdcd", bold = true }
unset_alt = { fg = "#f2cdcd", bg = "#313244" }
# : }}}
# : Status bar {{{
[status]
separator_open = ""
separator_close = ""
# Progress
progress_label = { fg = "#ffffff", bold = true }
progress_normal = { fg = "#89b4fa", bg = "#45475a" }
progress_error = { fg = "#f38ba8", bg = "#45475a" }
# Permissions
perm_sep = { fg = "#7f849c" }
perm_type = { fg = "#89b4fa" }
perm_read = { fg = "#f9e2af" }
perm_write = { fg = "#f38ba8" }
perm_exec = { fg = "#a6e3a1" }
# TODO: -- remove these once Yazi 0.4 gets released
separator_style = { fg = "#313244", bg = "#313244" }
mode_normal = { fg = "#1e1e2e", bg = "#89b4fa", bold = true }
mode_select = { fg = "#1e1e2e", bg = "#a6e3a1", bold = true }
mode_unset = { fg = "#1e1e2e", bg = "#f2cdcd", bold = true }
permissions_t = { fg = "#89b4fa" }
permissions_r = { fg = "#f9e2af" }
permissions_w = { fg = "#f38ba8" }
permissions_x = { fg = "#a6e3a1" }
permissions_s = { fg = "#7f849c" }
# TODO: remove these once Yazi 0.4 gets released --
# : }}}
# : Pick {{{
[pick]
border = { fg = "#89b4fa" }
active = { fg = "#f5c2e7", bold = true }
inactive = {}
# TODO: -- remove these once Yazi 0.4 gets released
[select]
border = { fg = "#89b4fa" }
active = { fg = "#f5c2e7", bold = true }
inactive = {}
# TODO: remove these once Yazi 0.4 gets released --
# : }}}
# : Input {{{
[input]
border = { fg = "#89b4fa" }
title = {}
value = {}
selected = { reversed = true }
# : }}}
# : Completion {{{
[completion]
border = { fg = "#89b4fa" }
# : }}}
# : Tasks {{{
[tasks]
border = { fg = "#89b4fa" }
title = {}
hovered = { fg = "#f5c2e7", underline = true }
# : }}}
# : Which {{{
[which]
mask = { bg = "#313244" }
cand = { fg = "#94e2d5" }
rest = { fg = "#9399b2" }
desc = { fg = "#f5c2e7" }
separator = "  "
separator_style = { fg = "#585b70" }
# : }}}
# : Help {{{
[help]
on = { fg = "#94e2d5" }
run = { fg = "#f5c2e7" }
hovered = { reversed = true, bold = true }
footer = { fg = "#313244", bg = "#cdd6f4" }
# : }}}
# : Notify {{{
[notify]
title_info = { fg = "#a6e3a1" }
title_warn = { fg = "#f9e2af" }
title_error = { fg = "#f38ba8" }
# : }}}
# : File-specific styles {{{
[filetype]
rules = [
# Images
{ mime = "image/*", fg = "#94e2d5" },
# Media
{ mime = "{audio,video}/*", fg = "#f9e2af" },
# Archives
{ mime = "application/*zip", fg = "#f5c2e7" },
{ mime = "application/x-{tar,bzip*,7z-compressed,xz,rar}", fg = "#f5c2e7" },
# Documents
{ mime = "application/{pdf,doc,rtf}", fg = "#a6e3a1" },
# Fallback
{ name = "*", fg = "#cdd6f4" },
{ name = "*/", fg = "#89b4fa" }
]
# : }}}

View file

@ -1,205 +0,0 @@
"$schema" = "https://yazi-rs.github.io/schemas/yazi.json"
[manager]
sort_by = "natural"
sort_sensitive = true
sort_reverse = false
sort_dir_first = true
sort_translit = true
linemode = "size"
show_hidden = false
show_symlink = true
scrolloff = 5
title_format = "Yazi: {cwd}"
[preview]
wrap = "no"
tab_size = 4
[opener]
# TODO
edit = [
{ run = '${EDITOR:-hx} "$@"', desc = "$EDITOR", block = true, for = "unix" },
]
open = [
{ run = 'xdg-open -- "$1"', desc = "Open", for = "unix" },
]
reveal = [
{ run = 'xdg-open -- "$(dirname -- "$1")"', desc = "Reveal", for = "unix" },
{ run = '''exiftool -- "$1"; echo "Press enter to exit"; read _''', block = true, desc = "Show EXIF", for = "unix" },
]
extract = [
{ run = 'ya pub extract --list "$@"', desc = "Extract here", for = "unix" },
]
play = [
{ run = 'xdg-open -- "$@"', orphan = true, for = "unix" },
{ run = '''mediainfo "$1"; echo "Press enter to exit"; read _''', block = true, desc = "Show media info", for = "unix" },
]
[open]
# TODO
rules = [
# Folder
{ name = "*/", use = [ "edit", "open", "reveal" ] },
# Text
{ mime = "text/*", use = [ "edit", "reveal" ] },
# Image
{ mime = "image/*", use = [ "open", "reveal" ] },
# Media
{ mime = "{audio,video}/*", use = [ "play", "reveal" ] },
# Archive
{ mime = "application/{zip,rar,7z*,tar,gzip,xz,zstd,bzip*,lzma,compress,archive,cpio,arj,xar,ms-cab*}", use = [ "extract", "reveal" ] },
# JSON
{ mime = "application/{json,ndjson}", use = [ "edit", "reveal" ] },
{ mime = "*/javascript", use = [ "edit", "reveal" ] },
# Empty file
{ mime = "inode/empty", use = [ "edit", "reveal" ] },
# Fallback
{ name = "*", use = [ "open", "reveal" ] },
]
[plugin]
# TODO
fetchers = [
# Mimetype
{ id = "mime", name = "*", run = "mime", if = "!mime", prio = "high" },
]
spotters = [
{ name = "*/", run = "folder" },
# Code
{ mime = "text/*", run = "code" },
{ mime = "*/{xml,javascript,wine-extension-ini}", run = "code" },
# Image
{ mime = "image/{avif,hei?,jxl,svg+xml}", run = "magick" },
{ mime = "image/*", run = "image" },
# Video
{ mime = "video/*", run = "video" },
# Fallback
{ name = "*", run = "file" },
]
preloaders = [
# Image
{ mime = "image/{avif,hei?,jxl,svg+xml}", run = "magick" },
{ mime = "image/*", run = "image" },
# Video
{ mime = "video/*", run = "video" },
# PDF
{ mime = "application/pdf", run = "pdf" },
# Font
{ mime = "font/*", run = "font" },
{ mime = "application/ms-opentype", run = "font" },
]
previewers = [
{ name = "*/", run = "folder", sync = true },
# Code
{ mime = "text/*", run = "code" },
{ mime = "*/{xml,javascript,wine-extension-ini}", run = "code" },
# JSON
{ mime = "application/{json,ndjson}", run = "json" },
# Image
{ mime = "image/{avif,hei?,jxl,svg+xml}", run = "magick" },
{ mime = "image/*", run = "image" },
# Video
{ mime = "video/*", run = "video" },
# PDF
{ mime = "application/pdf", run = "pdf" },
# Archive
{ mime = "application/{zip,rar,7z*,tar,gzip,xz,zstd,bzip*,lzma,compress,archive,cpio,arj,xar,ms-cab*}", run = "archive" },
{ mime = "application/{debian*-package,redhat-package-manager,rpm,android.package-archive}", run = "archive" },
{ name = "*.{AppImage,appimage}", run = "archive" },
# Virtual Disk / Disk Image
{ mime = "application/{iso9660-image,qemu-disk,ms-wim,apple-diskimage}", run = "archive" },
{ mime = "application/virtualbox-{vhd,vhdx}", run = "archive" },
{ name = "*.{img,fat,ext,ext2,ext3,ext4,squashfs,ntfs,hfs,hfsx}", run = "archive" },
# Font
{ mime = "font/*", run = "font" },
{ mime = "application/ms-opentype", run = "font" },
# Empty file
{ mime = "inode/empty", run = "empty" },
# Fallback
{ name = "*", run = "file" },
]
[input]
# TODO
cursor_blink = false
# cd
cd_title = "Change directory:"
cd_origin = "top-center"
cd_offset = [ 0, 2, 50, 3 ]
# create
create_title = [ "Create:", "Create (dir):" ]
create_origin = "top-center"
create_offset = [ 0, 2, 50, 3 ]
# rename
rename_title = "Rename:"
rename_origin = "hovered"
rename_offset = [ 0, 1, 50, 3 ]
# filter
filter_title = "Filter:"
filter_origin = "top-center"
filter_offset = [ 0, 2, 50, 3 ]
# find
find_title = [ "Find next:", "Find previous:" ]
find_origin = "top-center"
find_offset = [ 0, 2, 50, 3 ]
# search
search_title = "Search via {n}:"
search_origin = "top-center"
search_offset = [ 0, 2, 50, 3 ]
# shell
shell_title = [ "Shell:", "Shell (block):" ]
shell_origin = "top-center"
shell_offset = [ 0, 2, 50, 3 ]
[confirm]
# TODO
# trash
trash_title = "Trash {n} selected file{s}?"
trash_origin = "center"
trash_offset = [ 0, 0, 70, 20 ]
# delete
delete_title = "Permanently delete {n} selected file{s}?"
delete_origin = "center"
delete_offset = [ 0, 0, 70, 20 ]
# overwrite
overwrite_title = "Overwrite file?"
overwrite_content = "Will overwrite the following file:"
overwrite_origin = "center"
overwrite_offset = [ 0, 0, 50, 15 ]
# quit
quit_title = "Quit?"
quit_content = "The following task is still running, are you sure you want to quit?"
quit_origin = "center"
quit_offset = [ 0, 0, 50, 15 ]
[pick]
# TODO
open_title = "Open with:"
open_origin = "hovered"
open_offset = [ 0, 1, 50, 7 ]
[which]
# TODO
sort_by = "none"
sort_sensitive = false
sort_reverse = false
sort_translit = false

29
packages/codeinit/codeinit.bash Executable file
View file

@ -0,0 +1,29 @@
#!/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[@]}"

View file

@ -0,0 +1,6 @@
{writeShellApplication}:
writeShellApplication {
name = "codeinit";
text = builtins.readFile ./codeinit.bash;
}