grimm-nixos-laptop/common/tooling/default.nix

140 lines
2.8 KiB
Nix

{
pkgs,
config,
lib,
...
}:
let
inherit (config.grimmShared) enable tooling graphical;
inherit (lib)
mkEnableOption
mkOption
types
getExe
optionals
mkIf
;
in
{
imports = [
./lilypond.nix
./nix.nix
./security.nix
./python.nix
./rust.nix
./nvim.nix
./lsp.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 &'')
(writeShellScriptBin "silent-add" "git add --intent-to-add $@ ; git update-index --assume-unchanged $@")
urlencode
pstree
file
wget
hyfetch
util-linux
btop
linuxPackages.perf
eza
gcc
jdk17
pkg-config
unzip
p7zip
tea
fbcat
gomuks
ranger
visualvm
imagemagick
nmap
parted
glib
glibc
expect
]
++ optionals graphical [
wev
qdirstat
libva-utils
gparted
jetbrains.clion
jetbrains.idea-community
];
programs.git = {
enable = true;
lfs.enable = true;
config = {
init.defaultBranch = "main";
credential.username = tooling.git_user;
user.name = tooling.git_user;
user.email = tooling.git_email;
push.autoSetupRemote = true;
core.autocrlf = "input";
commit.gpgsign = true;
pull.rebase = true;
alias = {
pfusch = "push --force-with-lease --force-if-includes";
fuck = "reset HEAD~1";
fixup = "commit --fixup";
};
};
};
environment.shellAliases = {
":q" = "exit";
"ls" = "eza";
"lix" = "nix";
};
programs.tmux = {
enable = true;
historyLimit = 42000;
#keyMode = "vi";
};
# 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;
};
options.grimmShared.tooling = {
enable = mkEnableOption "grimm-tooling";
git_user = mkOption {
type = types.str;
default = "Grimmauld";
description = "Username for git to use";
};
git_email = mkOption {
type = types.str;
default = "${config.grimmShared.tooling.git_user}@grimmauld.de";
description = "Email for git to use";
};
};
}