v21*_*217 0 nixos nix nix-shell
shell.nix以下 cmdline 参数的最短等效项是什么?
nix-shell -p "haskell.packages.ghc865.ghcWithPackages (p: [p.ghci-pretty])"
Run Code Online (Sandbox Code Playgroud)
这有效,但它很冗长:
# contents of shell.nix file
# run with the following cmd:
# nix-shell shell.nix
{ nixpkgs ? import <nixpkgs> {} }:
let
inherit nixpkgs;
inherit (nixpkgs) haskellPackages;
haskellDeps = a: with a; [
ipprint
base
hscolour
ghci-pretty
];
ghc = nixpkgs.haskellPackages.ghcWithPackages haskellDeps;
nixPackages = [
haskellPackages.cabal-install
ghc
];
in
nixpkgs.stdenv.mkDerivation {
name = "profile_name";
buildInputs = nixPackages;
}
Run Code Online (Sandbox Code Playgroud)
您可以像这样逐字复制命令行:
{ pkgs ? import <nixpkgs> {} }:
let
ghc = pkgs.haskell.packages.ghc865.ghcWithPackages (p: [ p.ghci-pretty ]);
in
pkgs.mkShell {
buildInputs = [ ghc ];
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
413 次 |
| 最近记录: |