Skip to content
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
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: ea7b8978ef9d
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: f6105d21e38a
Choose a head ref

Commits on Nov 18, 2020

  1. nixos: openstack: have its own metadata fetcher expression

    These two APIs have diverged over time and are no longer compatible.
    grahamc committed Nov 18, 2020
    Copy the full SHA
    21339b4 View commit details
  2. matrix-dl: (unstable-)2019-09-22 -> unstable-2020-07-14

    Update, also change from
    
      pname = "package-unstable";
      version = "YYYY-MM-DD";
    
    to
    
      pname = "package";
      version = "unstable-YYYY-MM-DD";
    
    This allows $pname as $repo in fetchFromGitHub and also seems to be the
    more common way in nixpkgs.
    herrwiese committed Nov 18, 2020
    Copy the full SHA
    fe4cc65 View commit details

Commits on Nov 19, 2020

  1. Copy the full SHA
    4313ac6 View commit details
  2. Copy the full SHA
    e9a59fe View commit details
  3. asterisk: Bump all packages

    dasJ committed Nov 19, 2020
    Copy the full SHA
    1027c06 View commit details
  4. postfix: 3.5.7 -> 3.5.8

    r-ryantm committed Nov 19, 2020
    Copy the full SHA
    47ee518 View commit details
  5. Copy the full SHA
    8a3b33b View commit details
  6. Copy the full SHA
    5357abf View commit details
  7. Copy the full SHA
    11367b2 View commit details
  8. Copy the full SHA
    3a6f097 View commit details
  9. nixos: ec2 ami: support IMDSv2

    AWS's metadata service has two versions. Version 1 allowed plain HTTP
    requests to get metadata. However, this was frequently abused when a
    user could trick an AWS-hosted server in to proxying requests to the
    metadata service. Since the metadata service is frequently used to
    generate AWS access keys, this is pretty gnarly. Version two is
    identical except it requires the caller to request a token and provide
    it on each request.
    
    Today, starting a NixOS AMI in EC2 where the metadata service is
    configured to only allow v2 requests fails: the user's SSH key is not
    placed, and configuration provided by the user-data is not applied.
    The server is useless. This patch addresses that.
    
    Note the dependency on curl is not a joyful one, and it expand the
    initrd by 30M. However, see the added comment for more information
    about why this is needed. Note the idea of using `echo` and `nc` are
    laughable. Don't do that.
    grahamc committed Nov 19, 2020
    Copy the full SHA
    83ea88e View commit details
  10. nixos ami: preflight the imds token

    According to Freenode's ##AWS, the metadata server can sometimes
    take a few moments to get its shoes on, and the very first boot
    of a machine can see failed requests for a few moments.
    grahamc committed Nov 19, 2020
    Copy the full SHA
    f2cfecd View commit details
  11. Copy the full SHA
    0d87ce6 View commit details
  12. mercurial: remove dulwich dependency

    Jonathan Ringer committed Nov 19, 2020
    Copy the full SHA
    635485b View commit details
  13. cling: init at 0.7.0 (#64319)

    Co-authored-by: Dmitry Kalinkin <dmitry.kalinkin@gmail.com>
    thomasjm and veprbl authored Nov 19, 2020
    Copy the full SHA
    c81c3c3 View commit details
  14. mercurial: 5.4.2 -> 5.6

    Jonathan Ringer committed Nov 19, 2020
    Copy the full SHA
    81d1cea View commit details
  15. microcodeIntel: 20201112 -> 2020111

    Fixes a regression on some "OEM platforms".
    
    Relates to #104301
    mweinelt committed Nov 19, 2020
    Copy the full SHA
    5928d66 View commit details
  16. Merge pull request #104271 from adisbladis/dockertools-cross

    dockerTools.buildLayeredImage: Fix cross compilation
    roberth authored Nov 19, 2020
    Copy the full SHA
    c68e739 View commit details
  17. bind: fix cross-compilation

    Upstream accidently broke cross-compilation. It has been fixed but not released
    yet, so we temporarily add the patch here.
    lopsided98 authored and FRidh committed Nov 19, 2020
    Copy the full SHA
    82a9f23 View commit details
  18. mailutils: 3.9 -> 3.10

    lopsided98 authored and FRidh committed Nov 19, 2020
    Copy the full SHA
    a4c39a6 View commit details
  19. mailutils: fix cross-compilation

    Add a patch that I submitted upstream to fix cross-compilation.
    lopsided98 authored and FRidh committed Nov 19, 2020
    Copy the full SHA
    f7ec01a View commit details
  20. Merge pull request #104228 from herrwiese/for-master/matrix-dl-unstab…

    …le-2020-07-14
    
    matrix-dl: (unstable-)2019-09-22 -> unstable-2020-07-14
    symphorien authored Nov 19, 2020
    Copy the full SHA
    c694e77 View commit details
  21. Merge pull request #104193 from grahamc/ec2-metadata-imdsv2

    NixOS EC2 AMI: Support IMDSv2
    grahamc authored Nov 19, 2020
    Copy the full SHA
    7fa7bf2 View commit details
  22. Merge pull request #104303 from mweinelt/microcodeIntel

    microcodeIntel: 20201112 -> 2020111
    mweinelt authored Nov 19, 2020
    Copy the full SHA
    bd540a3 View commit details
  23. Merge pull request #104290 from helsinki-systems/upd/asterisk3

    asterisk: Bump all packages
    ajs124 authored Nov 19, 2020
    Copy the full SHA
    48c25e5 View commit details
  24. Merge pull request #104300 from Atemu/mlterm-new-upstream

    mlterm: fetch from GitHub instead of Sourceforge
    ryantm authored Nov 19, 2020
    Copy the full SHA
    b036f38 View commit details
  25. Merge pull request #104299 from r-ryantm/auto-update/postfix

    postfix: 3.5.7 -> 3.5.8
    mweinelt authored Nov 19, 2020
    Copy the full SHA
    bd699cc View commit details
  26. Merge pull request #104307 from jonringer/fix-mercurial

    mercurial: 5.4.2 -> 5.6, fix build
    mweinelt authored Nov 19, 2020
    Copy the full SHA
    46769c7 View commit details
  27. nixos/release-small: add amazonImage

    fixup breakage from #104193
    grahamc committed Nov 19, 2020
    Copy the full SHA
    1ef139f View commit details
  28. Merge pull request #104288 from r-ryantm/auto-update/python2.7-asana

    python27Packages.asana: 0.8.2 -> 0.10.3
    mweinelt authored Nov 19, 2020
    Copy the full SHA
    972863e View commit details
  29. Copy the full SHA
    af787d4 View commit details
  30. python37Packages.aiokafka: 0.6.0 -> 0.7.0

    r-ryantm authored and Jonathan Ringer committed Nov 19, 2020
    Copy the full SHA
    e2989e0 View commit details
  31. python37Packages.alerta-server: 8.0.3 -> 8.1.0

    r-ryantm authored and Jonathan Ringer committed Nov 19, 2020
    Copy the full SHA
    b22a7ad View commit details
  32. Merge pull request #104322 from grahamc/amazon-image

    nixos/release-small: add amazonImage
    grahamc authored Nov 19, 2020
    Copy the full SHA
    1115df8 View commit details

Commits on Nov 20, 2020

  1. pythonPackages.littleutils: init at 0.2.2

    jluttine authored and Jonathan Ringer committed Nov 20, 2020
    Copy the full SHA
    b8fa662 View commit details
  2. pythonPackages.stack-data: init at 0.0.7

    jluttine authored and Jonathan Ringer committed Nov 20, 2020
    Copy the full SHA
    854f78d View commit details
  3. Copy the full SHA
    f6105d2 View commit details
1 change: 1 addition & 0 deletions nixos/modules/virtualisation/amazon-image.nix
Original file line number Diff line number Diff line change
@@ -11,6 +11,7 @@ with lib;
let
cfg = config.ec2;
metadataFetcher = import ./ec2-metadata-fetcher.nix {
inherit (pkgs) curl;
targetRoot = "$targetRoot/";
wgetExtraOptions = "-q";
};
66 changes: 61 additions & 5 deletions nixos/modules/virtualisation/ec2-metadata-fetcher.nix
Original file line number Diff line number Diff line change
@@ -1,23 +1,79 @@
{ targetRoot, wgetExtraOptions }:
{ curl, targetRoot, wgetExtraOptions }:
# Note: be very cautious about dependencies, each dependency grows
# the closure of the initrd. Ideally we would not even require curl,
# but there is no reasonable way to send an HTTP PUT request without
# it. Note: do not be fooled: the wget referenced in this script
# is busybox's wget, not the fully featured one with --method support.
#
# Make sure that every package you depend on here is already listed as
# a channel blocker for both the full-sized and small channels.
# Otherwise, we risk breaking user deploys in released channels.
''
metaDir=${targetRoot}etc/ec2-metadata
mkdir -m 0755 -p "$metaDir"
get_imds_token() {
# retry-delay of 1 selected to give the system a second to get going,
# but not add a lot to the bootup time
${curl}/bin/curl \
-v \
--retry 3 \
--retry-delay 1 \
--fail \
-X PUT \
--connect-timeout 1 \
-H "X-aws-ec2-metadata-token-ttl-seconds: 600" \
http://169.254.169.254/latest/api/token
}
preflight_imds_token() {
# retry-delay of 1 selected to give the system a second to get going,
# but not add a lot to the bootup time
${curl}/bin/curl \
-v \
--retry 3 \
--retry-delay 1 \
--fail \
--connect-timeout 1 \
-H "X-aws-ec2-metadata-token: $IMDS_TOKEN" \
http://169.254.169.254/1.0/meta-data/instance-id
}
try=1
while [ $try -le 3 ]; do
echo "(attempt $try/3) getting an EC2 instance metadata service v2 token..."
IMDS_TOKEN=$(get_imds_token) && break
try=$((try + 1))
sleep 1
done
if [ "x$IMDS_TOKEN" == "x" ]; then
echo "failed to fetch an IMDS2v token."
fi
try=1
while [ $try -le 10 ]; do
echo "(attempt $try/10) validating the EC2 instance metadata service v2 token..."
preflight_imds_token && break
try=$((try + 1))
sleep 1
done
echo "getting EC2 instance metadata..."
if ! [ -e "$metaDir/ami-manifest-path" ]; then
wget ${wgetExtraOptions} -O "$metaDir/ami-manifest-path" http://169.254.169.254/1.0/meta-data/ami-manifest-path
wget ${wgetExtraOptions} --header "X-aws-ec2-metadata-token: $IMDS_TOKEN" -O "$metaDir/ami-manifest-path" http://169.254.169.254/1.0/meta-data/ami-manifest-path
fi
if ! [ -e "$metaDir/user-data" ]; then
wget ${wgetExtraOptions} -O "$metaDir/user-data" http://169.254.169.254/1.0/user-data && chmod 600 "$metaDir/user-data"
wget ${wgetExtraOptions} --header "X-aws-ec2-metadata-token: $IMDS_TOKEN" -O "$metaDir/user-data" http://169.254.169.254/1.0/user-data && chmod 600 "$metaDir/user-data"
fi
if ! [ -e "$metaDir/hostname" ]; then
wget ${wgetExtraOptions} -O "$metaDir/hostname" http://169.254.169.254/1.0/meta-data/hostname
wget ${wgetExtraOptions} --header "X-aws-ec2-metadata-token: $IMDS_TOKEN" -O "$metaDir/hostname" http://169.254.169.254/1.0/meta-data/hostname
fi
if ! [ -e "$metaDir/public-keys-0-openssh-key" ]; then
wget ${wgetExtraOptions} -O "$metaDir/public-keys-0-openssh-key" http://169.254.169.254/1.0/meta-data/public-keys/0/openssh-key
wget ${wgetExtraOptions} --header "X-aws-ec2-metadata-token: $IMDS_TOKEN" -O "$metaDir/public-keys-0-openssh-key" http://169.254.169.254/1.0/meta-data/public-keys/0/openssh-key
fi
''
2 changes: 1 addition & 1 deletion nixos/modules/virtualisation/openstack-config.nix
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
with lib;

let
metadataFetcher = import ./ec2-metadata-fetcher.nix {
metadataFetcher = import ./openstack-metadata-fetcher.nix {
targetRoot = "/";
wgetExtraOptions = "--retry-connrefused";
};
23 changes: 23 additions & 0 deletions nixos/modules/virtualisation/openstack-metadata-fetcher.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{ targetRoot, wgetExtraOptions }:
''
metaDir=${targetRoot}etc/ec2-metadata
mkdir -m 0755 -p "$metaDir"
echo "getting EC2 instance metadata..."
if ! [ -e "$metaDir/ami-manifest-path" ]; then
wget ${wgetExtraOptions} -O "$metaDir/ami-manifest-path" http://169.254.169.254/1.0/meta-data/ami-manifest-path
fi
if ! [ -e "$metaDir/user-data" ]; then
wget ${wgetExtraOptions} -O "$metaDir/user-data" http://169.254.169.254/1.0/user-data && chmod 600 "$metaDir/user-data"
fi
if ! [ -e "$metaDir/hostname" ]; then
wget ${wgetExtraOptions} -O "$metaDir/hostname" http://169.254.169.254/1.0/meta-data/hostname
fi
if ! [ -e "$metaDir/public-keys-0-openssh-key" ]; then
wget ${wgetExtraOptions} -O "$metaDir/public-keys-0-openssh-key" http://169.254.169.254/1.0/meta-data/public-keys/0/openssh-key
fi
''
1 change: 1 addition & 0 deletions nixos/release-combined.nix
Original file line number Diff line number Diff line change
@@ -49,6 +49,7 @@ in rec {
[ "nixos.channel" ]
(onFullSupported "nixos.dummy")
(onAllSupported "nixos.iso_minimal")
(onAllSupported "nixos.amazonImage")
(onSystems ["x86_64-linux"] "nixos.iso_plasma5")
(onSystems ["x86_64-linux"] "nixos.iso_gnome")
(onFullSupported "nixos.manual")
3 changes: 2 additions & 1 deletion nixos/release-small.nix
Original file line number Diff line number Diff line change
@@ -28,7 +28,7 @@ let
in rec {

nixos = {
inherit (nixos') channel manual options iso_minimal dummy;
inherit (nixos') channel manual options iso_minimal amazonImage dummy;
tests = {
inherit (nixos'.tests)
containers-imperative
@@ -92,6 +92,7 @@ in rec {
[ "nixos.channel"
"nixos.dummy.x86_64-linux"
"nixos.iso_minimal.x86_64-linux"
"nixos.amazonImage.x86_64-linux"
"nixos.manual.x86_64-linux"
"nixos.tests.boot.biosCdrom.x86_64-linux"
"nixos.tests.containers-imperative.x86_64-linux"
12 changes: 12 additions & 0 deletions nixos/tests/docker-tools.nix
Original file line number Diff line number Diff line change
@@ -234,5 +234,17 @@ import ./make-test-python.nix ({ pkgs, ... }: {
"docker run --rm file-in-store nix-store --verify --check-contents",
"docker run --rm file-in-store |& grep 'some data'",
)
with subtest("Ensure cross compiled image can be loaded and has correct arch."):
docker.succeed(
"docker load --input='${pkgs.dockerTools.examples.cross-aarch64}'",
)
assert (
docker.succeed(
"docker inspect ${pkgs.dockerTools.examples.cross-aarch64.imageName} "
+ "| ${pkgs.jq}/bin/jq -r .[].Architecture"
).strip()
== "arm64v8"
)
'';
})
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{ lib, python3Packages, fetchFromGitHub }:

python3Packages.buildPythonApplication rec {
pname = "matrix-dl-unstable";
version = "2019-09-22";
pname = "matrix-dl";
version = "unstable-2020-07-14";

src = fetchFromGitHub {
owner = "rubo77";
repo = "matrix-dl";
rev = "e91610f45b7b3b0aca34923309fc83ba377f8a69";
sha256 = "036xfdd21pcfjlilknc67z5jqpk0vz07853wwcsiac32iypc6f2q";
repo = pname;
rev = "b1a86d1421f39ee327284e1023f09dc165e3c8a5";
sha256 = "1l8nh8z7kz24v0wcy3ll3w6in2yxwa1yz8lyc3x0blz37d8ss4ql";
};

propagatedBuildInputs = with python3Packages; [
10 changes: 6 additions & 4 deletions pkgs/applications/terminal-emulators/mlterm/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ stdenv, lib, fetchurl, pkgconfig, autoconf, makeDesktopItem
{ stdenv, lib, fetchFromGitHub, pkgconfig, autoconf, makeDesktopItem
, libX11, gdk-pixbuf, cairo, libXft, gtk3, vte
, harfbuzz #substituting glyphs with opentype fonts
, fribidi, m17n_lib #bidi and encoding
@@ -12,9 +12,11 @@ stdenv.mkDerivation rec {
pname = "mlterm";
version = "3.9.1";

src = fetchurl {
url = "mirror://sourceforge/project/mlterm/01release/${pname}-${version}/${pname}-${version}.tar.gz";
sha256 = "03fnynwv7d1aicwk2rp31sgncv5m65agvygqvsgn59v9di40gnnb";
src = fetchFromGitHub {
owner = "arakiken";
repo = pname;
rev = "rel-${lib.replaceStrings [ "." ] [ "_" ] version}"; # 3.9.1 -> rel-3_9_1
sha256 = "1hh196kz2n3asv8r8r2bdk5b2w93zq7rw4880ciiq1554h0ib7fj";
};

nativeBuildInputs = [ pkgconfig autoconf wrapGAppsHook ];
10 changes: 4 additions & 6 deletions pkgs/applications/version-management/mercurial/default.nix
Original file line number Diff line number Diff line change
@@ -4,26 +4,24 @@
}:

let
inherit (python3Packages) docutils dulwich python;
inherit (python3Packages) docutils python;

in python3Packages.buildPythonApplication rec {
pname = "mercurial";
version = "5.4.2";
version = "5.6";

src = fetchurl {
url = "https://mercurial-scm.org/release/mercurial-${version}.tar.gz";
sha256 = "0ls8nwx3nz26pibphw54fg8pxqb365zmmqx95lqrxqqyf3d972sw";
sha256 = "1hk2y30zzdnlv8f71kabvh0xi9c7qhp28ksh20vpd0r712sv79yz";
};

format = "other";

inherit python; # pass it so that the same version can be used in hg2git
passthru = { inherit python; }; # pass it so that the same version can be used in hg2git

buildInputs = [ makeWrapper docutils unzip ]
++ stdenv.lib.optionals stdenv.isDarwin [ ApplicationServices ];

propagatedBuildInputs = [ dulwich ];

makeFlags = [ "PREFIX=$(out)" ];

postInstall = (stdenv.lib.optionalString guiSupport ''
25 changes: 18 additions & 7 deletions pkgs/build-support/docker/default.nix
Original file line number Diff line number Diff line change
@@ -31,6 +31,7 @@
writeScript,
writeText,
writePython3,
system, # Note: This is the cross system we're compiling for
}:

# WARNING: this API is unstable and may be subject to backwards-incompatible changes in the future.
@@ -48,14 +49,24 @@ let
# A user is required by nix
# https://github.com/NixOS/nix/blob/9348f9291e5d9e4ba3c4347ea1b235640f54fd79/src/libutil/util.cc#L478
export USER=nobody
${nix}/bin/nix-store --load-db < ${closureInfo {rootPaths = contentsList;}}/registration
${buildPackages.nix}/bin/nix-store --load-db < ${closureInfo {rootPaths = contentsList;}}/registration
mkdir -p nix/var/nix/gcroots/docker/
for i in ${lib.concatStringsSep " " contentsList}; do
ln -s $i nix/var/nix/gcroots/docker/$(basename $i)
done;
'';

# Map nixpkgs architecture to Docker notation
# Reference: https://github.com/docker-library/official-images#architectures-other-than-amd64
getArch = nixSystem: {
aarch64-linux = "arm64v8";
armv7l-linux = "arm32v7";
x86_64-linux = "amd64";
powerpc64le-linux = "ppc64le";
i686-linux = "i386";
}.${nixSystem} or "Can't map Nix system ${nixSystem} to Docker architecture notation. Please check that your input and your requested build are correct or update the mapping in Nixpkgs.";

in
rec {

@@ -72,7 +83,7 @@ rec {
, imageDigest
, sha256
, os ? "linux"
, arch ? buildPackages.go.GOARCH
, arch ? getArch system

# This is used to set name to the pulled image
, finalImageName ? imageName
@@ -443,7 +454,7 @@ rec {
runCommand "${name}.tar.gz" {
inherit (stream) imageName;
passthru = { inherit (stream) imageTag; };
buildInputs = [ pigz ];
nativeBuildInputs = [ pigz ];
} "${stream} | pigz -nT > $out";

# 1. extract the base image
@@ -488,7 +499,7 @@ rec {
baseJson = let
pure = writeText "${baseName}-config.json" (builtins.toJSON {
inherit created config;
architecture = buildPackages.go.GOARCH;
architecture = getArch system;
os = "linux";
});
impure = runCommand "${baseName}-config.json"
@@ -715,7 +726,7 @@ rec {
streamScript = writePython3 "stream" {} ./stream_layered_image.py;
baseJson = writeText "${name}-base.json" (builtins.toJSON {
inherit config;
architecture = buildPackages.go.GOARCH;
architecture = getArch system;
os = "linux";
});

@@ -762,7 +773,7 @@ rec {
else
lib.head (lib.strings.splitString "-" (baseNameOf conf.outPath));
paths = referencesByPopularity overallClosure;
buildInputs = [ jq ];
nativeBuildInputs = [ jq ];
} ''
${if (tag == null) then ''
outName="$(basename "$out")"
@@ -826,7 +837,7 @@ rec {
# take images can know in advance how the image is supposed to be used.
isExe = true;
};
buildInputs = [ makeWrapper ];
nativeBuildInputs = [ makeWrapper ];
} ''
makeWrapper ${streamScript} $out --add-flags ${conf}
'';
9 changes: 8 additions & 1 deletion pkgs/build-support/docker/examples.nix
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@
# $ nix-build '<nixpkgs>' -A dockerTools.examples.redis
# $ docker load < result

{ pkgs, buildImage, pullImage, shadowSetup, buildImageWithNixDb }:
{ pkgs, buildImage, pullImage, shadowSetup, buildImageWithNixDb, pkgsCross }:

rec {
# 1. basic example
@@ -407,4 +407,11 @@ rec {
contents = [ pkgs.bash pkgs.coreutils ] ++ nonRootShadowSetup { uid = 999; user = "somebody"; };
};

# basic example, with cross compilation
cross-aarch64 = pkgsCross.aarch64-multiplatform.dockerTools.buildImage {
name = "hello-cross";
tag = "latest";
contents = pkgsCross.aarch64-multiplatform.hello;
};

}
Loading