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

157 lines
3.2 KiB
Nix
Raw Normal View History

2024-04-27 10:51:53 +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-03-24 16:59:47 +01:00
config = with cfg; lib.mkIf (enable && tooling.enable) {
environment.systemPackages = with pkgs; [
(writeShellScriptBin "systemd-owner" "systemctl show -pUser,UID $@")
2024-04-27 10:51:53 +02:00
(writeShellScriptBin "tree" "${lib.getExe pkgs.eza} -T --git -lh --no-permissions --no-user --no-filesize --no-time")
2024-04-30 22:04:17 +02:00
urlencode
pstree
dos2unix
2024-04-26 21:36:24 +02:00
2024-03-24 16:59:47 +01:00
gcc
jdk17
pkg-config
2024-04-18 21:16:40 +02:00
unzip
p7zip
2024-04-10 16:51:28 +02:00
2024-03-24 16:59:47 +01:00
tea
2024-04-27 10:51:53 +02:00
eza
2024-03-24 16:59:47 +01:00
fbcat
gomuks
2024-05-02 14:02:35 +02:00
btop
2024-03-24 16:59:47 +01:00
ranger
wget
file
util-linux
visualvm
imagemagick
nmap
2024-04-10 16:51:28 +02:00
2024-03-24 16:59:47 +01:00
hyfetch
parted
2024-04-01 12:04:43 +02:00
glib
2024-04-13 19:16:33 +02:00
glibc
2024-04-18 21:16:40 +02:00
expect
2024-04-26 21:36:24 +02:00
neovim-remote
2024-03-24 16:59:47 +01:00
] ++ lib.optionals cfg.graphical [
2024-05-01 10:22:51 +02:00
wev
2024-03-24 16:59:47 +01:00
qdirstat
libva-utils
glxinfo
alacritty
vulkan-tools
2024-04-30 12:32:03 +02:00
2024-03-24 16:59:47 +01:00
gparted
];
programs.git = {
enable = true;
lfs.enable = true;
config = {
init.defaultBranch = "main";
credential.username = cfg.tooling.git_user;
core.editor = lib.getExe pkgs.neovim;
2024-03-24 16:59:47 +01:00
user.name = cfg.tooling.git_user;
user.email = cfg.tooling.git_email;
2024-04-18 21:16:40 +02:00
push.autoSetupRemote = true;
2024-04-30 12:08:28 +02:00
core.autocrlf = "input";
commit.gpgsign = true;
pull.rebase = true;
2024-03-24 16:59:47 +01:00
};
};
2024-04-10 16:51:28 +02:00
2024-04-30 12:08:28 +02:00
environment.shellAliases = {
":q" = "exit";
"ls" = "eza";
};
2024-03-24 16:59:47 +01:00
programs.tmux = {
enable = true;
historyLimit = 42000;
#keyMode = "vi";
};
2024-04-10 16:51:28 +02:00
2024-04-18 21:16:40 +02:00
# virtualisation.docker.enable = true;
2024-04-10 16:51:28 +02:00
2024-04-26 21:36:24 +02:00
grimmShared.tooling.nvim.plugins = with pkgs.vimPlugins; [
vim-scala
fugitive
];
2024-03-24 16:59:47 +01:00
programs.neovim = {
enable = true;
viAlias = true;
defaultEditor = true;
configure = {
2024-04-26 21:36:24 +02:00
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
2024-04-30 12:08:28 +02:00
set ff=unix
2024-04-26 21:36:24 +02:00
luafile ${luarc}
if filereadable($HOME . "/.vimrc")
source ~/.vimrc
endif
'';
packages.myVimPackage = {
start = tooling.nvim.plugins;
2024-03-24 16:59:47 +01:00
opt = [ ];
};
};
};
programs.ssh.startAgent = true;
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
}