diff --git a/flake.nix b/flake.nix index ef8eaa29..fe77f518 100644 --- a/flake.nix +++ b/flake.nix @@ -49,6 +49,8 @@ inputs.nixpkgs-lib.follows = "nixpkgs"; }; + nur.url = "github:nix-community/NUR"; + # Hyprland environment hyprland.url = "git+https://github.com/hyprwm/Hyprland?submodules=1"; hyprland-contrib = { @@ -86,7 +88,7 @@ }; }; - # Cachyos + # Chaotic chaotic.url = "https://flakehub.com/f/chaotic-cx/nyx/*.tar.gz"; # Miscellaneous @@ -100,8 +102,6 @@ }; }; - nur.url = "github:nix-community/NUR"; - anyrun.url = "github:anyrun-org/anyrun"; microfetch.url = "github:NotAShelf/microfetch"; agenix.url = "github:ryantm/agenix"; diff --git a/modules/default.nix b/modules/default.nix index c27c9d5c..9cc2ee44 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -13,11 +13,14 @@ ./home/gaming/steam - ./home/terminal/alacritty - ./home/terminal/foot - ./home/terminal/kitty - ./home/terminal/wezterm - ./home/terminal/zellij + ./home/cli/alacritty + ./home/cli/bash + ./home/cli/foot + ./home/cli/jujutsu + ./home/cli/kitty + ./home/cli/wezterm + ./home/cli/zellij + ./home/cli/zsh ./home/userd/blueman-applet ./home/userd/copyq diff --git a/modules/home/terminal/alacritty/default.nix b/modules/home/cli/alacritty/default.nix similarity index 94% rename from modules/home/terminal/alacritty/default.nix rename to modules/home/cli/alacritty/default.nix index 21c89701..791d480e 100644 --- a/modules/home/terminal/alacritty/default.nix +++ b/modules/home/cli/alacritty/default.nix @@ -4,10 +4,10 @@ ... }: let inherit (lib) mkIf mkEnableOption; - cfg = config.home.terminal.alacritty; + cfg = config.home.cli.alacritty; in { options = { - home.terminal.alacritty.enable = mkEnableOption "Enables firefox"; + home.cli.alacritty.enable = mkEnableOption "Enables firefox"; }; config = mkIf cfg.enable { programs.alacritty = { diff --git a/modules/home/cli/bash/default.nix b/modules/home/cli/bash/default.nix new file mode 100644 index 00000000..aa300488 --- /dev/null +++ b/modules/home/cli/bash/default.nix @@ -0,0 +1,17 @@ +{ + config, + lib, + ... +}: let + inherit (lib) mkIf mkEnableOption; + cfg = config.home.cli.bash; +in { + options = { + home.cli.bash.enable = mkEnableOption "Enables bash"; + }; + config = mkIf cfg.enable { + programs.bash = { + enable = true; + }; + }; +} diff --git a/modules/home/terminal/foot/default.nix b/modules/home/cli/foot/default.nix similarity index 98% rename from modules/home/terminal/foot/default.nix rename to modules/home/cli/foot/default.nix index 3f88d1ed..e66f85f5 100644 --- a/modules/home/terminal/foot/default.nix +++ b/modules/home/cli/foot/default.nix @@ -5,10 +5,10 @@ ... }: let inherit (lib) mkIf mkEnableOption; - cfg = config.home.terminal.foot; + cfg = config.home.cli.foot; in { options = { - home.terminal.foot.enable = mkEnableOption "Enables foot terminal"; + home.cli.foot.enable = mkEnableOption "Enables foot cli"; }; config = mkIf cfg.enable { programs.foot = { @@ -162,7 +162,7 @@ in { # font-increase=Control+plus Control+equal Control+KP_Add # font-decrease=Control+minus Control+KP_Subtract # font-reset=Control+0 Control+KP_0 - # spawn-terminal=Control+Shift+n + # spawn-cli=Control+Shift+n # minimize=none # maximize=none # fullscreen=none diff --git a/modules/home/cli/jujutsu/default.nix b/modules/home/cli/jujutsu/default.nix new file mode 100644 index 00000000..23245ca4 --- /dev/null +++ b/modules/home/cli/jujutsu/default.nix @@ -0,0 +1,53 @@ +{ + config, + lib, + ... +}: let + inherit (lib) mkIf mkEnableOption; + cfg = config.home.cli.jujutsu; +in { + options = { + home.cli.jujutsu.enable = mkEnableOption "Enables jujutsu"; + }; + config = mkIf cfg.enable { + programs.jujutsu = { + enable = true; + settings = { + user = { + name = config.programs.git.userName; + email = config.programs.git.userEmail; + }; + # ui = { + # diff-editor = lib.mkIf config.programs.neovim.enable [ + # "nvim" + # "-c" + # "DiffEditor $left $right $output" + # ]; + # pager = "less -FRX"; + # }; + # signing = let + # gitCfg = config.programs.git.extraConfig; + # in { + # backend = "gpg"; + # sign-all = gitCfg.commit.gpgSign; + # key = gitCfg.user.signing.key; + # }; + templates = { + draft_commit_description = '' + concat( + description, + indent("JJ: ", concat( + "\n", + "Change summary:\n", + indent(" ", diff.summary()), + "\n", + "Full change:\n", + indent(" ", diff.git()), + )), + ) + ''; + }; + }; + }; + }; +} diff --git a/modules/home/terminal/kitty/default.nix b/modules/home/cli/kitty/default.nix similarity index 96% rename from modules/home/terminal/kitty/default.nix rename to modules/home/cli/kitty/default.nix index 16b1f0c7..99d7fc15 100644 --- a/modules/home/terminal/kitty/default.nix +++ b/modules/home/cli/kitty/default.nix @@ -4,10 +4,10 @@ ... }: let inherit (lib) mkIf mkEnableOption; - cfg = config.home.terminal.kitty; + cfg = config.home.cli.kitty; in { options = { - home.terminal.kitty.enable = mkEnableOption "Enables kitty terminal"; + home.cli.kitty.enable = mkEnableOption "Enables kitty cli"; }; config = mkIf cfg.enable { programs.kitty = { diff --git a/modules/home/terminal/wezterm/default.nix b/modules/home/cli/wezterm/default.nix similarity index 94% rename from modules/home/terminal/wezterm/default.nix rename to modules/home/cli/wezterm/default.nix index 828a68e4..8d4b342c 100644 --- a/modules/home/terminal/wezterm/default.nix +++ b/modules/home/cli/wezterm/default.nix @@ -9,10 +9,10 @@ weztermPkg = pkgs.wezterm; # weztermFlake = inputs.wezterm.packages.${pkgs.system}.default; inherit (lib) mkIf mkEnableOption; - cfg = config.home.terminal.wezterm; + cfg = config.home.cli.wezterm; in { options = { - home.terminal.wezterm.enable = mkEnableOption "Enables wezterm terminal"; + home.cli.wezterm.enable = mkEnableOption "Enables wezterm cli"; }; config = mkIf cfg.enable { programs.wezterm = { diff --git a/modules/home/terminal/zellij/default.nix b/modules/home/cli/zellij/default.nix similarity index 95% rename from modules/home/terminal/zellij/default.nix rename to modules/home/cli/zellij/default.nix index 8a0a9891..0ab7bb9e 100644 --- a/modules/home/terminal/zellij/default.nix +++ b/modules/home/cli/zellij/default.nix @@ -4,10 +4,10 @@ ... }: let inherit (lib) mkIf mkEnableOption; - cfg = config.home.terminal.zellij; + cfg = config.home.cli.zellij; in { options = { - home.terminal.zellij.enable = mkEnableOption "Enables zellij"; + home.cli.zellij.enable = mkEnableOption "Enables zellij"; }; config = mkIf cfg.enable { programs.zellij = { diff --git a/modules/home/cli/zsh/default.nix b/modules/home/cli/zsh/default.nix new file mode 100644 index 00000000..eb6acabf --- /dev/null +++ b/modules/home/cli/zsh/default.nix @@ -0,0 +1,96 @@ +{ + config, + lib, + pkgs, + ... +}: let + inherit (lib) mkIf mkEnableOption; + cfg = config.home.cli.zsh; + inherit (lib.meta) getExe; + inherit (pkgs) eza bat; +in { + options = { + home.cli.zsh.enable = mkEnableOption "Enables zsh home configuration"; + }; + config = mkIf cfg.enable { + programs.zsh = { + enable = true; + dotDir = ".config/zsh"; + enableCompletion = true; + autosuggestion.enable = true; + syntaxHighlighting.enable = true; + + shellAliases = { + cat = "${getExe bat} --style=plain"; + ls = "${getExe eza} -h --git --icons --color=auto --group-directories-first -s extension"; + la = "${getExe eza} -lah --tree"; + tree = "${getExe eza} --tree --icons=always"; + extract = "extract.sh"; + usermodules = "$EDITOR /home/$USER/.nix-config/users/$USER/modules.nix"; + umod = "$EDITOR /home/$USER/.nix-config/users/$USER/modules.nix"; + systemmodules = "$EDITOR /home/$USER/.nix-config/hosts/$HOST/modules.nix"; + smod = "$EDITOR /home/$USER/.nix-config/hosts/$HOST/modules.nix"; + nixcleanboot = "sudo nix run /home/$USER/.nix-config#cleanup-boot"; + nixclean = "nh clean all --keep 3"; + nixdev = "nix develop ~/.nix-config -c $SHELL"; + nixconfig = "cd /home/$USER/.nix-config/"; + ll = "ls -l"; + nixupdate = "nh os switch -v -H $HOST"; + nixup = "nh os switch -H $HOST"; + flakeupdate = "nh os switch -u -v -H $HOST"; + flakeup = "nh os switch -u -H $HOST"; + ".." = "cd .."; + "..." = "cd ../../"; + "...." = "cd ../../../"; + "....." = "cd ../../../../"; + "......" = "cd ../../../../../"; + }; + history = { + size = 1000; + path = "${config.xdg.dataHome}/zsh/history"; + }; + oh-my-zsh = { + enable = true; + plugins = [ + "git" + ]; + theme = "robbyrussell"; + }; + profileExtra = '' + export PATH="$HOME/.local/bin:$PATH" + ''; + initExtraFirst = '' + autoload -U colors && colors + ''; + initExtra = '' + ZSH_THEME_GIT_PROMPT_PREFIX="%F{143}(%F{167}" + ZSH_THEME_GIT_PROMPT_SUFFIX="%f " + ZSH_THEME_GIT_PROMPT_DIRTY="%F{143}) %F{202}%1{✗%}" + ZSH_THEME_GIT_PROMPT_CLEAN="%F{143})" + + ZSH_THEME_RUBY_PROMPT_PREFIX="%F{167}‹" + ZSH_THEME_RUBY_PROMPT_SUFFIX="›%f" + + # Check if we're in a nix-shell or nix develop environment + if [[ -n "$IN_NIX_SHELL" ]]; then + PROMPT='%F{red}DEV%f%F{143}%~%f $(git_prompt_info)$(virtualenv_prompt_info) + %F{143}$ ' + else + PROMPT='%F{143}%~%f $(git_prompt_info)$(virtualenv_prompt_info) + %F{143}$ ' + fi + + RPROMPT='$(ruby_prompt_info)' + + VIRTUAL_ENV_DISABLE_PROMPT=0 + ZSH_THEME_VIRTUAL_ENV_PROMPT_PREFIX=" %F{66}🐍 " + ZSH_THEME_VIRTUAL_ENV_PROMPT_SUFFIX="%f" + ZSH_THEME_VIRTUALENV_PREFIX=$ZSH_THEME_VIRTUAL_ENV_PROMPT_PREFIX + ZSH_THEME_VIRTUALENV_SUFFIX=$ZSH_THEME_VIRTUAL_ENV_PROMPT_SUFFIX + + ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=241' + microfetch + ''; + }; + }; +} diff --git a/modules/system/utils/zsh/default.nix b/modules/system/utils/zsh/default.nix index 490edc01..b7b85569 100644 --- a/modules/system/utils/zsh/default.nix +++ b/modules/system/utils/zsh/default.nix @@ -7,7 +7,7 @@ cfg = config.system.utils.zsh; in { options = { - system.utils.zsh.enable = mkEnableOption "Enables android tools"; + system.utils.zsh.enable = mkEnableOption "Enables zsh shell"; }; config = mkIf cfg.enable { programs.zsh.enable = cfg.enable; diff --git a/users/cnst/default.nix b/users/cnst/default.nix index 6b5c9b10..b009cbfe 100644 --- a/users/cnst/default.nix +++ b/users/cnst/default.nix @@ -10,7 +10,7 @@ in { [ ./modules.nix ./git.nix - ./shell.nix + # ./shell.nix ] ++ lib.optionals isCnixpad [./cpmodules.nix]; diff --git a/users/cnst/modules.nix b/users/cnst/modules.nix index cef32c95..77d569ee 100644 --- a/users/cnst/modules.nix +++ b/users/cnst/modules.nix @@ -42,13 +42,19 @@ # enable = false; # }; }; - terminal = { + cli = { alacritty = { enable = true; }; + bash = { + enable = true; + }; foot = { enable = true; }; + jujutsu = { + enable = false; + }; kitty = { enable = true; }; @@ -58,6 +64,9 @@ zellij = { enable = false; }; + zsh = { + enable = true; + }; }; userd = { blueman-applet = { diff --git a/users/cnst/shell.nix b/users/cnst/shell.nix index ed67819f..cc347a72 100644 --- a/users/cnst/shell.nix +++ b/users/cnst/shell.nix @@ -20,8 +20,8 @@ in { la = "${getExe eza} -lah --tree"; tree = "${getExe eza} --tree --icons=always"; extract = "extract.sh"; - usermodules = "$EDITOR /home/$USER/.nix-config/home/users/$USER/modules.nix"; - umod = "$EDITOR /home/$USER/.nix-config/home/users/$USER/modules.nix"; + usermodules = "$EDITOR /home/$USER/.nix-config/users/$USER/modules.nix"; + umod = "$EDITOR /home/$USER/.nix-config/users/$USER/modules.nix"; systemmodules = "$EDITOR /home/$USER/.nix-config/hosts/$HOST/modules.nix"; smod = "$EDITOR /home/$USER/.nix-config/hosts/$HOST/modules.nix"; nixcleanboot = "sudo nix run /home/$USER/.nix-config#cleanup-boot"; diff --git a/users/toothpick/shell.nix b/users/toothpick/shell.nix index 9796dfd8..7de566f0 100644 --- a/users/toothpick/shell.nix +++ b/users/toothpick/shell.nix @@ -20,8 +20,8 @@ in { la = "${getExe eza} -lah --tree"; tree = "${getExe eza} --tree --icons=always"; extract = "extract.sh"; - usermodules = "$EDITOR /home/$USER/.nix-config/home/users/$USER/modules.nix"; - umod = "$EDITOR /home/$USER/.nix-config/home/users/$USER/modules.nix"; + usermodules = "$EDITOR /home/$USER/.nix-config/users/$USER/modules.nix"; + umod = "$EDITOR /home/$USER/.nix-config/users/$USER/modules.nix"; systemmodules = "$EDITOR /home/$USER/.nix-config/hosts/$HOST/modules.nix"; smod = "$EDITOR /home/$USER/.nix-config/hosts/$HOST/modules.nix"; nixcleanboot = "sudo nix run /home/$USER/.nix-config#cleanup-boot";