grimm-nixos-laptop/common/tooling/default.nix
2024-06-13 22:56:30 +02:00

126 lines
2.4 KiB
Nix

{
pkgs,
config,
lib,
...
}:
let
inherit (config.grimmShared) enable tooling graphical;
inherit (lib)
mkEnableOption
getExe
optionals
mkIf
;
in
{
imports = [
# ./lilypond.nix
./nix.nix
./security.nix
./python.nix
./rust.nix
./lsp.nix
./helix.nix
./git.nix
./c.nix
./java.nix
./ranger.nix
];
config = mkIf (enable && tooling.enable) {
environment.systemPackages =
with pkgs;
[
(writeShellScriptBin "systemd-owner" "systemctl show -pUser,UID $@")
(writeShellScriptBin "tree" "${getExe eza} -T --git -lh --no-permissions --no-user --no-filesize --no-time")
(writeShellScriptBin "spawn" ''exec "$@" &> /dev/null &'')
urlencode
rfindup
pstree
file
wget
bat
hyfetch
btop
eza
starship
unzip
p7zip
fbcat
gomuks
imagemagick
nmap
parted
expect
]
++ optionals graphical [
wev
qdirstat
libva-utils
gparted
];
environment.shellAliases = {
":q" = "exit";
"ls" = "eza";
"lix" = "nix";
"l" = "eza -hla";
"vi" = "hx";
"bat" = "bat --theme=Dracula";
};
programs.tmux = {
enable = true;
historyLimit = 42000;
#keyMode = "vi";
};
programs.fzf.fuzzyCompletion = true;
environment.sessionVariables = {
MANPAGER = "sh -c 'col -bx | ${getExe pkgs.bat} -l man -p'";
MANROFFOPT = "-c";
};
# virtualisation.docker.enable = true;
services.dbus.implementation = "broker";
boot.tmp.cleanOnBoot = true;
zramSwap.enable = true;
#programs.ssh = {
# # startAgent = true;
# enableAskPassword = graphical;
# askPassword = mkIf graphical (getExe pkgs.lxqt.lxqt-openssh-askpass);
#};
programs.thefuck.enable = true;
programs.starship = {
enable = true;
settings = {
format = "$all$directory$character";
nodejs.disabled = true;
cmake.symbol = "cmake ";
custom.shell = {
command = "basename $SHELL";
when = "test -v SHELL";
format = " in [$output]($style)";
# ignore_timeout = true;
};
# env_var.SHELL = {variable = "SHELL"; default = ""; };
};
};
};
options.grimmShared.tooling = {
enable = mkEnableOption "grimm-tooling";
};
}