From 1f6e2b3a64cba2df0bcc6dc09c61d965ce358823 Mon Sep 17 00:00:00 2001 From: m3tam3re Date: Tue, 3 Sep 2024 18:01:56 +0200 Subject: [PATCH] video3 --- home/features/cli/default.nix | 31 ++++++++++++++++++++++++++++++ home/features/cli/fish.nix | 32 +++++++++++++++++++++++++++++++ home/m3tam3re/home.nix | 3 ++- home/m3tam3re/m3-kratos.nix | 14 +++++++++++++- hosts/common/default.nix | 2 ++ hosts/m3-kratos/configuration.nix | 3 +++ 6 files changed, 83 insertions(+), 2 deletions(-) create mode 100644 home/features/cli/default.nix create mode 100644 home/features/cli/fish.nix diff --git a/home/features/cli/default.nix b/home/features/cli/default.nix new file mode 100644 index 0000000..233275c --- /dev/null +++ b/home/features/cli/default.nix @@ -0,0 +1,31 @@ +{pkgs, ...}: { + imports = [ + ./fish.nix + ]; + + programs.zoxide = { + enable = true; + enableFishIntegration = true; + }; + + programs.eza = { + enable = true; + enableFishIntegration = true; + enableBashIntegration = true; + extraOptions = ["-l" "--icons" "--git" "-a"]; + }; + + programs.bat = {enable = true;}; + + home.packages = with pkgs; [ + coreutils + fd + htop + httpie + jq + procs + ripgrep + tldr + zip + ]; +} diff --git a/home/features/cli/fish.nix b/home/features/cli/fish.nix new file mode 100644 index 0000000..e0d6e99 --- /dev/null +++ b/home/features/cli/fish.nix @@ -0,0 +1,32 @@ +{ + config, + lib, + ... +}: +with lib; let + cfg = config.features.cli.fish; +in { + options.features.cli.fish.enable = mkEnableOption "enable extended fish configuration"; + + config = mkIf cfg.enable { + programs.fish = { + enable = true; + loginShellInit = '' + set -x NIX_PATH nixpkgs=channel:nixos-unstable + set -x NIX_LOG info + set -x TERMINAL kitty + + if test (tty) = "/dev/tty1" + exec Hyprland &> /dev/null + end + ''; + shellAbbrs = { + ".." = "cd .."; + "..." = "cd ../.."; + ls = "eza"; + grep = "rg"; + ps = "procs"; + }; + }; + }; +} diff --git a/home/m3tam3re/home.nix b/home/m3tam3re/home.nix index a8ce00e..436bf90 100644 --- a/home/m3tam3re/home.nix +++ b/home/m3tam3re/home.nix @@ -24,7 +24,8 @@ # The home.packages option allows you to install Nix packages into your # environment. home.packages = with pkgs; [ - cowsay + kitty + wofi # # Adds the 'hello' command to your environment. It prints a friendly # # "Hello, world!" when run. # pkgs.hello diff --git a/home/m3tam3re/m3-kratos.nix b/home/m3tam3re/m3-kratos.nix index 7e288ee..d4be878 100644 --- a/home/m3tam3re/m3-kratos.nix +++ b/home/m3tam3re/m3-kratos.nix @@ -1 +1,13 @@ -{ config, ... }: { imports = [ ./home.nix ../common ]; } +{config, ...}: { + imports = [ + ../common + ../features/cli + ./home.nix + ]; + + features = { + cli = { + fish.enable = false; + }; + }; +} diff --git a/hosts/common/default.nix b/hosts/common/default.nix index 6e03062..ff8a063 100644 --- a/hosts/common/default.nix +++ b/hosts/common/default.nix @@ -1,5 +1,6 @@ # Common configuration for all hosts { + pkgs, lib, inputs, outputs, @@ -56,4 +57,5 @@ ((lib.filterAttrs (_: lib.isType "flake")) inputs); nixPath = ["/etc/nix/path"]; }; + users.defaultUserShell = pkgs.fish; } diff --git a/hosts/m3-kratos/configuration.nix b/hosts/m3-kratos/configuration.nix index e87af75..1ea4660 100644 --- a/hosts/m3-kratos/configuration.nix +++ b/hosts/m3-kratos/configuration.nix @@ -79,6 +79,9 @@ enable = true; xwayland.enable = true; }; + + programs.fish.enable = true; + # Open ports in the firewall. # networking.firewall.allowedTCPPorts = [ ... ]; # networking.firewall.allowedUDPPorts = [ ... ];