···63 script = with builtins; concatStringsSep "\n" (mapAttrsToList (cert: data: ''
64 for fixpath in /var/lib/acme/${escapeShellArg cert} /var/lib/acme/.lego/${escapeShellArg cert}; do
65 if [ -d "$fixpath" ]; then
66- chmod -R 750 "$fixpath"
67 chown -R acme:${data.group} "$fixpath"
68 fi
69 done
···271272 mv domainhash.txt certificates/
273 chmod 640 certificates/*
274- chmod -R 700 accounts/*
275276 # Group might change between runs, re-apply it
277 chown 'acme:${data.group}' certificates/*
···63 script = with builtins; concatStringsSep "\n" (mapAttrsToList (cert: data: ''
64 for fixpath in /var/lib/acme/${escapeShellArg cert} /var/lib/acme/.lego/${escapeShellArg cert}; do
65 if [ -d "$fixpath" ]; then
66+ chmod -R u=rwX,g=rX,o= "$fixpath"
67 chown -R acme:${data.group} "$fixpath"
68 fi
69 done
···271272 mv domainhash.txt certificates/
273 chmod 640 certificates/*
274+ chmod -R u=rwX,g=,o= accounts/*
275276 # Group might change between runs, re-apply it
277 chown 'acme:${data.group}' certificates/*
+21
nixos/tests/common/acme/server/README.md
···000000000000000000000
···1+# Fake Certificate Authority for ACME testing
2+3+This will set up a test node running [pebble](https://github.com/letsencrypt/pebble)
4+to serve ACME certificate requests.
5+6+## "Snake oil" certs
7+8+The snake oil certs are hard coded into the repo for reasons explained [here](https://github.com/NixOS/nixpkgs/pull/91121#discussion_r505410235).
9+The root of the issue is that Nix will hash the derivation based on the arguments
10+to mkDerivation, not the output. [Minica](https://github.com/jsha/minica) will
11+always generate a random certificate even if the arguments are unchanged. As a
12+result, it's possible to end up in a situation where the cached and local
13+generated certs mismatch and cause issues with testing.
14+15+To generate new certificates, run the following commands:
16+17+```bash
18+nix-build generate-certs.nix
19+cp result/* .
20+rm result
21+```
···51# that it has to be started _before_ the ACME service.
52{ config, pkgs, lib, ... }:
53let
54- testCerts = import ./snakeoil-certs.nix {
55- minica = pkgs.minica;
56- mkDerivation = pkgs.stdenv.mkDerivation;
57- };
58 domain = testCerts.domain;
5960 resolver = let
···51# that it has to be started _before_ the ACME service.
52{ config, pkgs, lib, ... }:
53let
54+ testCerts = import ./snakeoil-certs.nix;
00055 domain = testCerts.domain;
5657 resolver = let
+29
nixos/tests/common/acme/server/generate-certs.nix
···00000000000000000000000000000
···1+# Minica can provide a CA key and cert, plus a key
2+# and cert for our fake CA server's Web Front End (WFE).
3+{
4+ pkgs ? import <nixpkgs> {},
5+ minica ? pkgs.minica,
6+ mkDerivation ? pkgs.stdenv.mkDerivation
7+}:
8+let
9+ conf = import ./snakeoil-certs.nix;
10+ domain = conf.domain;
11+in mkDerivation {
12+ name = "test-certs";
13+ buildInputs = [ minica ];
14+ phases = [ "buildPhase" "installPhase" ];
15+16+ buildPhase = ''
17+ minica \
18+ --ca-key ca.key.pem \
19+ --ca-cert ca.cert.pem \
20+ --domains ${domain}
21+ '';
22+23+ installPhase = ''
24+ mkdir -p $out
25+ mv ca.*.pem $out/
26+ mv ${domain}/key.pem $out/${domain}.key.pem
27+ mv ${domain}/cert.pem $out/${domain}.cert.pem
28+ '';
29+}
+4-28
nixos/tests/common/acme/server/snakeoil-certs.nix
···1-# Minica can provide a CA key and cert, plus a key
2-# and cert for our fake CA server's Web Front End (WFE).
3-{ minica, mkDerivation }:
4let
5 domain = "acme.test";
6-7- selfSignedCertData = mkDerivation {
8- name = "test-certs";
9- buildInputs = [ minica ];
10- phases = [ "buildPhase" "installPhase" ];
11-12- buildPhase = ''
13- mkdir ca
14- minica \
15- --ca-key ca/key.pem \
16- --ca-cert ca/cert.pem \
17- --domains ${domain}
18- chmod 600 ca/*
19- chmod 640 ${domain}/*.pem
20- '';
21-22- installPhase = ''
23- mkdir -p $out
24- mv ${domain} ca $out/
25- '';
26- };
27in {
28 inherit domain;
29 ca = {
30- cert = "${selfSignedCertData}/ca/cert.pem";
31- key = "${selfSignedCertData}/ca/key.pem";
32 };
33 "${domain}" = {
34- cert = "${selfSignedCertData}/${domain}/cert.pem";
35- key = "${selfSignedCertData}/${domain}/key.pem";
36 };
37}
···1819mkDerivation rec {
20 pname = "cloudcompare";
21- version = "2.11.0";
2223 src = fetchFromGitHub {
24 owner = "CloudCompare";
25 repo = "CloudCompare";
26 rev = "v${version}";
27- sha256 = "02ahhhivgb9k1aygw1m35wdvhaizag1r98mb0r6zzrs5p4y64wlb";
28 # As of writing includes (https://github.com/CloudCompare/CloudCompare/blob/a1c589c006fc325e8b560c77340809b9c7e7247a/.gitmodules):
29 # * libE57Format
30 # * PoissonRecon
31- # In > 2.11 it will also contain
32 # * CCCoreLib
33 fetchSubmodules = true;
34 };
···53 ];
5455 cmakeFlags = [
56- # TODO: This will become -DCCCORELIB_USE_TBB=ON in > 2.11.0, see
57 # https://github.com/CloudCompare/CloudCompare/commit/f5a0c9fd788da26450f3fa488b2cf0e4a08d255f
58 "-DCOMPILE_CC_CORE_LIB_WITH_TBB=ON"
59 "-DOPTION_USE_DXF_LIB=ON"
···1819mkDerivation rec {
20 pname = "cloudcompare";
21+ version = "2.11.2";
2223 src = fetchFromGitHub {
24 owner = "CloudCompare";
25 repo = "CloudCompare";
26 rev = "v${version}";
27+ sha256 = "0sb2h08iaf6zrf54sg6ql6wm63q5vq0kpd3gffdm26z8w6j6wv3s";
28 # As of writing includes (https://github.com/CloudCompare/CloudCompare/blob/a1c589c006fc325e8b560c77340809b9c7e7247a/.gitmodules):
29 # * libE57Format
30 # * PoissonRecon
31+ # In a future version it will also contain
32 # * CCCoreLib
33 fetchSubmodules = true;
34 };
···53 ];
5455 cmakeFlags = [
56+ # TODO: This will become -DCCCORELIB_USE_TBB=ON in a future version, see
57 # https://github.com/CloudCompare/CloudCompare/commit/f5a0c9fd788da26450f3fa488b2cf0e4a08d255f
58 "-DCOMPILE_CC_CORE_LIB_WITH_TBB=ON"
59 "-DOPTION_USE_DXF_LIB=ON"
+27-13
pkgs/applications/misc/sakura/default.nix
···1-{ stdenv, fetchurl, cmake, pkgconfig, gtk3, perl, vte, pcre2, glib , makeWrapper }:
000000000023stdenv.mkDerivation rec {
4 pname = "sakura";
5- version = "3.7.0";
67 src = fetchurl {
8- url = "https://launchpad.net/sakura/trunk/${version}/+download/${pname}-${version}.tar.gz";
9- sha256 = "15gskj5yv5qs3cj4ps43735kfx2nzjlhq4dk9ghirl8lvhhxsm5m";
10 };
1112- nativeBuildInputs = [ cmake perl pkgconfig ];
1314- buildInputs = [ makeWrapper gtk3 vte pcre2 glib ];
1516- # Wrapper sets path to gsettings-schemata so sakura knows where to find colorchooser, fontchooser ...
17- postInstall = "wrapProgram $out/bin/sakura --suffix XDG_DATA_DIRS : ${gtk3}/share/gsettings-schemas/${gtk3.name}/";
00001819 meta = with stdenv.lib; {
020 description = "A terminal emulator based on GTK and VTE";
21- homepage = "https://www.pleyades.net/david/projects/sakura";
22- license = licenses.gpl2;
23- maintainers = with maintainers; [ astsmtl codyopel ];
24- platforms = platforms.linux;
25 longDescription = ''
26 sakura is a terminal emulator based on GTK and VTE. It's a terminal
27 emulator with few dependencies, so you don't need a full GNOME desktop
···32 terminals in one window and adds a contextual menu with some basic
33 options. No more no less.
34 '';
35- };
00036}
···1+{ stdenv
2+, fetchurl
3+, cmake
4+, pkgconfig
5+, gtk3
6+, perl
7+, vte
8+, pcre2
9+, glib
10+, makeWrapper
11+}:
1213stdenv.mkDerivation rec {
14 pname = "sakura";
15+ version = "3.7.1";
1617 src = fetchurl {
18+ url = "https://launchpad.net/${pname}/trunk/${version}/+download/${pname}-${version}.tar.bz2";
19+ sha256 = "sha256-cppODnUKQpS9kFkkOqxU3yqAElAVn8VQtQsP4Carkos=";
20 };
2122+ nativeBuildInputs = [ cmake perl pkgconfig makeWrapper ];
2324+ buildInputs = [ gtk3 vte pcre2 glib ];
2526+ # Set path to gsettings-schemata so sakura knows
27+ # where to find colorchooser, fontchooser etc.
28+ postInstall = ''
29+ wrapProgram $out/bin/sakura \
30+ --suffix XDG_DATA_DIRS : ${gtk3}/share/gsettings-schemas/${gtk3.name}/
31+ '';
3233 meta = with stdenv.lib; {
34+ homepage = "https://www.pleyades.net/david/projects/sakura";
35 description = "A terminal emulator based on GTK and VTE";
000036 longDescription = ''
37 sakura is a terminal emulator based on GTK and VTE. It's a terminal
38 emulator with few dependencies, so you don't need a full GNOME desktop
···43 terminals in one window and adds a contextual menu with some basic
44 options. No more no less.
45 '';
46+ license = licenses.gpl2Only;
47+ maintainers = with maintainers; [ astsmtl codyopel AndersonTorres ];
48+ platforms = platforms.linux;
49+ };
50}
···43 cd go
44 patchShebangs ./ # replace /bin/bash
450046 # Disabling the 'os/http/net' tests (they want files not available in
47 # chroot builds)
48 rm src/net/{multicast_test.go,parse_test.go,port_test.go}
···56 sed -i '/TestDialTimeout/areturn' src/net/dial_test.go
57 # Disable the hostname test
58 sed -i '/TestHostname/areturn' src/os/os_test.go
59- # ParseInLocation fails the test
60- sed -i '/TestParseInSydney/areturn' src/time/format_test.go
6162 sed -i 's,/etc/protocols,${iana-etc}/etc/protocols,' src/net/lookup_unix.go
63 '' + lib.optionalString stdenv.isLinux ''
···119 patches = [
120 ./remove-tools-1.4.patch
121 ./creds-test-1.4.patch
122-123- # This test checks for the wrong thing with recent tzdata. It's been fixed in master but the patch
124- # actually works on old versions too.
125- (fetchpatch {
126- url = "https://github.com/golang/go/commit/91563ced5897faf729a34be7081568efcfedda31.patch";
127- sha256 = "1ny5l3f8a9dpjjrnjnsplb66308a0x13sa0wwr4j6yrkc8j4qxqi";
128- })
129 ];
130131 GOOS = if stdenv.isDarwin then "darwin" else "linux";
···43 cd go
44 patchShebangs ./ # replace /bin/bash
4546+ # Disable timezone tests (these fail when `tzdata` is updated)
47+ rm src/time/{example,format}_test.go
48 # Disabling the 'os/http/net' tests (they want files not available in
49 # chroot builds)
50 rm src/net/{multicast_test.go,parse_test.go,port_test.go}
···58 sed -i '/TestDialTimeout/areturn' src/net/dial_test.go
59 # Disable the hostname test
60 sed -i '/TestHostname/areturn' src/os/os_test.go
006162 sed -i 's,/etc/protocols,${iana-etc}/etc/protocols,' src/net/lookup_unix.go
63 '' + lib.optionalString stdenv.isLinux ''
···119 patches = [
120 ./remove-tools-1.4.patch
121 ./creds-test-1.4.patch
0000000122 ];
123124 GOOS = if stdenv.isDarwin then "darwin" else "linux";
···12}:
1314let
15- version = "1.6.0";
16 device = if cudaSupport then "cuda" else "cpu";
17- srcs = import ./binary-hashes.nix;
18 unavailable = throw "libtorch is not available for this platform";
19in stdenv.mkDerivation {
20 inherit version;
···12}:
1314let
15+ version = "1.7.0";
16 device = if cudaSupport then "cuda" else "cpu";
17+ srcs = import ./binary-hashes.nix version;
18 unavailable = throw "libtorch is not available for this platform";
19in stdenv.mkDerivation {
20 inherit version;
···55 test "$?" == 124 && echo "ok")
56 '';
5758- meta = {
59 description = "Launcher for Pharo distributions";
060 longDescription = ''
61-62 Pharo's goal is to deliver a clean, innovative, free open-source
63 Smalltalk-inspired environment. By providing a stable and small
64 core system, excellent dev tools, and maintained releases, Pharo
···75 access it very rapidly from your OS application launcher. As a
76 result, launching any image is never more than 3 clicks away.
77 '';
78- homepage = "http://pharo.org";
79- license = stdenv.lib.licenses.mit;
80 maintainers = [ ];
81 platforms = pharo.meta.platforms;
82 };
···55 test "$?" == 124 && echo "ok")
56 '';
5758+ meta = with stdenv.lib; {
59 description = "Launcher for Pharo distributions";
60+ homepage = "https://pharo.org";
61 longDescription = ''
062 Pharo's goal is to deliver a clean, innovative, free open-source
63 Smalltalk-inspired environment. By providing a stable and small
64 core system, excellent dev tools, and maintained releases, Pharo
···75 access it very rapidly from your OS application launcher. As a
76 result, launching any image is never more than 3 clicks away.
77 '';
78+ license = licenses.mit;
079 maintainers = [ ];
80 platforms = pharo.meta.platforms;
81 };
+30-10
pkgs/development/pharo/vm/build-vm-legacy.nix
···1-{ stdenv, fetchurl, cmake, bash, unzip, glibc, openssl, gcc, libGLU, libGL, freetype, xorg, alsaLib, cairo, libuuid, makeWrapper, ... }:
000000000000000023{ name, src, ... }:
4···1011 hardeningDisable = [ "format" "pic" ];
1213- # Building
0000000014 preConfigure = ''
15 cd build/
16 '';
···46 ln -s "${pharo-share}/lib/"*.sources $prefix/lib/$name
47 '';
4849- LD_LIBRARY_PATH = stdenv.lib.makeLibraryPath [ cairo libGLU libGL freetype openssl libuuid alsaLib xorg.libICE xorg.libSM ];
50- nativeBuildInputs = [ unzip cmake gcc makeWrapper ];
51- buildInputs = [ bash glibc openssl libGLU libGL freetype xorg.libX11 xorg.libICE xorg.libSM alsaLib cairo pharo-share ];
52-53- meta = {
54 description = "Clean and innovative Smalltalk-inspired environment";
055 longDescription = ''
56 Pharo's goal is to deliver a clean, innovative, free open-source
57 Smalltalk-inspired environment. By providing a stable and small core
···65 Please fill bug reports on http://bugs.pharo.org under the 'Ubuntu
66 packaging (ppa:pharo/stable)' project.
67 '';
68- homepage = "http://pharo.org";
69- license = stdenv.lib.licenses.mit;
70- maintainers = [ stdenv.lib.maintainers.lukego ];
71 # Pharo VM sources are packaged separately for darwin (OS X)
72 platforms = stdenv.lib.filter
73 (system: with stdenv.lib.systems.elaborate { inherit system; };
···1+{ stdenv
2+, fetchurl
3+, cmake
4+, bash
5+, unzip
6+, glibc
7+, openssl
8+, gcc
9+, libGLU
10+, libGL
11+, freetype
12+, xorg
13+, alsaLib
14+, cairo
15+, libuuid
16+, makeWrapper
17+, ... }:
1819{ name, src, ... }:
20···2627 hardeningDisable = [ "format" "pic" ];
2829+ nativeBuildInputs = [ unzip cmake gcc makeWrapper ];
30+31+ buildInputs = [ bash glibc openssl libGLU libGL freetype
32+ xorg.libX11 xorg.libICE xorg.libSM alsaLib cairo pharo-share ];
33+34+ LD_LIBRARY_PATH = stdenv.lib.makeLibraryPath
35+ [ cairo libGLU libGL freetype openssl libuuid alsaLib
36+ xorg.libICE xorg.libSM ];
37+38 preConfigure = ''
39 cd build/
40 '';
···70 ln -s "${pharo-share}/lib/"*.sources $prefix/lib/$name
71 '';
7273+ meta = with stdenv.lib; {
000074 description = "Clean and innovative Smalltalk-inspired environment";
75+ homepage = "https://pharo.org";
76 longDescription = ''
77 Pharo's goal is to deliver a clean, innovative, free open-source
78 Smalltalk-inspired environment. By providing a stable and small core
···86 Please fill bug reports on http://bugs.pharo.org under the 'Ubuntu
87 packaging (ppa:pharo/stable)' project.
88 '';
89+ license = licenses.mit;
90+ maintainers = [ maintainers.lukego ];
091 # Pharo VM sources are packaged separately for darwin (OS X)
92 platforms = stdenv.lib.filter
93 (system: with stdenv.lib.systems.elaborate { inherit system; };
+28-28
pkgs/development/pharo/vm/build-vm.nix
···46 # while the VM depends on <= gcc48:
47 "stackprotector" ];
4800000000000000000000000000049 # Regenerate the configure script.
50 # Unnecessary? But the build breaks without this.
51 autoreconfPhase = ''
···123 ln -s ${libgit2}/lib/libgit2.so* "$out/"
124 '';
125126- enableParallelBuilding = true;
127-128- # gcc 4.8 used for the build:
129- #
130- # gcc5 crashes during compilation; gcc >= 4.9 produces a
131- # binary that crashes when forking a child process. See:
132- # http://forum.world.st/OSProcess-fork-issue-with-Debian-built-VM-td4947326.html
133- #
134- # (stack protection is disabled above for gcc 4.8 compatibility.)
135- nativeBuildInputs = [ autoreconfHook ];
136- buildInputs = [
137- bash
138- unzip
139- glibc
140- openssl
141- gcc48
142- libGLU libGL
143- freetype
144- xorg.libX11
145- xorg.libICE
146- xorg.libSM
147- alsaLib
148- cairo
149- pharo-share
150- libuuid
151- ];
152-153 meta = with stdenv.lib; {
154 description = "Clean and innovative Smalltalk-inspired environment";
0155 longDescription = ''
156 Pharo's goal is to deliver a clean, innovative, free open-source
157 Smalltalk-inspired environment. By providing a stable and small core
···165 Please fill bug reports on http://bugs.pharo.org under the 'Ubuntu
166 packaging (ppa:pharo/stable)' project.
167 '';
168- homepage = "http://pharo.org";
169 license = licenses.mit;
170 maintainers = [ maintainers.lukego ];
171 platforms = [ "i686-linux" "x86_64-linux" ];
···46 # while the VM depends on <= gcc48:
47 "stackprotector" ];
4849+ # gcc 4.8 used for the build:
50+ #
51+ # gcc5 crashes during compilation; gcc >= 4.9 produces a
52+ # binary that crashes when forking a child process. See:
53+ # http://forum.world.st/OSProcess-fork-issue-with-Debian-built-VM-td4947326.html
54+ #
55+ # (stack protection is disabled above for gcc 4.8 compatibility.)
56+ nativeBuildInputs = [ autoreconfHook ];
57+ buildInputs = [
58+ bash
59+ unzip
60+ glibc
61+ openssl
62+ gcc48
63+ libGLU libGL
64+ freetype
65+ xorg.libX11
66+ xorg.libICE
67+ xorg.libSM
68+ alsaLib
69+ cairo
70+ pharo-share
71+ libuuid
72+ ];
73+74+ enableParallelBuilding = true;
75+76 # Regenerate the configure script.
77 # Unnecessary? But the build breaks without this.
78 autoreconfPhase = ''
···150 ln -s ${libgit2}/lib/libgit2.so* "$out/"
151 '';
152000000000000000000000000000153 meta = with stdenv.lib; {
154 description = "Clean and innovative Smalltalk-inspired environment";
155+ homepage = "https://pharo.org";
156 longDescription = ''
157 Pharo's goal is to deliver a clean, innovative, free open-source
158 Smalltalk-inspired environment. By providing a stable and small core
···166 Please fill bug reports on http://bugs.pharo.org under the 'Ubuntu
167 packaging (ppa:pharo/stable)' project.
168 '';
0169 license = licenses.mit;
170 maintainers = [ maintainers.lukego ];
171 platforms = [ "i686-linux" "x86_64-linux" ];
···89buildPythonPackage rec {
10 pname = "pysmb";
11- version = "1.2.4";
1213 src = fetchPypi {
14 inherit pname version;
15 format = "setuptools";
16 extension = "zip";
17- sha256 = "0937cb44936805d403e8e678d7042feb6d85da950a7019e8ae6842a0720fb00c";
18 };
1920 propagatedBuildInputs = [
···24 # Tests require Network Connectivity and a server up and running
25 # https://github.com/miketeo/pysmb/blob/master/python3/tests/README_1st.txt
26 doCheck = false;
002728 meta = {
29 description = "Experimental SMB/CIFS library written in Python to support file sharing between Windows and Linux machines";
···89buildPythonPackage rec {
10 pname = "pysmb";
11+ version = "1.2.5";
1213 src = fetchPypi {
14 inherit pname version;
15 format = "setuptools";
16 extension = "zip";
17+ sha256 = "7aedd5e003992c6c78b41a0da4bf165359a46ea25ab2a9a1594d13f471ad7287";
18 };
1920 propagatedBuildInputs = [
···24 # Tests require Network Connectivity and a server up and running
25 # https://github.com/miketeo/pysmb/blob/master/python3/tests/README_1st.txt
26 doCheck = false;
27+28+ pythonImportsCheck = [ "nmb" "smb" ];
2930 meta = {
31 description = "Experimental SMB/CIFS library written in Python to support file sharing between Windows and Linux machines";
+16-2
pkgs/development/python-modules/pytorch/bin.nix
···11, patchelf
12, pyyaml
13, requests
014}:
1516let
17 pyVerNoDot = builtins.replaceStrings [ "." ] [ "" ] python.pythonVersion;
18 platform = if stdenv.isDarwin then "darwin" else "linux";
19- srcs = import ./binary-hashes.nix;
20 unsupported = throw "Unsupported system";
021in buildPythonPackage {
0022 pname = "pytorch";
23 # Don't forget to update pytorch to the same version.
24- version = "1.6.0";
2526 format = "wheel";
27···39 numpy
40 pyyaml
41 requests
0000000000042 ];
4344 postInstall = ''
···11, patchelf
12, pyyaml
13, requests
14+, typing-extensions
15}:
1617let
18 pyVerNoDot = builtins.replaceStrings [ "." ] [ "" ] python.pythonVersion;
19 platform = if stdenv.isDarwin then "darwin" else "linux";
20+ srcs = import ./binary-hashes.nix version;
21 unsupported = throw "Unsupported system";
22+ version = "1.7.0";
23in buildPythonPackage {
24+ inherit version;
25+26 pname = "pytorch";
27 # Don't forget to update pytorch to the same version.
02829 format = "wheel";
30···42 numpy
43 pyyaml
44 requests
45+ typing-extensions
46+ ];
47+48+ # PyTorch are broken: the dataclasses wheel is required, but ships with
49+ # Python >= 3.7. Our dataclasses derivation is incompatible with >= 3.7.
50+ #
51+ # https://github.com/pytorch/pytorch/issues/46930
52+ #
53+ # Should be removed with the next PyTorch version.
54+ pipInstallFlags = [
55+ "--no-deps"
56 ];
5758 postInstall = ''