···3131in
32323333{
3434+ nix.registry.nixpkgs.flake.outPath = builtins.path { name = "source"; path = pkgs.path; };
3435 # Provide the NixOS/Nixpkgs sources in /etc/nixos. This is required
3536 # for nixos-install.
3637 boot.postBootCommands = mkAfter
···465465 networking.wireguard = {
466466467467 enable = mkOption {
468468- description = lib.mdDoc "Whether to enable WireGuard.";
468468+ description = lib.mdDoc ''
469469+ Whether to enable WireGuard.
470470+471471+ Please note that {option}`systemd.network.netdevs` has more features
472472+ and is better maintained. When building new things, it is advised to
473473+ use that instead.
474474+ '';
469475 type = types.bool;
470476 # 2019-05-25: Backwards compatibility.
471477 default = cfg.interfaces != {};
···474480 };
475481476482 interfaces = mkOption {
477477- description = lib.mdDoc "WireGuard interfaces.";
483483+ description = lib.mdDoc ''
484484+ WireGuard interfaces.
485485+486486+ Please note that {option}`systemd.network.netdevs` has more features
487487+ and is better maintained. When building new things, it is advised to
488488+ use that instead.
489489+ '';
478490 default = {};
479491 example = {
480492 wg0 = {
···604604 The configuration for each network interface. If
605605 {option}`networking.useDHCP` is true, then every
606606 interface not listed here will be configured using DHCP.
607607+608608+ Please note that {option}`systemd.network.netdevs` has more features
609609+ and is better maintained. When building new things, it is advised to
610610+ use that instead.
607611 '';
608612 type = with types; attrsOf (submodule interfaceOpts);
609613 };
···11+import ./make-test-python.nix ({ lib, pkgs, ... }: {
22+ name = "xpadneo";
33+ meta.maintainers = with lib.maintainers; [ kira-bruneau ];
44+55+ nodes = {
66+ machine = {
77+ config.hardware.xpadneo.enable = true;
88+ };
99+ };
1010+1111+ # This is just a sanity check to make sure the module was
1212+ # loaded. We'd have to find some way to mock an xbox controller if
1313+ # we wanted more in-depth testing.
1414+ testScript = ''
1515+ machine.start();
1616+ machine.succeed("modinfo hid_xpadneo | grep 'version:\s\+${pkgs.linuxPackages.xpadneo.version}'")
1717+ '';
1818+})
···82828383 # disable formatting tests because they can break on black updates
8484 "test_code_is_black_clean"
8585+8686+ # fails at 2022-09-30
8787+ "test_identification"
8888+ "test_diff"
8589 ] ++ lib.optionals stdenv.isDarwin [
8690 # Disable flaky tests on Darwin
8791 "test_non_unicode_filename"
···11+{ lib, stdenv, makeWrapper, fetchzip, runCommand, plantuml, plantuml-c4, jre }:
22+33+# The C4-PlantUML docs say that it suffices to run plantuml with the
44+# -DRELATIVE_INCLUDE="..." arg to make plantuml find the C4 templates
55+# when included like "!include C4_Container.puml".
66+# Unfortunately, this is not sufficient in practise, when the path is not ".".
77+# What helps is setting -Dplantuml.include.path="..." *before* the jar
88+# parameter.
99+# The -DRELATIVE_INCLUDE param then *still* needs to be set (*after* the jar
1010+# argument), because the C4 template vars check for existence of this variable
1111+# and if it is not set, reference paths in the internet.
1212+1313+let
1414+ c4-lib = fetchzip {
1515+ url = "https://github.com/plantuml-stdlib/C4-PlantUML/archive/88a3f99150c6ff7953c4a99b184d03412ffdedb1.zip";
1616+ sha256 = "sha256-vk4YWdGb47OsI9mApGTQ7OfELRZdBouzKfUZq3kchcM=";
1717+ };
1818+1919+ sprites = fetchzip {
2020+ url = "https://github.com/tupadr3/plantuml-icon-font-sprites/archive/fa3f885dbd45c9cd0cdf6c0e5e4fb51ec8b76582.zip";
2121+ sha256 = "sha256-lt9+NNMIaZSkKNsGyHoqXUCTlKmZFGfNYYGjer6X0Xc=";
2222+ };
2323+2424+ # In order to pre-fix the plantuml.jar parameter with the argument
2525+ # -Dplantuml.include.path=..., we post-fix the java command using a wrapper.
2626+ # This way the plantuml derivation can remain unchanged.
2727+ plantumlWithExtraPath =
2828+ let
2929+ plantumlIncludePath = lib.concatStringsSep ":" [ c4-lib sprites ];
3030+ includeFlag = "-Dplantuml.include.path=${lib.escapeShellArg plantumlIncludePath}";
3131+ postFixedJre =
3232+ runCommand "jre-postfixed" { nativeBuildInputs = [ makeWrapper ]; } ''
3333+ mkdir -p $out/bin
3434+3535+ makeWrapper ${jre}/bin/java $out/bin/java \
3636+ --add-flags ${lib.escapeShellArg includeFlag}
3737+ '';
3838+ in
3939+ plantuml.override { jre = postFixedJre; };
4040+in
4141+4242+stdenv.mkDerivation rec {
4343+ pname = "plantuml-c4";
4444+ version = "unstable-2022-08-21";
4545+4646+ nativeBuildInputs = [ makeWrapper ];
4747+4848+ buildCommand = ''
4949+ mkdir -p $out/bin
5050+5151+ makeWrapper ${plantumlWithExtraPath}/bin/plantuml $out/bin/plantuml \
5252+ --add-flags "-DRELATIVE_INCLUDE=\"${c4-lib}\""
5353+5454+ $out/bin/plantuml -help
5555+ '';
5656+5757+ passthru.tests.example-c4-diagram =
5858+ runCommand "c4-plantuml-sample.png" { nativeBuildInputs = [ plantuml-c4 ]; } ''
5959+ sed 's/https:.*\///' "${c4-lib}/samples/C4_Context Diagram Sample - enterprise.puml" > sample.puml
6060+ plantuml sample.puml -o $out
6161+6262+ sed 's/!include ..\//!include /' ${sprites}/examples/complex-example.puml > sprites.puml
6363+ plantuml sprites.puml -o $out
6464+ '';
6565+6666+ meta = with lib; {
6767+ description = "PlantUML bundled with C4-Plantuml and plantuml sprites library";
6868+ homepage = "https://github.com/plantuml-stdlib/C4-PlantUML";
6969+ license = licenses.mit;
7070+ maintainers = with maintainers; [ tfc ];
7171+ platforms = platforms.unix;
7272+ };
7373+}