402 lines
8.7 KiB
Nix
402 lines
8.7 KiB
Nix
{ self
|
||
, config
|
||
, pkgs
|
||
, lib
|
||
, inputs
|
||
, system
|
||
, ...
|
||
}:
|
||
let
|
||
doomemacsSrc = builtins.fetchGit {
|
||
url = "https://github.com/doomemacs/doomemacs";
|
||
ref = "master";
|
||
rev = "56ce6cc284e8f4dd0cb0704dde6694a1b8e500ed";
|
||
};
|
||
neofetchThemesSrc = builtins.fetchGit {
|
||
url = "https://github.com/Chick2D/neofetch-themes";
|
||
ref = "main";
|
||
rev = "c7392136bed264258c9b8788b14410e1ff06d602";
|
||
};
|
||
myEmacs = (pkgs.emacsPackagesFor pkgs.emacs-unstable-pgtk).emacsWithPackages (epkgs:
|
||
with epkgs; [
|
||
vterm
|
||
treesit-grammars.with-all-grammars
|
||
inputs.nix-emacs-extra.packages."${system}".doom-dashboard
|
||
inputs.nix-emacs-extra.packages."${system}".ultra-scroll
|
||
]);
|
||
in
|
||
{
|
||
programs = {
|
||
alacritty = {
|
||
enable = true;
|
||
settings = {
|
||
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 = lib.mkOrder 199 ''
|
||
############################################
|
||
# Adds a seperating arrow inbetween commands
|
||
# ~ ls <----------- at 12:12
|
||
# some home folders
|
||
# ~ echo 123 <----------- at 12:13
|
||
# 123
|
||
# ~ _
|
||
############################################
|
||
function starship_transient_rprompt_func
|
||
set width "$(calc "($(tput cols)-12)/2")"
|
||
echo -n " <"
|
||
string repeat -n$width ─
|
||
echo -n " "
|
||
starship module time
|
||
end
|
||
|
||
any-nix-shell fish --info-right | source
|
||
if test -z $INSIDE_EMACS && test $TERM != linux ;
|
||
eval (${pkgs.zellij}/bin/zellij setup --generate-auto-start fish | string collect)
|
||
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;
|
||
|
||
jujutsu = {
|
||
enable = true;
|
||
settings = {
|
||
user = {
|
||
email = "tristan@vault81.de";
|
||
name = "Tristan Druyen";
|
||
};
|
||
};
|
||
};
|
||
|
||
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;
|
||
addKeysToAgent = "yes";
|
||
hashKnownHosts = true;
|
||
|
||
extraOptionOverrides = {
|
||
VerifyHostKeyDNS = "ask";
|
||
};
|
||
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;
|
||
enableFishIntegration = false;
|
||
};
|
||
|
||
zoxide.enable = true;
|
||
# zed-editor = {
|
||
# enable = true;
|
||
# };
|
||
};
|
||
|
||
services = {
|
||
ssh-agent.enable = true;
|
||
gpg-agent = {
|
||
enable = false;
|
||
# enable = true; # misbehaving atm
|
||
|
||
enableExtraSocket = true;
|
||
# enableSshSupport = true;
|
||
enableSshSupport = false;
|
||
pinentryPackage = lib.mkForce pkgs.pinentry-qt;
|
||
};
|
||
lorri.enable = true;
|
||
|
||
emacs = {
|
||
enable = true;
|
||
defaultEditor = true;
|
||
package = myEmacs;
|
||
socketActivation.enable = true;
|
||
};
|
||
};
|
||
|
||
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";
|
||
};
|
||
|
||
# TODO Disable gui apps & switch to emacs-git instead of pgtk on headless systems
|
||
packages = with pkgs; [
|
||
myEmacs
|
||
emacs-lsp-booster
|
||
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
|
||
texlive.combined.scheme-medium
|
||
tokei
|
||
tree-sitter
|
||
wget
|
||
wl-clipboard
|
||
zeal # GUI
|
||
zstd
|
||
neovim
|
||
lazydocker
|
||
sshx
|
||
bat
|
||
lazygit
|
||
xpipe
|
||
# surrealist
|
||
# surrealdb
|
||
pkgs.rage
|
||
pkgs.nh
|
||
pkgs.agenix-rekey
|
||
# android-studio-full
|
||
];
|
||
};
|
||
}
|