From 2e6db891ec7a350414fd4991593c604532d56b4c Mon Sep 17 00:00:00 2001 From: Tyler Mayoff Date: Sat, 1 Feb 2025 10:27:14 -0500 Subject: [PATCH] Setup hooks for chezmoi apply, setup nushell --- dot_config/flake/home/common.nix | 10 +++--- dot_config/flake/home/empty_shell.nix | 21 +++++++++++++ dot_config/flake/home/fish.nix | 31 ------------------ dot_config/flake/home/gnome.nix | 2 +- dot_config/flake/home/nushell.nix | 45 +++++---------------------- dot_config/flake/nushell.nix | 15 --------- run_home-manager.sh.tmpl | 3 ++ 7 files changed, 38 insertions(+), 89 deletions(-) create mode 100644 dot_config/flake/home/empty_shell.nix delete mode 100644 dot_config/flake/nushell.nix create mode 100644 run_home-manager.sh.tmpl diff --git a/dot_config/flake/home/common.nix b/dot_config/flake/home/common.nix index 323a16b..aa7f5e9 100644 --- a/dot_config/flake/home/common.nix +++ b/dot_config/flake/home/common.nix @@ -1,8 +1,6 @@ { inputs, outputs, - # lib, - # config, pkgs, ... }: { @@ -16,6 +14,7 @@ xdg.enable = true; imports = [ + ./shell.nix ./fish.nix ./nushell.nix # ./nom.nix @@ -32,9 +31,6 @@ }; home.packages = with pkgs; [ - # Fonts - #(nerdfonts.override {fonts = ["JetBrainsMono"];}) - unstable.nix-output-monitor # dotfiles @@ -114,6 +110,10 @@ shellWrapperName = "y"; }; + programs.zoxide = { + enable = true; + }; + home.stateVersion = "23.11"; programs.home-manager.enable = true; } diff --git a/dot_config/flake/home/empty_shell.nix b/dot_config/flake/home/empty_shell.nix new file mode 100644 index 0000000..264d4e7 --- /dev/null +++ b/dot_config/flake/home/empty_shell.nix @@ -0,0 +1,21 @@ +{...}: { + home.shellAliases = { + # Git + gc = "git commit"; + gcm = "git commit -m"; + # gac = "git add . and git commit"; + # gacp = "gac and git push"; + gs = "git status"; + + # nix + flake = "nix flake"; + + # home-manager + hm-upgrade = "nix flake update --flake ~/.local/share/chezmoi/dot_config/flake#"; + hm-update = "home-manager switch --flake ~/.config/flake"; + + # chezmoi + dot_apply = "chezmoi apply"; + dot_pull = "chezmoi update"; + }; +} diff --git a/dot_config/flake/home/fish.nix b/dot_config/flake/home/fish.nix index 591945e..b765c69 100644 --- a/dot_config/flake/home/fish.nix +++ b/dot_config/flake/home/fish.nix @@ -39,36 +39,5 @@ src = pkgs.fishPlugins.forgit.src; } ]; - - shellAliases = { - # ls - ls = "eza $eza_params"; - l = "eza --git-ignore $eza_params"; - ll = "eza --all --header --long $eza_params"; - llm = "eza --all --header --long --sort=modified $eza_params"; - la = "eza -lbhHigUmuSa"; - lx = "eza -lbhHigUmuSa@"; - lt = "eza --tree $eza_params"; - tree = "eza --tree $eza_params"; - - # Git - gc = "git commit"; - gcm = "git commit -m"; - gac = "git add . && git commit"; - gacp = "gac && git push"; - gs = "git status"; - - # yac = "yadm add . && yadm commit"; - # yacp = "yac && yadm push"; - # yc = "pushd $HOME/.local/share/yadm/repo.git && git-forgit add && yadm commit && popd"; - # yd = "pushd $HOME/.local/share/yadm/repo.git && git-forgit diff && popd"; - - # nix - flake = "nix flake"; - - # home-manager - hm-upgrade = "nix flake update --flake ~/.local/share/chezmoi/dot_config/flake#"; - hm-update = "home-manager switch --flake ~/.config/flake"; - }; }; } diff --git a/dot_config/flake/home/gnome.nix b/dot_config/flake/home/gnome.nix index 981580e..2f6172e 100644 --- a/dot_config/flake/home/gnome.nix +++ b/dot_config/flake/home/gnome.nix @@ -1,6 +1,6 @@ {pkgs, ...}: { home.packages = with pkgs; [ - gnome.gnome-tweaks + gnome-tweaks ]; programs.gnome-shell = { diff --git a/dot_config/flake/home/nushell.nix b/dot_config/flake/home/nushell.nix index 23af502..e9b5c26 100644 --- a/dot_config/flake/home/nushell.nix +++ b/dot_config/flake/home/nushell.nix @@ -1,44 +1,15 @@ -{pkgs, ...}: { +{config, ...}: { programs.nushell = { enable = true; - envFile = { - text = '' - $env.EDITOR = hx - $env.GIT_EDITOR = $env.EDITOR - $env.DEBMAIL = "tyler@tylermayoff.com" - $env.XDG_CONFIG_HOME = "$HOME/.config" - $env.XDG_CACHE_HOME = "$HOME/.cache" - $env.XDG_DATA_HOME = "$HOME/.local/share" - $env.XDG_STATE_HOME = "$HOME/.local/state" + shellAliases = + config.home.shellAliases; - zoxide init nushell | save -f ~/.config/nushell/zoxide.nu - ''; - }; + extraConfig = '' + $env.config.show_banner = false - shellAliases = { - # Git - gc = "git commit"; - gcm = "git commit -m"; - gac = "git add . and git commit"; - gacp = "gac and git push"; - gs = "git status"; - - yac = "yadm add --interactive and yadm commit"; - yacp = "yac and yadm push"; - - # nix - flake = "nix flake"; - - # home-manager - hm-upgrade = "nix flake update --flake ~/.config/home-manager/"; - hm-update = "home-manager switch --impure"; - }; - - configFile = { - text = '' - source ~/.config/nushell/zoxide.nu - ''; - }; + def gac [] { git add .; git commit } + def gacp [] { gac; git push } + ''; }; } diff --git a/dot_config/flake/nushell.nix b/dot_config/flake/nushell.nix deleted file mode 100644 index 6cfa022..0000000 --- a/dot_config/flake/nushell.nix +++ /dev/null @@ -1,15 +0,0 @@ -{pkgs, ...}: { - programs.nushell = { - enable = true; - - envFile = '' - $env.EDITOR = hx - $env.GIT_EDITOR = $env.EDITOR - $env.DEBMAIL = "tyler@tylermayoff.com" - $env.XDG_CONFIG_HOME = "$HOME/.config" - $env.XDG_CACHE_HOME = "$HOME/.cache" - $env.XDG_DATA_HOME = "$HOME/.local/share" - $env.XDG_STATE_HOME = "$HOME/.local/state" - ''; - }; -} diff --git a/run_home-manager.sh.tmpl b/run_home-manager.sh.tmpl new file mode 100644 index 0000000..529ba79 --- /dev/null +++ b/run_home-manager.sh.tmpl @@ -0,0 +1,3 @@ +#!/bin/bash + +home-manager switch --flake ~/.config/flake/