diff --git a/modules/home/default.nix b/modules/home/default.nix index ecbc2686..07b4b294 100644 --- a/modules/home/default.nix +++ b/modules/home/default.nix @@ -2,7 +2,7 @@ { disabledModules = [ "programs/vim.nix" ]; - imports = with (import (sources.arc-nixexprs + "/modules")).home-manager; [ base16 syncplay konawall i3gopher weechat ] ++ [ + imports = with (import (sources.arc-nixexprs + "/modules")).home-manager; [ base16 syncplay konawall i3gopher weechat shell ] ++ [ ./vim.nix ./deploy-tf (sources.tf-nix + "/modules/home/secrets.nix") diff --git a/users/kat/base/zsh.nix b/users/kat/base/zsh.nix index 69892e0a..35f80aae 100644 --- a/users/kat/base/zsh.nix +++ b/users/kat/base/zsh.nix @@ -1,6 +1,29 @@ { config, lib, pkgs, ... }: -{ +with lib; + +let + shellFunAlias = command: replacement: '' + if [[ ! -t 0 ]]; then + command ${command} $@ + else + echo 'use ${replacement}!' + fi + ''; + shellFunAliases = mapAttrs shellFunAlias; +in { + home.shell.functions = { + genmac = '' + nix run nixpkgs.openssl -c openssl rand -hex 6 | sed 's/\(..\)\(..\)\(..\)\(..\)\(..\)\(..\)/\1:\2:\3:\4:\5:\6/' + ''; + nano = '' + kitty +kitten icat ${./nano.png} + ''; + } // shellFunAliases { + sed = "sd"; + find = "fd"; + grep = "rg"; + }; xdg.dataFile = { "z/.keep".text = ""; }; home.packages = with pkgs; [ fzf fd ]; programs.zsh = { @@ -18,12 +41,6 @@ dmesg = "dmesg -HP"; lg = "log --no-pager | grep"; }; - initExtra = '' - genmac() { nix run nixpkgs.openssl -c openssl rand -hex 6 | sed 's/\(..\)\(..\)\(..\)\(..\)\(..\)\(..\)/\1:\2:\3:\4:\5:\6/' } - nano() { kitty +kitten icat ${./nano.png} } - find() { echo "use fd!" } - sed() { echo "use sd!" } - ''; localVariables = { _Z_DATA = "${config.xdg.dataHome}/z/data"; ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE = "fg=3,bold";