From 9b9ca64fc6200727bc9017a12a8fc1f9d6f845d1 Mon Sep 17 00:00:00 2001 From: rocketcamel <87954986+rocketcamel@users.noreply.github.com> Date: Mon, 3 Feb 2025 00:26:06 -0800 Subject: [PATCH] zsh additions + qol changes (#1) * flake changes * hm enable by default, omp home-manager * zsh plugins --- nix/flake.nix | 5 ++++- nix/hosts/tux/configuration.nix | 1 - nix/hosts/wsl-kumatani/configuration.nix | 1 - nix/hosts/wsl-usahara/configuration.nix | 1 - nix/modules/commonPackages.nix | 1 - nix/modules/hm.nix | 4 +++- nix/users/luca/home.nix | 3 ++- nix/users/luca/omp.nix | 7 +++++++ nix/users/luca/zsh.nix | 16 +++++++++++++++- 9 files changed, 31 insertions(+), 8 deletions(-) create mode 100644 nix/users/luca/omp.nix diff --git a/nix/flake.nix b/nix/flake.nix index cc4ab22..00b8c9e 100644 --- a/nix/flake.nix +++ b/nix/flake.nix @@ -19,14 +19,17 @@ hosts = [ { name = "wsl-kumatani"; + architecture = "x86_64-linux"; isWSL = true; } { name = "wsl-usahara"; + architecture = "x86_64-linux"; isWSL = true; } { name = "tux"; + architecture = "x86_64-linux"; } ]; in @@ -41,7 +44,7 @@ hostname = host.name; }; }; - system = "x86_64-linux"; + system = host.architecture; modules = [ ./hosts/${host.name}/configuration.nix ./modules/default.nix diff --git a/nix/hosts/tux/configuration.nix b/nix/hosts/tux/configuration.nix index 85c8ff1..ce38614 100644 --- a/nix/hosts/tux/configuration.nix +++ b/nix/hosts/tux/configuration.nix @@ -42,7 +42,6 @@ nerd-fonts.jetbrains-mono ]; - hm.enable = true; i3.enable = true; kanata.enable = true; diff --git a/nix/hosts/wsl-kumatani/configuration.nix b/nix/hosts/wsl-kumatani/configuration.nix index 0ca33be..1d2ebd3 100644 --- a/nix/hosts/wsl-kumatani/configuration.nix +++ b/nix/hosts/wsl-kumatani/configuration.nix @@ -16,7 +16,6 @@ wsl.enable = true; wsl.defaultUser = "luca"; networking.hostName = meta.hostname; - hm.enable = true; users.users.luca = { shell = pkgs.zsh; openssh.authorizedKeys.keys = config.authorized_ssh; diff --git a/nix/hosts/wsl-usahara/configuration.nix b/nix/hosts/wsl-usahara/configuration.nix index 0ca33be..1d2ebd3 100644 --- a/nix/hosts/wsl-usahara/configuration.nix +++ b/nix/hosts/wsl-usahara/configuration.nix @@ -16,7 +16,6 @@ wsl.enable = true; wsl.defaultUser = "luca"; networking.hostName = meta.hostname; - hm.enable = true; users.users.luca = { shell = pkgs.zsh; openssh.authorizedKeys.keys = config.authorized_ssh; diff --git a/nix/modules/commonPackages.nix b/nix/modules/commonPackages.nix index 88e0280..a4b6ec2 100644 --- a/nix/modules/commonPackages.nix +++ b/nix/modules/commonPackages.nix @@ -14,7 +14,6 @@ curl stow gh - oh-my-posh neovim ripgrep git diff --git a/nix/modules/hm.nix b/nix/modules/hm.nix index f8ca2d1..c9aaad0 100644 --- a/nix/modules/hm.nix +++ b/nix/modules/hm.nix @@ -6,7 +6,9 @@ }: { options = { - hm.enable = lib.mkEnableOption "enable home-manager"; + hm.enable = lib.mkEnableOption "enable home-manager" // { + default = true; + }; }; config = lib.mkIf config.hm.enable { diff --git a/nix/users/luca/home.nix b/nix/users/luca/home.nix index f86a32c..24c8a7e 100644 --- a/nix/users/luca/home.nix +++ b/nix/users/luca/home.nix @@ -6,8 +6,9 @@ programs = { git = import ./git.nix; - zsh = import ./zsh.nix; + zsh = import ./zsh.nix { inherit pkgs; }; tmux = import ./tmux.nix { inherit pkgs; }; + oh-my-posh = import ./omp.nix; }; home.packages = with pkgs; [ diff --git a/nix/users/luca/omp.nix b/nix/users/luca/omp.nix new file mode 100644 index 0000000..8874cae --- /dev/null +++ b/nix/users/luca/omp.nix @@ -0,0 +1,7 @@ +{ + enable = true; + enableZshIntegration = true; + settings = builtins.fromTOML ( + builtins.unsafeDiscardStringContext (builtins.readFile ../../../.config/ohmyposh/zen.toml) + ); +} diff --git a/nix/users/luca/zsh.nix b/nix/users/luca/zsh.nix index 07cc35c..67975cc 100644 --- a/nix/users/luca/zsh.nix +++ b/nix/users/luca/zsh.nix @@ -1,9 +1,23 @@ +{ pkgs, ... }: { enable = true; enableCompletion = true; autosuggestion.enable = true; + history.size = 1000; envExtra = '' . "$HOME/.rokit/env" - eval "$(oh-my-posh init zsh -c ~/.config/ohmyposh/zen.toml)" ''; + oh-my-zsh = { + enable = true; + plugins = [ + "git" + ]; + }; + plugins = [ + { + name = "fzf-tab"; + src = pkgs.zsh-fzf-tab; + file = "share/fzf-tab/fzf-tab.plugin.zsh"; + } + ]; }