refactor(common): move some bash stuff to relevant modules

This commit is contained in:
matt1432 2023-12-01 12:39:16 -05:00
parent 52f2d8711f
commit 1fe3920c50
5 changed files with 44 additions and 40 deletions

View file

@ -1,11 +1,5 @@
{
config,
lib,
...
}: {
imports = [
./programs.nix
];
{lib, ...}: {
imports = [./programs.nix];
programs = {
starship = let
@ -125,30 +119,11 @@
sudo = "sudo ";
frick = "sudo $(fc -ln -1)";
nivm = "nvim";
nivim = "nvim";
tmux = "tmux -2";
ls = "ls -lah --color=auto";
tree = "tree -a -I node_modules";
cp = "cp -r";
chore = "(cd ~/.nix; git add flake.lock; git commit -m 'chore: update flake.lock'; git push)";
tup = "tailscale up --login-server https://headscale.nelim.org";
pc = "mosh matt@binto -- tmux -2u new -At laptop";
oksys = "mosh matt@oksys -- tmux -2u new -At laptop";
pve = "mosh matt@pve -- tmux -2u new -At laptop";
mc = "mosh mc@mc -- tmux -2u new -At laptop";
pod = "mosh matt@pve -- ssh -t -p 6768 matt@10.0.0.122 'tmux -2u new -At laptop'";
jelly = "mosh matt@pve -- ssh -t matt@10.0.0.123 'tmux -2u new -At laptop'";
qbit = "mosh matt@pve -- ssh -t matt@10.0.0.128 'tmux -2u new -At laptop'";
};
sessionVariables = {
# FIXME: why is this not set by home-manager?
"RIPGREP_CONFIG_PATH" = "${config.xdg.configHome}/ripgrep/ripgreprc";
};
profileExtra = ''

View file

@ -1,10 +1,14 @@
{pkgs, ...}: {
{pkgs, config, ...}: {
programs = {
fzf = {
enable = true;
enableBashIntegration = true;
};
bash.sessionVariables = {
# FIXME: why is this not set by home-manager?
"RIPGREP_CONFIG_PATH" = "${config.xdg.configHome}/ripgrep/ripgreprc";
};
ripgrep = {
enable = true;
arguments = [

View file

@ -6,25 +6,34 @@
...
}: let
fileContents = lib.strings.fileContents;
javaSdk = pkgs.temurin-bin-17;
nvim-treesitter-hypr = tree-sitter-hypr-flake.packages.${pkgs.system}.default;
coc-stylelintplus = coc-stylelintplus-flake.packages.${pkgs.system}.default;
in {
# TODO: make a gradle module and have java in device-vars.nix
xdg.dataFile = {
".gradle/gradle.properties".source = pkgs.writeText "gradle.properties" ''
org.gradle.java.home = ${pkgs.temurin-bin-17}
'';
};
home.packages = with pkgs; [
gradle
gradle-completion # FIXME: not working
alejandra
];
# TODO: make a gradle/java module
xdg.dataFile = {
".gradle/gradle.properties".text = ''
org.gradle.java.home = ${javaSdk}
'';
};
programs = {
java = {
enable = true;
package = pkgs.temurin-bin-17;
package = javaSdk;
};
# I love doing typos
bash.shellAliases = {
nivm = "nvim";
nivim = "nvim";
};
neovim = {
@ -113,7 +122,7 @@ in {
# Java
java.jdt.ls = {
java.home = "${pkgs.temurin-bin-17}";
java.home = "${javaSdk}";
statusIcons = {
"busy" = "Busy";
"ready" = "OK";

View file

@ -1,5 +1,8 @@
{pkgs, ...}: {
programs = {
# Make sure we have color support
bash.shellAliases.tmux = "tmux -2";
tmux = {
enable = true;
mouse = true;
@ -8,9 +11,7 @@
newSession = true;
historyLimit = 30000;
plugins = with pkgs.tmuxPlugins; [
dracula
];
plugins = with pkgs.tmuxPlugins; [dracula];
extraConfig = ''
bind-key -n Home send Escape "OH"

View file

@ -1,4 +1,6 @@
{...}: {
{config, ...}: let
vars = config.services.device-vars;
in {
services = {
tailscale = {
enable = true;
@ -8,4 +10,17 @@
];
};
};
home-manager.users.${vars.username}.programs.bash.shellAliases = {
tup = "tailscale up --login-server https://headscale.nelim.org";
pc = "mosh matt@binto -- tmux -2u new -At laptop";
oksys = "mosh matt@oksys -- tmux -2u new -At laptop";
pve = "mosh matt@pve -- tmux -2u new -At laptop";
mc = "mosh mc@mc -- tmux -2u new -At laptop";
pod = "mosh matt@pve -- ssh -t -p 6768 matt@10.0.0.122 'tmux -2u new -At laptop'";
jelly = "mosh matt@pve -- ssh -t matt@10.0.0.123 'tmux -2u new -At laptop'";
qbit = "mosh matt@pve -- ssh -t matt@10.0.0.128 'tmux -2u new -At laptop'";
};
}