From 7f4ccfa1901dfe5ddc2a70e34e833eb98ad9d300 Mon Sep 17 00:00:00 2001 From: cy Date: Sun, 22 Dec 2024 21:07:38 -0500 Subject: [PATCH 1/4] init fish --- home/fish.nix | 59 +++++++++++++++++++++++++++++++++++++++++ home/yt/ytnix.nix | 1 + hosts/common.nix | 9 +++++++ hosts/ytnix/default.nix | 8 ------ 4 files changed, 69 insertions(+), 8 deletions(-) create mode 100644 home/fish.nix diff --git a/home/fish.nix b/home/fish.nix new file mode 100644 index 0000000..d73f448 --- /dev/null +++ b/home/fish.nix @@ -0,0 +1,59 @@ +{pkgs, ...}: { + programs.fish = { + enable = true; + plugins = [ + { + name = "colored-man-pages"; + src = pkgs.fetchFromGitHub { + owner = "PatrickF1"; + repo = "colored_man_pages.fish"; + rev = "f885c2507128b70d6c41b043070a8f399988bc7a"; + hash = "sha256-ii9gdBPlC1/P1N9xJzqomrkyDqIdTg+iCg0mwNVq2EU="; + }; + } + ]; + shellAliases = { + "vi" = "nvim"; + "vim" = "nvim"; + "t" = "tmux"; + "tl" = "tmux list-sessions"; + "ta" = "tmux new-session -A -s"; + "se" = "sudoedit"; + "s" = "sudo"; + "nrs" = "sudo nixos-rebuild switch --flake ."; + "nrt" = "sudo nixos-rebuild test --flake ."; + "hrs" = "home-manager switch --flake ."; + "g" = "git"; + "ga" = "git add"; + "gaa" = "git add --all"; + "gb" = "git branch"; + "gc" = "git commit --verbose"; + "gcmsg" = "git commit --message"; + "gd" = "git diff"; + "gdca" = "git diff --cached"; + "gds" = "git diff --staged"; + "gl" = "git log --stat"; + "glg" = "git log --graph"; + "glga" = "git log --graph --decorate --all"; + "glo" = "git log --oneline --decorate"; + "gp" = "git push"; + "gr" = "git remote"; + "gra" = "git remote add"; + "grv" = "git remote --verbose"; + "gs" = "git status --short"; + "gss" = "git status"; + }; + }; + + programs.fzf = { + enableFishIntegration = true; + }; + + programs.zoxide = { + enableFishIntegration = true; + }; + + programs.eza = { + enableFishIntegration = true; + }; +} diff --git a/home/yt/ytnix.nix b/home/yt/ytnix.nix index 0056a40..02f8838 100644 --- a/home/yt/ytnix.nix +++ b/home/yt/ytnix.nix @@ -6,6 +6,7 @@ imports = [ ./common.nix ../foot.nix + ../fish.nix ]; home = { username = "yt"; diff --git a/hosts/common.nix b/hosts/common.nix index bbd1718..e370dda 100644 --- a/hosts/common.nix +++ b/hosts/common.nix @@ -20,4 +20,13 @@ }; time.timeZone = "America/Toronto"; networking.firewall.logRefusedConnections = false; + + # this is true by default and mutually exclusive with + # programs.nix-index + programs.command-not-found.enable = false; + programs.nix-index = { + enable = true; + enableZshIntegration = true; + }; + } diff --git a/hosts/ytnix/default.nix b/hosts/ytnix/default.nix index 61b162b..0639e6a 100644 --- a/hosts/ytnix/default.nix +++ b/hosts/ytnix/default.nix @@ -281,14 +281,6 @@ programs.nix-ld.enable = true; programs.evolution.enable = true; - # this is true by default and mutually exclusive with - # programs.nix-index - programs.command-not-found.enable = false; - programs.nix-index = { - enable = true; - enableZshIntegration = true; - }; - xdg.portal = { enable = true; wlr.enable = true; From f73ada358b3ad30d49a2e1b5fa151c46459c503b Mon Sep 17 00:00:00 2001 From: cy Date: Mon, 23 Dec 2024 02:30:20 -0500 Subject: [PATCH 2/4] enable integrations and nix fmt --- home/fish.nix | 28 +++++----------------------- home/yt/common.nix | 5 +++++ home/zsh/default.nix | 18 +++--------------- hosts/ytnix/default.nix | 4 ++-- 4 files changed, 15 insertions(+), 40 deletions(-) diff --git a/home/fish.nix b/home/fish.nix index d73f448..f2590d0 100644 --- a/home/fish.nix +++ b/home/fish.nix @@ -1,17 +1,7 @@ -{pkgs, ...}: { +{ ... }: +{ programs.fish = { enable = true; - plugins = [ - { - name = "colored-man-pages"; - src = pkgs.fetchFromGitHub { - owner = "PatrickF1"; - repo = "colored_man_pages.fish"; - rev = "f885c2507128b70d6c41b043070a8f399988bc7a"; - hash = "sha256-ii9gdBPlC1/P1N9xJzqomrkyDqIdTg+iCg0mwNVq2EU="; - }; - } - ]; shellAliases = { "vi" = "nvim"; "vim" = "nvim"; @@ -45,15 +35,7 @@ }; }; - programs.fzf = { - enableFishIntegration = true; - }; - - programs.zoxide = { - enableFishIntegration = true; - }; - - programs.eza = { - enableFishIntegration = true; - }; + programs.fzf.enableFishIntegration = true; + programs.zoxide.enableFishIntegration = true; + programs.eza.enableFishIntegration = true; } diff --git a/home/yt/common.nix b/home/yt/common.nix index f4918ad..110c79d 100644 --- a/home/yt/common.nix +++ b/home/yt/common.nix @@ -19,4 +19,9 @@ man man-db ]; + + programs.zoxide.options = [ "--cmd cd" ]; + programs.fzf.enable = true; + programs.zoxide.enable = true; + programs.eza.enable = true; } diff --git a/home/zsh/default.nix b/home/zsh/default.nix index 8e5e6f3..ca495aa 100644 --- a/home/zsh/default.nix +++ b/home/zsh/default.nix @@ -84,19 +84,7 @@ }; }; - programs.fzf = { - enable = true; - enableZshIntegration = true; - }; - - programs.zoxide = { - enable = true; - enableZshIntegration = true; - options = [ "--cmd cd" ]; - }; - - programs.eza = { - enable = true; - enableZshIntegration = true; - }; + programs.fzf.enableZshIntegration = true; + programs.zoxide.enableZshIntegration = true; + programs.eza.enableZshIntegration = true; } diff --git a/hosts/ytnix/default.nix b/hosts/ytnix/default.nix index 0639e6a..e486e34 100644 --- a/hosts/ytnix/default.nix +++ b/hosts/ytnix/default.nix @@ -115,9 +115,9 @@ "libvirtd" "docker" ]; - shell = pkgs.zsh; + shell = pkgs.fish; }; - programs.zsh.enable = true; + programs.fish.enable = true; environment.systemPackages = with pkgs; [ tmux From 8d0314e0aa49312a18c3569d4e8a59605a698f9b Mon Sep 17 00:00:00 2001 From: cy Date: Mon, 23 Dec 2024 11:23:03 -0500 Subject: [PATCH 3/4] disable greeting message --- home/fish.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/home/fish.nix b/home/fish.nix index f2590d0..1cda73a 100644 --- a/home/fish.nix +++ b/home/fish.nix @@ -33,6 +33,10 @@ "gs" = "git status --short"; "gss" = "git status"; }; + + shellInit = '' + set fish_greeting + ''; }; programs.fzf.enableFishIntegration = true; From e7c389f859d3fb8b68a80559e7023b29f1c43a3a Mon Sep 17 00:00:00 2001 From: cy Date: Mon, 23 Dec 2024 11:39:48 -0500 Subject: [PATCH 4/4] make fish common --- home/fish.nix | 1 + home/yt/common.nix | 2 +- home/yt/ytnix.nix | 1 - home/zsh/default.nix | 1 + hosts/chunk/default.nix | 2 -- hosts/common.nix | 9 ++++----- hosts/ytnix/default.nix | 2 -- 7 files changed, 7 insertions(+), 11 deletions(-) diff --git a/home/fish.nix b/home/fish.nix index 1cda73a..8003572 100644 --- a/home/fish.nix +++ b/home/fish.nix @@ -42,4 +42,5 @@ programs.fzf.enableFishIntegration = true; programs.zoxide.enableFishIntegration = true; programs.eza.enableFishIntegration = true; + programs.nix-index.enableFishIntegration = true; } diff --git a/home/yt/common.nix b/home/yt/common.nix index 110c79d..844f01b 100644 --- a/home/yt/common.nix +++ b/home/yt/common.nix @@ -2,7 +2,7 @@ { imports = [ ../tmux.nix - ../zsh + ../fish.nix ]; home.sessionVariables = { diff --git a/home/yt/ytnix.nix b/home/yt/ytnix.nix index 02f8838..0056a40 100644 --- a/home/yt/ytnix.nix +++ b/home/yt/ytnix.nix @@ -6,7 +6,6 @@ imports = [ ./common.nix ../foot.nix - ../fish.nix ]; home = { username = "yt"; diff --git a/home/zsh/default.nix b/home/zsh/default.nix index ca495aa..fabb7ba 100644 --- a/home/zsh/default.nix +++ b/home/zsh/default.nix @@ -87,4 +87,5 @@ programs.fzf.enableZshIntegration = true; programs.zoxide.enableZshIntegration = true; programs.eza.enableZshIntegration = true; + programs.nix-index.enableZshIntegration = true; } diff --git a/hosts/chunk/default.nix b/hosts/chunk/default.nix index 216ed72..bf8bc98 100644 --- a/hosts/chunk/default.nix +++ b/hosts/chunk/default.nix @@ -156,9 +156,7 @@ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPdhAQYy0+vS+QmyCd0MAbqbgzyMGcsuuFyf6kg2yKge yt@ytlinux" "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINyn2+OoRN4nExti+vFQ1NHEZip0slAoCH9C5/FzvgZD yt@ytnix" ]; - shell = pkgs.zsh; }; - programs.zsh.enable = true; users.users.root.openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPdhAQYy0+vS+QmyCd0MAbqbgzyMGcsuuFyf6kg2yKge yt@ytlinux" "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINyn2+OoRN4nExti+vFQ1NHEZip0slAoCH9C5/FzvgZD yt@ytnix" diff --git a/hosts/common.nix b/hosts/common.nix index e370dda..bcc2fa5 100644 --- a/hosts/common.nix +++ b/hosts/common.nix @@ -1,4 +1,4 @@ -{ ... }: +{pkgs, ... }: { nix = { settings = { @@ -24,9 +24,8 @@ # this is true by default and mutually exclusive with # programs.nix-index programs.command-not-found.enable = false; - programs.nix-index = { - enable = true; - enableZshIntegration = true; - }; + programs.nix-index.enable = true; + users.users.yt.shell = pkgs.fish; + programs.fish.enable = true; } diff --git a/hosts/ytnix/default.nix b/hosts/ytnix/default.nix index e486e34..eef7186 100644 --- a/hosts/ytnix/default.nix +++ b/hosts/ytnix/default.nix @@ -115,9 +115,7 @@ "libvirtd" "docker" ]; - shell = pkgs.fish; }; - programs.fish.enable = true; environment.systemPackages = with pkgs; [ tmux