nix/home-mods/shell/default.nix

355 lines
7.5 KiB
Nix
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{ self
, config
, pkgs
, lib
, ...
}:
let
doomemacsSrc = builtins.fetchGit {
url = "https://github.com/doomemacs/doomemacs";
ref = "master";
rev = "9620bb45ac4cd7b0274c497b2d9d93c4ad9364ee";
};
neofetchThemesSrc = builtins.fetchGit {
url = "https://github.com/Chick2D/neofetch-themes";
ref = "main";
rev = "c7392136bed264258c9b8788b14410e1ff06d602";
};
myEmacs = (pkgs.emacsPackagesFor pkgs.emacs-pgtk).emacsWithPackages (epkgs:
with epkgs; [
vterm
treesit-grammars.with-all-grammars
]);
in
{
programs = {
alacritty = {
enable = true;
settings = {
window.opacity = 0.88;
window.dimensions = {
lines = 40;
columns = 150;
};
};
};
bash = {
enable = true;
enableVteIntegration = true;
};
btop.enable = true;
direnv.enable = true;
fd.enable = true;
fzf.enable = true;
lsd = {
enable = true;
enableAliases = true;
};
fish = {
enable = true;
package = pkgs.fish;
interactiveShellInit = ''
if test -z $INSIDE_EMACS ;
eval (${pkgs.zellij}/bin/zellij setup --generate-auto-start fish | string collect)
end
any-nix-shell fish --info-right | source
function starship_transient_rprompt_func
set width "$(calc "($(tput cols)-12)/2")"
echo -n " <"
string repeat -n$width
echo -n " "
starship module time
end
cat /var/lib/rust-motd/motd
'';
loginShellInit = ''
'';
functions = {
ec = "emacsclient $argv";
ecc = "emacsclient -c $argv";
ecr = "emacsclient -r $argv";
ecrr = "emacsclient -r $argv";
};
plugins = [
{
name = "sponge";
src = pkgs.fetchFromGitHub {
owner = "meaningful-ooo";
repo = "sponge";
rev = "384299545104d5256648cee9d8b117aaa9a6d7be";
sha256 = "31d71950346d349762ca8da5f68e666bb9c05fce311096c616101584af999b5c";
};
}
];
};
git = {
enable = true;
userName = "Tristan Druyen";
userEmail = "tristan@vault81.de";
lfs = {
enable = true;
};
aliases = {
ci = "commit";
co = "checkout";
s = "status";
};
extraConfig = {
user.signingkey = "${config.home.homeDirectory}/.ssh/id_ed25519";
commit.gpgsign = true;
gpg.format = "ssh";
};
package = pkgs.git;
};
lazygit.enable = true;
nix-index = {
enable = true;
enableFishIntegration = true;
};
pandoc.enable = true;
rbw = {
enable = true;
settings = {
base_url = "https://bw.vlt81.de";
email = "tristandruyen@vault81.de";
};
};
starship = {
enable = true;
package = pkgs.starship;
enableTransience = true;
settings = {
format = lib.concatStrings [
"$username"
"$hostname"
"$localip"
"$directory"
"$vcsh"
"$fossil_branch"
"$fossil_metrics"
"$git_branch"
"$git_commit"
"$git_state"
"$git_metrics"
"$git_status"
"$docker_context"
"$package"
"$c"
"$cmake"
"$cobol"
"$daml"
"$dart"
"$deno"
"$dotnet"
"$elixir"
"$elm"
"$erlang"
"$fennel"
"$gleam"
"$golang"
"$haskell"
"$haxe"
"$helm"
"$java"
"$julia"
"$kotlin"
"$lua"
"$nim"
"$nodejs"
"$ocaml"
"$opa"
"$perl"
"$php"
"$python"
"$rlang"
"$red"
"$ruby"
"$rust"
"$scala"
"$solidity"
"$swift"
"$terraform"
"$typst"
"$vlang"
"$vagrant"
"$zig"
"$buf"
"$nix_shell"
"$conda"
"$spack"
"$memory_usage"
"$aws"
"$gcloud"
"$openstack"
"$azure"
"$nats"
"$direnv"
"$env_var"
"$crystal"
"$custom"
"$sudo"
"$cmd_duration"
"$line_break"
"$jobs"
"$battery"
"$status"
"$os"
"$container"
"$shell"
"$shlvl"
"$character"
];
direnv.disabled = false;
memory_usage.disabled = false;
shlvl = {
disabled = false;
format = "[$symbol]($style)";
repeat = true;
symbol = "";
repeat_offset = 2;
threshold = 0;
};
time.disabled = false;
};
};
ssh = {
enable = true;
package = pkgs.openssh;
matchBlocks = {
"he4" = {
host = "he4";
hostname = "he4.vault81.de";
user = "tristand";
identityFile = "~/.ssh/id_ed25519";
};
"he2" = {
host = "he2";
hostname = "he2.vault81.de";
user = "root";
identityFile = "~/.ssh/id_v81_ed25519";
};
"nixos-desk" = {
host = "nixos-desk";
hostname = "nixos-desk";
user = "tristand";
identityFile = "~/.ssh/id_v81_ed25519";
};
};
};
gpg.enable = true;
ripgrep = {
enable = true;
package = pkgs.ripgrep.override { withPCRE2 = true; };
};
zellij = {
enable = true;
};
zoxide.enable = true;
};
services = {
gpg-agent = {
enable = true;
enableExtraSocket = true;
enableSshSupport = true;
pinentryPackage = lib.mkForce pkgs.pinentry-qt;
};
lorri.enable = true;
emacs = {
enable = true;
defaultEditor = true;
package = myEmacs;
};
};
home = {
activation.setupEmacs = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
mkdir ~/.config/emacs -p
chmod u+rw -R ~/.config/emacs
cp -r ${doomemacsSrc}/. "$HOME/.config/emacs"
'';
activation.setupNeofetch = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
mkdir ~/.config/neofetch -p
chmod u+rw -R ~/.config/neofetch
cp ${neofetchThemesSrc}/normal/acenoster.conf "$HOME/.config/neofetch/config.conf"
'';
file.".config/doom" = {
recursive = true;
source = ../../ext/doom;
# onChange = "${config.home.homeDirectory}/.config/emacs/bin/doom sync";
};
sessionVariables = {
TERMINAL = "alacritty";
ZELLIJ_AUTO_EXIT = "true";
ZELLIJ_AUTO_ATTACH = "false";
};
packages = with pkgs; [
myEmacs
# asciinema
any-nix-shell
atool
aspell
aspellDicts.en
aspellDicts.en-computers
aspellDicts.en-science
aspellDicts.de
binutils
calc
cmake
curl
exercism
filezilla
gnutls
gnumake
gcc
imagemagick
libtool
neofetch
nil
nixpkgs-fmt
nodejs_20
tree
python312Full
python312Packages.epc
python312Packages.orjson
rust-motd
rcm
(lib.mkIf config.services.gpg-agent.enable
pinentry-emacs)
shellcheck
shfmt
statix
texlive.combined.scheme-full
tokei
tree-sitter
wget
wl-clipboard
zeal
zstd
neovim
lazydocker
zed-editor
];
};
}