mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 12:29:19 -08:00
users/kat/base/zsh: Rework of shell functions
This commit is contained in:
parent
a74972437d
commit
b0b23ed772
2 changed files with 25 additions and 8 deletions
|
|
@ -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")
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue