mirror of
https://github.com/bennofs/nix-script
synced 2025-01-09 20:34:20 +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
|
||||
languages :: [Language]
|
||||
languages = [haskell, python, javascript, perl, shell]
|
||||
languages = [haskell, python 2, python 3, javascript, perl, shell]
|
||||
where
|
||||
haskell = Language "haskell" d r i where
|
||||
d pkgs = pure ("haskellPackages.ghcWithPackages (hs: with hs; [" ++
|
||||
@ -51,10 +51,12 @@ languages = [haskell, python, javascript, perl, shell]
|
||||
r script = ("runghc" , [script])
|
||||
i script = ("ghci" , [script])
|
||||
|
||||
python = Language "python" d r i where
|
||||
d pkgs = "python" : map ("pythonPackages." ++) pkgs
|
||||
r script = ("python" , [script])
|
||||
i script = ("python" , ["-i", script])
|
||||
python v = Language ("python" ++ show v) d r i where
|
||||
d pkgs = pure ("python" ++ (show v) ++
|
||||
".withPackages (py: with py; [" ++
|
||||
unwords pkgs ++ "])")
|
||||
r script = ("python" ++ show v, [script])
|
||||
i script = ("python" ++ show v, ["-i", script])
|
||||
|
||||
javascript = Language "javascript" d r i where
|
||||
d pkgs = "node" : map ("nodePackages." ++) pkgs
|
||||
|
Loading…
Reference in New Issue
Block a user