pinwheel: Inject src path in flake templates for skal

This commit is contained in:
Alexander Heldt
2023-11-11 16:14:09 +01:00
parent 16199dd192
commit ea9de56810
2 changed files with 16 additions and 1 deletions

View File

@@ -15,11 +15,15 @@ let
if [ "$1" == "create" ]; then
if [ ! -d "$FLAKE_DIR" ]; then
echo Creating flake "$FLAKE_DIR"
PWD=$(pwd)
echo Creating flake '"$FLAKE_DIR' using '$PWD' as source path"
mkdir -p "$FLAKE_DIR"
FLAKE="$FLAKE_DIR"/flake.nix
cp ${./flake-template.nix} "$FLAKE"
chmod 700 "$FLAKE"
sed -i -e "s|SRC_PATH|$PWD|" "$FLAKE"
${pkgs.vim}/bin/vim "$FLAKE"
exit 0
else