nixos/home/cli.nix

157 lines
4.1 KiB
Nix
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{ config, pkgs, ... }:
{
imports = [
./packages/helix
];
home = {
username = "hms";
homeDirectory = "/home/hms";
# Packages
packages = with pkgs; [
xz
zip
unzip
ripgrep
tealdeer
zoxide
just
xclip
eza
];
# Bash configuration
shell.enableBashIntegration = true;
shellAliases = {
":q" = "exit";
"h" = "hx";
"o" = "xdg-open";
"rebuild" = "sudo nixos-rebuild switch --flake ~/dev/nixos";
"update" = "nix flake update --flake ~/dev/nixos";
"rm" = "rm -i";
"ls" = "eza --git-ignore -ls type";
};
stateVersion = "25.11";
};
programs.home-manager.enable = true;
programs.taskwarrior = {
enable = true;
dataLocation = "${config.home.homeDirectory}/.local/share/task";
colorTheme = "light-256";
config.editor = "hx";
config.taskd = {
server = "henri-saudubray.fr:53589";
certificate = "/home/hms/.task/keys/public.cert";
key = "/home/hms/.task/keys/private.key";
ca = "/home/hms/.task/keys/ca.cert";
credentials = "personal/hms/2f8f33f0-a0b3-4f61-aba7-4d2b8c9cfbc7";
};
config.report.ls.sort = "project-";
};
programs.jujutsu = {
enable = true;
settings.user.name = "Henri Saudubray";
settings.user.email = "henri.saudubray@proton.me";
settings.ui.default-command = "log";
settings.ui.diff-editor = ":builtin";
settings.signing.behavior = "own";
settings.signing.backend = "gpg";
};
programs.bat.enable = true;
programs.git = {
enable = true;
settings = {
user = {
email = "henri.saudubray@proton.me";
name = "Henri Saudubray";
};
init.defaultBranch = "main";
merge.conflictstyle = "diff3";
};
signing = {
format = "openpgp";
signByDefault = true;
key = "0x7065F57ED8856128";
};
ignores = [
".direnv"
];
};
programs.bash = {
enable = true;
initExtra = ''
export PS1=" \u@\h:\w \[\e[38;5;205m\]λ\[\e[0m\] "
task ls
mkdir -p ~/dwn
mkdir -p ~/tmp
rmdir ~/thunderbird 2>/dev/null
if [ "$(ls -A ~/dwn)" ]; then echo "TODO: organize dwn."; fi
if [ "$(ls -A ~/tmp)" ]; then echo "TODO:organize tmp."; fi
'';
};
programs.gpg.enable = true;
programs.zoxide = {
enable = true;
enableBashIntegration = true;
options = [ "--cmd cd" ];
};
programs.direnv = {
enable = true;
enableBashIntegration = true;
nix-direnv.enable = true;
};
xdg.userDirs = {
enable = true;
desktop = "${config.home.homeDirectory}/dsk";
documents = "${config.home.homeDirectory}/doc";
download = "${config.home.homeDirectory}/dwn";
music = "${config.home.homeDirectory}/aud";
pictures = "${config.home.homeDirectory}/img";
publicShare = "${config.home.homeDirectory}/pub";
templates = "${config.home.homeDirectory}/tpl";
videos = "${config.home.homeDirectory}/vid";
};
## FIXME: Find an alternative.
# systemd.user.services.helix-theme = {
# Unit = {
# Description = "Helix System Colour Scheme Synchronisation Service";
# Documentation = "https://github.com/helix-editor/helix/issues/2158";
# After = "gnome-session.target";
# };
# Install.WantedBy = [ "gnome-session.target" ];
# Service = {
# Type = "simple";
# RestartSec = 5;
# Restart = "always";
# ExecStart =
# let
# update-script = pkgs.writeShellScript "helix-theme-update" ''
# set -eu -o pipefail
# if [ "$1" = "default" ]; then
# sed -i 's/theme = ".*"/theme = "adwaita-light"/' \
# $HOME/.config/helix/config.toml
# else
# sed -i 's/theme = ".*"/theme = "adwaita-dark"/' \
# $HOME/.config/helix/config.toml
# fi
# killall -s SIGUSR1 hx
# '';
# in
# "${pkgs.writeShellScript "helix-theme-monitor" ''
# gsettings monitor org.gnome.desktop.interface color-scheme \
# | xargs -L1 bash -c "source ${update-script}"
# ''}";
# };
# };
}