···8484 </para>
8585 <para>
8686 You'll need <literal>nixos-generate-config</literal> and
8787- <literal>nixos-install</literal> and we'll throw in some man pages and
8888- <literal>nixos-enter</literal> just in case you want to chroot into your
8989- NixOS partition. They are installed by default on NixOS, but you don't have
8787+ <literal>nixos-install</literal>, but this also makes some man pages
8888+ and <literal>nixos-enter</literal> available, just in case you want to chroot into your
8989+ NixOS partition. NixOS installs these by default, but you don't have
9090 NixOS yet..
9191 </para>
9292-<screen><prompt>$ </prompt>nix-env -f '<nixpkgs/nixos>' --arg configuration {} -iA config.system.build.{nixos-generate-config,nixos-install,nixos-enter,manual.manpages}</screen>
9292+ <screen><prompt>$ </prompt>nix-env -f '<nixpkgs>' -iA nixos-install-tools</screen>
9393 </listitem>
9494 <listitem>
9595 <note>
+13
nixos/doc/manual/release-notes/rl-2105.xml
···112112 it is deprecated.
113113 </para>
114114 </listitem>
115115+ <listitem>
116116+ <para>
117117+ <link xlink:href="https://libreswan.org/">Libreswan</link> has been updated
118118+ to version 4.4. The package now includes example configurations and manual
119119+ pages by default. The NixOS module has been changed to use the upstream
120120+ systemd units and write the configuration in the <literal>/etc/ipsec.d/
121121+ </literal> directory. In addition, two new options have been added to
122122+ specify connection policies
123123+ (<xref linkend="opt-services.libreswan.policies"/>)
124124+ and disable send/receive redirects
125125+ (<xref linkend="opt-services.libreswan.disableRedirects"/>).
126126+ </para>
127127+ </listitem>
115128 </itemizedlist>
116129 </section>
117130
···33333434 hardware.opengl.enable = true;
3535 programs.xwayland.enable = true;
3636- environment.systemPackages = [ pkgs.cagebreak pkgs.wallutils ];
3636+ environment.systemPackages = [ pkgs.cagebreak pkgs.wayland-utils ];
37373838 virtualisation.memorySize = 1024;
3939 # Need to switch to a different VGA card / GPU driver than the default one (std) so that Cagebreak can launch:
···5151 machine.wait_for_file("${XDG_RUNTIME_DIR}/wayland-0")
52525353 with subtest("ensure wayland works with wayinfo from wallutils"):
5454- print(machine.succeed("env XDG_RUNTIME_DIR=${XDG_RUNTIME_DIR} wayinfo"))
5454+ print(machine.succeed("env XDG_RUNTIME_DIR=${XDG_RUNTIME_DIR} wayland-info"))
55555656 # TODO: Fix the XWayland test (log the cagebreak output to debug):
5757 # with subtest("ensure xwayland works with xterm"):
+134
nixos/tests/libreswan.nix
···11+# This test sets up a host-to-host IPsec VPN between Alice and Bob, each on its
22+# own network and with Eve as the only route between each other. We check that
33+# Eve can eavesdrop the plaintext traffic between Alice and Bob, but once they
44+# enable the secure tunnel Eve's spying becomes ineffective.
55+66+import ./make-test-python.nix ({ lib, pkgs, ... }:
77+88+let
99+1010+ # IPsec tunnel between Alice and Bob
1111+ tunnelConfig = {
1212+ services.libreswan.enable = true;
1313+ services.libreswan.connections.tunnel =
1414+ ''
1515+ leftid=@alice
1616+ left=fd::a
1717+ rightid=@bob
1818+ right=fd::b
1919+ authby=secret
2020+ auto=add
2121+ '';
2222+ environment.etc."ipsec.d/tunnel.secrets" =
2323+ { text = ''@alice @bob : PSK "j1JbIi9WY07rxwcNQ6nbyThKCf9DGxWOyokXIQcAQUnafsNTUJxfsxwk9WYK8fHj"'';
2424+ mode = "600";
2525+ };
2626+ };
2727+2828+ # Common network setup
2929+ baseNetwork = {
3030+ # shared hosts file
3131+ extraHosts = lib.mkVMOverride ''
3232+ fd::a alice
3333+ fd::b bob
3434+ fd::e eve
3535+ '';
3636+ # remove all automatic addresses
3737+ useDHCP = false;
3838+ interfaces.eth1.ipv4.addresses = lib.mkVMOverride [];
3939+ interfaces.eth2.ipv4.addresses = lib.mkVMOverride [];
4040+ # open a port for testing
4141+ firewall.allowedUDPPorts = [ 1234 ];
4242+ };
4343+4444+ # Adds an address and route from a to b via Eve
4545+ addRoute = a: b: {
4646+ interfaces.eth1.ipv6.addresses =
4747+ [ { address = a; prefixLength = 64; } ];
4848+ interfaces.eth1.ipv6.routes =
4949+ [ { address = b; prefixLength = 128; via = "fd::e"; } ];
5050+ };
5151+5252+in
5353+5454+{
5555+ name = "libreswan";
5656+ meta = with lib.maintainers; {
5757+ maintainers = [ rnhmjoj ];
5858+ };
5959+6060+ # Our protagonist
6161+ nodes.alice = { ... }: {
6262+ virtualisation.vlans = [ 1 ];
6363+ networking = baseNetwork // addRoute "fd::a" "fd::b";
6464+ } // tunnelConfig;
6565+6666+ # Her best friend
6767+ nodes.bob = { ... }: {
6868+ virtualisation.vlans = [ 2 ];
6969+ networking = baseNetwork // addRoute "fd::b" "fd::a";
7070+ } // tunnelConfig;
7171+7272+ # The malicious network operator
7373+ nodes.eve = { ... }: {
7474+ virtualisation.vlans = [ 1 2 ];
7575+ networking = lib.mkMerge
7676+ [ baseNetwork
7777+ { interfaces.br0.ipv6.addresses =
7878+ [ { address = "fd::e"; prefixLength = 64; } ];
7979+ bridges.br0.interfaces = [ "eth1" "eth2" ];
8080+ }
8181+ ];
8282+ environment.systemPackages = [ pkgs.tcpdump ];
8383+ boot.kernel.sysctl."net.ipv6.conf.all.forwarding" = true;
8484+ };
8585+8686+ testScript =
8787+ ''
8888+ def alice_to_bob(msg: str):
8989+ """
9090+ Sends a message as Alice to Bob
9191+ """
9292+ bob.execute("nc -lu ::0 1234 >/tmp/msg &")
9393+ alice.sleep(1)
9494+ alice.succeed(f"echo '{msg}' | nc -uw 0 bob 1234")
9595+ bob.succeed(f"grep '{msg}' /tmp/msg")
9696+9797+9898+ def eavesdrop():
9999+ """
100100+ Starts eavesdropping on Alice and Bob
101101+ """
102102+ match = "src host alice and dst host bob"
103103+ eve.execute(f"tcpdump -i br0 -c 1 -Avv {match} >/tmp/log &")
104104+105105+106106+ start_all()
107107+108108+ with subtest("Network is up"):
109109+ alice.wait_until_succeeds("ping -c1 bob")
110110+111111+ with subtest("Eve can eavesdrop cleartext traffic"):
112112+ eavesdrop()
113113+ alice_to_bob("I secretly love turnip")
114114+ eve.sleep(1)
115115+ eve.succeed("grep turnip /tmp/log")
116116+117117+ with subtest("Libreswan is ready"):
118118+ alice.wait_for_unit("ipsec")
119119+ bob.wait_for_unit("ipsec")
120120+ alice.succeed("ipsec verify 1>&2")
121121+122122+ with subtest("Alice and Bob can start the tunnel"):
123123+ alice.execute("ipsec auto --start tunnel &")
124124+ bob.succeed("ipsec auto --start tunnel")
125125+ # apparently this is needed to "wake" the tunnel
126126+ bob.execute("ping -c1 alice")
127127+128128+ with subtest("Eve no longer can eavesdrop"):
129129+ eavesdrop()
130130+ alice_to_bob("Just kidding, I actually like rhubarb")
131131+ eve.sleep(1)
132132+ eve.fail("grep rhubarb /tmp/log")
133133+ '';
134134+})
···78787979 # ignore a deprecation warning for usage of `cmp` in the attrs library in the doctests
8080 ./patches/ignore-cmp-deprecation.patch
8181+8282+ # https://trac.sagemath.org/ticket/30801. this patch has
8383+ # positive_review but has not been merged upstream yet, so we
8484+ # don't use fetchSageDiff because it returns a file that contains
8585+ # each commit as a separate patch instead of a single diff, and
8686+ # some commits from the pari update branch are already in 9.3.rc5
8787+ # (auto-resolvable merge conflicts).
8888+ (fetchpatch {
8989+ name = "pari-2.13.1.patch";
9090+ url = "https://github.com/sagemath/sagetrac-mirror/compare/d6c5cd9be78cc448ee4c54bac93385b1244a234c...10a4531721d2700fd717e2b3a1364508ffd971c3.diff";
9191+ sha256 = "sha256-zMjRMEReoiTvmt+vvV0Ij1jtyLSLwSXBEVXqgvmq1D4=";
9292+ })
8193 ];
82948395 patches = nixPatches ++ bugfixPatches ++ packageUpgradePatches;
···11-{ lib, buildPythonApplication, fetchPypi, pyyaml }:
11+{ lib, buildPythonApplication, fetchFromGitHub, pyyaml }:
2233buildPythonApplication rec {
44- version = "0.1.5";
44+ version = "0.2.0pre-2021-05-18";
55 pname = "podman-compose";
6677- src = fetchPypi {
88- inherit pname version;
99- sha256 = "1sgbc889zq127qhxa9frhswa1mid19fs5qnyzfihx648y5i968pv";
77+ # "This project is still under development." -- README.md
88+ #
99+ # As of May 2021, the latest release (0.1.5) has fewer than half of all
1010+ # commits. This project seems to have no release management, so the last
1111+ # commit is the best one until proven otherwise.
1212+ src = fetchFromGitHub {
1313+ repo = "podman-compose";
1414+ owner = "containers";
1515+ rev = "62d2024feecf312e9591cc145f49cee9c70ab4fe";
1616+ sha256 = "17992imkvi6129wvajsp0iz5iicfmh53i20qy2mzz17kcz30r2pp";
1017 };
11181219 propagatedBuildInputs = [ pyyaml ];
···11+#!/usr/bin/env python
22+33+import argparse
44+from argparse import RawDescriptionHelpFormatter
55+66+description = """
77+Replace a string in one file with a secret from a second file.
88+99+Since the secret is read from a file, it won't be leaked through
1010+'/proc/<pid>/cmdline', unlike when 'sed' or 'replace' is used.
1111+"""
1212+1313+parser = argparse.ArgumentParser(
1414+ description=description,
1515+ formatter_class=RawDescriptionHelpFormatter
1616+)
1717+parser.add_argument("string_to_replace", help="the string to replace")
1818+parser.add_argument("secret_file", help="the file containing the secret")
1919+parser.add_argument("file", help="the file to perform the replacement on")
2020+args = parser.parse_args()
2121+2222+with open(args.secret_file) as sf, open(args.file, 'r+') as f:
2323+ old = f.read()
2424+ secret = sf.read().strip("\n")
2525+ new_content = old.replace(args.string_to_replace, secret)
2626+ f.seek(0)
2727+ f.write(new_content)
2828+ f.truncate()
···1010, # GHC can be built with system libffi or a bundled one.
1111 libffi ? null
12121313-, enableDwarf ? !stdenv.targetPlatform.isDarwin &&
1313+ # Libdw.c only supports x86_64, i686 and s390x
1414+, enableDwarf ? stdenv.targetPlatform.isx86 &&
1515+ !stdenv.targetPlatform.isDarwin &&
1416 !stdenv.targetPlatform.isWindows
1517, elfutils # for DWARF support
1618···259261 description = "The Glasgow Haskell Compiler";
260262 maintainers = with lib.maintainers; [ marcweber andres peti ];
261263 inherit (ghc.meta) license platforms;
264264+ # ghcHEAD times out on aarch64-linux on Hydra.
265265+ hydraPlatforms = builtins.filter (p: p != "aarch64-linux") ghc.meta.platforms;
262266 };
263267264268 dontStrip = (targetPlatform.useAndroidPrebuilt || targetPlatform.isWasm);
···11-diff '--color=auto' '--color=never' -r --unified hnix-0.12.0.1/hnix.cabal hnix-patched/hnix.cabal
22---- hnix-0.12.0.1/hnix.cabal 2001-09-09 03:46:40.000000000 +0200
33-+++ hnix-patched/hnix.cabal 2021-05-05 12:07:38.388267353 +0200
44-@@ -430,7 +430,7 @@
55- , parser-combinators >= 1.0.1 && < 1.3
66- , prettyprinter >= 1.7.0 && < 1.8
77- , process >= 1.6.3 && < 1.7
88-- , ref-tf >= 0.4.0 && < 0.5
99-+ , ref-tf >= 0.5
1010- , regex-tdfa >= 1.2.3 && < 1.4
1111- , scientific >= 0.3.6 && < 0.4
1212- , semialign >= 1 && < 1.2
1313-diff '--color=auto' '--color=never' -r --unified hnix-0.12.0.1/src/Nix/Fresh.hs hnix-patched/src/Nix/Fresh.hs
1414---- hnix-0.12.0.1/src/Nix/Fresh.hs 2001-09-09 03:46:40.000000000 +0200
1515-+++ hnix-patched/src/Nix/Fresh.hs 2021-05-05 12:07:45.841267497 +0200
1616-@@ -65,18 +65,3 @@
1717-1818- runFreshIdT :: Functor m => Var m i -> FreshIdT i m a -> m a
1919- runFreshIdT i m = runReaderT (unFreshIdT m) i
2020--
2121---- Orphan instance needed by Infer.hs and Lint.hs
2222--
2323---- Since there's no forking, it's automatically atomic.
2424--instance MonadAtomicRef (ST s) where
2525-- atomicModifyRef r f = do
2626-- v <- readRef r
2727-- let (a, b) = f v
2828-- writeRef r a
2929-- return b
3030-- atomicModifyRef' r f = do
3131-- v <- readRef r
3232-- let (a, b) = f v
3333-- writeRef r $! a
3434-- return b
···33, rustPlatform
44, fetchFromGitHub
55, installShellFiles
66+, libiconv
67, Security
88+, CoreServices
79}:
810911rustPlatform.buildRustPackage rec {
···23252426 nativeBuildInputs = [ installShellFiles ];
25272626- buildInputs = lib.optionals stdenv.isDarwin [ Security ];
2828+ buildInputs = lib.optionals stdenv.isDarwin [ libiconv Security CoreServices ];
27292830 postInstall = ''
2931 installManPage texlab.1
···3234 # links to the generated rlib and doesn't reference the dylib. I
3335 # couldn't find any way to prevent building this by passing cargo flags.
3436 # See https://gitlab.com/Kanedias/html2md/-/blob/0.2.10/Cargo.toml#L20
3535- rm "$out/lib/libhtml2md.so"
3737+ rm "$out/lib/libhtml2md${stdenv.hostPlatform.extensions.sharedLibrary}"
3638 rmdir "$out/lib"
3737- '';
3939+ '';
38403941 meta = with lib; {
4042 description = "An implementation of the Language Server Protocol for LaTeX";
+1-1
pkgs/development/tools/ocaml/dune/1.nix
···2233if !lib.versionAtLeast ocaml.version "4.02"
44|| lib.versionAtLeast ocaml.version "4.12"
55-then throw "dune is not available for OCaml ${ocaml.version}"
55+then throw "dune 1 is not available for OCaml ${ocaml.version}"
66else
7788stdenv.mkDerivation rec {
+1-1
pkgs/development/tools/ocaml/dune/2.nix
···11{ lib, stdenv, fetchurl, ocaml, findlib }:
2233if lib.versionOlder ocaml.version "4.08"
44-then throw "dune is not available for OCaml ${ocaml.version}"
44+then throw "dune 2 is not available for OCaml ${ocaml.version}"
55else
6677stdenv.mkDerivation rec {
···1111, CoreServices
1212, Metal
1313, Foundation
1414+, QuartzCore
1415, librusty_v8 ? callPackage ./librusty_v8.nix { }
1516}:
1617···31323233 buildAndTestSubdir = "cli";
33343434- buildInputs = lib.optionals stdenv.isDarwin [ libiconv libobjc Security CoreServices Metal Foundation ];
3535+ buildInputs = lib.optionals stdenv.isDarwin
3636+ [ libiconv libobjc Security CoreServices Metal Foundation QuartzCore ];
35373638 # The rusty_v8 package will try to download a `librusty_v8.a` release at build time to our read-only filesystem
3739 # To avoid this we pre-download the file and place it in the locations it will require it in advance
···11/*
22+ This is the Hydra jobset for the `haskell-updates` branch in Nixpkgs.
33+ You can see the status of this jobset at
44+ https://hydra.nixos.org/jobset/nixpkgs/haskell-updates.
55+26 To debug this expression you can use `hydra-eval-jobs` from
37 `pkgs.hydra-unstable` which prints the jobset description
48 to `stdout`:
···144148 koka
145149 krank
146150 lambdabot
147147- ldgallery
148151 madlang
149152 matterhorn
150153 mueval
···205208 cabal-install = all;
206209 Cabal_3_4_0_0 = with compilerNames; [ ghc884 ghc8104 ];
207210 funcmp = all;
208208- haskell-language-server = all;
211211+ # Doesn't currently work on ghc-9.0:
212212+ # https://github.com/haskell/haskell-language-server/issues/297
213213+ haskell-language-server = with compilerNames; [ ghc884 ghc8104 ];
209214 hoogle = all;
210215 hsdns = all;
211216 jailbreak-cabal = all;
···226231 constituents = accumulateDerivations [
227232 # haskell specific tests
228233 jobs.tests.haskell
229229- jobs.tests.writers # writeHaskell{,Bin}
234234+ # writeHaskell and writeHaskellBin
235235+ # TODO: writeHaskell currently fails on darwin
236236+ jobs.tests.writers.x86_64-linux
237237+ jobs.tests.writers.aarch64-linux
230238 # important top-level packages
231239 jobs.cabal-install
232240 jobs.cabal2nix