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 [ "$1" == "create" ]; then
if [ ! -d "$FLAKE_DIR" ]; 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" mkdir -p "$FLAKE_DIR"
FLAKE="$FLAKE_DIR"/flake.nix FLAKE="$FLAKE_DIR"/flake.nix
cp ${./flake-template.nix} "$FLAKE" cp ${./flake-template.nix} "$FLAKE"
chmod 700 "$FLAKE" chmod 700 "$FLAKE"
sed -i -e "s|SRC_PATH|$PWD|" "$FLAKE"
${pkgs.vim}/bin/vim "$FLAKE" ${pkgs.vim}/bin/vim "$FLAKE"
exit 0 exit 0
else else

View File

@@ -10,6 +10,17 @@
systems = [ "x86_64-linux" ]; systems = [ "x86_64-linux" ];
in in
{ {
packages = nixpkgs.lib.genAttrs systems (system:
# let
# pkgs = nixpkgs.legacyPackages.${system};
# in
{
default = {
src = SRC_PATH;
};
}
);
devShells = nixpkgs.lib.genAttrs systems (system: devShells = nixpkgs.lib.genAttrs systems (system:
let let
pkgs = nixpkgs.legacyPackages.${system}; pkgs = nixpkgs.legacyPackages.${system};