导入<频道名称> =>找不到

时间:2019-11-19 09:19:12

标签: nix

我正在关注nix药丸[1],在最新的频道发行版[2]中,该药不再起作用。

$ echo 'graph test { a -- b }'|result/bin/dot -Tpng -o test.png
Format: "png" not recognized. ...

因此,我建议使用旧频道[3](并将binutils替换为binutils-unwrapped)。

nix-channel --add https://nixos.org/channels/nixpkgs-release-14.12

哪个效果很好?

nixpkgs https://nixos.org/channels/nixpkgs-unstable
nixpkgs-release-14.12 https://nixos.org/channels/nixpkgs-release-14.12

但是当我尝试通过import <nixpkgs-release-14.12>

使用它时

我明白了

error: file 'nixpkgs-release-14.12' was not found in the Nix search path

3 个答案:

答案 0 :(得分:1)

我通过

import (fetchTarball https://github.com/NixOS/nixpkgs-channels/archive/nixos-14.12.tar.gz)

有效,但我不确定这是否是最佳解决方案。

答案 1 :(得分:1)

您必须使用nix-channel --update命令下载它,但是由于删除了该频道,因此该命令不起作用。您必须使用较新的频道并运行--update

答案 2 :(得分:0)

您可以通过在目录中使用git签出所需版本并设置package interest; import java.util.Scanner; public class Interest { public static void main(String[] args) { Scanner userInput = new Scanner(System.in); Scanner whatKindPeriod = new Scanner(System.in); double principle; double rate; double period; double result; double periodNumber; String type; String matOrSimp; double matResult; System.out.println("find maturity or simple interest? for simple interest enter simple, and for maturity enter maturity"); matOrSimp = userInput.next(); switch (matOrSimp) { case "simple": System.out.println("please enter the principle:"); principle = userInput.nextDouble(); System.out.println("Enter the rate:"); rate = userInput.nextDouble(); System.out.println("enter period:"); period = userInput.nextDouble(); System.out.println("is it daily, monthly or yearly?"); type = userInput.next(); switch (type) { case "yearly": result = (principle * rate * period) / 100; System.out.println("your simple interest is: $" + result); case "daily": double daily = period / 365; result = (principle * rate * daily) / 100; System.out.println("your simple interest is: $" + result); case "monthly": double monthly = period / 12; result = (principle * rate * monthly) / 100; System.out.println("your simple interest is: $" + result); SimpleInterest interest = new SimpleInterest(principle, rate, period); } case "maturity": System.out.println("please enter the principle:"); principle = userInput.nextDouble(); System.out.println("Enter the rate:"); rate = userInput.nextDouble(); System.out.println("enter time of invesment:"); period = userInput.nextDouble(); double monthly = period / 12; matResult = (principle * (1 + rate * monthly)); System.out.println("result is:" + matResult); } } } 来实现。否则,它可能不可用和/或较新的频道中的其他软件包将取代它。您必须在NIX_PATH之前调用命令。