From a28025ffaa785d5ce810572a49746ee6bef14d59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Thu, 2 Jun 2022 18:16:04 +0200 Subject: [PATCH] :rocket: add command substitiution function --- modules/cli/default.nix | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/modules/cli/default.nix b/modules/cli/default.nix index 36fd792..fe2e9a2 100644 --- a/modules/cli/default.nix +++ b/modules/cli/default.nix @@ -12,7 +12,12 @@ ./spotify.nix ./yubikey.nix ]; - modules.cli.shell = let editor = "emacsclient -t -a 'emacs -t'"; + modules.cli.shell = let + editor = "emacsclient -t -a 'emacs -t'"; + cmdSub = command: + "${ + if (config.modules.cli.shell.name == "fish") then "" else "$" + }${command}"; in { name = "fish"; abbreviations = { @@ -50,9 +55,8 @@ nixpkgs-review = "nixpkgs-review-checks"; - nixpkgs-pr = "nixpkgs-review pr --token ${ - if (config.modules.cli.shell.name == "fish") then "" else "$" - }(cat /run/agenix/github)"; + nixpkgs-pr = + "nixpkgs-review pr --token ${cmdSub "cat /run/agenix/github"}"; latexwatch = ''find -type f -name "*.tex" | entr -c latexmk -pdf -silent'';