From 788e476c0104023b2cd56c9072c73611c70dc14b Mon Sep 17 00:00:00 2001 From: Jack O'Sullivan Date: Wed, 16 Feb 2022 22:45:17 +0000 Subject: [PATCH] home-modules/common: Add flake-src util --- home-modules/common.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/home-modules/common.nix b/home-modules/common.nix index 12d8d71..81c5e7e 100644 --- a/home-modules/common.nix +++ b/home-modules/common.nix @@ -40,6 +40,12 @@ in bash = { # This not only installs bash but has home-manager control .bashrc and friends enable = mkDefault true; + initExtra = + '' + flake-src() { + cd "$(nix eval "''${@:2}" --impure --raw --expr "builtins.getFlake \"$1\"")" + } + ''; }; direnv = {