Skip to content
This repository was archived by the owner on Apr 12, 2021. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs-channels
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: fdbae69e8ce4
Choose a base ref
...
head repository: NixOS/nixpkgs-channels
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 5475b8485973
Choose a head ref

Commits on May 8, 2020

  1. ruby: fix soname tag

    Izorkin committed May 8, 2020
    Copy the full SHA
    4b93708 View commit details

Commits on Jun 18, 2020

  1. libdrm: 2.4.100 -> 2.4.102

    akvadrako committed Jun 18, 2020
    Copy the full SHA
    2ea669b View commit details
  2. Copy the full SHA
    6053264 View commit details
  3. pythonPackages.blivet: drop cryptsetup dependency

    The python bindings were dropped in cryptsetup-2.1.0:
    https://gitlab.com/cryptsetup/cryptsetup/-/blob/master/docs/v2.1.0-ReleaseNotes#L63
    
    However this did not cause the blivet build to fail nor did anyone
    notice (cryptsetup-2.1.0 was introduced in nixos-19.09).
    mmilata committed Jun 18, 2020
    Copy the full SHA
    2c23cba View commit details

Commits on Jul 2, 2020

  1. Copy the full SHA
    f6ef3ac View commit details
  2. Copy the full SHA
    7e5bfbc View commit details
  3. Copy the full SHA
    9e7f109 View commit details
  4. Copy the full SHA
    f85535f View commit details
  5. Copy the full SHA
    1bfa734 View commit details
  6. Copy the full SHA
    9d1b3a1 View commit details
  7. Copy the full SHA
    542c8ff View commit details
  8. Copy the full SHA
    9aadc46 View commit details
  9. zmap: support json_c-0.14

    mmilata committed Jul 2, 2020
    Copy the full SHA
    b39c3a1 View commit details
  10. Copy the full SHA
    b81594a View commit details

Commits on Jul 3, 2020

  1. Copy the full SHA
    57f3c83 View commit details
  2. gd: fix "Error: Problem doing text layout"

    This backport allows the Wayland documentation to be successfully
    built.
    alyssais committed Jul 3, 2020
    Copy the full SHA
    10ad3f6 View commit details
  3. Copy the full SHA
    8b5bb18 View commit details

Commits on Jul 4, 2020

  1. wayland: documentation outputs

    Build the documentation by default, but install it to seperate outputs
    so it doesn't have to be downloaded.  Documentation is still disabled
    when cross-compiling, because that is currently broken:
    wayland -> graphviz -> libdevil -> openexr -> ilmbase (broken)
    alyssais committed Jul 4, 2020
    Copy the full SHA
    ee5f705 View commit details
  2. python3Packages.awkward1: 0.2.23 -> 0.2.24

    veprbl authored and Jon committed Jul 4, 2020
    Copy the full SHA
    f02d1db View commit details
  3. curl: 7.70.0 -> 7.71.1

    dasj19 committed Jul 4, 2020
    Copy the full SHA
    6ca2afc View commit details
  4. python36: 3.6.10 -> 3.6.11

    FRidh committed Jul 4, 2020
    Copy the full SHA
    60fb772 View commit details
  5. python37: 3.7.7 -> 3.7.8

    FRidh committed Jul 4, 2020
    Copy the full SHA
    7935bf7 View commit details
  6. btrfs-progs: 5.6.1 -> 5.7

    r-ryantm committed Jul 4, 2020
    Copy the full SHA
    d2ee5fd View commit details
  7. Copy the full SHA
    3d6fcff View commit details

Commits on Jul 5, 2020

  1. man: 2.9.2 -> 2.9.3

    r-ryantm committed Jul 5, 2020
    Copy the full SHA
    906c560 View commit details
  2. librsvg: 2.48.7 -> 2.48.8

    r-ryantm authored and jtojnar committed Jul 5, 2020
    Copy the full SHA
    a8842fd View commit details
  3. libqmi: 1.25.900 -> 1.26.0

    r-ryantm authored and jtojnar committed Jul 5, 2020
    Copy the full SHA
    d8af01b View commit details
  4. nspr: 4.25 -> 4.26

    ajs124 committed Jul 5, 2020
    Copy the full SHA
    cebca41 View commit details
  5. Copy the full SHA
    b01f391 View commit details

Commits on Jul 6, 2020

  1. help2man: 1.47.15 -> 1.47.16

    r-ryantm authored and jtojnar committed Jul 6, 2020
    Copy the full SHA
    9beef71 View commit details
  2. libuv: 1.38.0 -> 1.38.1

    r-ryantm authored and jtojnar committed Jul 6, 2020
    Copy the full SHA
    dde3311 View commit details
  3. glib: 2.64.3 -> 2.64.4

    r-ryantm authored and jtojnar committed Jul 6, 2020
    Copy the full SHA
    82153b8 View commit details
  4. gssdp: 1.2.2 -> 1.2.3

    r-ryantm authored and jtojnar committed Jul 6, 2020
    Copy the full SHA
    aa02946 View commit details
  5. libinput: 1.15.5 -> 1.15.6

    r-ryantm authored and jtojnar committed Jul 6, 2020
    Copy the full SHA
    b1c6615 View commit details
  6. lcms2: 2.10 -> 2.11

    r-ryantm authored and jtojnar committed Jul 6, 2020
    Copy the full SHA
    f25b933 View commit details
  7. dbus: 1.12.18 -> 1.12.20

    r-ryantm authored and jtojnar committed Jul 6, 2020
    Copy the full SHA
    253431d View commit details
  8. bison: 3.6.3 -> 3.6.4

    r-ryantm authored and jtojnar committed Jul 6, 2020
    Copy the full SHA
    0a5fd4c View commit details
  9. libwacom: 1.3 -> 1.4.1

    r-ryantm authored and jtojnar committed Jul 6, 2020
    Copy the full SHA
    573bff4 View commit details
  10. Copy the full SHA
    a60b186 View commit details

Commits on Jul 7, 2020

  1. Merge pull request #92153 from ckauhaus/sqlite-cves

    sqlite: 3.32.2 -> 3.32.3
    Christian Kauhaus authored Jul 7, 2020
    Copy the full SHA
    a130b5a View commit details
  2. Copy the full SHA
    519606e View commit details
  3. flrig: 1.3.50 -> 1.3.51

    r-ryantm authored and Jon committed Jul 7, 2020
    Copy the full SHA
    9002e5c View commit details
  4. Merge pull request #92592 from worldofpeace/vala-update

    vala: 0.48.1 -> 0.48.7
    worldofpeace authored Jul 7, 2020
    Copy the full SHA
    71d6910 View commit details
  5. vim: 8.2.0701 -> 8.2.1123

    r-ryantm committed Jul 7, 2020
    Copy the full SHA
    8d28b32 View commit details

Commits on Jul 8, 2020

  1. Merge pull request #92655 from r-ryantm/auto-update/vim

    vim: 8.2.0701 -> 8.2.1123
    ryantm authored Jul 8, 2020
    Copy the full SHA
    9ad2c16 View commit details
  2. Copy the full SHA
    a58c2d2 View commit details
  3. Copy the full SHA
    7daccdb View commit details
  4. Copy the full SHA
    3abffce View commit details

Commits on Jul 9, 2020

  1. Merge pull request #92285 from r-ryantm/auto-update/btrfs-progs

    btrfs-progs: 5.6.1 -> 5.7
    7c6f434c authored Jul 9, 2020
    Copy the full SHA
    0bbeec1 View commit details
  2. libevent: 2.1.11 -> 2.1.12

    r-ryantm committed Jul 9, 2020
    Copy the full SHA
    adda7cf View commit details
Showing with 1,406 additions and 507 deletions.
  1. +6 −0 maintainers/maintainer-list.nix
  2. +6 −10 nixos/modules/config/fonts/fontconfig.nix
  3. +11 −1 nixos/modules/services/networking/dhcpd.nix
  4. +4 −1 nixos/modules/services/networking/yggdrasil.nix
  5. +157 −0 nixos/modules/services/networking/yggdrasil.xml
  6. +3 −3 nixos/modules/system/boot/stage-1.nix
  7. +60 −7 nixos/modules/tasks/lvm.nix
  8. +17 −4 nixos/tests/installer.nix
  9. +5 −0 nixos/tests/systemd.nix
  10. +41 −1 nixos/tests/yggdrasil.nix
  11. +2 −2 pkgs/applications/audio/jackmix/default.nix
  12. +2 −2 pkgs/applications/audio/mixxx/default.nix
  13. +2 −2 pkgs/applications/audio/rhvoice/default.nix
  14. +2 −2 pkgs/applications/editors/vim/common.nix
  15. +0 −2 pkgs/applications/graphics/darktable/default.nix
  16. +2 −2 pkgs/applications/graphics/fluxus/default.nix
  17. +10 −7 pkgs/applications/networking/browsers/firefox/common.nix
  18. +10 −4 pkgs/applications/networking/browsers/firefox/packages.nix
  19. +8 −1 pkgs/applications/networking/browsers/firefox/wrapper.nix
  20. +2 −2 pkgs/applications/networking/instant-messengers/swift-im/default.nix
  21. +0 −3 pkgs/applications/networking/p2p/transmission/default.nix
  22. +2 −2 pkgs/applications/radio/flrig/default.nix
  23. +4 −4 pkgs/applications/video/makemkv/default.nix
  24. +20 −19 pkgs/applications/window-managers/qtile/0001-Substitution-vars-for-absolute-paths.patch
  25. +21 −10 pkgs/applications/window-managers/qtile/0002-Restore-PATH-and-PYTHONPATH.patch
  26. +6 −6 pkgs/applications/window-managers/qtile/0003-Restart-executable.patch
  27. +8 −6 pkgs/applications/window-managers/qtile/default.nix
  28. +8 −5 pkgs/build-support/rust/default.nix
  29. +2 −2 pkgs/development/compilers/go/1.14.nix
  30. +1 −0 pkgs/development/compilers/openjdk/11.nix
  31. +1 −0 pkgs/development/compilers/openjdk/12.nix
  32. +1 −0 pkgs/development/compilers/openjdk/13.nix
  33. +42 −0 pkgs/development/compilers/rust/1_45.nix
  34. +5 −0 pkgs/development/compilers/rust/rustfmt.nix
  35. +2 −2 pkgs/development/compilers/vala/default.nix
  36. +4 −4 pkgs/development/interpreters/python/default.nix
  37. +1 −1 pkgs/development/interpreters/ruby/default.nix
  38. +1 −1 pkgs/development/libraries/arrow-cpp/default.nix
  39. +2 −2 pkgs/development/libraries/dbus/default.nix
  40. +18 −10 pkgs/development/libraries/fontconfig/config-compat.patch
  41. +71 −11 pkgs/development/libraries/fontconfig/default.nix
  42. +0 −23 pkgs/development/libraries/fontconfig/fix-joypixels.patch
  43. +8 −0 pkgs/development/libraries/fontconfig/make-fonts-conf.xsl
  44. +18 −3 pkgs/development/libraries/gd/default.nix
  45. +2 −2 pkgs/development/libraries/glib/default.nix
  46. +4 −10 pkgs/development/libraries/gpgme/default.nix
  47. +2 −2 pkgs/development/libraries/gssdp/default.nix
  48. +2 −2 pkgs/development/libraries/gtk/3.x.nix
  49. +6 −6 pkgs/development/libraries/json-c/default.nix
  50. +2 −2 pkgs/development/libraries/lcms2/default.nix
  51. +11 −12 pkgs/development/libraries/libdrm/cross-build-nm-path.patch
  52. +3 −3 pkgs/development/libraries/libdrm/default.nix
  53. +10 −1 pkgs/development/libraries/libevdev/default.nix
  54. +2 −2 pkgs/development/libraries/libevent/default.nix
  55. +2 −2 pkgs/development/libraries/libgcrypt/default.nix
  56. +18 −4 pkgs/development/libraries/libinput/default.nix
  57. +14 −4 pkgs/development/libraries/libmbim/default.nix
  58. +2 −2 pkgs/development/libraries/libqmi/default.nix
  59. +2 −2 pkgs/development/libraries/librsvg/default.nix
  60. +10 −1 pkgs/development/libraries/libu2f-host/default.nix
  61. +10 −1 pkgs/development/libraries/libu2f-server/default.nix
  62. +2 −2 pkgs/development/libraries/libuv/default.nix
  63. +2 −2 pkgs/development/libraries/libwacom/default.nix
  64. +2 −2 pkgs/development/libraries/mesa/default.nix
  65. +2 −2 pkgs/development/libraries/nspr/default.nix
  66. +144 −0 pkgs/development/libraries/nss/3.44.nix
  67. +81 −0 pkgs/development/libraries/nss/85_security_load-3.44.patch
  68. +19 −24 pkgs/development/libraries/nss/85_security_load.patch
  69. +49 −44 pkgs/development/libraries/nss/default.nix
  70. +11 −0 pkgs/development/libraries/nss/fix-cross-compilation.patch
  71. +2 −2 pkgs/development/libraries/poppler/default.nix
  72. +2 −2 pkgs/development/libraries/serf/default.nix
  73. +2 −2 pkgs/development/libraries/swiften/default.nix
  74. +3 −1 pkgs/development/libraries/wayland/default.nix
  75. +2 −2 pkgs/development/python-modules/awkward1/default.nix
  76. +3 −6 pkgs/development/python-modules/blivet/default.nix
  77. +3 −4 pkgs/development/python-modules/gyp/default.nix
  78. +16 −2 pkgs/development/python-modules/libevdev/default.nix
  79. +22 −0 pkgs/development/python-modules/libevdev/fix-paths.patch
  80. +2 −2 pkgs/development/python-modules/openrazer/common.nix
  81. +1 −1 pkgs/development/python-modules/pyudev/default.nix
  82. +18 −0 pkgs/development/tools/build-managers/cmake/setup-hook.sh
  83. +8 −2 pkgs/development/tools/build-managers/scons/common.nix
  84. +5 −1 pkgs/development/tools/build-managers/scons/default.nix
  85. +3 −3 pkgs/development/tools/continuous-integration/fly/default.nix
  86. +33 −0 pkgs/development/tools/go-task/default.nix
  87. +2 −2 pkgs/development/tools/misc/automake/automake-1.15.x.nix
  88. +2 −2 pkgs/development/tools/misc/help2man/default.nix
  89. +2 −2 pkgs/development/tools/nsis/default.nix
  90. +2 −2 pkgs/development/tools/parsing/bison/default.nix
  91. +1 −3 pkgs/development/tools/rust/rustup/default.nix
  92. +2 −2 pkgs/games/tdm/default.nix
  93. +2 −2 pkgs/games/vdrift/default.nix
  94. +2 −2 pkgs/misc/drivers/xboxdrv/default.nix
  95. +4 −5 pkgs/os-specific/linux/apparmor/default.nix
  96. +7 −13 pkgs/os-specific/linux/cryptsetup/default.nix
  97. +2 −2 pkgs/os-specific/linux/ffado/default.nix
  98. +80 −45 pkgs/os-specific/linux/lvm2/default.nix
  99. +0 −4 pkgs/os-specific/linux/lvm2/default.upstream
  100. +5 −0 pkgs/os-specific/linux/multipath-tools/default.nix
  101. +21 −0 pkgs/os-specific/linux/multipath-tools/json-c-0.14.patch
  102. +0 −10 pkgs/os-specific/linux/systemd/0007-hostnamed-localed-timedated-disable-methods-that-cha.patch
  103. +2 −2 pkgs/servers/gpsd/default.nix
  104. +3 −3 pkgs/servers/nosql/mongodb/mongodb.nix
  105. +19 −5 pkgs/tools/compression/zstd/default.nix
  106. +2 −2 pkgs/tools/filesystems/btrfs-progs/default.nix
  107. +2 −2 pkgs/tools/misc/fluent-bit/default.nix
  108. +2 −2 pkgs/tools/misc/gringo/default.nix
  109. +2 −2 pkgs/tools/misc/man-db/default.nix
  110. +2 −2 pkgs/tools/misc/mc/default.nix
  111. +10 −1 pkgs/tools/misc/yubikey-personalization/default.nix
  112. +11 −2 pkgs/tools/networking/connman/connman-ncurses/default.nix
  113. +2 −2 pkgs/tools/networking/curl/default.nix
  114. +5 −4 pkgs/tools/networking/network-manager/default.nix
  115. +2 −2 pkgs/tools/networking/network-manager/fix-install-paths.patch
  116. +29 −26 pkgs/tools/networking/network-manager/fix-paths.patch
  117. +5 −7 pkgs/tools/security/eid-mw/default.nix
  118. +13 −0 pkgs/tools/security/zmap/cmake-json-0.14-fix.patch
  119. +5 −0 pkgs/tools/security/zmap/default.nix
  120. +1 −0 pkgs/top-level/aliases.nix
  121. +19 −15 pkgs/top-level/all-packages.nix
  122. +1 −1 pkgs/top-level/static.nix
6 changes: 6 additions & 0 deletions maintainers/maintainer-list.nix
Original file line number Diff line number Diff line change
@@ -6160,6 +6160,12 @@
githubId = 20792;
name = "Sebastian Galkin";
};
parasrah = {
email = "nixos@parasrah.com";
github = "parasrah";
githubId = 14935550;
name = "Brad Pfannmuller";
};
pashashocky = {
email = "pashashocky@gmail.com";
github = "pashashocky";
16 changes: 6 additions & 10 deletions nixos/modules/config/fonts/fontconfig.nix
Original file line number Diff line number Diff line change
@@ -214,15 +214,7 @@ let
# fontconfig default config files
ln -s ${supportPkg.out}/etc/fonts/conf.d/*.conf \
$support_folder/
ln -s ${latestPkg.out}/etc/fonts/conf.d/*.conf \
$latest_folder/
# update latest 51-local.conf path to look at the latest local.conf
rm $latest_folder/51-local.conf
substitute ${latestPkg.out}/etc/fonts/conf.d/51-local.conf \
$latest_folder/51-local.conf \
--replace local.conf /etc/fonts/${latestVersion}/local.conf
# Latest fontconfig is configured to look for the upstream defaults inside the package.
# 00-nixos-cache.conf
ln -s ${cacheConfSupport} \
@@ -236,7 +228,11 @@ let
# 50-user.conf
${optionalString (!cfg.includeUserConf) ''
rm $support_folder/50-user.conf
rm $latest_folder/50-user.conf
''}
# Since latest fontconfig looks for default files inside the package,
# we had to move this one elsewhere to be able to exclude it here.
${optionalString cfg.includeUserConf ''
ln -s ${latestPkg.out}/etc/fonts/conf.d.bak/50-user.conf $latest_folder/50-user.conf
''}
# local.conf (indirect priority 51)
12 changes: 11 additions & 1 deletion nixos/modules/services/networking/dhcpd.nix
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ let
''
default-lease-time 600;
max-lease-time 7200;
authoritative;
${optionalString (!cfg.authoritative) "not "}authoritative;
ddns-update-style interim;
log-facility local1; # see dhcpd.nix
@@ -176,6 +176,16 @@ let
'';
};

authoritative = mkOption {
type = types.bool;
default = true;
description = ''
Whether the DHCP server shall send DHCPNAK messages to misconfigured
clients. If this is not done, clients may be unable to get a correct
IP address after changing subnets until their old lease has expired.
'';
};

};

in
5 changes: 4 additions & 1 deletion nixos/modules/services/networking/yggdrasil.nix
Original file line number Diff line number Diff line change
@@ -195,5 +195,8 @@ in {
# Make yggdrasilctl available on the command line.
environment.systemPackages = [ cfg.package ];
});
meta.maintainers = with lib.maintainers; [ gazally ehmry ];
meta = {
doc = ./yggdrasil.xml;
maintainers = with lib.maintainers; [ gazally ehmry ];
};
}
157 changes: 157 additions & 0 deletions nixos/modules/services/networking/yggdrasil.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
<?xml version="1.0"?>
<chapter xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude" version="5.0" xml:id="module-services-networking-yggdrasil">
<title>Yggdrasil</title>
<para>
<emphasis>Source:</emphasis>
<filename>modules/services/networking/yggdrasil/default.nix</filename>
</para>
<para>
<emphasis>Upstream documentation:</emphasis>
<link xlink:href="https://yggdrasil-network.github.io/"/>
</para>
<para>
Yggdrasil is an early-stage implementation of a fully end-to-end encrypted,
self-arranging IPv6 network.
</para>
<section xml:id="module-services-networking-yggdrasil-configuration">
<title>Configuration</title>
<section xml:id="module-services-networking-yggdrasil-configuration-simple">
<title>Simple ephemeral node</title>
<para>
An annotated example of a simple configuration:
<programlisting>
{
services.yggdrasil = {
enable = true;
persistentKeys = false;
# The NixOS module will generate new keys and a new IPv6 address each time
# it is started if persistentKeys is not enabled.

config = {
Peers = [
# Yggdrasil will automatically connect and "peer" with other nodes it
# discovers via link-local multicast annoucements. Unless this is the
# case (it probably isn't) a node needs peers within the existing
# network that it can tunnel to.
"tcp://1.2.3.4:1024"
"tcp://1.2.3.5:1024"
# Public peers can be found at
# https://github.com/yggdrasil-network/public-peers
];
};
};
}
</programlisting>
</para>
</section>
<section xml:id="module-services-networking-yggdrasil-configuration-prefix">
<title>Persistent node with prefix</title>
<para>
A node with a fixed address that announces a prefix:
<programlisting>
let
address = "210:5217:69c0:9afc:1b95:b9f:8718:c3d2";
prefix = "310:5217:69c0:9afc";
# taken from the output of "yggdrasilctl getself".
in {

services.yggdrasil = {
enable = true;
persistentKeys = true; # Maintain a fixed public key and IPv6 address.
config = {
Peers = [ "tcp://1.2.3.4:1024" "tcp://1.2.3.5:1024" ];
NodeInfo = {
# This information is visible to the network.
name = config.networking.hostName;
location = "The North Pole";
};
};
};

boot.kernel.sysctl."net.ipv6.conf.all.forwarding" = 1;
# Forward traffic under the prefix.

networking.interfaces.${eth0}.ipv6.addresses = [{
# Set a 300::/8 address on the local physical device.
address = prefix + "::1";
prefixLength = 64;
}];

services.radvd = {
# Annouce the 300::/8 prefix to eth0.
enable = true;
config = ''
interface eth0
{
AdvSendAdvert on;
AdvDefaultLifetime 0;
prefix ${prefix}::/64 {
AdvOnLink on;
AdvAutonomous on;
};
route 200::/8 {};
};
'';
};
}
</programlisting>
</para>
</section>
<section xml:id="module-services-networking-yggdrasil-configuration-container">
<title>Yggdrasil attached Container</title>
<para>
A NixOS container attached to the Yggdrasil network via a node running on the
host:
<programlisting>
let
yggPrefix64 = "310:5217:69c0:9afc";
# Again, taken from the output of "yggdrasilctl getself".
in
{
boot.kernel.sysctl."net.ipv6.conf.all.forwarding" = 1;
# Enable IPv6 forwarding.

networking = {
bridges.br0.interfaces = [ ];
# A bridge only to containers&#x2026;

interfaces.br0 = {
# &#x2026; configured with a prefix address.
ipv6.addresses = [{
address = "${yggPrefix64}::1";
prefixLength = 64;
}];
};
};

containers.foo = {
autoStart = true;
privateNetwork = true;
hostBridge = "br0";
# Attach the container to the bridge only.
config = { config, pkgs, ... }: {
networking.interfaces.eth0.ipv6 = {
addresses = [{
# Configure a prefix address.
address = "${yggPrefix64}::2";
prefixLength = 64;
}];
routes = [{
# Configure the prefix route.
address = "200::";
prefixLength = 7;
via = "${yggPrefix64}::1";
}];
};

services.httpd.enable = true;
networking.firewall.allowedTCPPorts = [ 80 ];
};
};

}
</programlisting>
</para>
</section>
</section>
</chapter>
6 changes: 3 additions & 3 deletions nixos/modules/system/boot/stage-1.nix
Original file line number Diff line number Diff line change
@@ -111,8 +111,8 @@ let
copy_bin_and_libs ${pkgs.utillinux}/sbin/blkid
# Copy dmsetup and lvm.
copy_bin_and_libs ${pkgs.lvm2}/sbin/dmsetup
copy_bin_and_libs ${pkgs.lvm2}/sbin/lvm
copy_bin_and_libs ${getBin pkgs.lvm2}/bin/dmsetup
copy_bin_and_libs ${getBin pkgs.lvm2}/bin/lvm
# Add RAID mdadm tool.
copy_bin_and_libs ${pkgs.mdadm}/sbin/mdadm
@@ -235,7 +235,7 @@ let
--replace cdrom_id ${extraUtils}/bin/cdrom_id \
--replace ${pkgs.coreutils}/bin/basename ${extraUtils}/bin/basename \
--replace ${pkgs.utillinux}/bin/blkid ${extraUtils}/bin/blkid \
--replace ${pkgs.lvm2}/sbin ${extraUtils}/bin \
--replace ${getBin pkgs.lvm2}/bin ${extraUtils}/bin \
--replace ${pkgs.mdadm}/sbin ${extraUtils}/sbin \
--replace ${pkgs.bash}/bin/sh ${extraUtils}/bin/sh \
--replace ${udev} ${extraUtils}
67 changes: 60 additions & 7 deletions nixos/modules/tasks/lvm.nix
Original file line number Diff line number Diff line change
@@ -1,17 +1,70 @@
{ config, lib, pkgs, ... }:

with lib;
let
cfg = config.services.lvm;
in {
options.services.lvm = {
package = mkOption {
type = types.package;
default = if cfg.dmeventd.enable then pkgs.lvm2_dmeventd else pkgs.lvm2;
internal = true;
defaultText = "pkgs.lvm2";
description = ''
This option allows you to override the LVM package that's used on the system
(udev rules, tmpfiles, systemd services).
Defaults to pkgs.lvm2, or pkgs.lvm2_dmeventd if dmeventd is enabled.
'';
};
dmeventd.enable = mkEnableOption "the LVM dmevent daemon";
boot.thin.enable = mkEnableOption "support for booting from ThinLVs";
};

{

###### implementation
config = mkMerge [
(mkIf (!config.boot.isContainer) {
systemd.tmpfiles.packages = [ cfg.package.out ];
environment.systemPackages = [ cfg.package ];
systemd.packages = [ cfg.package ];

config = mkIf (!config.boot.isContainer) {
# TODO: update once https://github.com/NixOS/nixpkgs/pull/93006 was merged
services.udev.packages = [ cfg.package.out ];
})
(mkIf cfg.dmeventd.enable {
systemd.sockets."dm-event".wantedBy = [ "sockets.target" ];
systemd.services."lvm2-monitor".wantedBy = [ "sysinit.target" ];

environment.systemPackages = [ pkgs.lvm2 ];
environment.etc."lvm/lvm.conf".text = ''
dmeventd/executable = "${cfg.package}/bin/dmeventd"
'';
})
(mkIf cfg.boot.thin.enable {
boot.initrd = {
kernelModules = [ "dm-snapshot" "dm-thin-pool" ];

services.udev.packages = [ pkgs.lvm2 ];
extraUtilsCommands = ''
copy_bin_and_libs ${pkgs.thin-provisioning-tools}/bin/pdata_tools
copy_bin_and_libs ${pkgs.thin-provisioning-tools}/bin/thin_check
'';
};

};
environment.etc."lvm/lvm.conf".text = ''
global/thin_check_executable = "${pkgs.thin-provisioning-tools}/bin/thin_check"
'';
})
(mkIf (cfg.dmeventd.enable || cfg.boot.thin.enable) {
boot.initrd.preLVMCommands = ''
mkdir -p /etc/lvm
cat << EOF >> /etc/lvm/lvm.conf
${optionalString cfg.boot.thin.enable ''
global/thin_check_executable = "$(command -v thin_check)"
''}
${optionalString cfg.dmeventd.enable ''
dmeventd/executable = "$(command -v false)"
activation/monitoring = 0
''}
EOF
'';
})
];

}
Loading