curl -s https://gist.githubusercontent.com/notnmeyer/a89531e91904c74f09582005bdf700ec/raw/f32c459f485a16096645870f525d2da6055e8871/flake-template.sh | bash
Last active
April 12, 2024 03:06
-
-
Save notnmeyer/a89531e91904c74f09582005bdf700ec to your computer and use it in GitHub Desktop.
nix flake template
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
#/usr/bin/env bash | |
echo '{ | |
inputs = { | |
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; | |
systems.url = "github:nix-systems/default"; | |
}; | |
outputs = { | |
systems, | |
nixpkgs, | |
... | |
} @ inputs: let | |
eachSystem = f: | |
nixpkgs.lib.genAttrs (import systems) ( | |
system: | |
f nixpkgs.legacyPackages.${system} | |
); | |
in { | |
devShells = eachSystem (pkgs: { | |
default = pkgs.mkShell { | |
buildInputs = [ | |
pkgs.nodejs_20 | |
]; | |
}; | |
}); | |
}; | |
}' > flake.nix | |
echo ".direnv" >> .gitignore | |
echo "use flake" > .envrc | |
echo "Done! Add your packages to flake.nix and optionally run `direnv allow`." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment