From 95bc01f27764cfdfc6229ffe3d59517dea0c9e5b Mon Sep 17 00:00:00 2001 From: David Morgan Date: Tue, 3 Sep 2024 15:26:06 +0000 Subject: Reformat with newer nixfmt --- nix-conf/home/djmuk1.nix | 3 +- nix-conf/home/djmuk2.nix | 3 +- nix-conf/home/edrahil.nix | 12 +- nix-conf/home/egalmoth.nix | 3 +- nix-conf/home/includes/clojure.nix | 27 ++++- nix-conf/home/includes/common.nix | 97 +++++++++++------ nix-conf/home/includes/darwin.nix | 17 ++- nix-conf/home/includes/dev-common.nix | 58 +++++----- nix-conf/home/includes/irssi.nix | 21 ++-- nix-conf/home/includes/linux-dev.nix | 11 +- nix-conf/home/includes/linux-server.nix | 4 +- .../home/includes/scripts/hm-changes-report.nix | 7 +- .../includes/scripts/system-changes-report.nix | 7 +- nix-conf/home/includes/zsh.nix | 121 ++++++++++----------- nix-conf/home/otm.nix | 38 ++++--- 15 files changed, 254 insertions(+), 175 deletions(-) (limited to 'nix-conf/home') diff --git a/nix-conf/home/djmuk1.nix b/nix-conf/home/djmuk1.nix index 6ca3473..d11499e 100644 --- a/nix-conf/home/djmuk1.nix +++ b/nix-conf/home/djmuk1.nix @@ -1,4 +1,5 @@ -{ config, pkgs, ... }: { +{ config, pkgs, ... }: +{ imports = [ ./includes/linux-server.nix ]; # Let Home Manager install and manage itself. diff --git a/nix-conf/home/djmuk2.nix b/nix-conf/home/djmuk2.nix index 250f564..576ed39 100644 --- a/nix-conf/home/djmuk2.nix +++ b/nix-conf/home/djmuk2.nix @@ -1,4 +1,5 @@ -{ config, pkgs, ... }: { +{ config, pkgs, ... }: +{ imports = [ ./includes/linux-server.nix ]; # Let Home Manager install and manage itself. diff --git a/nix-conf/home/edrahil.nix b/nix-conf/home/edrahil.nix index 4e654e3..9b7f2fb 100644 --- a/nix-conf/home/edrahil.nix +++ b/nix-conf/home/edrahil.nix @@ -1,5 +1,9 @@ -{ config, pkgs, ... }: { - imports = [ ./includes/linux-server.nix ./includes/irssi.nix ]; +{ config, pkgs, ... }: +{ + imports = [ + ./includes/linux-server.nix + ./includes/irssi.nix + ]; # Let Home Manager install and manage itself. programs.home-manager.enable = true; @@ -9,7 +13,9 @@ home.username = "djm"; home.homeDirectory = "/home/djm"; - home.sessionVariables = { TMUX_AUTO_ATTACH = 1; }; + home.sessionVariables = { + TMUX_AUTO_ATTACH = 1; + }; # This value determines the Home Manager release that your # configuration is compatible with. This helps avoid breakage diff --git a/nix-conf/home/egalmoth.nix b/nix-conf/home/egalmoth.nix index e680ee3..79d29d0 100644 --- a/nix-conf/home/egalmoth.nix +++ b/nix-conf/home/egalmoth.nix @@ -1,4 +1,5 @@ -{ config, pkgs, ... }: { +{ config, pkgs, ... }: +{ imports = [ ./includes/linux-dev.nix ]; # Let Home Manager install and manage itself. diff --git a/nix-conf/home/includes/clojure.nix b/nix-conf/home/includes/clojure.nix index e362fd0..85bd261 100644 --- a/nix-conf/home/includes/clojure.nix +++ b/nix-conf/home/includes/clojure.nix @@ -1,8 +1,23 @@ -{ config, pkgs, lib, ... }: -let inherit (lib) optionals; -in { - home.packages = with pkgs; - [ babashka clj-kondo clojure clojure-lsp jet maven neil ] +{ + config, + pkgs, + lib, + ... +}: +let + inherit (lib) optionals; +in +{ + home.packages = + with pkgs; + [ + babashka + clj-kondo + clojure + clojure-lsp + jet + maven + neil + ] ++ optionals stdenv.isLinux [ leiningen ]; } - diff --git a/nix-conf/home/includes/common.nix b/nix-conf/home/includes/common.nix index 9ae2151..68fc9e1 100644 --- a/nix-conf/home/includes/common.nix +++ b/nix-conf/home/includes/common.nix @@ -1,16 +1,22 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: let - hcr = - pkgs.callPackage ./scripts/hm-changes-report.nix { inherit config pkgs; }; - scr = pkgs.callPackage ./scripts/system-changes-report.nix { - inherit config pkgs; - }; + hcr = pkgs.callPackage ./scripts/hm-changes-report.nix { inherit config pkgs; }; + scr = pkgs.callPackage ./scripts/system-changes-report.nix { inherit config pkgs; }; unstable = import { }; -in { - imports = [ ./zsh.nix ]; +in +{ + imports = [ + ./zsh.nix + + ]; - nixpkgs.config.allowUnfreePredicate = pkg: - builtins.elem (lib.getName pkg) [ "aspell-dict-en-science" ]; + nixpkgs.config.allowUnfreePredicate = + pkg: builtins.elem (lib.getName pkg) [ "aspell-dict-en-science" ]; sops = { age.keyFile = "${config.xdg.configHome}/sops/age/keys.txt"; @@ -90,13 +96,21 @@ in { config = { style = "full"; pager = "less -RXF"; - map-syntax = [ ".ignore:.gitignore" "*.jenkinsfile:Groovy" ]; + map-syntax = [ + ".ignore:.gitignore" + "*.jenkinsfile:Groovy" + ]; }; }; nix = { package = pkgs.nix; - settings = { extra-experimental-features = [ "nix-command" "flakes" ]; }; + settings = { + extra-experimental-features = [ + "nix-command" + "flakes" + ]; + }; }; programs.gpg.enable = true; @@ -155,8 +169,10 @@ in { UseKeychain yes User djm ''; - includes = - [ "~/.ssh/config_local" config.sops.secrets."ssh_config/oci".path ]; + includes = [ + "~/.ssh/config_local" + config.sops.secrets."ssh_config/oci".path + ]; matchBlocks = { "djm.ovh" = { hostname = "v.djm.ovh"; @@ -183,10 +199,18 @@ in { hostname = "ssh.blinkenshell.org"; port = 2222; }; - "hashbang" = { hostname = "de1.hashbang.sh"; }; - "tilde.institute" = { hostname = "tilde.institute"; }; - "tilde.team" = { hostname = "tilde.team"; }; - "ctrl-c.club" = { hostname = "ctrl-c.club"; }; + "hashbang" = { + hostname = "de1.hashbang.sh"; + }; + "tilde.institute" = { + hostname = "tilde.institute"; + }; + "tilde.team" = { + hostname = "tilde.team"; + }; + "ctrl-c.club" = { + hostname = "ctrl-c.club"; + }; "github.com" = { hostname = "github.com"; user = "git"; @@ -199,18 +223,14 @@ in { programs.git = { enable = true; userName = "David Morgan"; - includes = - [{ path = config.sops.secrets."git_email_config/default".path; }]; + includes = [ { path = config.sops.secrets."git_email_config/default".path; } ]; aliases = { # difftastic - logt = - "!sh -c 'GIT_EXTERNAL_DIFF=\"difft --background=dark\" git log -p --ext-diff'"; - showt = - "!show() { GIT_EXTERNAL_DIFF=difft git show \${1} --ext-diff; }; show"; + logt = "!sh -c 'GIT_EXTERNAL_DIFF=\"difft --background=dark\" git log -p --ext-diff'"; + showt = "!show() { GIT_EXTERNAL_DIFF=difft git show \${1} --ext-diff; }; show"; difft = "difftool"; # "raw" output - rlog = - "!git -c delta.raw=true -c core.pager=${pkgs.less}/bin/less log"; # usually used with -p + rlog = "!git -c delta.raw=true -c core.pager=${pkgs.less}/bin/less log"; # usually used with -p rshow = "!git -c delta.raw=true -c core.pager=${pkgs.less}/bin/less show"; rdiff = "!git -c delta.raw=true -c core.pager=${pkgs.less}/bin/less diff"; # copiable output (without line numbers or +/- indicators) @@ -218,8 +238,7 @@ in { cshow = "!git -c delta.line-numbers=false show"; cdiff = "!git -c delta.line-numbers=false diff"; # diff-so-fancy - flog = '' - !git -c core.pager="diff-so-fancy | less" log''; # usually used with -p + flog = ''!git -c core.pager="diff-so-fancy | less" log''; # usually used with -p fshow = ''!git -c core.pager="diff-so-fancy | less" show''; fdiff = ''!git -c core.pager="diff-so-fancy | less" diff''; @@ -227,25 +246,36 @@ in { update-master = "!git fetch origin master:master"; update-main = "!git fetch origin main:main"; }; - attributes = [ "*.el diff=elisp" "*.clj diff=clojure" ]; + attributes = [ + "*.el diff=elisp" + "*.clj diff=clojure" + ]; extraConfig = { core.editor = "vim"; diff = { tool = "difftastic"; colorMoved = "default"; - elisp = { xfuncname = "^\\((((def\\S+)|use-package)\\s+\\S+)"; }; - clojure = { xfuncname = "^\\((def\\S+\\s+\\S+)"; }; + elisp = { + xfuncname = "^\\((((def\\S+)|use-package)\\s+\\S+)"; + }; + clojure = { + xfuncname = "^\\((def\\S+\\s+\\S+)"; + }; }; difftool = { prompt = false; - difftastic = { cmd = ''difft "$LOCAL" "$REMOTE"''; }; + difftastic = { + cmd = ''difft "$LOCAL" "$REMOTE"''; + }; }; pull = { ff = "only"; rebase = false; }; push.autoSetupRemote = true; - rebase = { autostash = true; }; + rebase = { + autostash = true; + }; }; delta = { enable = true; @@ -273,4 +303,3 @@ in { }; }; } - diff --git a/nix-conf/home/includes/darwin.nix b/nix-conf/home/includes/darwin.nix index 4001348..7372d66 100644 --- a/nix-conf/home/includes/darwin.nix +++ b/nix-conf/home/includes/darwin.nix @@ -1,4 +1,9 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: with lib; let @@ -21,7 +26,8 @@ let --prefix PYTHONPATH : $out/${pkgs.mopidyPackages.python.sitePackages} ''; }; -in { +in +{ imports = [ ./dev-common.nix ]; home.packages = with pkgs; [ @@ -30,8 +36,10 @@ in { coreutils curl diffutils - ((emacsPackagesFor emacs29-macport).emacsWithPackages - (ps: [ ps.vterm ps.multi-vterm ])) + ((emacsPackagesFor emacs29-macport).emacsWithPackages (ps: [ + ps.vterm + ps.multi-vterm + ])) findutils gh gh-dash @@ -62,4 +70,3 @@ in { keep-derivations = true; }; } - diff --git a/nix-conf/home/includes/dev-common.nix b/nix-conf/home/includes/dev-common.nix index 97fb3a6..12f4893 100644 --- a/nix-conf/home/includes/dev-common.nix +++ b/nix-conf/home/includes/dev-common.nix @@ -1,9 +1,20 @@ -{ config, pkgs, lib, ... }: -let inherit (lib) optionals; -in { - imports = [ ./common.nix ./clojure.nix ]; +{ + config, + pkgs, + lib, + ... +}: +let + inherit (lib) optionals; +in +{ + imports = [ + ./common.nix + ./clojure.nix + ]; - home.packages = with pkgs; + home.packages = + with pkgs; [ docker docker-compose @@ -11,7 +22,11 @@ in { gopass-jsonapi multimarkdown neovim - ] ++ optionals (!stdenv.isDarwin) [ ffmpeg mpv ]; + ] + ++ optionals (!stdenv.isDarwin) [ + ffmpeg + mpv + ]; programs.tmux = { enable = true; @@ -37,14 +52,8 @@ in { set -g @thumbs-unique enabled set -g @thumbs-position right set -g @thumbs-contrast 1 - #${ - lib.optionalString pkgs.stdenv.isLinux - "set -g @thumbs-upcase-command 'xargs xdg-open {}'" - } - #${ - lib.optionalString pkgs.stdenv.isDarwin - "set -g @thumbs-upcase-command 'xargs open {}'" - } + #${lib.optionalString pkgs.stdenv.isLinux "set -g @thumbs-upcase-command 'xargs xdg-open {}'"} + #${lib.optionalString pkgs.stdenv.isDarwin "set -g @thumbs-upcase-command 'xargs open {}'"} ''; } ]; @@ -61,20 +70,15 @@ in { set-option -g status-left-length 50 set-option -g status-right " %a, %b %d - %H:%M " - ${ - lib.optionalString pkgs.stdenv.isLinux '' - bind-key -T copy-mode y send-keys -X copy-pipe-and-cancel "xsel -i -p && xsel -o -p | xsel -i -b" - bind-key C-y run "xsel -o | tmux load-buffer - ; tmux paste-buffer" - '' - } - ${ - lib.optionalString pkgs.stdenv.isDarwin '' - bind-key -T copy-mode y send-keys -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy" - bind-key C-y run "reattach-to-user-namespace pbpaste | tmux load-buffer - ; tmux paste-buffer" - '' - } + ${lib.optionalString pkgs.stdenv.isLinux '' + bind-key -T copy-mode y send-keys -X copy-pipe-and-cancel "xsel -i -p && xsel -o -p | xsel -i -b" + bind-key C-y run "xsel -o | tmux load-buffer - ; tmux paste-buffer" + ''} + ${lib.optionalString pkgs.stdenv.isDarwin '' + bind-key -T copy-mode y send-keys -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy" + bind-key C-y run "reattach-to-user-namespace pbpaste | tmux load-buffer - ; tmux paste-buffer" + ''} ''; }; } - diff --git a/nix-conf/home/includes/irssi.nix b/nix-conf/home/includes/irssi.nix index 1c43867..54bdc9b 100644 --- a/nix-conf/home/includes/irssi.nix +++ b/nix-conf/home/includes/irssi.nix @@ -1,4 +1,9 @@ -{ config, pkgs, lib, ... }: +{ + config, + pkgs, + lib, + ... +}: { programs.irssi = { @@ -141,7 +146,9 @@ certificateFile = "${config.home.homeDirectory}/.irssi/oftc.pem"; }; }; - channels = { home-manager.autoJoin = true; }; + channels = { + home-manager.autoJoin = true; + }; }; blinkenirc = { nick = "djm"; @@ -158,8 +165,7 @@ ssl = { enable = true; verify = true; - certificateFile = - "${config.home.homeDirectory}/.irssi/blinkenirc.pem"; + certificateFile = "${config.home.homeDirectory}/.irssi/blinkenirc.pem"; }; }; channels = { @@ -178,11 +184,12 @@ ssl = { enable = true; verify = true; - certificateFile = - "${config.home.homeDirectory}/.irssi/hashbang.pem"; + certificateFile = "${config.home.homeDirectory}/.irssi/hashbang.pem"; }; }; - channels = { "#!".autoJoin = true; }; + channels = { + "#!".autoJoin = true; + }; }; }; }; diff --git a/nix-conf/home/includes/linux-dev.nix b/nix-conf/home/includes/linux-dev.nix index ddccc25..a7a8dda 100644 --- a/nix-conf/home/includes/linux-dev.nix +++ b/nix-conf/home/includes/linux-dev.nix @@ -1,10 +1,16 @@ -{ config, pkgs, ... }: { +{ config, pkgs, ... }: +{ imports = [ ./dev-common.nix ]; programs.emacs = { enable = true; package = pkgs.emacs29; - extraPackages = (epkgs: [ epkgs.vterm epkgs.multi-vterm ]); + extraPackages = ( + epkgs: [ + epkgs.vterm + epkgs.multi-vterm + ] + ); }; home.packages = with pkgs; [ @@ -18,4 +24,3 @@ ]; } - diff --git a/nix-conf/home/includes/linux-server.nix b/nix-conf/home/includes/linux-server.nix index fc3a2f7..e5f9caa 100644 --- a/nix-conf/home/includes/linux-server.nix +++ b/nix-conf/home/includes/linux-server.nix @@ -1,4 +1,5 @@ -{ config, pkgs, ... }: { +{ config, pkgs, ... }: +{ imports = [ ./common.nix ]; home.packages = with pkgs; [ @@ -49,4 +50,3 @@ programs.vim.packageConfigurable = pkgs.vim; } - diff --git a/nix-conf/home/includes/scripts/hm-changes-report.nix b/nix-conf/home/includes/scripts/hm-changes-report.nix index 0df6e4c..65e7fe8 100644 --- a/nix-conf/home/includes/scripts/hm-changes-report.nix +++ b/nix-conf/home/includes/scripts/hm-changes-report.nix @@ -2,9 +2,9 @@ # https://github.com/gvolpe/nix-config/blob/e28a220d0087064e6bad6b992b4914a65eb545e5/home/scripts/changes-report.nix let - hm-profiles = - "${config.home.homeDirectory}/.local/state/nix/profiles/home-manager-*-link"; -in pkgs.writeShellScriptBin "hm-changes-report" '' + hm-profiles = "${config.home.homeDirectory}/.local/state/nix/profiles/home-manager-*-link"; +in +pkgs.writeShellScriptBin "hm-changes-report" '' # Disable nvd if there are less than 2 hm profiles. if [ $(ls -d1v ${hm-profiles} 2>/dev/null | wc -l) -lt 2 ]; then echo "Skipping changes report..." @@ -12,4 +12,3 @@ in pkgs.writeShellScriptBin "hm-changes-report" '' ${pkgs.nvd}/bin/nvd diff $(ls -d1v ${hm-profiles} | tail -2) fi '' - diff --git a/nix-conf/home/includes/scripts/system-changes-report.nix b/nix-conf/home/includes/scripts/system-changes-report.nix index c7f0449..b94498c 100644 --- a/nix-conf/home/includes/scripts/system-changes-report.nix +++ b/nix-conf/home/includes/scripts/system-changes-report.nix @@ -1,8 +1,10 @@ { config, pkgs, ... }: # https://github.com/gvolpe/nix-config/blob/e28a220d0087064e6bad6b992b4914a65eb545e5/home/scripts/changes-report.nix -let system-profiles = "/nix/var/nix/profiles/system-*-link"; -in pkgs.writeShellScriptBin "system-changes-report" '' +let + system-profiles = "/nix/var/nix/profiles/system-*-link"; +in +pkgs.writeShellScriptBin "system-changes-report" '' # Disable nvd if there are less than 2 hm profiles. if [ $(ls -d1v ${system-profiles} 2>/dev/null | wc -l) -lt 2 ]; then echo "Skipping changes report..." @@ -10,4 +12,3 @@ in pkgs.writeShellScriptBin "system-changes-report" '' ${pkgs.nvd}/bin/nvd diff $(ls -d1v ${system-profiles} | tail -2) fi '' - diff --git a/nix-conf/home/includes/zsh.nix b/nix-conf/home/includes/zsh.nix index 049bd88..9a8c1cf 100644 --- a/nix-conf/home/includes/zsh.nix +++ b/nix-conf/home/includes/zsh.nix @@ -1,6 +1,13 @@ -{ config, pkgs, lib, ... }: -let inherit (lib) optionalAttrs optionals; -in { +{ + config, + pkgs, + lib, + ... +}: +let + inherit (lib) optionalAttrs optionals; +in +{ home.packages = with pkgs; [ zsh-completions ]; programs.fzf = { @@ -17,8 +24,15 @@ in { }; programs.keychain = { enable = lib.mkIf pkgs.stdenv.isLinux true; - agents = [ "ssh" "gpg" ]; - keys = [ "id_rsa" "id_ed25519" "C171251002C200F2" ]; + agents = [ + "ssh" + "gpg" + ]; + keys = [ + "id_rsa" + "id_ed25519" + "C171251002C200F2" + ]; # extraFlags = [ "--quiet" "--ignore-missing" ]; }; programs.command-not-found.enable = true; @@ -52,24 +66,16 @@ in { pp = ''pushbullet push "Pixel" link "''${1}" "''${1}"''; - upgrade_emacs = '' - cp ~/.emacs.d/straight/versions/default.el ~/straight-versions-default-`date "+%Y-%m-%d-%H%M%S"`.el && emacs --batch -l "~/.emacs.d/init.el" -f "my/upgrade-packages"''; - diff_emacs = - "difft --color always --context 0 $(ls -d1v ~/straight-versions-default-*.el | tail -1) ~/.emacs.d/straight/versions/default.el | grep '\\[9[12]' | egrep -v '(gnu-elpa-mirror|nongnu-elpa|melpa|emacsmirror-mirror)'"; - - nix-up = - "git -C ~/dotfiles pull && doas nix-channel --update && doas nixos-rebuild switch && nix-channel --update && home-manager switch && system-changes-report && hm-changes-report && df -h && date"; - _nix-up = - "doas nix-channel --update && doas nixos-rebuild switch && nix-channel --update && home-manager switch && system-changes-report && hm-changes-report && df -h && date"; - home-up = - "git -C ~/dotfiles pull && nix-channel --update && home-manager switch && hm-changes-report"; - _home-up = - "nix-channel --update && home-manager switch && hm-changes-report"; - nix-hammer = - "nix shell -f https://github.com/jtojnar/nixpkgs-hammering/archive/master.tar.gz -c nixpkgs-hammer"; - - fb = - "fzf --preview 'bat --color=always --style=numbers --line-range=:500 {}'"; + upgrade_emacs = ''cp ~/.emacs.d/straight/versions/default.el ~/straight-versions-default-`date "+%Y-%m-%d-%H%M%S"`.el && emacs --batch -l "~/.emacs.d/init.el" -f "my/upgrade-packages"''; + diff_emacs = "difft --color always --context 0 $(ls -d1v ~/straight-versions-default-*.el | tail -1) ~/.emacs.d/straight/versions/default.el | grep '\\[9[12]' | egrep -v '(gnu-elpa-mirror|nongnu-elpa|melpa|emacsmirror-mirror)'"; + + nix-up = "git -C ~/dotfiles pull && doas nix-channel --update && doas nixos-rebuild switch && nix-channel --update && home-manager switch && system-changes-report && hm-changes-report && df -h && date"; + _nix-up = "doas nix-channel --update && doas nixos-rebuild switch && nix-channel --update && home-manager switch && system-changes-report && hm-changes-report && df -h && date"; + home-up = "git -C ~/dotfiles pull && nix-channel --update && home-manager switch && hm-changes-report"; + _home-up = "nix-channel --update && home-manager switch && hm-changes-report"; + nix-hammer = "nix shell -f https://github.com/jtojnar/nixpkgs-hammering/archive/master.tar.gz -c nixpkgs-hammer"; + + fb = "fzf --preview 'bat --color=always --style=numbers --line-range=:500 {}'"; zz = "z $PWD"; @@ -77,8 +83,7 @@ in { erg = "ea run grouped rg --"; fd = "ea run linear fd --"; - git-reset-branch = - "git fetch && git reset --hard origin/$(git branch --show-current)"; + git-reset-branch = "git fetch && git reset --hard origin/$(git branch --show-current)"; # Git log aliases from the omz git plugin gl = "git pull"; @@ -88,27 +93,23 @@ in { glgga = "git log --graph --decorate --all"; glgm = "git log --graph --max-count=10"; glo_ = "git log --oneline --decorate"; - glol = '' - git log --graph --pretty="%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ar) %C(bold blue)<%an>%Creset"''; - glols = '' - git log --graph --pretty="%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ar) %C(bold blue)<%an>%Creset" --stat''; - glod = '' - git log --graph --pretty="%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ad) %C(bold blue)<%an>%Creset"''; - glods = '' - git log --graph --pretty="%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ad) %C(bold blue)<%an>%Creset" --date=short''; - glola = '' - git log --graph --pretty="%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ar) %C(bold blue)<%an>%Creset" --all''; + glol = ''git log --graph --pretty="%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ar) %C(bold blue)<%an>%Creset"''; + glols = ''git log --graph --pretty="%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ar) %C(bold blue)<%an>%Creset" --stat''; + glod = ''git log --graph --pretty="%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ad) %C(bold blue)<%an>%Creset"''; + glods = ''git log --graph --pretty="%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ad) %C(bold blue)<%an>%Creset" --date=short''; + glola = ''git log --graph --pretty="%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ar) %C(bold blue)<%an>%Creset" --all''; glog = "git log --oneline --decorate --graph"; gloga = "git log --oneline --decorate --graph --all"; - } // optionalAttrs pkgs.stdenv.isDarwin { - oemacs = "open -a /Applications/Emacs.app"; - }; + } // optionalAttrs pkgs.stdenv.isDarwin { oemacs = "open -a /Applications/Emacs.app"; }; localVariables = { PER_DIRECTORY_HISTORY_TOGGLE = "^\\\\"; # ^\\ is ^# HISTORY_START_WITH_GLOBAL = true; - ZSH_AUTOSUGGEST_STRATEGY = [ "history" "completion" ]; + ZSH_AUTOSUGGEST_STRATEGY = [ + "history" + "completion" + ]; NVM_AUTO_USE = true; NVM_LAZY_LOAD = true; @@ -116,15 +117,11 @@ in { LSP_USE_PLISTS = true; LESS = "-iRXF"; - FZF_DEFAULT_COMMAND = '' - rg --files --no-ignore --hidden --follow -g \"!{.git,node_modules}/*\" 2> /dev/null''; - FZF_CTRL_T_COMMAND = - config.programs.zsh.localVariables.FZF_DEFAULT_COMMAND; - FZF_ALT_C_COMMAND = '' - rg --hidden --files --sort-files --null -g \"!{.git,node_modules}/*\" | xargs -0 dirname | sort -u''; + FZF_DEFAULT_COMMAND = ''rg --files --no-ignore --hidden --follow -g \"!{.git,node_modules}/*\" 2> /dev/null''; + FZF_CTRL_T_COMMAND = config.programs.zsh.localVariables.FZF_DEFAULT_COMMAND; + FZF_ALT_C_COMMAND = ''rg --hidden --files --sort-files --null -g \"!{.git,node_modules}/*\" | xargs -0 dirname | sort -u''; FZF_ALT_C_OPTS = "--preview 'eza --tree {} | head -200'"; - FZF_CTRL_R_OPTS = - "--preview 'echo {}' --preview-window down:3:hidden:wrap --bind 'ctrl-t:toggle-preview'"; + FZF_CTRL_R_OPTS = "--preview 'echo {}' --preview-window down:3:hidden:wrap --bind 'ctrl-t:toggle-preview'"; FZF_DEFAULT_OPTS = "--bind=ctrl-t:toggle-all --bind=ctrl-j:jump"; }; initExtraFirst = '' @@ -284,7 +281,8 @@ in { [[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh ''; - plugins = with pkgs; + plugins = + with pkgs; [ { name = "zsh-autopair"; @@ -314,8 +312,7 @@ in { { name = "zsh-history-substring-search"; src = zsh-history-substring-search; - file = - "share/zsh-history-substring-search/zsh-history-substring-search.zsh"; + file = "share/zsh-history-substring-search/zsh-history-substring-search.zsh"; } { name = "zsh-forgit"; @@ -342,16 +339,18 @@ in { }; file = "per-directory-history.zsh"; } - ] ++ optionals stdenv.isDarwin [{ - name = "zsh-nvm"; - src = fetchFromGitHub { - owner = "lukechilds"; - repo = "zsh-nvm"; - rev = "23067bd9bb6eb6f4737a3ea90cb0cb5e85f61ba2"; - sha256 = "Zwdi7bezMFKaIKYwsSftu3mJSFvadEWmY2hYnU1Kpu4="; - }; - file = "zsh-nvm.plugin.zsh"; - }]; + ] + ++ optionals stdenv.isDarwin [ + { + name = "zsh-nvm"; + src = fetchFromGitHub { + owner = "lukechilds"; + repo = "zsh-nvm"; + rev = "23067bd9bb6eb6f4737a3ea90cb0cb5e85f61ba2"; + sha256 = "Zwdi7bezMFKaIKYwsSftu3mJSFvadEWmY2hYnU1Kpu4="; + }; + file = "zsh-nvm.plugin.zsh"; + } + ]; }; } - diff --git a/nix-conf/home/otm.nix b/nix-conf/home/otm.nix index b9e3c44..839540c 100644 --- a/nix-conf/home/otm.nix +++ b/nix-conf/home/otm.nix @@ -1,4 +1,9 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: let zscaler-cert = '' -----BEGIN CERTIFICATE----- @@ -81,12 +86,12 @@ let -----END CERTIFICATE----- ''; - aws-cert = (builtins.readFile - "${pkgs.awscli2}/lib/python${pkgs.awscli2.python.pythonVersion}/site-packages/awscli/botocore/cacert.pem") + aws-cert = + (builtins.readFile "${pkgs.awscli2}/lib/python${pkgs.awscli2.python.pythonVersion}/site-packages/awscli/botocore/cacert.pem") + zscaler-cert; - full-cert = (builtins.readFile /etc/ssl/cert.pem) + aws-cert + internal-cert - + internal-staging-cert; + full-cert = + (builtins.readFile /etc/ssl/cert.pem) + aws-cert + internal-cert + internal-staging-cert; zscaler-cert-file = pkgs.writeText "zscaler-cert.pem" zscaler-cert; aws-cert-file = pkgs.writeText "aws-cert.pem" aws-cert; @@ -97,13 +102,16 @@ let # See https://github.com/nix-community/home-manager/blob/086f619dd991a4d355c07837448244029fc2d9ab/modules/programs/java.nix#L39-L41 # and https://github.com/NixOS/nixpkgs/blob/4877ea239f4d02410c3516101faf35a81af0c30e/pkgs/development/compilers/openjdk/jre.nix#L32 passthru.home = "${zscaler-jdk}"; # make sure JAVA_HOME is set - installPhase = old.installPhase + '' - $out/bin/keytool -import -noprompt -trustcacerts -alias zscalerrootca -keystore $out/lib/security/cacerts <<< "${zscaler-cert}" - ''; + installPhase = + old.installPhase + + '' + $out/bin/keytool -import -noprompt -trustcacerts -alias zscalerrootca -keystore $out/lib/security/cacerts <<< "${zscaler-cert}" + ''; }); zscaler-lein = pkgs.leiningen.override { jdk = zscaler-jdk; }; -in { +in +{ imports = [ ./includes/darwin.nix ]; # Let Home Manager install and manage itself. @@ -127,15 +135,11 @@ in { }; home.shellAliases = { - notify_success = '' - ( osascript -e 'display notification "The command finished" with title "Success"' && afplay /System/Library/Sounds/Ping.aiff && say done )''; - notify_failure = '' - ( osascript -e 'display notification "The command failed" with title "Failure"' && afplay /System/Library/Sounds/Sosumi.aiff && say failed )''; + notify_success = ''( osascript -e 'display notification "The command finished" with title "Success"' && afplay /System/Library/Sounds/Ping.aiff && say done )''; + notify_failure = ''( osascript -e 'display notification "The command failed" with title "Failure"' && afplay /System/Library/Sounds/Sosumi.aiff && say failed )''; notify = "notify_success || notify_failure"; - auth = - "auth2aws login -r aws_otm_dev_developers,aws_otm_prd_developers && osascript -e 'tell app \"iTerm\" to activate'"; - yarn_build = - "aws codeartifact login --tool npm --repository otm-js --domain otm --domain-owner 103567893073 --region eu-west-1 --profile aws_otm_dev_developers && yarn && yarn build && notify"; + auth = "auth2aws login -r aws_otm_dev_developers,aws_otm_prd_developers && osascript -e 'tell app \"iTerm\" to activate'"; + yarn_build = "aws codeartifact login --tool npm --repository otm-js --domain otm --domain-owner 103567893073 --region eu-west-1 --profile aws_otm_dev_developers && yarn && yarn build && notify"; }; home.packages = with pkgs; [ zscaler-lein ]; -- cgit 1.4.1-2-gfad0