mirror of
https://github.com/bennofs/nix-script
synced 2025-01-10 04:44:21 +01:00
Add more languages
This commit is contained in:
parent
d28f2a06ea
commit
14c4b916ba
@ -32,7 +32,7 @@ data LangDef = LangDef
|
||||
}
|
||||
|
||||
languages :: [LangDef]
|
||||
languages = [haskell, shell]
|
||||
languages = [haskell, python, javascript, perl, shell]
|
||||
|
||||
haskell :: LangDef
|
||||
haskell = LangDef "haskell" d r i where
|
||||
@ -41,6 +41,27 @@ haskell = LangDef "haskell" d r i where
|
||||
r script = ("runhaskell" , [script])
|
||||
i script = ("ghci" , [script])
|
||||
|
||||
python :: LangDef
|
||||
python = LangDef "python" d r i where
|
||||
d pkgs = return $
|
||||
Text.unwords (map ("pythonPackages." <>) pkgs)
|
||||
r script = ("python" , [script])
|
||||
i script = ("python" , ["-i", script])
|
||||
|
||||
javascript :: LangDef
|
||||
javascript = LangDef "javascript" d r i where
|
||||
d pkgs = return $
|
||||
Text.unwords (map ("nodePackages." <>) pkgs)
|
||||
r script = ("node" , [script])
|
||||
i script = ("node" , [])
|
||||
|
||||
perl :: LangDef
|
||||
perl = LangDef "perl" d r i where
|
||||
d pkgs = return $
|
||||
Text.unwords (map ("perlPackages." <>) pkgs)
|
||||
r script = ("perl" , [script])
|
||||
i script = ("perl" , ["-d", script])
|
||||
|
||||
shell :: LangDef
|
||||
shell = LangDef "shell" (extraPackages ++) r i where
|
||||
r script = ("bash", [script])
|
||||
|
Loading…
Reference in New Issue
Block a user