diff options
| -rw-r--r-- | machines/work.nix | 8 | ||||
| -rw-r--r-- | mut/neovim/fnl/conf/init.fnl | 23 | ||||
| -rw-r--r-- | profiles/core/home.nix | 24 |
3 files changed, 33 insertions, 22 deletions
diff --git a/machines/work.nix b/machines/work.nix index 1e945b2..7fe204b 100644 --- a/machines/work.nix +++ b/machines/work.nix @@ -36,9 +36,13 @@ pkgs.kitty ]; + networking.hostName = "work"; sops.age.keyFile = "${config.hm.xdg.configHome}/sops/age/keys.txt"; homebrew = { enable = true; + casks = [ + "docker" + ]; masApps = { tailscale = 1475387142; }; @@ -53,10 +57,6 @@ nix.extraOptions = ''extra-platforms = x86_64-darwin aarch64-darwin ''; - # Create /etc/zshrc that loads the nix-darwin environment. - programs.zsh.enable = true; # default shell on catalina - # programs.fish.enable = true; - # Set Git commit hash for darwin-version. system.configurationRevision = self.rev or self.dirtyRev or null; diff --git a/mut/neovim/fnl/conf/init.fnl b/mut/neovim/fnl/conf/init.fnl index 0b4e538..aec028f 100644 --- a/mut/neovim/fnl/conf/init.fnl +++ b/mut/neovim/fnl/conf/init.fnl @@ -34,7 +34,7 @@ (map :n "<M-j>" ":cnext<cr>") (map :n "<M-k>" ":cprev<cr>") (map :n :<M-l> ":Recompile<CR>") - (map :n :<C-x> + (map :n :<C-s> #(do (vim.api.nvim_feedkeys (vim.api.nvim_replace_termcodes @@ -42,8 +42,18 @@ :n false) (vim.schedule #(do (vim.cmd "let v:searchforward = 0") - (map :n :/ "/Sh.* " {:buffer true}) - (map :n :? "?Sh.* " {:buffer true}))))) + (map :n :/ "/Sh.*" {:buffer true}) + (map :n :? "?Sh.*" {:buffer true}))))) + (map :n :<C-x> + #(do + (vim.api.nvim_feedkeys + (vim.api.nvim_replace_termcodes + ":Compile<up><c-f>" true false true) + :n false) + (vim.schedule #(do + (vim.cmd "let v:searchforward = 0") + (map :n :/ "/Compile.*" {:buffer true}) + (map :n :? "?Compile.*" {:buffer true}))))) (map :n "[q" ":cprevious<cr>") (map :n "]q" ":cnext<cr>") (map :n "[x" ":lprevious<cr>") @@ -131,6 +141,13 @@ (vim.notify (.. "\"" title "\" succeeded!")))))))))) (vim.api.nvim_create_user_command + :Compile + (fn [cmd] + (local thunk #(qfjob cmd.fargs nil)) + (set last_job_thunk thunk) + (thunk)) + {:nargs :* :bang true :complete :shellcmd}) +(vim.api.nvim_create_user_command :Sh (fn [cmd] (local thunk #(qfjob [:sh :-c cmd.args] nil)) diff --git a/profiles/core/home.nix b/profiles/core/home.nix index 64a4297..246e73d 100644 --- a/profiles/core/home.nix +++ b/profiles/core/home.nix @@ -11,8 +11,8 @@ # home.file.".local/bin".source = config.lib.meta.mkMutableSymlink /mut/bin; xdg = { enable = true; - mime.enable = !pkgs.stdenv.isDarwin; - mimeApps = optionalAttrs (!pkgs.stdenv.isDarwin) { + mime.enable = !machine.isDarwin; + mimeApps = optionalAttrs (!machine.isDarwin) { enable = true; defaultApplications = { "text/x-shellscript" = ["text.desktop"]; @@ -34,7 +34,7 @@ "x-scheme-handler/msteams" = ["teams.desktop"]; }; }; - desktopEntries = optionalAttrs (!pkgs.stdenv.isDarwin) { + desktopEntries = optionalAttrs (!machine.isDarwin) { text= { type = "Application"; name = "Text editor"; exec = "${pkgs.st}/bin/st -e kak %u"; }; file = { type = "Application"; name = "File Manager"; exec = "${pkgs.st}/bin/st -e lfub %u"; }; torrent = { type = "Application"; name = "Torrent"; exec = "${pkgs.coreutils}/bin/env transadd %U"; }; @@ -115,8 +115,10 @@ programs.bash = { enable = true; bashrcExtra = '' - (echo; echo 'eval "$(/opt/homebrew/bin/brew shellenv)"') >> /Users/ivi/.bash_profile - eval "$(/opt/homebrew/bin/brew shellenv)" + ( command -v brew ) &>/dev/null && eval "$(/opt/homebrew/bin/brew shellenv)" + ( command -v docker ) &>/dev/null && eval "$(docker completion bash)" + ( command -v kubectl ) &>/dev/null && eval "$(kubectl completion bash)" + ( command -v zoxide ) &>/dev/null && eval "$(zoxide init bash)" export PATH=$PATH:$HOME/.local/bin [[ -f ~/.cache/wal/sequences ]] && (cat ~/.cache/wal/sequences &) unset LD_PRELOAD @@ -125,27 +127,19 @@ fi # include nix.sh if it exists [[ -f ~/.nix-profile/etc/profile.d/nix.sh ]] && . ~/.nix-profile/etc/profile.d/nix.sh - # source some workspace specific stuff - [[ -f ~/env.sh ]] && . ~/env.sh - eval "$(zoxide init bash)" export COLORTERM=truecolor export GPG_TTY="$(tty)" export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket) gpgconf --launch gpg-agent ''; shellAliases = { - e = "kakup "; - es = "kakup -f"; - k9s = "k9s"; + k9s = "k9s "; k = "kubectl "; d = "docker "; ls = "ls --color=auto"; - s = "sudo nixos-rebuild switch --flake ${config.ivi.home}/flake#"; + s = "${if machine.isDarwin then "darwin-rebuild" else "sudo nixos-rebuild"} switch --flake ${config.ivi.home}/flake#${config.networking.hostName}"; b = "/run/current-system/bin/switch-to-configuration boot"; - h = "home-manager switch --flake ${config.ivi.home}/flake --impure"; - fa = "azdo-switch-project"; v = "nvim"; - V = "nvim -S .vimsession.vim"; M = "xrandr --output HDMI1 --auto --output eDP1 --off"; m = "xrandr --output eDP1 --auto --output HDMI1 --off"; mM = "xrandr --output eDP1 --auto --output HDMI1 --off"; |
