nix/home.nix

535 lines
12 KiB
Nix
Raw Normal View History

2024-09-18 12:03:23 +02:00
{
pkgs,
2025-04-10 14:48:36 +02:00
pkgs-unstable,
lib,
2024-09-18 12:03:23 +02:00
nixvim,
river-shifttags,
other-transcode,
2024-09-18 12:03:23 +02:00
kitty-unstable,
2024-10-02 15:23:06 +02:00
nix-doom-emacs-unstraightened,
2025-02-02 18:10:31 +01:00
cassowary,
2024-09-18 12:03:23 +02:00
...
}: let
username = "khais";
in {
imports = [
./stylix.nix
2024-08-14 12:10:46 +02:00
./wm
2024-08-14 13:48:04 +02:00
./direnv.nix
2024-10-02 15:23:06 +02:00
nix-doom-emacs-unstraightened
];
home = {
packages = with pkgs; [
# system tools & bragging
2024-09-18 12:03:23 +02:00
htop
2025-04-30 13:39:37 +02:00
fastfetch
2024-09-18 12:03:23 +02:00
ripgrep
usbutils
wget
curl
dua
du-dust
2024-09-18 12:03:23 +02:00
trashy
unzip
2024-10-02 15:22:33 +02:00
parallel
2025-03-16 14:12:31 +01:00
tcpdump
libqalculate
ouch
inetutils
2025-04-12 16:27:54 +02:00
fd
2025-10-13 13:24:31 +02:00
file
rclone
# used for yazi epub previews
epub-thumbnailer
# remote working
remmina
# communication
discord
# passwords
bitwarden-desktop
2025-02-27 16:09:04 +01:00
bitwarden-cli
# editors
2024-09-18 12:02:41 +02:00
nixvim
# make clipboard yanking work in neovim
# https://superuser.com/a/1803183
wl-clipboard
# wm river utils
2024-09-18 12:03:23 +02:00
playerctl
brightnessctl
river-shifttags
wlr-randr
mako
libnotify
# dev tools
2024-09-18 12:03:23 +02:00
gitu
lnav
# music
cmus
2024-09-17 17:31:13 +02:00
# music collection tools
2024-09-18 12:03:23 +02:00
picard
kid3
2024-09-17 17:31:13 +02:00
# audio
audacity
2025-01-18 12:28:58 +01:00
pavucontrol
2025-07-28 20:37:03 +02:00
openai-whisper
2024-09-18 12:03:02 +02:00
# video
mpv
other-transcode
2025-04-12 16:27:54 +02:00
ani-cli
# file sending
magic-wormhole
# drawing apps
2024-09-18 12:03:23 +02:00
krita
inkscape
2024-09-17 14:39:04 +02:00
# office apps
libreoffice-fresh
2025-07-27 09:46:56 +02:00
recoll
2025-08-05 17:17:08 +02:00
taskwarrior-tui
2025-05-04 14:25:32 +02:00
# spell check
ispell
hunspell
2025-07-27 14:40:32 +02:00
(aspellWithDicts (d: [d.fr d.de d.en]))
2025-07-27 10:06:36 +02:00
hunspellDicts.fr-moderne
hunspellDicts.de-de
hunspellDicts.en-us
# nixos tools
2024-09-18 12:03:23 +02:00
nh
nix-output-monitor
2024-10-07 11:22:12 +02:00
alejandra
2025-10-16 12:35:47 +02:00
nix-index
2024-10-09 15:58:15 +02:00
# archiving
archivebox
2025-01-18 12:28:58 +01:00
# games
lutris
2025-10-12 19:12:31 +02:00
wine64
2025-03-16 14:12:31 +01:00
prismlauncher
2025-01-19 18:33:43 +01:00
# ai
ollama
2025-02-02 18:10:31 +01:00
# windows
cassowary
# xmonad
# apparently this is needed for the haskell lsp
ghc
2025-02-09 13:19:01 +01:00
i3lock
xmobar
2025-02-10 16:17:09 +01:00
# show volume in xmobar
alsa-utils
2025-03-16 14:12:31 +01:00
# remote
rustdesk
# other lsps
nixd
nil
2025-05-24 13:26:50 +02:00
# used for jujutsu watch
watchman
];
file = {
# konsole configuration
".local/share/konsole/Nixos.profile".source = ./konsole/Nixos.profile;
".config/nixpkgs/config.nix".text = ''
{ allowUnfree = true; }
'';
};
sessionVariables = {
EDITOR = "hx";
};
inherit username;
homeDirectory = "/home/${username}";
stateVersion = "23.11";
};
nixpkgs.config.allowUnfree = true;
programs.git = {
enable = true;
userEmail = "khais.colin@gmail.com";
userName = "Khaïs COLIN";
# better diffs
diff-so-fancy.enable = true;
# always show diff in commits
extraConfig.commit.verbose = true;
};
programs.jujutsu = {
2025-04-10 14:48:36 +02:00
package = pkgs-unstable.jujutsu;
enable = true;
ediff = true;
settings = {
2025-10-14 10:19:57 +02:00
# monitor filesystem for changes for faster snapshots in large repos
fsmonitor = {
backend = "watchman";
2025-05-24 13:26:50 +02:00
# automatically snapshot on file changes
watchman.register-snapshot-trigger = true;
};
user = {
email = "khais.colin@gmail.com";
name = "Khaïs COLIN";
};
signing = {
behavior = "own";
backend = "ssh";
key = "/home/khais/.ssh/id_ed25519.pub";
};
ui = {
editor = "hx";
2024-12-24 13:05:59 +01:00
default-command = "log";
2024-12-29 16:07:33 +01:00
movement.edit = true;
# do not page if output fits on one screen
pager = "less -FRX";
2024-12-24 13:05:59 +01:00
};
fix.tools = {
clang-format = {
command = ["${pkgs.clang-tools}/bin/clang-format" "--assume-filename=$path"];
patterns = ["glob:'**/*.cpp'" "glob:'**/*.hpp'"];
};
whitespace = {
command = ["${pkgs.perl}/bin/perl" "-p" "-e" "s/ +$//" "$path"];
patterns = ["glob:'**/*'"];
};
};
templates.draft_commit_description = ''
concat(
description,
surround(
"\nJJ: This commit contains the following changes:\n", "",
indent("JJ: ", diff.stat(72)),
),
"\nJJ: ignore-rest\n",
diff.git(),
)
'';
aliases = {
tug = ["bookmark" "move" "--from" "heads(::@- & bookmarks())" "--to" "@-"];
};
2025-05-24 01:23:25 +02:00
git = {
write-change-id-header = true;
};
};
};
programs.zsh = {
enable = true;
enableVteIntegration = true;
prezto = {
enable = true;
};
shellAliases = {
gc = "git commit -v";
ga = "git add";
gst = "git status";
gp = "git push";
gd = "git diff";
gds = "git diff --staged";
vim = "hx";
vi = "hx";
# progress cp
# https://serverfault.com/questions/43014/copying-a-large-directory-tree-locally-cp-or-rsync
pcp = "rsync --info=progress2 --archive --hard-links --acls --xattrs --human-readable --sparse --stats";
};
2024-08-15 17:03:35 +02:00
initExtra = ''
# enable jj completion
source <(jj util completion zsh)
# bind ctrl-backspace to delete word
bindkey '^H' backward-kill-word
2024-08-15 17:03:35 +02:00
'';
};
2025-01-18 12:20:41 +01:00
programs.fish = {
enable = true;
shellAliases = {
vim = "hx";
vi = "hx";
2025-05-24 00:27:27 +02:00
cat = "bat";
2025-05-24 00:31:56 +02:00
ls = "eza";
2025-01-18 12:20:41 +01:00
# progress cp
# https://serverfault.com/questions/43014/copying-a-large-directory-tree-locally-cp-or-rsync
pcp = "rsync --info=progress2 --archive --hard-links --acls --xattrs --human-readable --sparse --stats";
};
};
programs.kitty = {
package = kitty-unstable;
enable = true;
keybindings = {
"super+shift+enter" = "new_os_window_with_cwd";
};
settings = {
text_fg_override_threshold = 10;
};
};
programs.fuzzel.enable = true;
programs.zellij.enable = true;
2024-08-24 12:39:49 +02:00
programs.ssh = {
enable = true;
matchBlocks = {
"quasar" = {
hostname = "109.199.126.230";
user = "root";
};
2025-04-12 16:38:52 +02:00
"*.005540.xyz" = {
port = 2201;
};
"005540.xyz" = {
port = 2201;
};
"void" = {
port = 2201;
};
"void.hummingbird-stork.ts.net" = {
port = 2201;
};
};
};
# default connection to qemu for virt-manager
dconf.settings = {
"org/virt-manager/virt-manager/connections" = {
autoconnect = ["qemu:///system"];
uris = ["qemu:///system"];
};
};
2024-09-09 13:12:59 +02:00
programs.beets = {
enable = true;
settings = {
directory = "/pile/Music";
library = "/pile/beets.db";
import = {
move = false;
copy = true;
incremental = false;
write = true;
};
2024-09-18 12:03:23 +02:00
plugins = ["lyrics" "web" "info" "edit"];
2024-09-09 13:12:59 +02:00
};
};
2024-09-13 14:22:22 +02:00
programs.yt-dlp = {
enable = true;
settings = {
embed-thumbnail = true;
embed-subs = true;
sub-langs = "all";
};
};
2024-10-02 15:23:06 +02:00
programs.doom-emacs = {
enable = true;
doomDir = ./doom.d;
extraBinPackages = with pkgs; [clang-tools nil nixd haskell-language-server ghc];
2024-10-02 15:23:06 +02:00
};
2024-11-09 21:04:00 +01:00
programs.yazi = {
enable = true;
enableFishIntegration = true;
plugins = {
epub-preview =
pkgs.fetchFromGitHub
{
owner = "kirasok";
repo = "epub-preview.yazi";
rev = "2e8079e4a7f6315de99a5b968ed5fda479f1f39c";
hash = "sha256-wHTR8frrFL3cUD8fvSTO+m/77wQ7auVjTZ1uCTB/UzU=";
};
2025-07-29 17:41:41 +02:00
quick-folder = ./quick-folder.yazi;
};
settings = {
plugin.prepend_previewers = [
{
mime = "application/epub+zip";
run = "epub-preview";
}
];
2025-07-29 17:21:02 +02:00
# larger rename box
input.rename_offset = [0 1 200 3];
};
2025-07-29 17:41:41 +02:00
keymap = {
mgr.prepend_keymap = [
{
on = ["g" "j"];
run = "cd ~/Johnny.Decimal";
desc = "Go to Johnny Decimal";
}
{
on = "A";
run = "create --dir";
desc = "Create directory";
}
{
on = "b";
run = ["plugin quick-folder"];
desc = "Create directory with name of hovered file and move selected files into it";
}
];
};
2024-11-09 21:04:00 +01:00
};
2025-02-09 13:19:01 +01:00
xsession.windowManager.xmonad = {
enable = true;
config = ./xmonad.hs;
enableContribAndExtras = true;
};
2025-02-27 14:48:50 +01:00
programs.xmobar = {
enable = true;
extraConfig = builtins.readFile ./xmobarrc;
};
2025-02-09 13:19:01 +01:00
programs.rofi.enable = true;
2025-02-27 16:09:04 +01:00
# email
programs.mbsync.enable = true;
programs.msmtp.enable = true;
2025-03-08 10:48:05 +01:00
programs.offlineimap.enable = true;
2025-02-27 16:09:04 +01:00
programs.lieer = {
enable = true;
};
accounts.email.accounts.gmail = {
address = "khais.colin@gmail.com";
lieer = {
enable = true;
settings.local_trash_tag = "killed";
sync.enable = true;
};
msmtp.enable = true;
notmuch.enable = true;
primary = true;
realName = "Khaïs COLIN";
signature = {
text = ''
Cordialement,
-- Khaïs COLIN
'';
showSignature = "append";
};
passwordCommand = "cat /home/khais/.home-manager-gmail-password";
userName = "khais.colin@gmail.com";
flavor = "gmail.com";
};
2025-03-08 10:48:05 +01:00
accounts.email.accounts.orange = {
address = "kh.col@orange.fr";
offlineimap = {
enable = true;
};
msmtp.enable = true;
notmuch.enable = true;
realName = "Khaïs COLIN";
signature = {
text = ''
Cordialement,
-- Khaïs COLIN
'';
showSignature = "append";
};
passwordCommand = "cat /home/khais/.home-manager-orange-password";
userName = "kh.col@orange.fr";
imap = {
host = "imap.orange.fr";
port = 993;
};
smtp = {
host = "smtp.orange.fr";
};
};
2025-02-27 16:09:04 +01:00
programs.notmuch = {
enable = true;
new = {
tags = ["new" "unread"];
};
hooks = {
2025-03-08 10:48:05 +01:00
preNew = "gmi sync --path ~/Maildir/gmail; offlineimap";
2025-02-27 16:09:04 +01:00
postNew = "afew --verbose --tag --new";
};
search.excludeTags = [
"killed"
"spam"
];
};
programs.afew = {
enable = true;
extraConfig = builtins.readFile ./afew.config;
};
programs.helix = {
enable = true;
ignores = [".jj/"];
settings = {
theme = lib.mkForce "modus_vivendi";
editor = {
cursor-shape = {
insert = "bar";
normal = "block";
select = "underline";
};
end-of-line-diagnostics = "hint";
};
};
};
2025-05-24 00:27:27 +02:00
programs.bat = {
enable = true;
config = {
style = ["header-filename" "grid" "rule"];
};
2025-05-24 00:27:27 +02:00
};
2025-05-24 00:31:56 +02:00
programs.eza = {
enable = true;
git = true;
icons = true;
};
2025-05-24 00:36:59 +02:00
programs.starship = {
enable = true;
settings = {
# short prompt timeout
command_timeout = 30;
# custom.jj = {
# command = ''
# jj log -r@ -n1 --ignore-working-copy --no-graph --color always -T '
# separate(" ",
# bookmarks.map(|x| truncate_end(10, x.name(), "…")).join(" "),
# tags.map(|x| truncate_end(10, x.name(), "…")).join(" "),
# surround("\"", "\"", truncate_end(24, description.first_line(), "…")),
# if(conflict, "conflict"),
# if(divergent, "divergent"),
# if(hidden, "hidden"), )
# '
# '';
# when = "jj root --ignore-working-copy";
# symbol = "jj";
# };
# custom.jjstate = {
# command = ''
# jj log -r@ -n1 --ignore-working-copy --no-graph --stat | tail -n1 | ${pkgs.sd}/bin/sd "(\d+) files? changed, (\d+) insertions?\(\+\), (\d+) deletions?\(-\)" ' ''${1}m ''${2}+ ''${3}-' | ${pkgs.sd}/bin/sd " 0." ""
# '';
# when = "jj root";
# };
git_state.disabled = true;
git_commit.disabled = true;
git_metrics.disabled = true;
git_branch.disabled = true;
};
2025-05-24 00:36:59 +02:00
};
2025-08-05 17:17:08 +02:00
# task management
programs.taskwarrior = {
enable = true;
package = pkgs.taskwarrior3;
};
}