Files
config/users/pbsds/home/default.nix

193 lines
4.5 KiB
Nix

# https://nix-community.github.io/home-manager/options.html
{ pkgs, lib, config, ... }:
{
#nixpkgs.config.allowUnfree = true;
home.stateVersion = "23.11";
imports = [
./profiles/bashrc.d
#./profiles/sops.nix
./profiles/bat.nix
#./profiles/xdg-ninja.nix
./profiles/git.nix
./profiles/pueue.nix
./profiles/gtk.nix
./profiles/micro.nix
./profiles/ast-grep.nix
./profiles/shell.nix
./profiles/ssh.nix
/* ./profiles/tmate.nix */
./profiles/update-diff.nix
./profiles/desktop/zed/remote.nix
];
# TODO: add remote-exec once packaged
programs.bash.initExtra = ''
# remote-exec
if command -v remote >/dev/null && command -v remote-quick >/dev/null; then
complete -F _command remote
complete -F _command remote-quick
fi
# TODO: remove
function atom_nix {
#nix-shell -p atom --run "atom $(printf "%q " "$@") --in-process-gpu --no-sandbox"
#nix-shell -p atom --run "atom $(printf "%q " "$@") --no-sandbox"
nix run nixpkgs#atom -- --disable-gpu --in-process-gpu --no-sandbox "$@"
}
nix-prefetch-sri() {
url="$1"; shift
nix hash to-sri --type sha256 "$@" "$(nix-prefetch-url "$url")"
}
'';
home.packages = with pkgs; [
xclip
#rmate-sh # TODO: add to ssh config
#remote-exec # TODO
shpool
zip
unrar
unzip
atool
p7zip
bzip2
gzip
atool
dos2unix
pandoc # TODO: latex
graphviz
visidata
typst
gallery-dl
yt-dlp
vgmstream
ffmpeg-full
/* (pkgs.termsvg or pkgs.unstable.termsvg) */
lolcat
toilet
boxes
tewisay
ponysay
# TODO: move to graphical? kiosk?
cage
mesa-demos
librespeed-cli
/* flox */
/* devenv */
/* cachix */
/* nix-template */
nix-output-monitor
nix-du
nix-tree
nix-visualize
nix-inspect
nix-btm
unstable.nixpkgs-review bubblewrap
unstable.nixpkgs-hammering
unstable.nix-update
unstable.nix-init
unstable.deadnix
unstable.statix
/* unstable.nixtract */
unstable.nixfmt-rfc-style
nurl
manix
#comma # collides with nix-index-database
nix-search-cli # nix-search
devenv
nix-fast-build
nix-eval-jobs
#cargo
#cargo-update
#cargo-edit
#nim
#nimble
poetry
(python3.withPackages (python-packages: with python-packages; [
matplotlib
more-itertools
numpy
#objexplore # TODO: package this, used in python interactive shell
ptpython
python-lsp-server
pyyaml
requests
rich
scipy
toml
virtualenv
]))
];
# https://docs.astral.sh/uv/configuration/files/
# https://docs.astral.sh/uv/reference/settings/
xdg.configFile."uv/uv.toml".source = (pkgs.formats.toml { }).generate "uv-config" {
python-downloads = "never";
python-preference = "only-system";
pip.index-url = "https://test.pypi.org/simple";
};
xdg.configFile."ptpython/config.py" = {
source = ./files/ptpython-config.py;
force = true;
};
home.shellAliases = {
flexget = "ssh -t noximilien sudo --user=flexget flexget -c /var/lib/flexget/flexget.yml"; # TODO: only applies to nox...
# hman = "man -H "; # HTML opened in a browser
tmux = "systemd-run --scope --user tmux"; # detach from ssh scope, surviving logout
/* shpool = "systemd-run --scope --user shpool"; # detach from ssh scope, surviving logout */
#TODO: vpn
# TODO: ps1?
pwd-fqdn = ''echo "$(whoami)@$(hostname -f):$(printf "%q" "$(realpath .)/")"'';
manix-fzf = ''manix "" 2>/dev/null | grep '^# ' | sed 's/^# \(.*\) (.*/\1/;s/ (.*//;s/^# //' | fzf --preview="manix '{}'" | xargs manix'';
killall = "killall -v";
# bin = "python -c 'import sys; sys.stdout.write(sys.stdin.read().strip())' | curl -is -X POST https://i.kuklef.se/upload -F content=@- -F expiration=10d | grep '^location:' | cut -d' ' -f2-";
bin = "${lib.getExe pkgs.netcat} termbin.com 9999";
denix = "sed -E 's@/nix/store/[^ /]+@@g'";
};
home.enableNixpkgsReleaseCheck = true;
xdg.enable = true;
#TODO: xdg.desktopEntries
/** /
programs.beets = {
enable = true;
settings = {
directory = "/mnt/meconium/beets_preprocessed/data";
#library = "/mnt/meconium/beets_preprocessed/library.db";
library = "${config.xdg.configHome}/beets/library_preprocessed.db";
#directory = "/mnt/meconium/beets_music/library";
#library = "${config.xdg.configHome}/beets/library_meconium.db";
##library = "/mnt/meconium/beets_music/data.db";
};
};
/**/
}