mirror of
https://github.com/bennofs/nix-script
synced 2025-01-10 04:44:21 +01:00
Support both python 2 and 3
This commit is contained in:
parent
83064dc557
commit
15c9d337ae
@ -43,7 +43,7 @@ baseEnv = ["LOCALE_ARCHIVE", "SSL_CERT_FILE" ,"LANG", "TERMINFO", "TERM"]
|
|||||||
|
|
||||||
-- | List of supported language definitions
|
-- | List of supported language definitions
|
||||||
languages :: [Language]
|
languages :: [Language]
|
||||||
languages = [haskell, python, javascript, perl, shell]
|
languages = [haskell, python 2, python 3, javascript, perl, shell]
|
||||||
where
|
where
|
||||||
haskell = Language "haskell" d r i where
|
haskell = Language "haskell" d r i where
|
||||||
d pkgs = pure ("haskellPackages.ghcWithPackages (hs: with hs; [" ++
|
d pkgs = pure ("haskellPackages.ghcWithPackages (hs: with hs; [" ++
|
||||||
@ -51,10 +51,12 @@ languages = [haskell, python, javascript, perl, shell]
|
|||||||
r script = ("runghc" , [script])
|
r script = ("runghc" , [script])
|
||||||
i script = ("ghci" , [script])
|
i script = ("ghci" , [script])
|
||||||
|
|
||||||
python = Language "python" d r i where
|
python v = Language ("python" ++ show v) d r i where
|
||||||
d pkgs = "python" : map ("pythonPackages." ++) pkgs
|
d pkgs = pure ("python" ++ (show v) ++
|
||||||
r script = ("python" , [script])
|
".withPackages (py: with py; [" ++
|
||||||
i script = ("python" , ["-i", script])
|
unwords pkgs ++ "])")
|
||||||
|
r script = ("python" ++ show v, [script])
|
||||||
|
i script = ("python" ++ show v, ["-i", script])
|
||||||
|
|
||||||
javascript = Language "javascript" d r i where
|
javascript = Language "javascript" d r i where
|
||||||
d pkgs = "node" : map ("nodePackages." ++) pkgs
|
d pkgs = "node" : map ("nodePackages." ++) pkgs
|
||||||
|
Loading…
Reference in New Issue
Block a user