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

187 lines
4.2 KiB
Nix
Raw Normal View History

2024-05-07 23:31:41 +02:00
{
pkgs,
config,
lib,
...
}:
2024-04-10 16:51:28 +02:00
let
2024-03-24 16:59:47 +01:00
cfg = config.grimmShared;
2024-04-10 16:51:28 +02:00
in
{
2024-04-26 21:36:24 +02:00
imports = [
./lilypond.nix
2024-04-27 10:51:53 +02:00
./nix.nix
./security.nix
./python.nix
2024-04-26 21:36:24 +02:00
];
2024-05-07 23:31:41 +02:00
config =
with cfg;
lib.mkIf (enable && tooling.enable) {
environment.systemPackages =
with pkgs;
[
(writeShellScriptBin "systemd-owner" "systemctl show -pUser,UID $@")
(writeShellScriptBin "tree" "${lib.getExe pkgs.eza} -T --git -lh --no-permissions --no-user --no-filesize --no-time")
(writeShellScriptBin "spawn" ''exec "$@" &> /dev/null &'')
2024-05-08 21:49:37 +02:00
(writeShellScriptBin "silent-add" "git add --intent-to-add $@ ; git update-index --assume-unchanged $@")
2024-05-07 23:31:41 +02:00
urlencode
pstree
dos2unix
treefmt
2024-05-08 21:49:37 +02:00
file
wget
hyfetch
util-linux
btop
neovim-remote
linuxPackages.perf
eza
2024-05-07 23:31:41 +02:00
gcc
jdk17
pkg-config
unzip
p7zip
tea
fbcat
gomuks
ranger
2024-05-08 21:50:08 +02:00
2024-05-07 23:31:41 +02:00
visualvm
imagemagick
nmap
2024-05-08 21:50:08 +02:00
2024-05-07 23:31:41 +02:00
parted
glib
glibc
expect
]
++ lib.optionals cfg.graphical [
wev
qdirstat
libva-utils
gparted
jetbrains.clion
jetbrains.idea-community
2024-05-07 23:31:41 +02:00
];
programs.git = {
enable = true;
lfs.enable = true;
config = {
init.defaultBranch = "main";
credential.username = cfg.tooling.git_user;
core.editor = lib.getExe pkgs.neovim;
user.name = cfg.tooling.git_user;
user.email = cfg.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";
};
2024-05-06 23:22:32 +02:00
};
2024-03-24 16:59:47 +01:00
};
2024-04-10 16:51:28 +02:00
2024-05-07 23:31:41 +02:00
environment.shellAliases = {
":q" = "exit";
"ls" = "eza";
2024-05-08 00:05:17 +02:00
"lix" = "nix";
2024-05-07 23:31:41 +02:00
};
2024-04-30 12:08:28 +02:00
2024-05-07 23:31:41 +02:00
programs.tmux = {
enable = true;
historyLimit = 42000;
#keyMode = "vi";
};
2024-04-10 16:51:28 +02:00
2024-05-07 23:31:41 +02:00
# virtualisation.docker.enable = true;
services.dbus.implementation = "broker";
2024-05-07 23:31:41 +02:00
2024-05-11 11:37:59 +02:00
grimmShared.tooling.nvim = {
plugins = with pkgs.vimPlugins; [
fugitive
nvim-lspconfig
];
};
2024-05-07 23:31:41 +02:00
2024-05-08 21:49:37 +02:00
boot.tmp.cleanOnBoot = true;
zramSwap.enable = true;
2024-05-07 23:31:41 +02:00
programs.neovim = {
enable = true;
viAlias = true;
defaultEditor = true;
configure = {
customRC =
let
luarc = pkgs.writeText "init.lua" (lib.concatLines tooling.nvim.extraLuaRC);
in
''
set number
set hidden
set fileencodings=utf-8
set nocompatible
set clipboard+=unnamedplus
set ff=unix
luafile ${luarc}
if filereadable($HOME . "/.vimrc")
source ~/.vimrc
endif
'';
packages.myVimPackage = {
start = tooling.nvim.plugins;
opt = [ ];
};
2024-03-24 16:59:47 +01:00
};
};
2024-05-08 08:31:25 +02:00
programs.ssh = {
startAgent = true;
enableAskPassword = graphical;
askPassword = lib.mkIf graphical (lib.getExe pkgs.lxqt.lxqt-openssh-askpass);
};
2024-05-07 23:31:41 +02:00
programs.thefuck.enable = true;
};
options.grimmShared.tooling = with lib; {
enable = mkEnableOption "grimm-tooling";
2024-04-26 21:36:24 +02:00
nvim = {
plugins = mkOption {
type = types.listOf types.package;
default = [ ];
description = "Extra vim plugins to include";
};
extraLuaRC = mkOption {
type = types.listOf types.nonEmptyStr;
default = [ ];
description = "Extra init LUA scripts";
};
};
2024-04-30 12:32:03 +02:00
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";
};
};
2024-03-24 16:59:47 +01:00
}