shell.nix
generator.
If you have the file named hs.yaml
(or hs.yml
) like below,
packages:
- ghc
- cabal-install
- haskell-language-server
shellAliases:
b: "cabal build"
c: "cabal clean"
r: "cabal run"
repl: "cabal repl"
shellHook: |
function hi() {
echo "hi"
}
Pura recognizes this file as a boilerplate of shell.nix
named hs
.
After you executed pura hs
, Pura generated a shell.nix
like below
with import <nixpkgs> {};
mkShell {
packages = [
ghc
cabal-install
haskell-language-server
];
shellHook = ''
alias b="cabal build"
alias c="cabal clean"
alias r="cabal run"
alias repl="cabal repl"
function hi() {
echo "hi"
}
'';
}
- Prepare template file
- Move to a project root directory
- Execute
pura <name>
- Done
Pura supposes the location of template files is ~/.config/pura
but you can specify it your choice by using --template-root
option.
name | type | default |
---|---|---|
packages | Array | [] |
shellAliases | Array<KeyValue<Name,Value>> | [] |
shellHook | String | "" |
shellAliases
are merged with shellHook
as shell aliases.