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 @@
{ {lib, ...}: {
config, imports = [./programs.nix];
lib,
...
}: {
imports = [
./programs.nix
];
programs = { programs = {
starship = let starship = let
@ -125,30 +119,11 @@
sudo = "sudo "; sudo = "sudo ";
frick = "sudo $(fc -ln -1)"; frick = "sudo $(fc -ln -1)";
nivm = "nvim";
nivim = "nvim";
tmux = "tmux -2";
ls = "ls -lah --color=auto"; ls = "ls -lah --color=auto";
tree = "tree -a -I node_modules"; tree = "tree -a -I node_modules";
cp = "cp -r"; cp = "cp -r";
chore = "(cd ~/.nix; git add flake.lock; git commit -m 'chore: update flake.lock'; git push)"; 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 = '' profileExtra = ''

View file

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

View file

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

View file

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

View file

@ -1,4 +1,6 @@
{...}: { {config, ...}: let
vars = config.services.device-vars;
in {
services = { services = {
tailscale = { tailscale = {
enable = true; 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'";
};
} }