-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(scripts): move to scripts.nix
- Loading branch information
Showing
2 changed files
with
56 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
{ writeScriptBin, nix, nixpkgs-fmt }: | ||
{ | ||
update = writeScriptBin "update" | ||
'' | ||
for dir in `ls -d */`; do | ||
( | ||
cd $dir | ||
${nix}/bin/nix flake update # Update flake.lock | ||
${nix}/bin/nix develop $dir # Make sure this work after update | ||
) | ||
done | ||
''; | ||
|
||
test-develop = writeScriptBin "test-develop" | ||
'' | ||
for dir in `ls -d */`; do | ||
( | ||
${nix}/bin/nix develop $dir # Make sure this work after update | ||
sleep 0.2 | ||
) | ||
done | ||
''; | ||
|
||
format = writeScriptBin "format" | ||
'' | ||
${nixpkgs-fmt}/bin/nixpkgs-fmt **/*.nix | ||
''; | ||
|
||
dvt = writeScriptBin "dvt" | ||
'' | ||
if [ -z $1 ]; then | ||
echo "no template specified" | ||
exit 1 | ||
fi | ||
TEMPLATE=$1 | ||
${nix}/bin/nix \ | ||
--experimental-features 'nix-command flakes' \ | ||
flake init \ | ||
--template \ | ||
"github:efishery/dvt#''${TEMPLATE}" | ||
''; | ||
} | ||
|