From 169c3f11bddbca0336ec7a21622d9c5d08e24a07 Mon Sep 17 00:00:00 2001 From: Thilo Billerbeck Date: Mon, 18 Mar 2024 22:53:37 +0100 Subject: [PATCH] enhance shell --- home-manager/modules/machine.nix | 2 ++ home-manager/modules/packages.nix | 1 - home-manager/programs/atuin.nix | 3 +++ home-manager/programs/git.nix | 3 +++ home-manager/programs/thefuck.nix | 3 +++ home-manager/programs/zsh.nix | 43 ++++++++++--------------------- 6 files changed, 25 insertions(+), 30 deletions(-) create mode 100644 home-manager/programs/atuin.nix create mode 100644 home-manager/programs/thefuck.nix diff --git a/home-manager/modules/machine.nix b/home-manager/modules/machine.nix index 96c74c0..0f58962 100644 --- a/home-manager/modules/machine.nix +++ b/home-manager/modules/machine.nix @@ -1,6 +1,7 @@ { lib, pkgs, config, ... }: with lib; { imports = [ + ./../programs/atuin.nix ./../programs/alacritty.nix ./../programs/bat.nix ./../programs/beets.nix @@ -21,6 +22,7 @@ with lib; { ./../programs/mpv.nix ./../programs/syncthing.nix ./../programs/hstr.nix + ./../programs/thefuck.nix ./../../nix.nix ./packages.nix ]; diff --git a/home-manager/modules/packages.nix b/home-manager/modules/packages.nix index 1b3fa65..00f963e 100644 --- a/home-manager/modules/packages.nix +++ b/home-manager/modules/packages.nix @@ -65,7 +65,6 @@ in { inputs.nixpkgs-update.packages.x86_64-linux.nixpkgs-update inputs.dagger.packages.x86_64-linux.dagger unzip - gh nil nixd unrar diff --git a/home-manager/programs/atuin.nix b/home-manager/programs/atuin.nix new file mode 100644 index 0000000..a97ccc4 --- /dev/null +++ b/home-manager/programs/atuin.nix @@ -0,0 +1,3 @@ +{ + programs.atuin = { enable = true; }; +} diff --git a/home-manager/programs/git.nix b/home-manager/programs/git.nix index b71b072..fab6ce4 100644 --- a/home-manager/programs/git.nix +++ b/home-manager/programs/git.nix @@ -28,4 +28,7 @@ }; }; programs.git-credential-oauth = { enable = true; }; + programs.gh.enable = true; + programs.gh-dash.enable = true; + programs.lazygit.enable = true; } diff --git a/home-manager/programs/thefuck.nix b/home-manager/programs/thefuck.nix new file mode 100644 index 0000000..59cb7db --- /dev/null +++ b/home-manager/programs/thefuck.nix @@ -0,0 +1,3 @@ +{ + programs.thefuck = { enable = true; }; +} diff --git a/home-manager/programs/zsh.nix b/home-manager/programs/zsh.nix index 14d793e..144ea62 100644 --- a/home-manager/programs/zsh.nix +++ b/home-manager/programs/zsh.nix @@ -1,25 +1,6 @@ { pkgs, ... }: -let - omz-plugins = [ - "git" - "archlinux" - "composer" - "colored-man-pages" - "extract" - "gradle" - "node" - "npm" - "rbenv" - "sudo" - "direnv" - "docker" - "docker-compose" - "golang" - "pip" - "history" - "vagrant" - ]; -in { + +{ programs.zsh = { enable = true; autosuggestion.enable = true; @@ -36,18 +17,22 @@ in { undo-git-reset-head = "git reset 'HEAD@{1}'"; update-local = "bash $HOME/.dotfiles/install"; }; - zplug = { - enable = true; - plugins = map (x: { - name = "plugins/${x}"; - tags = [ "from:oh-my-zsh" ]; - }) omz-plugins; - }; initExtra = '' - eval $(${pkgs.thefuck}/bin/thefuck --alias) [ -d ~/.npm-global ] || mkdir ~/.npm-global ${pkgs.nodejs}/bin/npm config set prefix '~/.npm-global' export PATH=~/.npm-global/bin:$PATH ''; + plugins = [ + { + name = "zsh-nix-shell"; + file = "nix-shell.plugin.zsh"; + src = pkgs.fetchFromGitHub { + owner = "chisui"; + repo = "zsh-nix-shell"; + rev = "v0.8.0"; + sha256 = "1lzrn0n4fxfcgg65v0qhnj7wnybybqzs4adz7xsrkgmcsr0ii8b7"; + }; + } + ]; }; }