From 87eeb522a2010d6c3c73f9fc63edeb955b9375e0 Mon Sep 17 00:00:00 2001 From: h7x4 Date: Fri, 6 Oct 2023 17:19:50 +0200 Subject: [PATCH] home/shell: make mainProgram selection better --- home/shell.nix | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/home/shell.nix b/home/shell.nix index c687428..dd6a9e5 100644 --- a/home/shell.nix +++ b/home/shell.nix @@ -9,7 +9,10 @@ colorSlashes = colorRed "/" { middle = "/"; }; - p = pkg: "${pkgs.${pkg}}/bin/${pkg}"; + p = name: let + pkg = pkgs.${name}; + exe = if pkg.meta ? mainProgram then pkg.meta.mainProgram else name; + in "${pkg}/bin/${exe}"; in { local.shell.aliases = { @@ -82,6 +85,7 @@ in { "Nix Stuff" = { nxr = "sudo nixos-rebuild switch"; + nxrl = "sudo nixos-rebuild switch --option builders '' -L"; nix-check-syntax = "nix-instantiate --parse-only"; @@ -335,4 +339,4 @@ in { # POWERLEVEL9K_LEFT_PROMPT_ELEMENTS = ["dir" "vcs"]; # NIX_PATH = ''$HOME/.nix-defexpr/channels$\{NIX_PATH:+:}$NIX_PATH''; # }; -} \ No newline at end of file +}