Created
September 19, 2019 07:28
-
-
Save fghibellini/f592d439eeff8f569df02016a00c4cad to your computer and use it in GitHub Desktop.
shell.nix file that sets up a valid `bower_components` folder to build the project and deletes it when the shell is left
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
{ pkgs ? import <nixpkgs> {} }: | |
pkgs.mkShell { | |
bowerComponents = pkgs.buildBowerComponents { | |
name = "bower-test"; | |
generated = ./bower-generated.nix; | |
src = ./.; | |
}; | |
shellHook = '' | |
function _nix_shell_cleanup { | |
rm -rf bower_components | |
} | |
trap _nix_shell_cleanup EXIT | |
rm -rf bower_components | |
ln -s "$bowerComponents/bower_components" bower_components | |
''; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment