Merge remote-tracking branch 'upstream/staging-next' into staging

This commit is contained in:
John Ericson 2019-11-25 15:59:05 -05:00
commit f191360ad0
151 changed files with 1795 additions and 858 deletions

3
.github/CODEOWNERS vendored
View File

@ -47,6 +47,9 @@
/nixos/doc/manual/man-nixos-option.xml @nbp /nixos/doc/manual/man-nixos-option.xml @nbp
/nixos/modules/installer/tools/nixos-option.sh @nbp /nixos/modules/installer/tools/nixos-option.sh @nbp
# NixOS integration test driver
/nixos/lib/test-driver @tfc
# New NixOS modules # New NixOS modules
/nixos/modules/module-list.nix @Infinisil /nixos/modules/module-list.nix @Infinisil

View File

@ -37,6 +37,7 @@ rec {
else if final.isAndroid then "bionic" else if final.isAndroid then "bionic"
else if final.isLinux /* default */ then "glibc" else if final.isLinux /* default */ then "glibc"
else if final.isMsp430 then "newlib" else if final.isMsp430 then "newlib"
else if final.isVc4 then "newlib"
else if final.isAvr then "avrlibc" else if final.isAvr then "avrlibc"
else if final.isNetBSD then "nblibc" else if final.isNetBSD then "nblibc"
# TODO(@Ericson2314) think more about other operating systems # TODO(@Ericson2314) think more about other operating systems

View File

@ -26,7 +26,7 @@ let
"riscv32-linux" "riscv64-linux" "riscv32-linux" "riscv64-linux"
"aarch64-none" "avr-none" "arm-none" "i686-none" "x86_64-none" "powerpc-none" "msp430-none" "riscv64-none" "riscv32-none" "aarch64-none" "avr-none" "arm-none" "i686-none" "x86_64-none" "powerpc-none" "msp430-none" "riscv64-none" "riscv32-none" "vc4-none"
]; ];
allParsed = map parse.mkSystemFromString all; allParsed = map parse.mkSystemFromString all;
@ -45,6 +45,7 @@ in {
x86_64 = filterDoubles predicates.isx86_64; x86_64 = filterDoubles predicates.isx86_64;
mips = filterDoubles predicates.isMips; mips = filterDoubles predicates.isMips;
riscv = filterDoubles predicates.isRiscV; riscv = filterDoubles predicates.isRiscV;
vc4 = filterDoubles predicates.isVc4;
cygwin = filterDoubles predicates.isCygwin; cygwin = filterDoubles predicates.isCygwin;
darwin = filterDoubles predicates.isDarwin; darwin = filterDoubles predicates.isDarwin;

View File

@ -118,6 +118,12 @@ rec {
config = "avr"; config = "avr";
}; };
vc4 = {
config = "vc4-elf";
libc = "newlib";
platform = {};
};
arm-embedded = { arm-embedded = {
config = "arm-none-eabi"; config = "arm-none-eabi";
libc = "newlib"; libc = "newlib";

View File

@ -21,6 +21,7 @@ rec {
isSparc = { cpu = { family = "sparc"; }; }; isSparc = { cpu = { family = "sparc"; }; };
isWasm = { cpu = { family = "wasm"; }; }; isWasm = { cpu = { family = "wasm"; }; };
isMsp430 = { cpu = { family = "msp430"; }; }; isMsp430 = { cpu = { family = "msp430"; }; };
isVc4 = { cpu = { family = "vc4"; }; };
isAvr = { cpu = { family = "avr"; }; }; isAvr = { cpu = { family = "avr"; }; };
isAlpha = { cpu = { family = "alpha"; }; }; isAlpha = { cpu = { family = "alpha"; }; };
isJavaScript = { cpu = cpuTypes.js; }; isJavaScript = { cpu = cpuTypes.js; };

View File

@ -112,6 +112,8 @@ rec {
msp430 = { bits = 16; significantByte = littleEndian; family = "msp430"; }; msp430 = { bits = 16; significantByte = littleEndian; family = "msp430"; };
avr = { bits = 8; family = "avr"; }; avr = { bits = 8; family = "avr"; };
vc4 = { bits = 32; significantByte = littleEndian; family = "vc4"; };
js = { bits = 32; significantByte = littleEndian; family = "js"; }; js = { bits = 32; significantByte = littleEndian; family = "js"; };
}; };

View File

@ -3601,6 +3601,12 @@
github = "klntsky"; github = "klntsky";
githubId = 18447310; githubId = 18447310;
}; };
kmcopper = {
email = "kmcopper@danwin1210.me";
name = "Kyle Copperfield";
github = "kmcopper";
githubId = 57132115;
};
kmeakin = { kmeakin = {
email = "karlwfmeakin@gmail.com"; email = "karlwfmeakin@gmail.com";
name = "Karl Meakin"; name = "Karl Meakin";

View File

@ -126,7 +126,7 @@ let
packageData = package: { packageData = package: {
name = package.name; name = package.name;
pname = lib.getName package; pname = pkgs.lib.getName package;
updateScript = map builtins.toString (pkgs.lib.toList package.updateScript); updateScript = map builtins.toString (pkgs.lib.toList package.updateScript);
}; };

View File

@ -181,6 +181,11 @@
The BeeGFS module has been removed. The BeeGFS module has been removed.
</para> </para>
</listitem> </listitem>
<listitem>
<para>
The osquery module has been removed.
</para>
</listitem>
</itemizedlist> </itemizedlist>
</section> </section>

View File

@ -86,7 +86,7 @@ let
optionsList = lib.sort optionLess optionsListDesc; optionsList = lib.sort optionLess optionsListDesc;
# Convert the list of options into an XML file. # Convert the list of options into an XML file.
optionsXML = builtins.toFile "options.xml" (builtins.toXML optionsList); optionsXML = pkgs.writeText "options.xml" (builtins.toXML optionsList);
optionsNix = builtins.listToAttrs (map (o: { name = o.name; value = removeAttrs o ["name" "visible" "internal"]; }) optionsList); optionsNix = builtins.listToAttrs (map (o: { name = o.name; value = removeAttrs o ["name" "visible" "internal"]; }) optionsList);

View File

@ -3,7 +3,6 @@ from contextlib import contextmanager, _GeneratorContextManager
from xml.sax.saxutils import XMLGenerator from xml.sax.saxutils import XMLGenerator
import _thread import _thread
import atexit import atexit
import json
import os import os
import ptpython.repl import ptpython.repl
import pty import pty
@ -16,7 +15,7 @@ import sys
import tempfile import tempfile
import time import time
import unicodedata import unicodedata
from typing import Tuple, TextIO, Any, Callable, Dict, Iterator, Optional, List from typing import Tuple, Any, Callable, Dict, Iterator, Optional, List
CHAR_TO_KEY = { CHAR_TO_KEY = {
"A": "shift-a", "A": "shift-a",
@ -771,7 +770,9 @@ def run_tests() -> None:
machine.execute("sync") machine.execute("sync")
if nr_tests != 0: if nr_tests != 0:
log.log("{} out of {} tests succeeded".format(nr_succeeded, nr_tests)) eprint("{} out of {} tests succeeded".format(nr_succeeded, nr_tests))
if nr_tests > nr_succeeded:
sys.exit(1)
@contextmanager @contextmanager

View File

@ -518,7 +518,6 @@
./services/monitoring/munin.nix ./services/monitoring/munin.nix
./services/monitoring/nagios.nix ./services/monitoring/nagios.nix
./services/monitoring/netdata.nix ./services/monitoring/netdata.nix
./services/monitoring/osquery.nix
./services/monitoring/prometheus/default.nix ./services/monitoring/prometheus/default.nix
./services/monitoring/prometheus/alertmanager.nix ./services/monitoring/prometheus/alertmanager.nix
./services/monitoring/prometheus/exporters.nix ./services/monitoring/prometheus/exporters.nix

View File

@ -10,6 +10,7 @@ with lib;
(mkRenamedOptionModule [ "networking" "enableRalinkFirmware" ] [ "hardware" "enableRedistributableFirmware" ]) (mkRenamedOptionModule [ "networking" "enableRalinkFirmware" ] [ "hardware" "enableRedistributableFirmware" ])
(mkRenamedOptionModule [ "networking" "enableRTL8192cFirmware" ] [ "hardware" "enableRedistributableFirmware" ]) (mkRenamedOptionModule [ "networking" "enableRTL8192cFirmware" ] [ "hardware" "enableRedistributableFirmware" ])
(mkRenamedOptionModule [ "networking" "networkmanager" "useDnsmasq" ] [ "networking" "networkmanager" "dns" ]) (mkRenamedOptionModule [ "networking" "networkmanager" "useDnsmasq" ] [ "networking" "networkmanager" "dns" ])
(mkRenamedOptionModule [ "networking" "connman" ] [ "services" "connman" ])
(mkChangedOptionModule [ "services" "printing" "gutenprint" ] [ "services" "printing" "drivers" ] (mkChangedOptionModule [ "services" "printing" "gutenprint" ] [ "services" "printing" "drivers" ]
(config: (config:
let enabled = getAttrFromPath [ "services" "printing" "gutenprint" ] config; let enabled = getAttrFromPath [ "services" "printing" "gutenprint" ] config;
@ -284,6 +285,9 @@ with lib;
(mkRemovedOptionModule [ "services.beegfsEnable" ] "The BeeGFS module has been removed") (mkRemovedOptionModule [ "services.beegfsEnable" ] "The BeeGFS module has been removed")
(mkRemovedOptionModule [ "services.beegfs" ] "The BeeGFS module has been removed") (mkRemovedOptionModule [ "services.beegfs" ] "The BeeGFS module has been removed")
# osquery
(mkRemovedOptionModule [ "services.osquery" ] "The osquery module has been removed")
# Redis # Redis
(mkRemovedOptionModule [ "services" "redis" "user" ] "The redis module now is hardcoded to the redis user.") (mkRemovedOptionModule [ "services" "redis" "user" ] "The redis module now is hardcoded to the redis user.")
(mkRemovedOptionModule [ "services" "redis" "dbpath" ] "The redis module now uses /var/lib/redis as data directory.") (mkRemovedOptionModule [ "services" "redis" "dbpath" ] "The redis module now uses /var/lib/redis as data directory.")

View File

@ -1,91 +0,0 @@
{ config, lib, pkgs, ... }:
with builtins;
with lib;
let
cfg = config.services.osquery;
in
{
options = {
services.osquery = {
enable = mkEnableOption "osquery";
loggerPath = mkOption {
type = types.path;
description = "Base directory used for logging.";
default = "/var/log/osquery";
};
pidfile = mkOption {
type = types.path;
description = "Path used for pid file.";
default = "/var/osquery/osqueryd.pidfile";
};
utc = mkOption {
type = types.bool;
description = "Attempt to convert all UNIX calendar times to UTC.";
default = true;
};
databasePath = mkOption {
type = types.path;
description = "Path used for database file.";
default = "/var/osquery/osquery.db";
};
extraConfig = mkOption {
type = types.attrs // {
merge = loc: foldl' (res: def: recursiveUpdate res def.value) {};
};
description = "Extra config to be recursively merged into the JSON config file.";
default = { };
};
};
};
config = mkIf cfg.enable {
environment.systemPackages = [ pkgs.osquery ];
environment.etc."osquery/osquery.conf".text = toJSON (
recursiveUpdate {
options = {
config_plugin = "filesystem";
logger_plugin = "filesystem";
logger_path = cfg.loggerPath;
database_path = cfg.databasePath;
utc = cfg.utc;
};
} cfg.extraConfig
);
systemd.services.osqueryd = {
description = "The osquery Daemon";
after = [ "network.target" "syslog.service" ];
wantedBy = [ "multi-user.target" ];
path = [ pkgs.osquery ];
preStart = ''
mkdir -p ${escapeShellArg cfg.loggerPath}
mkdir -p "$(dirname ${escapeShellArg cfg.pidfile})"
mkdir -p "$(dirname ${escapeShellArg cfg.databasePath})"
'';
serviceConfig = {
TimeoutStartSec = "infinity";
ExecStart = "${pkgs.osquery}/bin/osqueryd --logger_path ${escapeShellArg cfg.loggerPath} --pidfile ${escapeShellArg cfg.pidfile} --database_path ${escapeShellArg cfg.databasePath}";
KillMode = "process";
KillSignal = "SIGTERM";
Restart = "on-failure";
};
};
};
}

View File

@ -4,7 +4,7 @@ with pkgs;
with lib; with lib;
let let
cfg = config.networking.connman; cfg = config.services.connman;
configFile = pkgs.writeText "connman.conf" '' configFile = pkgs.writeText "connman.conf" ''
[General] [General]
NetworkInterfaceBlacklist=${concatStringsSep "," cfg.networkInterfaceBlacklist} NetworkInterfaceBlacklist=${concatStringsSep "," cfg.networkInterfaceBlacklist}
@ -17,7 +17,7 @@ in {
options = { options = {
networking.connman = { services.connman = {
enable = mkOption { enable = mkOption {
type = types.bool; type = types.bool;
@ -71,13 +71,13 @@ in {
assertions = [{ assertions = [{
assertion = !config.networking.useDHCP; assertion = !config.networking.useDHCP;
message = "You can not use services.networking.connman with services.networking.useDHCP"; message = "You can not use services.connman with networking.useDHCP";
}{ }{
assertion = config.networking.wireless.enable; assertion = config.networking.wireless.enable;
message = "You must use services.networking.connman with services.networking.wireless"; message = "You must use services.connman with networking.wireless";
}{ }{
assertion = !config.networking.networkmanager.enable; assertion = !config.networking.networkmanager.enable;
message = "You can not use services.networking.connman with services.networking.networkmanager"; message = "You can not use services.connman with networking.networkmanager";
}]; }];
environment.systemPackages = [ connman ]; environment.systemPackages = [ connman ];

View File

@ -924,6 +924,8 @@ in
config = mkIf config.systemd.network.enable { config = mkIf config.systemd.network.enable {
users.users.systemd-network.group = "systemd-network";
systemd.additionalUpstreamSystemUnits = [ systemd.additionalUpstreamSystemUnits = [
"systemd-networkd.service" "systemd-networkd-wait-online.service" "systemd-networkd.service" "systemd-networkd-wait-online.service"
]; ];

View File

@ -136,6 +136,8 @@ in
} }
]; ];
users.users.resolved.group = "systemd-resolve";
systemd.additionalUpstreamSystemUnits = [ systemd.additionalUpstreamSystemUnits = [
"systemd-resolved.service" "systemd-resolved.service"
]; ];

View File

@ -50,7 +50,10 @@ with lib;
${config.services.timesyncd.extraConfig} ${config.services.timesyncd.extraConfig}
''; '';
users.users.systemd-timesync.uid = config.ids.uids.systemd-timesync; users.users.systemd-timesync = {
uid = config.ids.uids.systemd-timesync;
group = "systemd-timesync";
};
users.groups.systemd-timesync.gid = config.ids.gids.systemd-timesync; users.groups.systemd-timesync.gid = config.ids.gids.systemd-timesync;
system.activationScripts.systemd-timesyncd-migration = mkIf (versionOlder config.system.stateVersion "19.09") '' system.activationScripts.systemd-timesyncd-migration = mkIf (versionOlder config.system.stateVersion "19.09") ''

View File

@ -149,7 +149,7 @@ let
--setenv PATH="$PATH" \ --setenv PATH="$PATH" \
${optionalString cfg.ephemeral "--ephemeral"} \ ${optionalString cfg.ephemeral "--ephemeral"} \
${if cfg.additionalCapabilities != null && cfg.additionalCapabilities != [] then ${if cfg.additionalCapabilities != null && cfg.additionalCapabilities != [] then
''--capability="${concatStringsSep " " cfg.additionalCapabilities}"'' else "" ''--capability="${concatStringsSep "," cfg.additionalCapabilities}"'' else ""
} \ } \
${if cfg.tmpfs != null && cfg.tmpfs != [] then ${if cfg.tmpfs != null && cfg.tmpfs != [] then
''--tmpfs=${concatStringsSep " --tmpfs=" cfg.tmpfs}'' else "" ''--tmpfs=${concatStringsSep " --tmpfs=" cfg.tmpfs}'' else ""

View File

@ -42,6 +42,9 @@ in {
default = false; default = false;
description = '' description = ''
Whether to start racoon service for openvswitch. Whether to start racoon service for openvswitch.
Supported only if openvswitch version is less than 2.6.0.
Use <literal>virtualisation.vswitch.package = pkgs.openvswitch-lts</literal>
for a version that supports ipsec over GRE.
''; '';
}; };
}; };
@ -89,6 +92,13 @@ in {
"${cfg.package}/share/openvswitch/vswitch.ovsschema" "${cfg.package}/share/openvswitch/vswitch.ovsschema"
fi fi
chmod -R +w /var/db/openvswitch chmod -R +w /var/db/openvswitch
if ${cfg.package}/bin/ovsdb-tool needs-conversion /var/db/openvswitch/conf.db | grep -q "yes"
then
echo "Performing database upgrade"
${cfg.package}/bin/ovsdb-tool convert /var/db/openvswitch/conf.db
else
echo "Database already up to date"
fi
''; '';
serviceConfig = { serviceConfig = {
ExecStart = ExecStart =
@ -133,7 +143,7 @@ in {
}; };
} }
(mkIf cfg.ipsec { (mkIf (cfg.ipsec && (versionOlder cfg.package.version "2.6.0")) {
services.racoon.enable = true; services.racoon.enable = true;
services.racoon.configPath = "${runDir}/ipsec/etc/racoon/racoon.conf"; services.racoon.configPath = "${runDir}/ipsec/etc/racoon/racoon.conf";
@ -172,5 +182,4 @@ in {
''; '';
}; };
})])); })]));
} }

View File

@ -620,7 +620,7 @@ in
# Wireless won't work in the VM. # Wireless won't work in the VM.
networking.wireless.enable = mkVMOverride false; networking.wireless.enable = mkVMOverride false;
networking.connman.enable = mkVMOverride false; services.connman.enable = mkVMOverride false;
# Speed up booting by not waiting for ARP. # Speed up booting by not waiting for ARP.
networking.dhcpcd.extraConfig = "noarp"; networking.dhcpcd.extraConfig = "noarp";

View File

@ -206,7 +206,6 @@ in
openstack-image-metadata = (handleTestOn ["x86_64-linux"] ./openstack-image.nix {}).metadata or {}; openstack-image-metadata = (handleTestOn ["x86_64-linux"] ./openstack-image.nix {}).metadata or {};
orangefs = handleTest ./orangefs.nix {}; orangefs = handleTest ./orangefs.nix {};
os-prober = handleTestOn ["x86_64-linux"] ./os-prober.nix {}; os-prober = handleTestOn ["x86_64-linux"] ./os-prober.nix {};
osquery = handleTest ./osquery.nix {};
osrm-backend = handleTest ./osrm-backend.nix {}; osrm-backend = handleTest ./osrm-backend.nix {};
overlayfs = handleTest ./overlayfs.nix {}; overlayfs = handleTest ./overlayfs.nix {};
packagekit = handleTest ./packagekit.nix {}; packagekit = handleTest ./packagekit.nix {};

View File

@ -1,4 +1,4 @@
import ./make-test.nix ({ pkgs, ...}: import ./make-test-python.nix ({ pkgs, ...}:
let let
adminPrivateKey = pkgs.writeText "id_ed25519" '' adminPrivateKey = pkgs.writeText "id_ed25519" ''
@ -43,7 +43,7 @@ let
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJZNonUP1ePHLrvn0W9D2hdN6zWWZYFyJc+QR6pOKQEw bob@client ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJZNonUP1ePHLrvn0W9D2hdN6zWWZYFyJc+QR6pOKQEw bob@client
''; '';
gitoliteAdminConfSnippet = '' gitoliteAdminConfSnippet = pkgs.writeText "gitolite-admin-conf-snippet" ''
repo alice-project repo alice-project
RW+ = alice RW+ = alice
''; '';
@ -85,55 +85,54 @@ in
}; };
testScript = '' testScript = ''
startAll; start_all()
subtest "can setup ssh keys on system", sub { with subtest("can setup ssh keys on system"):
$client->mustSucceed("mkdir -p ~root/.ssh"); client.succeed(
$client->mustSucceed("cp ${adminPrivateKey} ~root/.ssh/id_ed25519"); "mkdir -p ~root/.ssh",
$client->mustSucceed("chmod 600 ~root/.ssh/id_ed25519"); "cp ${adminPrivateKey} ~root/.ssh/id_ed25519",
"chmod 600 ~root/.ssh/id_ed25519",
)
client.succeed(
"sudo -u alice mkdir -p ~alice/.ssh",
"sudo -u alice cp ${alicePrivateKey} ~alice/.ssh/id_ed25519",
"sudo -u alice chmod 600 ~alice/.ssh/id_ed25519",
)
client.succeed(
"sudo -u bob mkdir -p ~bob/.ssh",
"sudo -u bob cp ${bobPrivateKey} ~bob/.ssh/id_ed25519",
"sudo -u bob chmod 600 ~bob/.ssh/id_ed25519",
)
$client->mustSucceed("sudo -u alice mkdir -p ~alice/.ssh"); with subtest("gitolite server starts"):
$client->mustSucceed("sudo -u alice cp ${alicePrivateKey} ~alice/.ssh/id_ed25519"); server.wait_for_unit("gitolite-init.service")
$client->mustSucceed("sudo -u alice chmod 600 ~alice/.ssh/id_ed25519"); server.wait_for_unit("sshd.service")
client.succeed("ssh gitolite@server info")
$client->mustSucceed("sudo -u bob mkdir -p ~bob/.ssh"); with subtest("admin can clone and configure gitolite-admin.git"):
$client->mustSucceed("sudo -u bob cp ${bobPrivateKey} ~bob/.ssh/id_ed25519"); client.succeed(
$client->mustSucceed("sudo -u bob chmod 600 ~bob/.ssh/id_ed25519"); "git clone gitolite@server:gitolite-admin.git",
}; "git config --global user.name 'System Administrator'",
"git config --global user.email root\@domain.example",
"cp ${alicePublicKey} gitolite-admin/keydir/alice.pub",
"cp ${bobPublicKey} gitolite-admin/keydir/bob.pub",
"(cd gitolite-admin && git add . && git commit -m 'Add keys for alice, bob' && git push)",
"cat ${gitoliteAdminConfSnippet} >> gitolite-admin/conf/gitolite.conf",
"(cd gitolite-admin && git add . && git commit -m 'Add repo for alice' && git push)",
)
subtest "gitolite server starts", sub { with subtest("non-admins cannot clone gitolite-admin.git"):
$server->waitForUnit("gitolite-init.service"); client.fail("sudo -i -u alice git clone gitolite@server:gitolite-admin.git")
$server->waitForUnit("sshd.service"); client.fail("sudo -i -u bob git clone gitolite@server:gitolite-admin.git")
$client->mustSucceed('ssh gitolite@server info');
};
subtest "admin can clone and configure gitolite-admin.git", sub { with subtest("non-admins can clone testing.git"):
$client->mustSucceed('git clone gitolite@server:gitolite-admin.git'); client.succeed("sudo -i -u alice git clone gitolite@server:testing.git")
$client->mustSucceed("git config --global user.name 'System Administrator'"); client.succeed("sudo -i -u bob git clone gitolite@server:testing.git")
$client->mustSucceed("git config --global user.email root\@domain.example");
$client->mustSucceed("cp ${alicePublicKey} gitolite-admin/keydir/alice.pub");
$client->mustSucceed("cp ${bobPublicKey} gitolite-admin/keydir/bob.pub");
$client->mustSucceed('(cd gitolite-admin && git add . && git commit -m "Add keys for alice, bob" && git push)');
$client->mustSucceed("printf '${gitoliteAdminConfSnippet}' >> gitolite-admin/conf/gitolite.conf");
$client->mustSucceed('(cd gitolite-admin && git add . && git commit -m "Add repo for alice" && git push)');
};
subtest "non-admins cannot clone gitolite-admin.git", sub { with subtest("alice can clone alice-project.git"):
$client->mustFail('sudo -i -u alice git clone gitolite@server:gitolite-admin.git'); client.succeed("sudo -i -u alice git clone gitolite@server:alice-project.git")
$client->mustFail('sudo -i -u bob git clone gitolite@server:gitolite-admin.git');
};
subtest "non-admins can clone testing.git", sub { with subtest("bob cannot clone alice-project.git"):
$client->mustSucceed('sudo -i -u alice git clone gitolite@server:testing.git'); client.fail("sudo -i -u bob git clone gitolite@server:alice-project.git")
$client->mustSucceed('sudo -i -u bob git clone gitolite@server:testing.git');
};
subtest "alice can clone alice-project.git", sub {
$client->mustSucceed('sudo -i -u alice git clone gitolite@server:alice-project.git');
};
subtest "bob cannot clone alice-project.git", sub {
$client->mustFail('sudo -i -u bob git clone gitolite@server:alice-project.git');
};
''; '';
}) })

View File

@ -1,6 +1,6 @@
# This test runs influxdb and checks if influxdb is up and running # This test runs influxdb and checks if influxdb is up and running
import ./make-test.nix ({ pkgs, ...} : { import ./make-test-python.nix ({ pkgs, ...} : {
name = "influxdb"; name = "influxdb";
meta = with pkgs.stdenv.lib.maintainers; { meta = with pkgs.stdenv.lib.maintainers; {
maintainers = [ offline ]; maintainers = [ offline ];
@ -9,25 +9,32 @@ import ./make-test.nix ({ pkgs, ...} : {
nodes = { nodes = {
one = { ... }: { one = { ... }: {
services.influxdb.enable = true; services.influxdb.enable = true;
environment.systemPackages = [ pkgs.httpie ];
}; };
}; };
testScript = '' testScript = ''
startAll; import shlex
$one->waitForUnit("influxdb.service"); start_all()
one.wait_for_unit("influxdb.service")
# create database # create database
$one->succeed(q~ one.succeed(
curl -XPOST http://localhost:8086/query --data-urlencode "q=CREATE DATABASE test" "curl -XPOST http://localhost:8086/query --data-urlencode 'q=CREATE DATABASE test'"
~); )
# write some points and run simple query # write some points and run simple query
$one->succeed(q~ out = one.succeed(
curl -XPOST 'http://localhost:8086/write?db=test' --data-binary 'cpu_load_short,host=server01,region=us-west value=0.64 1434055562000000000' "curl -XPOST 'http://localhost:8086/write?db=test' --data-binary 'cpu_load_short,host=server01,region=us-west value=0.64 1434055562000000000'"
~); )
$one->succeed(q~
curl -GET 'http://localhost:8086/query' --data-urlencode "db=test" --data-urlencode "q=SELECT \"value\" FROM \"cpu_load_short\" WHERE \"region\"='us-west'" | grep "0\.64" qv = "SELECT value FROM cpu_load_short WHERE region='us-west'"
~); cmd = f'curl -GET "http://localhost:8086/query?db=test" --data-urlencode {shlex.quote("q="+ qv)}'
out = one.succeed(cmd)
assert "2015-06-11T20:46:02Z" in out
assert "0.64" in out
''; '';
}) })

View File

@ -3,7 +3,7 @@
# 2. jenkins user can be extended on both master and slave # 2. jenkins user can be extended on both master and slave
# 3. jenkins service not started on slave node # 3. jenkins service not started on slave node
import ./make-test.nix ({ pkgs, ...} : { import ./make-test-python.nix ({ pkgs, ...} : {
name = "jenkins"; name = "jenkins";
meta = with pkgs.stdenv.lib.maintainers; { meta = with pkgs.stdenv.lib.maintainers; {
maintainers = [ bjornfor coconnor domenkozar eelco ]; maintainers = [ bjornfor coconnor domenkozar eelco ];
@ -33,18 +33,17 @@ import ./make-test.nix ({ pkgs, ...} : {
}; };
testScript = '' testScript = ''
startAll; start_all()
$master->waitForUnit("jenkins"); master.wait_for_unit("jenkins")
$master->mustSucceed("curl http://localhost:8080 | grep 'Authentication required'"); assert "Authentication required" in master.succeed("curl http://localhost:8080")
print $master->execute("sudo -u jenkins groups"); for host in master, slave:
$master->mustSucceed("sudo -u jenkins groups | grep jenkins | grep users"); groups = host.succeed("sudo -u jenkins groups")
assert "jenkins" in groups
assert "users" in groups
print $slave->execute("sudo -u jenkins groups"); slave.fail("systemctl is-enabled jenkins.service")
$slave->mustSucceed("sudo -u jenkins groups | grep jenkins | grep users");
$slave->mustFail("systemctl is-enabled jenkins.service");
''; '';
}) })

View File

@ -1,4 +1,4 @@
import ./make-test.nix ({ pkgs, ...} : import ./make-test-python.nix ({ pkgs, ...} :
let let
accessKey = "BKIKJAA5BMMU2RHO6IBB"; accessKey = "BKIKJAA5BMMU2RHO6IBB";
secretKey = "V7f1CwQqAcwo80UEIJEjc5gVQUSSx5ohQ9GSrr12"; secretKey = "V7f1CwQqAcwo80UEIJEjc5gVQUSSx5ohQ9GSrr12";
@ -18,7 +18,7 @@ let
sio.seek(0) sio.seek(0)
minioClient.put_object('test-bucket', 'test.txt', sio, sio_len, content_type='text/plain') minioClient.put_object('test-bucket', 'test.txt', sio, sio_len, content_type='text/plain')
''; '';
in { in {
name = "minio"; name = "minio";
meta = with pkgs.stdenv.lib.maintainers; { meta = with pkgs.stdenv.lib.maintainers; {
maintainers = [ bachp ]; maintainers = [ bachp ];
@ -37,19 +37,19 @@ let
}; };
}; };
testScript = testScript = ''
'' start_all()
startAll; machine.wait_for_unit("minio.service")
$machine->waitForUnit("minio.service"); machine.wait_for_open_port(9000)
$machine->waitForOpenPort(9000);
# Create a test bucket on the server # Create a test bucket on the server
$machine->succeed("mc config host add minio http://localhost:9000 ${accessKey} ${secretKey} S3v4"); machine.succeed(
$machine->succeed("mc mb minio/test-bucket"); "mc config host add minio http://localhost:9000 ${accessKey} ${secretKey} S3v4"
$machine->succeed("${minioPythonScript}"); )
$machine->succeed("mc ls minio") =~ /test-bucket/ or die; machine.succeed("mc mb minio/test-bucket")
$machine->succeed("mc cat minio/test-bucket/test.txt") =~ /Test from Python/ or die; machine.succeed("${minioPythonScript}")
$machine->shutdown; assert "test-bucket" in machine.succeed("mc ls minio")
assert "Test from Python" in machine.succeed("mc cat minio/test-bucket/test.txt")
''; machine.shutdown()
'';
}) })

View File

@ -3,7 +3,7 @@
# 2. nexus service can startup on server (creating database and all other initial stuff) # 2. nexus service can startup on server (creating database and all other initial stuff)
# 3. the web application is reachable via HTTP # 3. the web application is reachable via HTTP
import ./make-test.nix ({ pkgs, ...} : { import ./make-test-python.nix ({ pkgs, ...} : {
name = "nexus"; name = "nexus";
meta = with pkgs.stdenv.lib.maintainers; { meta = with pkgs.stdenv.lib.maintainers; {
maintainers = [ ironpinguin ma27 ]; maintainers = [ ironpinguin ma27 ];
@ -22,11 +22,11 @@ import ./make-test.nix ({ pkgs, ...} : {
}; };
testScript = '' testScript = ''
startAll; start_all()
$server->waitForUnit("nexus"); server.wait_for_unit("nexus")
$server->waitForOpenPort(8081); server.wait_for_open_port(8081)
$server->succeed("curl -f 127.0.0.1:8081"); server.succeed("curl -f 127.0.0.1:8081")
''; '';
}) })

View File

@ -1,28 +0,0 @@
import ./make-test.nix ({ pkgs, lib, ... }:
with lib;
{
name = "osquery";
meta = with pkgs.stdenv.lib.maintainers; {
maintainers = [ ma27 ];
};
machine = {
services.osquery.enable = true;
services.osquery.loggerPath = "/var/log/osquery/logs";
services.osquery.pidfile = "/run/osqueryd.pid";
};
testScript = ''
$machine->start;
$machine->waitForUnit("osqueryd.service");
$machine->succeed("echo 'SELECT address FROM etc_hosts LIMIT 1;' | osqueryi | grep '127.0.0.1'");
$machine->succeed(
"echo 'SELECT value FROM osquery_flags WHERE name = \"logger_path\";' | osqueryi | grep /var/log/osquery/logs"
);
$machine->succeed("echo 'SELECT value FROM osquery_flags WHERE name = \"pidfile\";' | osqueryi | grep /run/osqueryd.pid");
'';
})

View File

@ -1,9 +1,10 @@
import ./make-test.nix ({ pkgs, ...} : import ./make-test-python.nix ({ pkgs, ...} :
{ {
name = "pantheon"; name = "pantheon";
meta = with pkgs.stdenv.lib.maintainers; { meta = with pkgs.stdenv.lib.maintainers; {
maintainers = [ worldofpeace ]; maintainers = pkgs.pantheon.maintainers;
}; };
machine = { ... }: machine = { ... }:
@ -21,35 +22,37 @@ import ./make-test.nix ({ pkgs, ...} :
testScript = { nodes, ... }: let testScript = { nodes, ... }: let
user = nodes.machine.config.users.users.alice; user = nodes.machine.config.users.users.alice;
bob = nodes.machine.config.users.users.bob;
in '' in ''
startAll; machine.wait_for_unit("display-manager.service")
# Wait for display manager to start with subtest("Test we can see usernames in elementary-greeter"):
$machine->waitForText(qr/${user.description}/); machine.wait_for_text("${user.description}")
$machine->screenshot("lightdm"); machine.wait_for_text("${bob.description}")
machine.screenshot("elementary_greeter_lightdm")
# Log in with subtest("Login with elementary-greeter"):
$machine->sendChars("${user.password}\n"); machine.send_chars("${user.password}\n")
$machine->waitForFile("/home/alice/.Xauthority"); machine.wait_for_x()
$machine->succeed("xauth merge ~alice/.Xauthority"); machine.wait_for_file("${user.home}/.Xauthority")
machine.succeed("xauth merge ${user.home}/.Xauthority")
# Check if "pantheon-shell" components actually start with subtest("Check that logging in has given the user ownership of devices"):
$machine->waitUntilSucceeds("pgrep gala"); machine.succeed("getfacl -p /dev/snd/timer | grep -q ${user.name}")
$machine->waitForWindow(qr/gala/);
$machine->waitUntilSucceeds("pgrep wingpanel");
$machine->waitForWindow("wingpanel");
$machine->waitUntilSucceeds("pgrep plank");
$machine->waitForWindow(qr/plank/);
# Check that logging in has given the user ownership of devices. # TODO: DBus API could eliminate this? Pantheon uses Bamf.
$machine->succeed("getfacl -p /dev/snd/timer | grep -q alice"); with subtest("Check if pantheon session components actually start"):
machine.wait_until_succeeds("pgrep gala")
machine.wait_for_window("gala")
machine.wait_until_succeeds("pgrep wingpanel")
machine.wait_for_window("wingpanel")
machine.wait_until_succeeds("pgrep plank")
machine.wait_for_window("plank")
# Open elementary terminal with subtest("Open elementary terminal"):
$machine->execute("su - alice -c 'DISPLAY=:0.0 io.elementary.terminal &'"); machine.execute("su - ${user.name} -c 'DISPLAY=:0 io.elementary.terminal &'")
$machine->waitForWindow(qr/io.elementary.terminal/); machine.wait_for_window("io.elementary.terminal")
machine.sleep(20)
# Take a screenshot of the desktop machine.screenshot("screen")
$machine->sleep(20);
$machine->screenshot("screen");
''; '';
}) })

View File

@ -1,4 +1,4 @@
import ./make-test.nix ({ pkgs, ...} : import ./make-test-python.nix ({ pkgs, ...} :
{ {
name = "plasma5"; name = "plasma5";
@ -7,23 +7,11 @@ import ./make-test.nix ({ pkgs, ...} :
}; };
machine = { ... }: machine = { ... }:
let
sddm_theme = pkgs.stdenv.mkDerivation {
name = "breeze-ocr-theme";
phases = "buildPhase";
buildCommand = ''
mkdir -p $out/share/sddm/themes/
cp -r ${pkgs.plasma-workspace}/share/sddm/themes/breeze $out/share/sddm/themes/breeze-ocr-theme
chmod -R +w $out/share/sddm/themes/breeze-ocr-theme
printf "[General]\ntype=color\ncolor=#1d99f3\nbackground=\n" > $out/share/sddm/themes/breeze-ocr-theme/theme.conf
'';
};
in
{ {
imports = [ ./common/user-account.nix ]; imports = [ ./common/user-account.nix ];
services.xserver.enable = true; services.xserver.enable = true;
services.xserver.displayManager.sddm.enable = true; services.xserver.displayManager.sddm.enable = true;
services.xserver.displayManager.sddm.theme = "breeze-ocr-theme";
services.xserver.desktopManager.plasma5.enable = true; services.xserver.desktopManager.plasma5.enable = true;
services.xserver.desktopManager.default = "plasma5"; services.xserver.desktopManager.default = "plasma5";
services.xserver.displayManager.sddm.autoLogin = { services.xserver.displayManager.sddm.autoLogin = {
@ -32,34 +20,40 @@ import ./make-test.nix ({ pkgs, ...} :
}; };
hardware.pulseaudio.enable = true; # needed for the factl test, /dev/snd/* exists without them but udev doesn't care then hardware.pulseaudio.enable = true; # needed for the factl test, /dev/snd/* exists without them but udev doesn't care then
virtualisation.memorySize = 1024; virtualisation.memorySize = 1024;
environment.systemPackages = [ sddm_theme ];
}; };
testScript = { nodes, ... }: let testScript = { nodes, ... }: let
user = nodes.machine.config.users.users.alice; user = nodes.machine.config.users.users.alice;
xdo = "${pkgs.xdotool}/bin/xdotool"; xdo = "${pkgs.xdotool}/bin/xdotool";
in '' in ''
startAll; with subtest("Wait for login"):
# wait for log in start_all()
$machine->waitForFile("/home/alice/.Xauthority"); machine.wait_for_file("${user.home}/.Xauthority")
$machine->succeed("xauth merge ~alice/.Xauthority"); machine.succeed("xauth merge ${user.home}/.Xauthority")
$machine->waitUntilSucceeds("pgrep plasmashell"); with subtest("Check plasmashell started"):
$machine->waitForWindow("^Desktop "); machine.wait_until_succeeds("pgrep plasmashell")
machine.wait_for_window("^Desktop ")
# Check that logging in has given the user ownership of devices. with subtest("Check that logging in has given the user ownership of devices"):
$machine->succeed("getfacl -p /dev/snd/timer | grep -q alice"); machine.succeed("getfacl -p /dev/snd/timer | grep -q ${user.name}")
$machine->execute("su - alice -c 'DISPLAY=:0.0 dolphin &'"); with subtest("Run Dolphin"):
$machine->waitForWindow(" Dolphin"); machine.execute("su - ${user.name} -c 'DISPLAY=:0.0 dolphin &'")
machine.wait_for_window(" Dolphin")
$machine->execute("su - alice -c 'DISPLAY=:0.0 konsole &'"); with subtest("Run Konsole"):
$machine->waitForWindow("Konsole"); machine.execute("su - ${user.name} -c 'DISPLAY=:0.0 konsole &'")
machine.wait_for_window("Konsole")
$machine->execute("su - alice -c 'DISPLAY=:0.0 systemsettings5 &'"); with subtest("Run systemsettings"):
$machine->waitForWindow("Settings"); machine.execute("su - ${user.name} -c 'DISPLAY=:0.0 systemsettings5 &'")
machine.wait_for_window("Settings")
$machine->execute("${xdo} key Alt+F1 sleep 10"); with subtest("Wait to get a screenshot"):
$machine->screenshot("screen"); machine.execute(
"${xdo} key Alt+F1 sleep 10"
)
machine.screenshot("screen")
''; '';
}) })

View File

@ -31,7 +31,7 @@ let
}; };
}; };
in import ./make-test.nix { in import ./make-test-python.nix {
name = "prometheus"; name = "prometheus";
nodes = { nodes = {
@ -173,67 +173,73 @@ in import ./make-test.nix {
testScript = { nodes, ... } : '' testScript = { nodes, ... } : ''
# Before starting the other machines we first make sure that our S3 service is online # Before starting the other machines we first make sure that our S3 service is online
# and has a bucket added for thanos: # and has a bucket added for thanos:
$s3->start; s3.start()
$s3->waitForUnit("minio.service"); s3.wait_for_unit("minio.service")
$s3->waitForOpenPort(${toString minioPort}); s3.wait_for_open_port(${toString minioPort})
$s3->succeed( s3.succeed(
"mc config host add minio " . "mc config host add minio "
"http://localhost:${toString minioPort} ${s3.accessKey} ${s3.secretKey} S3v4"); + "http://localhost:${toString minioPort} "
$s3->succeed("mc mb minio/thanos-bucket"); + "${s3.accessKey} ${s3.secretKey} S3v4",
"mc mb minio/thanos-bucket",
)
# Now that s3 has started we can start the other machines: # Now that s3 has started we can start the other machines:
$prometheus->start; for machine in prometheus, query, store:
$query->start; machine.start()
$store->start;
# Check if prometheus responds to requests: # Check if prometheus responds to requests:
$prometheus->waitForUnit("prometheus.service"); prometheus.wait_for_unit("prometheus.service")
$prometheus->waitForOpenPort(${toString queryPort}); prometheus.wait_for_open_port(${toString queryPort})
$prometheus->succeed("curl -s http://127.0.0.1:${toString queryPort}/metrics"); prometheus.succeed("curl -s http://127.0.0.1:${toString queryPort}/metrics")
# Let's test if pushing a metric to the pushgateway succeeds: # Let's test if pushing a metric to the pushgateway succeeds:
$prometheus->waitForUnit("pushgateway.service"); prometheus.wait_for_unit("pushgateway.service")
$prometheus->succeed( prometheus.succeed(
"echo 'some_metric 3.14' | " . "echo 'some_metric 3.14' | "
"curl --data-binary \@- http://127.0.0.1:${toString pushgwPort}/metrics/job/some_job"); + "curl --data-binary \@- "
+ "http://127.0.0.1:${toString pushgwPort}/metrics/job/some_job"
)
# Now check whether that metric gets ingested by prometheus. # Now check whether that metric gets ingested by prometheus.
# Since we'll check for the metric several times on different machines # Since we'll check for the metric several times on different machines
# we abstract the test using the following function: # we abstract the test using the following function:
# Function to check if the metric "some_metric" has been received and returns the correct value. # Function to check if the metric "some_metric" has been received and returns the correct value.
local *Machine::waitForMetric = sub { def wait_for_metric(machine):
my ($self) = @_; return machine.wait_until_succeeds(
$self->waitUntilSucceeds( "curl -sf 'http://127.0.0.1:${toString queryPort}/api/v1/query?query=some_metric' | "
"curl -sf 'http://127.0.0.1:${toString queryPort}/api/v1/query?query=some_metric' " . + "jq '.data.result[0].value[1]' | grep '\"3.14\"'"
"| jq '.data.result[0].value[1]' | grep '\"3.14\"'"); )
};
$prometheus->waitForMetric;
wait_for_metric(prometheus)
# Let's test if the pushgateway persists metrics to the configured location. # Let's test if the pushgateway persists metrics to the configured location.
$prometheus->waitUntilSucceeds("test -e /var/lib/prometheus-pushgateway/metrics"); prometheus.wait_until_succeeds("test -e /var/lib/prometheus-pushgateway/metrics")
# Test thanos # Test thanos
$prometheus->waitForUnit("thanos-sidecar.service"); prometheus.wait_for_unit("thanos-sidecar.service")
# Test if the Thanos query service can correctly retrieve the metric that was send above. # Test if the Thanos query service can correctly retrieve the metric that was send above.
$query->waitForUnit("thanos-query.service"); query.wait_for_unit("thanos-query.service")
$query->waitForMetric; wait_for_metric(query)
# Test if the Thanos sidecar has correctly uploaded its TSDB to S3, if the # Test if the Thanos sidecar has correctly uploaded its TSDB to S3, if the
# Thanos storage service has correctly downloaded it from S3 and if the Thanos # Thanos storage service has correctly downloaded it from S3 and if the Thanos
# query service running on $store can correctly retrieve the metric: # query service running on $store can correctly retrieve the metric:
$store->waitForUnit("thanos-store.service"); store.wait_for_unit("thanos-store.service")
$store->waitForMetric; wait_for_metric(store)
$store->waitForUnit("thanos-compact.service"); store.wait_for_unit("thanos-compact.service")
# Test if the Thanos bucket command is able to retrieve blocks from the S3 bucket # Test if the Thanos bucket command is able to retrieve blocks from the S3 bucket
# and check if the blocks have the correct labels: # and check if the blocks have the correct labels:
$store->succeed( store.succeed(
"thanos bucket ls" . "thanos bucket ls "
" --objstore.config-file=${nodes.store.config.services.thanos.store.objstore.config-file}" . + "--objstore.config-file=${nodes.store.config.services.thanos.store.objstore.config-file} "
" --output=json | jq .thanos.labels.some_label | grep 'required by thanos'"); + "--output=json | "
+ "jq .thanos.labels.some_label | "
+ "grep 'required by thanos'"
)
''; '';
} }

View File

@ -4,7 +4,7 @@ let
password = "helloworld"; password = "helloworld";
in in
import ./make-test.nix ({ pkgs, ...} : { import ./make-test-python.nix ({ pkgs, ...} : {
name = "sudo"; name = "sudo";
meta = with pkgs.stdenv.lib.maintainers; { meta = with pkgs.stdenv.lib.maintainers; {
maintainers = [ lschuermann ]; maintainers = [ lschuermann ];
@ -50,44 +50,34 @@ in
testScript = testScript =
'' ''
subtest "users in wheel group should have passwordless sudo", sub { with subtest("users in wheel group should have passwordless sudo"):
$machine->succeed("su - test0 -c \"sudo -u root true\""); machine.succeed('su - test0 -c "sudo -u root true"')
};
subtest "test1 user should have sudo with password", sub { with subtest("test1 user should have sudo with password"):
$machine->succeed("su - test1 -c \"echo ${password} | sudo -S -u root true\""); machine.succeed('su - test1 -c "echo ${password} | sudo -S -u root true"')
};
subtest "test1 user should not be able to use sudo without password", sub { with subtest("test1 user should not be able to use sudo without password"):
$machine->fail("su - test1 -c \"sudo -n -u root true\""); machine.fail('su - test1 -c "sudo -n -u root true"')
};
subtest "users in group 'foobar' should be able to use sudo with password", sub { with subtest("users in group 'foobar' should be able to use sudo with password"):
$machine->succeed("sudo -u test2 echo ${password} | sudo -S -u root true"); machine.succeed("sudo -u test2 echo ${password} | sudo -S -u root true")
};
subtest "users in group 'barfoo' should be able to use sudo without password", sub { with subtest("users in group 'barfoo' should be able to use sudo without password"):
$machine->succeed("sudo -u test3 sudo -n -u root true"); machine.succeed("sudo -u test3 sudo -n -u root true")
};
subtest "users in group 'baz' (GID 1337) should be able to use sudo without password", sub { with subtest("users in group 'baz' (GID 1337)"):
$machine->succeed("sudo -u test4 sudo -n -u root echo true"); machine.succeed("sudo -u test4 sudo -n -u root echo true")
};
subtest "test5 user should be able to run commands under test1", sub { with subtest("test5 user should be able to run commands under test1"):
$machine->succeed("sudo -u test5 sudo -n -u test1 true"); machine.succeed("sudo -u test5 sudo -n -u test1 true")
};
subtest "test5 user should not be able to run commands under root", sub { with subtest("test5 user should not be able to run commands under root"):
$machine->fail("sudo -u test5 sudo -n -u root true"); machine.fail("sudo -u test5 sudo -n -u root true")
};
subtest "test5 user should be able to keep his environment", sub { with subtest("test5 user should be able to keep his environment"):
$machine->succeed("sudo -u test5 sudo -n -E -u test1 true"); machine.succeed("sudo -u test5 sudo -n -E -u test1 true")
};
subtest "users in group 'barfoo' should not be able to keep their environment", sub { with subtest("users in group 'barfoo' should not be able to keep their environment"):
$machine->fail("sudo -u test3 sudo -n -E -u root true"); machine.fail("sudo -u test3 sudo -n -E -u root true")
};
''; '';
}) })

View File

@ -1,4 +1,4 @@
import ./make-test.nix ({ lib, pkgs, ... }: let import ./make-test-python.nix ({ lib, pkgs, ... }: let
testId = "7CFNTQM-IMTJBHJ-3UWRDIU-ZGQJFR6-VCXZ3NB-XUH3KZO-N52ITXR-LAIYUAU"; testId = "7CFNTQM-IMTJBHJ-3UWRDIU-ZGQJFR6-VCXZ3NB-XUH3KZO-N52ITXR-LAIYUAU";
@ -22,13 +22,11 @@ in {
}; };
testScript = '' testScript = ''
my $config; machine.wait_for_unit("syncthing-init.service")
config = machine.succeed("cat /var/lib/syncthing/.config/syncthing/config.xml")
$machine->waitForUnit("syncthing-init.service");
$config = $machine->succeed("cat /var/lib/syncthing/.config/syncthing/config.xml");
$config =~ /${testId}/ or die; assert "testFolder" in config
$config =~ /testFolder/ or die; assert "${testId}" in config
''; '';
}) })

View File

@ -1,4 +1,4 @@
import ./make-test.nix ({ lib, pkgs, ... }: { import ./make-test-python.nix ({ lib, pkgs, ... }: {
name = "syncthing-relay"; name = "syncthing-relay";
meta.maintainers = with pkgs.stdenv.lib.maintainers; [ delroth ]; meta.maintainers = with pkgs.stdenv.lib.maintainers; [ delroth ];
@ -14,9 +14,13 @@ import ./make-test.nix ({ lib, pkgs, ... }: {
}; };
testScript = '' testScript = ''
$machine->waitForUnit("syncthing-relay.service"); machine.wait_for_unit("syncthing-relay.service")
$machine->waitForOpenPort(12345); machine.wait_for_open_port(12345)
$machine->waitForOpenPort(12346); machine.wait_for_open_port(12346)
$machine->succeed("curl http://localhost:12346/status | jq -r '.options.\"provided-by\"'") =~ /nixos-test/ or die;
out = machine.succeed(
"curl -sS http://localhost:12346/status | jq -r '.options.\"provided-by\"'"
)
assert "nixos-test" in out
''; '';
}) })

View File

@ -1,4 +1,4 @@
let generateNodeConf = { lib, pkgs, config, privkpath, pubk, peerId, nodeId, ...}: { let generateNodeConf = { lib, pkgs, config, privk, pubk, peerId, nodeId, ...}: {
imports = [ common/user-account.nix ]; imports = [ common/user-account.nix ];
systemd.services.systemd-networkd.environment.SYSTEMD_LOG_LEVEL = "debug"; systemd.services.systemd-networkd.environment.SYSTEMD_LOG_LEVEL = "debug";
networking.useNetworkd = true; networking.useNetworkd = true;
@ -7,13 +7,16 @@ let generateNodeConf = { lib, pkgs, config, privkpath, pubk, peerId, nodeId, ...
virtualisation.vlans = [ 1 ]; virtualisation.vlans = [ 1 ];
environment.systemPackages = with pkgs; [ wireguard-tools ]; environment.systemPackages = with pkgs; [ wireguard-tools ];
boot.extraModulePackages = [ config.boot.kernelPackages.wireguard ]; boot.extraModulePackages = [ config.boot.kernelPackages.wireguard ];
systemd.tmpfiles.rules = [
"f /run/wg_priv 0640 root systemd-network - ${privk}"
];
systemd.network = { systemd.network = {
enable = true; enable = true;
netdevs = { netdevs = {
"90-wg0" = { "90-wg0" = {
netdevConfig = { Kind = "wireguard"; Name = "wg0"; }; netdevConfig = { Kind = "wireguard"; Name = "wg0"; };
wireguardConfig = { wireguardConfig = {
PrivateKeyFile = privkpath ; PrivateKeyFile = "/run/wg_priv";
ListenPort = 51820; ListenPort = 51820;
FwMark = 42; FwMark = 42;
}; };
@ -53,7 +56,7 @@ in import ./make-test-python.nix ({pkgs, ... }: {
nodes = { nodes = {
node1 = { pkgs, ... }@attrs: node1 = { pkgs, ... }@attrs:
let localConf = { let localConf = {
privkpath = pkgs.writeText "priv.key" "GDiXWlMQKb379XthwX0haAbK6hTdjblllpjGX0heP00="; privk = "GDiXWlMQKb379XthwX0haAbK6hTdjblllpjGX0heP00=";
pubk = "iRxpqj42nnY0Qz8MAQbSm7bXxXP5hkPqWYIULmvW+EE="; pubk = "iRxpqj42nnY0Qz8MAQbSm7bXxXP5hkPqWYIULmvW+EE=";
nodeId = "1"; nodeId = "1";
peerId = "2"; peerId = "2";
@ -62,7 +65,7 @@ in import ./make-test-python.nix ({pkgs, ... }: {
node2 = { pkgs, ... }@attrs: node2 = { pkgs, ... }@attrs:
let localConf = { let localConf = {
privkpath = pkgs.writeText "priv.key" "eHxSI2jwX/P4AOI0r8YppPw0+4NZnjOxfbS5mt06K2k="; privk = "eHxSI2jwX/P4AOI0r8YppPw0+4NZnjOxfbS5mt06K2k=";
pubk = "27s0OvaBBdHoJYkH9osZpjpgSOVNw+RaKfboT/Sfq0g="; pubk = "27s0OvaBBdHoJYkH9osZpjpgSOVNw+RaKfboT/Sfq0g=";
nodeId = "2"; nodeId = "2";
peerId = "1"; peerId = "1";

View File

@ -1,4 +1,4 @@
import ./make-test.nix ({ pkgs, ... }: import ./make-test-python.nix ({ pkgs, ... }:
{ {
name = "uwsgi"; name = "uwsgi";
meta = with pkgs.stdenv.lib.maintainers; { meta = with pkgs.stdenv.lib.maintainers; {
@ -30,9 +30,9 @@ import ./make-test.nix ({ pkgs, ... }:
testScript = testScript =
'' ''
$machine->waitForUnit('multi-user.target'); machine.wait_for_unit("multi-user.target")
$machine->waitForUnit('uwsgi.service'); machine.wait_for_unit("uwsgi.service")
$machine->waitForOpenPort(8000); machine.wait_for_open_port(8000)
$machine->succeed('curl -v 127.0.0.1:8000 | grep "Hello World!"'); assert "Hello World" in machine.succeed("curl -v 127.0.0.1:8000")
''; '';
}) })

View File

@ -45,12 +45,12 @@ import ./make-test-python.nix ({ pkgs, ... }:
with subtest("wordpress-init went through"): with subtest("wordpress-init went through"):
for site_name in site_names: for site_name in site_names:
info = machine.get_unit_info(f"wordpress-init-{site_name}") info = machine.get_unit_info(f"wordpress-init-{site_name}")
assert info.Result == "success" assert info["Result"] == "success"
with subtest("secret keys are set"): with subtest("secret keys are set"):
re.compile(r"^define.*NONCE_SALT.{64,};$") pattern = re.compile(r"^define.*NONCE_SALT.{64,};$", re.MULTILINE)
for site_name in site_names: for site_name in site_names:
assert r.match( assert pattern.search(
machine.succeed(f"cat /var/lib/wordpress/{site_name}/secret-keys.php") machine.succeed(f"cat /var/lib/wordpress/{site_name}/secret-keys.php")
) )
''; '';

View File

@ -7,12 +7,12 @@
with stdenv.lib; with stdenv.lib;
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
version = "2.3.2"; version = "2.3.3";
pname = "audacity"; pname = "audacity";
src = fetchzip { src = fetchzip {
url = "https://github.com/audacity/audacity/archive/Audacity-${version}.tar.gz"; url = "https://github.com/audacity/audacity/archive/Audacity-${version}.tar.gz";
sha256 = "08w96124vv8k4myd4vifq73ningq6404x889wvg2sk016kc4dfv1"; sha256 = "0ddc03dbm4ixy877czmwd03fpjgr3y68bxfgb6n2q6cv4prp30ig";
}; };
preConfigure = /* we prefer system-wide libs */ '' preConfigure = /* we prefer system-wide libs */ ''

View File

@ -6,16 +6,16 @@
rustPlatform.buildRustPackage rec { rustPlatform.buildRustPackage rec {
pname = "spotifyd"; pname = "spotifyd";
version = "0.2.19"; version = "0.2.20";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "Spotifyd"; owner = "Spotifyd";
repo = "spotifyd"; repo = "spotifyd";
rev = "v${version}"; rev = "v${version}";
sha256 = "063b28ysj224m6ngns9i574i7vnp1x4g07cqjw908ch04yngcg1c"; sha256 = "1hf4wpk7r0s4jpjhxaz67y1hd8jx9ns5imd85r3cdg4lxf3j5gph";
}; };
cargoSha256 = "0pqxqd5dyw9mjclrqkxzfnzsz74xl4bg0b86v5q6kc0a91zd49b9"; cargoSha256 = "1h3fis47hmxvppiv1icjhgp48nd46gayfcmzfjs34q6jask90n0w";
cargoBuildFlags = [ cargoBuildFlags = [
"--no-default-features" "--no-default-features"
@ -36,7 +36,7 @@ rustPlatform.buildRustPackage rec {
description = "An open source Spotify client running as a UNIX daemon"; description = "An open source Spotify client running as a UNIX daemon";
homepage = "https://github.com/Spotifyd/spotifyd"; homepage = "https://github.com/Spotifyd/spotifyd";
license = with licenses; [ gpl3 ]; license = with licenses; [ gpl3 ];
maintainers = [ maintainers.anderslundstedt maintainers.marsam ]; maintainers = with maintainers; [ anderslundstedt filalex77 marsam ];
platforms = platforms.unix; platforms = platforms.unix;
}; };
} }

View File

@ -60,11 +60,11 @@ let
in mkDerivation rec { in mkDerivation rec {
pname = "drawpile"; pname = "drawpile";
version = "2.1.13"; version = "2.1.14";
src = fetchurl { src = fetchurl {
url = "https://drawpile.net/files/src/drawpile-${version}.tar.gz"; url = "https://drawpile.net/files/src/drawpile-${version}.tar.gz";
sha256 = "0r56hkzjdlg4615zvrjv60i3f06pv7ssh6bs6jb46qs8wbsawsxf"; sha256 = "0vpsq8swvli6xiykjqjmdcz33jd44nvhq1n350dm9qap9s9wdr47";
}; };
nativeBuildInputs = [ nativeBuildInputs = [

View File

@ -1,6 +1,7 @@
{ stdenv { stdenv
, mkDerivation , mkDerivation
, fetchFromGitHub , fetchFromGitHub
, fetchpatch
, cmake , cmake
, pkgconfig , pkgconfig
@ -9,7 +10,7 @@
, qtsvg , qtsvg
, exiv2 , exiv2
, opencv , opencv4
, libraw , libraw
, libtiff , libtiff
, quazip , quazip
@ -28,6 +29,12 @@ mkDerivation rec {
patches = [ patches = [
./nomacs-iostream.patch ./nomacs-iostream.patch
(fetchpatch {
name = "darwin-less-restrictive-opencv.patch";
url = "https://github.com/nomacs/nomacs/commit/d182fce4bcd9a25bd15e3de065ca67849a32458c.patch";
sha256 = "0j6sviwrjn69nqf59hjn30c4j838h8az7rnlwcx8ymlb21vd9x2h";
stripLen = 1;
})
]; ];
enableParallelBuilding = true; enableParallelBuilding = true;
@ -43,7 +50,7 @@ mkDerivation rec {
qttools qttools
qtsvg qtsvg
exiv2 exiv2
opencv opencv4
libraw libraw
libtiff libtiff
quazip]; quazip];

View File

@ -9,13 +9,13 @@
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "clightd"; pname = "clightd";
version = "3.4"; version = "4.0";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "FedeDP"; owner = "FedeDP";
repo = "Clightd"; repo = "Clightd";
rev = version; rev = version;
sha256 = "0g6kawizwfhvigkwm7rbfq6rg872xn8igy8n355w4d7mmcxk0jf8"; sha256 = "0cskxy3xsy187in5vg8xcs3kwcx2s160qv009v0ahkcalp29ghz4";
}; };
# dbus-1.pc has datadir=/etc # dbus-1.pc has datadir=/etc

View File

@ -1,18 +1,18 @@
{ lib, stdenv, fetchFromGitHub { lib, stdenv, fetchFromGitHub
, dbus, cmake, pkgconfig, bash-completion , dbus, cmake, pkgconfig, bash-completion
, gsl, popt, clightd, systemd, libconfig , gsl, popt, clightd, systemd, libconfig, libmodule
, withGeoclue ? true, geoclue2 , withGeoclue ? true, geoclue2
, withUpower ? true, upower }: , withUpower ? true, upower }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "clight"; pname = "clight";
version = "3.1"; version = "4.0";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "FedeDP"; owner = "FedeDP";
repo = "Clight"; repo = "Clight";
rev = version; rev = version;
sha256 = "0rzcr1x9h4llnmklhgzs9r7xwhsrw1qkqvfffkp8fs90nycaqx81"; sha256 = "101fp9kwmfmfffpdvv41wf96kdjw0b16xk49g43w32a5wlr74zrq";
}; };
# bash-completion.pc completionsdir=${bash-completion.out} # bash-completion.pc completionsdir=${bash-completion.out}
@ -42,6 +42,7 @@ stdenv.mkDerivation rec {
systemd systemd
geoclue2 geoclue2
libconfig libconfig
libmodule
] ++ optional withGeoclue geoclue2 ] ++ optional withGeoclue geoclue2
++ optional withUpower upower; ++ optional withUpower upower;

View File

@ -5,13 +5,13 @@
mkDerivation rec { mkDerivation rec {
pname = "CopyQ"; pname = "CopyQ";
version = "3.9.2"; version = "3.9.3";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "hluk"; owner = "hluk";
repo = "CopyQ"; repo = "CopyQ";
rev = "v${version}"; rev = "v${version}";
sha256 = "02zs444i7hnqishs1i6vp8ffjxlxk3xkrw935pdwnwppv9s9v202"; sha256 = "0wlwq9xg8rzsbj0b29z358k4mbrqy04iraa8x0p26pa95yskgcma";
}; };
nativeBuildInputs = [ cmake ]; nativeBuildInputs = [ cmake ];

View File

@ -7,7 +7,7 @@
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "dbeaver-ce"; pname = "dbeaver-ce";
version = "6.2.4"; version = "6.2.5";
desktopItem = makeDesktopItem { desktopItem = makeDesktopItem {
name = "dbeaver"; name = "dbeaver";
@ -30,7 +30,7 @@ stdenv.mkDerivation rec {
src = fetchurl { src = fetchurl {
url = "https://dbeaver.io/files/${version}/dbeaver-ce-${version}-linux.gtk.x86_64.tar.gz"; url = "https://dbeaver.io/files/${version}/dbeaver-ce-${version}-linux.gtk.x86_64.tar.gz";
sha256 = "1k3aan290kfy2b53gl8r4yxvb8jas6sms1r052m3jld3i8frqgva"; sha256 = "1bg5cq7ivf263mjr8g9qwdhp9x0gm04nqiya4fyw0k33yiab85zn";
}; };
installPhase = '' installPhase = ''

View File

@ -8,7 +8,7 @@ let
wrapperScript = writeScript "glava" '' wrapperScript = writeScript "glava" ''
#!${runtimeShell} #!${runtimeShell}
case "$1" in case "$1" in
--copy-config) --copy-config|-C)
# The binary would symlink it, which won't work in Nix because the # The binary would symlink it, which won't work in Nix because the
# garbage collector will eventually remove the original files after # garbage collector will eventually remove the original files after
# updates # updates
@ -45,6 +45,14 @@ in
]; ];
preConfigure = '' preConfigure = ''
for f in $(find -type f);do
substituteInPlace $f \
--replace /etc/xdg $out/etc/xdg
done
substituteInPlace Makefile \
--replace '$(DESTDIR)$(SHADERDIR)' '$(SHADERDIR)'
substituteInPlace Makefile \ substituteInPlace Makefile \
--replace 'unknown' 'v${version}' --replace 'unknown' 'v${version}'

View File

@ -1,5 +1,5 @@
{ cairo, cmake, fetchFromGitHub, libXdmcp, libpthreadstubs, libxcb, pcre, pkgconfig { cairo, cmake, fetchFromGitHub, libXdmcp, libpthreadstubs, libxcb, pcre, pkgconfig
, python2, stdenv, xcbproto, xcbutil, xcbutilcursor, xcbutilimage , python3, stdenv, xcbproto, xcbutil, xcbutilcursor, xcbutilimage
, xcbutilrenderutil, xcbutilwm, xcbutilxrm, makeWrapper , xcbutilrenderutil, xcbutilwm, xcbutilxrm, makeWrapper
# optional packages-- override the variables ending in 'Support' to enable or # optional packages-- override the variables ending in 'Support' to enable or
@ -24,15 +24,16 @@ assert nlSupport -> ! iwSupport && libnl != null;
assert i3Support -> ! i3GapsSupport && jsoncpp != null && i3 != null; assert i3Support -> ! i3GapsSupport && jsoncpp != null && i3 != null;
assert i3GapsSupport -> ! i3Support && jsoncpp != null && i3-gaps != null; assert i3GapsSupport -> ! i3Support && jsoncpp != null && i3-gaps != null;
stdenv.mkDerivation rec { let xcbproto-py3 = xcbproto.override { python = python3; };
in stdenv.mkDerivation rec {
pname = "polybar"; pname = "polybar";
version = "3.4.0"; version = "3.4.1";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "jaagr"; owner = pname;
repo = pname; repo = pname;
rev = version; rev = version;
sha256 = "1g3zj0788cdlm8inpl19279bw8zjcy7dzj7q4f1l2d8c8g1jhv0m"; sha256 = "1z1m6dxh2i5vsnkzaccb9j02ab05wgmcgig5d0l9w856g5jp3zmy";
fetchSubmodules = true; fetchSubmodules = true;
}; };
@ -45,12 +46,12 @@ stdenv.mkDerivation rec {
having a black belt in shell scripting. having a black belt in shell scripting.
''; '';
license = licenses.mit; license = licenses.mit;
maintainers = [ maintainers.afldcr ]; maintainers = with maintainers; [ afldcr filalex77 ];
platforms = platforms.unix; platforms = platforms.linux;
}; };
buildInputs = [ buildInputs = [
cairo libXdmcp libpthreadstubs libxcb pcre python2 xcbproto xcbutil cairo libXdmcp libpthreadstubs libxcb pcre python3 xcbproto-py3 xcbutil
xcbutilcursor xcbutilimage xcbutilrenderutil xcbutilwm xcbutilxrm xcbutilcursor xcbutilimage xcbutilrenderutil xcbutilwm xcbutilxrm
(if alsaSupport then alsaLib else null) (if alsaSupport then alsaLib else null)

View File

@ -17,7 +17,7 @@ buildGoPackage rec {
meta = with stdenv.lib; { meta = with stdenv.lib; {
description = "C14 is designed for data archiving & long-term backups."; description = "C14 is designed for data archiving & long-term backups.";
homepage = https://www.online.net/en/c14; homepage = https://www.online.net/en/storage/c14-cold-storage;
license = licenses.mit; license = licenses.mit;
maintainers = with maintainers; [ apeyroux ]; maintainers = with maintainers; [ apeyroux ];
}; };

View File

@ -11,11 +11,11 @@
mkDerivation rec { mkDerivation rec {
pname = "datovka"; pname = "datovka";
version = "4.14.0"; version = "4.14.1";
src = fetchurl { src = fetchurl {
url = "https://secure.nic.cz/files/datove_schranky/${version}/${pname}-${version}.tar.xz"; url = "https://secure.nic.cz/files/datove_schranky/${version}/${pname}-${version}.tar.xz";
sha256 = "0q7zlq522wdgwxgd3jxmxvr3awclcy0mbw3qaymwzn2b8d35168r"; sha256 = "0jinxsm2zw77294vz9pjiqpgpzdwx5nijsi4nqzxna5rkmwdyxk6";
}; };
buildInputs = [ libisds qmake qtbase qtsvg libxml2 ]; buildInputs = [ libisds qmake qtbase qtsvg libxml2 ];

View File

@ -2,19 +2,18 @@
, zlib, libxml2, gtk2, libnotify, speex, ffmpeg, libX11, libsoup, udev , zlib, libxml2, gtk2, libnotify, speex, ffmpeg, libX11, libsoup, udev
, ortp, mediastreamer, sqlite, belle-sip, libosip, libexosip, bzrtp , ortp, mediastreamer, sqlite, belle-sip, libosip, libexosip, bzrtp
, mediastreamer-openh264, bctoolbox, makeWrapper, fetchFromGitHub, cmake , mediastreamer-openh264, bctoolbox, makeWrapper, fetchFromGitHub, cmake
, libmatroska, bcunit, doxygen, gdk-pixbuf, glib, cairo, pango, polarssl , libmatroska, bcunit, doxygen, gdk-pixbuf, glib, cairo, pango, mbedtls
, python, graphviz, belcard , python, graphviz, belcard, bcg729
, withGui ? true , withGui ? true
}: }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
baseName = "linphone"; pname = "linphone";
version = "3.12.0"; version = "3.12.0";
name = "${baseName}-${version}";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "BelledonneCommunications"; owner = "BelledonneCommunications";
repo = baseName; repo = pname;
rev = version; rev = version;
sha256 = "0az2ywrpx11sqfb4s4r2v726avcjf4k15bvrqj7xvhz7hdndmh0j"; sha256 = "0az2ywrpx11sqfb4s4r2v726avcjf4k15bvrqj7xvhz7hdndmh0j";
}; };
@ -27,21 +26,25 @@ stdenv.mkDerivation rec {
buildInputs = [ buildInputs = [
readline openldap cyrus_sasl libupnp zlib libxml2 gtk2 libnotify speex ffmpeg libX11 readline openldap cyrus_sasl libupnp zlib libxml2 gtk2 libnotify speex ffmpeg libX11
polarssl libsoup udev ortp mediastreamer sqlite belle-sip libosip libexosip mbedtls libsoup udev ortp mediastreamer sqlite belle-sip libosip libexosip
bctoolbox libmatroska bcunit gdk-pixbuf glib cairo pango bzrtp belcard bctoolbox libmatroska gdk-pixbuf glib cairo pango bzrtp belcard bcg729
]; ];
nativeBuildInputs = [ nativeBuildInputs = [
intltool pkgconfig makeWrapper cmake doxygen graphviz intltool pkgconfig makeWrapper cmake bcunit doxygen graphviz
(python.withPackages (ps: [ ps.pystache ps.six ])) (python.withPackages (ps: [ ps.pystache ps.six ]))
]; ];
NIX_CFLAGS_COMPILE = " -Wno-error -I${glib.dev}/include/glib-2.0 NIX_CFLAGS_COMPILE = [
-I${glib.out}/lib/glib-2.0/include -I${gtk2.dev}/include/gtk-2.0/ "-Wno-error"
-I${cairo.dev}/include/cairo -I${pango.dev}/include/pango-1.0 "-I${glib.dev}/include/glib-2.0"
-I${gtk2}/lib/gtk-2.0/include "-I${glib.out}/lib/glib-2.0/include"
-DLIBLINPHONE_GIT_VERSION=\"v${version}\" "-I${gtk2.dev}/include/gtk-2.0/"
"; "-I${cairo.dev}/include/cairo"
"-I${pango.dev}/include/pango-1.0"
"-I${gtk2}/lib/gtk-2.0/include"
"-DLIBLINPHONE_GIT_VERSION=\"v${version}\""
];
postInstall = '' postInstall = ''
for i in $(cd $out/bin && ls); do for i in $(cd $out/bin && ls); do
@ -50,8 +53,8 @@ stdenv.mkDerivation rec {
''; '';
meta = with stdenv.lib; { meta = with stdenv.lib; {
homepage = http://www.linphone.org/; homepage = https://www.linphone.org/;
description = "Open Source video SIP softphone"; description = "Open source SIP phone for voice/video calls and instant messaging";
license = licenses.gpl2Plus; license = licenses.gpl2Plus;
platforms = platforms.linux; platforms = platforms.linux;
}; };

View File

@ -1,21 +1,22 @@
{ stdenv, buildGoModule, fetchurl { stdenv, buildGoModule, fetchurl
, go, ncurses, scdoc , go, ncurses, notmuch, scdoc
, python3, perl, w3m, dante , python3, perl, w3m, dante
}: }:
buildGoModule rec { buildGoModule rec {
pname = "aerc"; pname = "aerc";
version = "0.2.1"; version = "0.3.0";
src = fetchurl { src = fetchurl {
url = "https://git.sr.ht/~sircmpwn/aerc/archive/${version}.tar.gz"; url = "https://git.sr.ht/~sircmpwn/aerc/archive/${version}.tar.gz";
sha256 = "1ky1nl5b54lf5jnac2kb5404fplwnwypjplas8imdlsf517fw32n"; sha256 = "188jln8hmgiqn5il5m54bns0wk4grj09di8y6mmid58ibw6spma4";
}; };
nativeBuildInputs = [ nativeBuildInputs = [
go go
scdoc scdoc
python3.pkgs.wrapPython python3.pkgs.wrapPython
notmuch
]; ];
patches = [ patches = [
@ -28,6 +29,8 @@ buildGoModule rec {
buildInputs = [ python3 perl ]; buildInputs = [ python3 perl ];
GOFLAGS="-tags=notmuch";
buildPhase = " buildPhase = "
runHook preBuild runHook preBuild
# we use make instead of go build # we use make instead of go build
@ -43,12 +46,12 @@ buildGoModule rec {
postFixup = '' postFixup = ''
wrapProgram $out/bin/aerc --prefix PATH ":" \ wrapProgram $out/bin/aerc --prefix PATH ":" \
"$out/share/aerc/filters:${stdenv.lib.makeBinPath [ ncurses.dev ]}" "$out/share/aerc/filters:${stdenv.lib.makeBinPath [ ncurses ]}"
wrapProgram $out/share/aerc/filters/html --prefix PATH ":" \ wrapProgram $out/share/aerc/filters/html --prefix PATH ":" \
${stdenv.lib.makeBinPath [ w3m dante ]} ${stdenv.lib.makeBinPath [ w3m dante ]}
''; '';
modSha256 = "0fc9m1qb8innypc8cxzbqyrfkawawyaqq3gqy7lqwmyh32f300jh"; modSha256 = "0pxbv4zfhii0g41cy0ycfpkkxw6nnd4ibavic6zqw30j476jnm2x";
meta = with stdenv.lib; { meta = with stdenv.lib; {
description = "aerc is an email client for your terminal"; description = "aerc is an email client for your terminal";

View File

@ -1,18 +1,19 @@
From 7ea68a2eef026723903d72f54ca54b629881ec06 Mon Sep 17 00:00:00 2001 From 6cf3c2e42d219b9665a43ca65f321c653b0aa102 Mon Sep 17 00:00:00 2001
From: Tadeo Kondrak <me@tadeo.ca> From: Tadeo Kondrak <me@tadeo.ca>
Date: Mon, 28 Oct 2019 08:36:36 -0600 Date: Mon, 28 Oct 2019 08:36:36 -0600
Subject: [PATCH] Fix aerc breaking every time the package is rebuilt. Subject: [PATCH] Fix aerc breaking every time the package is rebuilt.
On NixOS, the SHAREDIR changes on every rebuild to the package, but aerc On NixOS, the SHAREDIR changes on every rebuild to the package, but aerc
fills it in as part of the default config. Fix this by not substituting fills it in as part of the default config and then installs that config
@SHAREDIR@ in the default config until runtime. to the users home folder. Fix this by not substituting @SHAREDIR@ in the
default config until runtime.
--- ---
Makefile | 2 +- Makefile | 2 +-
config/config.go | 3 +++ config/config.go | 8 ++++++++
2 files changed, 4 insertions(+), 1 deletion(-) 2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/Makefile b/Makefile diff --git a/Makefile b/Makefile
index d3072d3..17ca0be 100644 index d1c755d..1185a96 100644
--- a/Makefile --- a/Makefile
+++ b/Makefile +++ b/Makefile
@@ -24,7 +24,7 @@ aerc: $(GOSRC) @@ -24,7 +24,7 @@ aerc: $(GOSRC)
@ -25,10 +26,22 @@ index d3072d3..17ca0be 100644
DOCS := \ DOCS := \
aerc.1 \ aerc.1 \
diff --git a/config/config.go b/config/config.go diff --git a/config/config.go b/config/config.go
index bfcbecf..2f4e703 100644 index 32d07fc..8ffd3e8 100644
--- a/config/config.go --- a/config/config.go
+++ b/config/config.go +++ b/config/config.go
@@ -377,6 +377,9 @@ func LoadConfigFromFile(root *string, sharedir string) (*AercConfig, error) { @@ -355,6 +355,11 @@ func LoadConfigFromFile(root *string, sharedir string) (*AercConfig, error) {
return nil, err
}
}
+ if sec, err := file.GetSection("templates"); err == nil {
+ if key, err := sec.GetKey("template-dirs"); err == nil {
+ sec.NewKey("template-dirs", strings.ReplaceAll(key.String(), "@SHAREDIR@", sharedir))
+ }
+ }
file.NameMapper = mapName
config := &AercConfig{
Bindings: BindingConfig{
@@ -423,6 +428,9 @@ func LoadConfigFromFile(root *string, sharedir string) (*AercConfig, error) {
if err = config.LoadConfig(file); err != nil { if err = config.LoadConfig(file); err != nil {
return nil, err return nil, err
} }

View File

@ -52,7 +52,7 @@ stdenv.mkDerivation rec {
homepage = https://github.com/ingydotnet/git-subrepo; homepage = https://github.com/ingydotnet/git-subrepo;
description = "Git submodule alternative"; description = "Git submodule alternative";
license = licenses.mit; license = licenses.mit;
platforms = platforms.linux; platforms = platforms.unix ++ platforms.darwin;
maintainers = [ maintainers.ryantrinkle ]; maintainers = [ maintainers.ryantrinkle ];
}; };
} }

View File

@ -1,9 +1,9 @@
{ {
"version": "12.4.2", "version": "12.4.3",
"repo_hash": "00y8n0y7wydwxq62fyf7hcpx90zz5sw458m2773lz7pdgnpnrdc2", "repo_hash": "1qsd3qxvvb3rbyrlyrqvrday4c9s2krgics99ch7v74hprj3xfq9",
"owner": "gitlab-org", "owner": "gitlab-org",
"repo": "gitlab", "repo": "gitlab",
"rev": "v12.4.2-ee", "rev": "v12.4.3-ee",
"passthru": { "passthru": {
"GITALY_SERVER_VERSION": "1.67.0", "GITALY_SERVER_VERSION": "1.67.0",
"GITLAB_PAGES_VERSION": "1.11.0", "GITLAB_PAGES_VERSION": "1.11.0",

View File

@ -162,6 +162,15 @@
sha256 = "0jb2834rw5sykfr937fxi8hxi2zy80sj2bdn9b3jb4b26ksqng30"; sha256 = "0jb2834rw5sykfr937fxi8hxi2zy80sj2bdn9b3jb4b26ksqng30";
}; };
} }
{
goPackagePath = "github.com/golang/lint";
fetch = {
type = "git";
url = "https://github.com/golang/lint";
rev = "06c8688daad7";
sha256 = "0xi94dwvz50a66bq1hp9fyqkym5mcpdxdb1hrfvicldgjf37lc47";
};
}
{ {
goPackagePath = "github.com/golang/mock"; goPackagePath = "github.com/golang/mock";
fetch = { fetch = {
@ -252,6 +261,15 @@
sha256 = "1zcq480ig7wbg4378qcfxznp2gzqmk7x6rbxizflvg9v2f376vrw"; sha256 = "1zcq480ig7wbg4378qcfxznp2gzqmk7x6rbxizflvg9v2f376vrw";
}; };
} }
{
goPackagePath = "github.com/kisielk/gotool";
fetch = {
type = "git";
url = "https://github.com/kisielk/gotool";
rev = "v1.0.0";
sha256 = "14af2pa0ssyp8bp2mvdw184s5wcysk6akil3wzxmr05wwy951iwn";
};
}
{ {
goPackagePath = "github.com/konsorten/go-windows-terminal-sequences"; goPackagePath = "github.com/konsorten/go-windows-terminal-sequences";
fetch = { fetch = {

View File

@ -5,10 +5,10 @@
mkDerivation rec { mkDerivation rec {
pname = "clipgrab"; pname = "clipgrab";
version = "3.8.5"; version = "3.8.6";
src = fetchurl { src = fetchurl {
sha256 = "0jfjnzwvz4ynlld0ih7f7d575s5w2dag0hvb02c6qan7xm5jdhv9"; sha256 = "1w2j1wk9sf22nnschlraxdbxabqblrxyb8kq0lkyk7dkfa5d0hdq";
# The .tar.bz2 "Download" link is a binary blob, the source is the .tar.gz! # The .tar.bz2 "Download" link is a binary blob, the source is the .tar.gz!
url = "https://download.clipgrab.org/${pname}-${version}.tar.gz"; url = "https://download.clipgrab.org/${pname}-${version}.tar.gz";
}; };

View File

@ -184,6 +184,7 @@ stdenv.mkDerivation {
else if targetPlatform.isMsp430 then "msp430" else if targetPlatform.isMsp430 then "msp430"
else if targetPlatform.isAvr then "avr" else if targetPlatform.isAvr then "avr"
else if targetPlatform.isAlpha then "alpha" else if targetPlatform.isAlpha then "alpha"
else if targetPlatform.isVc4 then "vc4"
else throw "unknown emulation for platform: ${targetPlatform.config}"; else throw "unknown emulation for platform: ${targetPlatform.config}";
in if targetPlatform.useLLVM or false then "" in if targetPlatform.useLLVM or false then ""
else targetPlatform.platform.bfdEmulation or (fmt + sep + arch); else targetPlatform.platform.bfdEmulation or (fmt + sep + arch);

View File

@ -6,7 +6,7 @@ export CLASSPATH
addPkgToClassPath () { addPkgToClassPath () {
local jar local jar
for jar in $1/share/java/*.jar; do for jar in $1/share/java/*.jar; do
export CLASSPATH=''${CLASSPATH}''${CLASSPATH:+:}''${jar} export CLASSPATH=''${CLASSPATH-}''${CLASSPATH:+:}''${jar}
done done
} }

View File

@ -2,16 +2,16 @@
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "adapta-kde-theme"; pname = "adapta-kde-theme";
version = "20180512"; version = "20180828";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "PapirusDevelopmentTeam"; owner = "PapirusDevelopmentTeam";
repo = "adapta-kde"; repo = "adapta-kde";
rev = version; rev = version;
sha256 = "1lgpkylhzbayk892inql16sjyy9d3v126f9i1v7qgha1203rwcji"; sha256 = "1q85678sff8is2kwvgd703ckcns42gdga2c1rqlp61gb6bqf09j8";
}; };
makeFlags = ["PREFIX=$(out)" ]; makeFlags = [ "PREFIX=$(out)" ];
# Make this a fixed-output derivation # Make this a fixed-output derivation
outputHashMode = "recursive"; outputHashMode = "recursive";

View File

@ -1,17 +1,17 @@
{ stdenv, fetchFromGitHub }: { stdenv, fetchFromGitHub }:
stdenv.mkDerivation { stdenv.mkDerivation rec {
pname = "arc-kde-theme"; pname = "arc-kde-theme";
version = "2017-11-09"; version = "20180614";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "PapirusDevelopmentTeam"; owner = "PapirusDevelopmentTeam";
repo = "arc-kde"; repo = "arc-kde";
rev = "a0abe6fc5ebf74f9ae88b8a2035957cc16f706f5"; rev = version;
sha256 = "1p6f4ny97096nb054lrgyjwikmvg0qlbcnsjag7m5dfbclfnvzkg"; sha256 = "0wli16k9my7m8a9561545vjwfifmxm4w606z1h0j08msvlky40xw";
}; };
makeFlags = ["PREFIX=$(out)" ]; makeFlags = [ "PREFIX=$(out)" ];
# Make this a fixed-output derivation # Make this a fixed-output derivation
outputHashMode = "recursive"; outputHashMode = "recursive";

View File

@ -1,12 +1,12 @@
{ stdenv, fetchurl }: { stdenv, fetchzip }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
version = "7.0.1"; version = "7.0.1";
pname = "clearlooks-phenix"; pname = "clearlooks-phenix";
src = fetchurl { src = fetchzip {
url = "https://github.com/jpfleury/clearlooks-phenix/archive/${version}.tar.gz"; url = "https://github.com/jpfleury/clearlooks-phenix/archive/${version}.tar.gz";
sha256 = "1x2psfbhxc3bk3q795bafxv6p890yfsankfw64p44q4r1x0236ra"; sha256 = "1b6y4l3rf3c5r4v72fyj3ppvnvw13kvr2a1dyl63ni1jxnlk50kd";
}; };
dontBuild = true; dontBuild = true;

View File

@ -1,18 +1,17 @@
{ stdenv, fetchFromGitHub, mkDerivation { lib, fetchFromGitHub, mkDerivation
, cmake, extra-cmake-modules , cmake, extra-cmake-modules
, qtbase, kcoreaddons, kdecoration }: , qtbase, kcoreaddons, kdecoration
}:
let mkDerivation rec {
version = "2017-03-15";
in mkDerivation rec {
pname = "kde2-decoration"; pname = "kde2-decoration";
inherit version; version = "1.0";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "repos-holder"; owner = "repos-holder";
repo = "kdecoration2-kde2"; repo = "kdecoration2-kde2";
rev = "2a9cf18ac0646b3532d4db2dd28bd73c4c229783"; rev = version;
sha256 = "0kilw6sd3blvm6gx9w4w5ivkjfxlv6wnyivw46pwwvhgxqymkbxk"; sha256 = "1766z9wscybcqvr828xih93b3rab3hb0ghsf818iflhp1xy0js08";
}; };
enableParallelBuilding = true; enableParallelBuilding = true;
@ -21,9 +20,9 @@ in mkDerivation rec {
buildInputs = [ qtbase kcoreaddons kdecoration ]; buildInputs = [ qtbase kcoreaddons kdecoration ];
meta = with stdenv.lib; { meta = with lib; {
description = "KDE 2 window decoration ported to Plasma 5"; description = "KDE 2 window decoration ported to Plasma 5";
homepage = src.meta.homepage; homepage = "https://github.com/repos-holder/kdecoration2-kde2";
license = licenses.bsd2; license = licenses.bsd2;
platforms = platforms.linux; platforms = platforms.linux;
maintainers = with maintainers; [ gnidorah ]; maintainers = with maintainers; [ gnidorah ];

View File

@ -11,7 +11,7 @@ in mkDerivation {
pname = "qtcurve"; pname = "qtcurve";
inherit version; inherit version;
src = fetchurl { src = fetchurl {
url = "http://download.kde.org/stable/qtcurve/qtcurve-${version}.tar.xz"; url = "https://download.kde.org/stable/qtcurve/qtcurve-${version}.tar.xz";
sha256 = "169gdny1cdld0qnx3nqvx568zjzdba4pwp3gxapc1hdh2cymw7r8"; sha256 = "169gdny1cdld0qnx3nqvx568zjzdba4pwp3gxapc1hdh2cymw7r8";
}; };

View File

@ -17,13 +17,13 @@
python3.pkgs.buildPythonApplication rec { python3.pkgs.buildPythonApplication rec {
name = "accerciser-${version}"; name = "accerciser-${version}";
version = "3.34.1"; version = "3.34.2";
format = "other"; format = "other";
src = fetchurl { src = fetchurl {
url = "mirror://gnome/sources/accerciser/${stdenv.lib.versions.majorMinor version}/${name}.tar.xz"; url = "mirror://gnome/sources/accerciser/${stdenv.lib.versions.majorMinor version}/${name}.tar.xz";
sha256 = "1awf7fcm52r23s51gllyybhywf2kljqkaw4znblajph9sawnfs3l"; sha256 = "1n6sy95j0r0v01sc9rbbpzikq2z4z42j8ah73hzmjdmck4iniik4";
}; };
nativeBuildInputs = [ nativeBuildInputs = [

View File

@ -3,11 +3,11 @@
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "file-roller"; pname = "file-roller";
version = "3.32.2"; version = "3.32.3";
src = fetchurl { src = fetchurl {
url = "mirror://gnome/sources/file-roller/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz"; url = "mirror://gnome/sources/file-roller/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
sha256 = "0w8s6hakgsvb2nqwbv0lr8ki4cbf1pz5z3qwkb0b2k7ppbh7j2n6"; sha256 = "0ap2hxvjljh4p6wsd9ikh2my3vsxp9r2nvjxxj3v87nwfyw1y4dy";
}; };
LANG = "en_US.UTF-8"; # postinstall.py LANG = "en_US.UTF-8"; # postinstall.py

View File

@ -34,11 +34,11 @@
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "epiphany"; pname = "epiphany";
version = "3.34.1"; version = "3.34.2";
src = fetchurl { src = fetchurl {
url = "mirror://gnome/sources/epiphany/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz"; url = "mirror://gnome/sources/epiphany/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
sha256 = "1nf1pqv3pdgrlq7fbic06rl3731dx5ihpfsphpai9grcmnbwjyx0"; sha256 = "18d48vcp2nxs63bddkdplslgbnlfq79pm2ivl8hk38kkggy3dahf";
}; };
# Tests need an X display # Tests need an X display

View File

@ -20,57 +20,57 @@ addEnvVars() {
local filename local filename
for filename in $1/share/GNUstep/Makefiles/Additional/*.make ; do for filename in $1/share/GNUstep/Makefiles/Additional/*.make ; do
if case "$NIX_GNUSTEP_MAKEFILES_ADDITIONAL" in *"{$filename}"*) false;; *) true;; esac; then if case "${NIX_GNUSTEP_MAKEFILES_ADDITIONAL-}" in *"{$filename}"*) false;; *) true;; esac; then
export NIX_GNUSTEP_MAKEFILES_ADDITIONAL+=" $filename" export NIX_GNUSTEP_MAKEFILES_ADDITIONAL+=" $filename"
fi fi
done done
local tmp="$1/lib/GNUstep/Applications" local tmp="$1/lib/GNUstep/Applications"
if [ -d "$tmp" ] && case "$NIX_GNUSTEP_SYSTEM_APPS" in *"${tmp}"*) false;; *) true;; esac; then if [ -d "$tmp" ] && case "${NIX_GNUSTEP_SYSTEM_APPS-}" in *"${tmp}"*) false;; *) true;; esac; then
addToSearchPath NIX_GNUSTEP_SYSTEM_APPS "$tmp" addToSearchPath NIX_GNUSTEP_SYSTEM_APPS "$tmp"
fi fi
tmp="$1/lib/GNUstep/Applications" tmp="$1/lib/GNUstep/Applications"
if [ -d "$tmp" ] && case "$NIX_GNUSTEP_SYSTEM_ADMIN_APPS" in *"${tmp}"*) false;; *) true;; esac; then if [ -d "$tmp" ] && case "${NIX_GNUSTEP_SYSTEM_ADMIN_APPS-}" in *"${tmp}"*) false;; *) true;; esac; then
addToSearchPath NIX_GNUSTEP_SYSTEM_ADMIN_APPS "$tmp" addToSearchPath NIX_GNUSTEP_SYSTEM_ADMIN_APPS "$tmp"
fi fi
tmp="$1/lib/GNUstep/WebApplications" tmp="$1/lib/GNUstep/WebApplications"
if [ -d "$tmp" ] && case "$NIX_GNUSTEP_SYSTEM_WEB_APPS" in *"${tmp}"*) false;; *) true;; esac; then if [ -d "$tmp" ] && case "${NIX_GNUSTEP_SYSTEM_WEB_APPS-}" in *"${tmp}"*) false;; *) true;; esac; then
addToSearchPath NIX_GNUSTEP_SYSTEM_WEB_APPS "$tmp" addToSearchPath NIX_GNUSTEP_SYSTEM_WEB_APPS "$tmp"
fi fi
tmp="$1/bin" tmp="$1/bin"
if [ -d "$tmp" ] && case "$NIX_GNUSTEP_SYSTEM_TOOLS" in *"${tmp}"*) false;; *) true;; esac; then if [ -d "$tmp" ] && case "${NIX_GNUSTEP_SYSTEM_TOOLS-}" in *"${tmp}"*) false;; *) true;; esac; then
addToSearchPath NIX_GNUSTEP_SYSTEM_TOOLS "$tmp" addToSearchPath NIX_GNUSTEP_SYSTEM_TOOLS "$tmp"
fi fi
tmp="$1/sbin" tmp="$1/sbin"
if [ -d "$tmp" ] && case "$NIX_GNUSTEP_SYSTEM_ADMIN_TOOLS" in *"${tmp}"*) false;; *) true;; esac; then if [ -d "$tmp" ] && case "${NIX_GNUSTEP_SYSTEM_ADMIN_TOOLS-}" in *"${tmp}"*) false;; *) true;; esac; then
addToSearchPath NIX_GNUSTEP_SYSTEM_ADMIN_TOOLS "$tmp" addToSearchPath NIX_GNUSTEP_SYSTEM_ADMIN_TOOLS "$tmp"
fi fi
tmp="$1/lib/GNUstep" tmp="$1/lib/GNUstep"
if [ -d "$tmp" ] && case "$NIX_GNUSTEP_SYSTEM_LIBRARY" in *"${tmp}"*) false;; *) true;; esac; then if [ -d "$tmp" ] && case "${NIX_GNUSTEP_SYSTEM_LIBRARY-}" in *"${tmp}"*) false;; *) true;; esac; then
addToSearchPath NIX_GNUSTEP_SYSTEM_LIBRARY "$tmp" addToSearchPath NIX_GNUSTEP_SYSTEM_LIBRARY "$tmp"
fi fi
tmp="$1/include" tmp="$1/include"
if [ -d "$tmp" ] && case "$NIX_GNUSTEP_SYSTEM_HEADERS" in *"${tmp}"*) false;; *) true;; esac; then if [ -d "$tmp" ] && case "${NIX_GNUSTEP_SYSTEM_HEADERS-}" in *"${tmp}"*) false;; *) true;; esac; then
if [ -z "$NIX_GNUSTEP_SYSTEM_HEADERS" ]; then if [ -z "${NIX_GNUSTEP_SYSTEM_HEADERS-}" ]; then
export NIX_GNUSTEP_SYSTEM_HEADERS="$tmp" export NIX_GNUSTEP_SYSTEM_HEADERS="$tmp"
else else
export NIX_GNUSTEP_SYSTEM_HEADERS+=" $tmp" export NIX_GNUSTEP_SYSTEM_HEADERS+=" $tmp"
fi fi
fi fi
tmp="$1/lib" tmp="$1/lib"
if [ -d "$tmp" ] && case "$NIX_GNUSTEP_SYSTEM_LIBRARIES" in *"${tmp}"*) false;; *) true;; esac; then if [ -d "$tmp" ] && case "${NIX_GNUSTEP_SYSTEM_LIBRARIES-}" in *"${tmp}"*) false;; *) true;; esac; then
addToSearchPath NIX_GNUSTEP_SYSTEM_LIBRARIES "$tmp" addToSearchPath NIX_GNUSTEP_SYSTEM_LIBRARIES "$tmp"
fi fi
tmp="$1/share/GNUstep/Documentation" tmp="$1/share/GNUstep/Documentation"
if [ -d "$tmp" ] && case "$NIX_GNUSTEP_SYSTEM_DOC" in *"${tmp}"*) false;; *) true;; esac; then if [ -d "$tmp" ] && case "${NIX_GNUSTEP_SYSTEM_DOC-}" in *"${tmp}"*) false;; *) true;; esac; then
addToSearchPath NIX_GNUSTEP_SYSTEM_DOC "$tmp" addToSearchPath NIX_GNUSTEP_SYSTEM_DOC "$tmp"
fi fi
tmp="$1/share/man" tmp="$1/share/man"
if [ -d "$tmp" ] && case "$NIX_GNUSTEP_SYSTEM_DOC_MAN" in *"${tmp}"*) false;; *) true;; esac; then if [ -d "$tmp" ] && case "${NIX_GNUSTEP_SYSTEM_DOC_MAN-}" in *"${tmp}"*) false;; *) true;; esac; then
addToSearchPath NIX_GNUSTEP_SYSTEM_DOC_MAN "$tmp" addToSearchPath NIX_GNUSTEP_SYSTEM_DOC_MAN "$tmp"
fi fi
tmp="$1/share/info" tmp="$1/share/info"
if [ -d "$tmp" ] && case "$NIX_GNUSTEP_SYSTEM_DOC_INFO" in *"${tmp}"*) false;; *) true;; esac; then if [ -d "$tmp" ] && case "${NIX_GNUSTEP_SYSTEM_DOC_INFO-}" in *"${tmp}"*) false;; *) true;; esac; then
addToSearchPath NIX_GNUSTEP_SYSTEM_DOC_INFO "$tmp" addToSearchPath NIX_GNUSTEP_SYSTEM_DOC_INFO "$tmp"
fi fi
} }

View File

@ -43,11 +43,11 @@ let
propagate = out: propagate = out:
let setupHook = { writeScript }: let setupHook = { writeScript }:
writeScript "setup-hook" '' writeScript "setup-hook" ''
if [ "''${hookName:-}" != postHook ]; then if [[ "''${hookName-}" != postHook ]]; then
postHooks+=("source @dev@/nix-support/setup-hook") postHooks+=("source @dev@/nix-support/setup-hook")
else else
# Propagate $${out} output # Propagate $${out} output
propagatedUserEnvPkgs="$propagatedUserEnvPkgs @${out}@" propagatedUserEnvPkgs+=" @${out}@"
if [ -z "$outputDev" ]; then if [ -z "$outputDev" ]; then
echo "error: \$outputDev is unset!" >&2 echo "error: \$outputDev is unset!" >&2
@ -57,7 +57,7 @@ let
# Propagate $dev so that this setup hook is propagated # Propagate $dev so that this setup hook is propagated
# But only if there is a separate $dev output # But only if there is a separate $dev output
if [ "$outputDev" != out ]; then if [ "$outputDev" != out ]; then
propagatedBuildInputs="$propagatedBuildInputs @dev@" propagatedBuildInputs+=" @dev@"
fi fi
fi fi
''; '';

View File

@ -1,4 +1,4 @@
{ stdenv, targetPackages, fetchurl, fetchpatch, noSysDirs { stdenv, targetPackages, fetchurl, fetchpatch, fetchFromGitHub, noSysDirs
, langC ? true, langCC ? true, langFortran ? false , langC ? true, langCC ? true, langFortran ? false
, langObjC ? stdenv.targetPlatform.isDarwin , langObjC ? stdenv.targetPlatform.isDarwin
, langObjCpp ? stdenv.targetPlatform.isDarwin , langObjCpp ? stdenv.targetPlatform.isDarwin
@ -9,6 +9,7 @@
, enableShared ? true , enableShared ? true
, enableLTO ? true , enableLTO ? true
, texinfo ? null , texinfo ? null
, flex
, perl ? null # optional, for texi2pod (then pod2man); required for Java , perl ? null # optional, for texi2pod (then pod2man); required for Java
, gmp, mpfr, libmpc, gettext, which , gmp, mpfr, libmpc, gettext, which
, libelf # optional, for link-time optimizations (LTO) , libelf # optional, for link-time optimizations (LTO)
@ -108,7 +109,12 @@ stdenv.mkDerivation ({
builder = ../builder.sh; builder = ../builder.sh;
src = fetchurl { src = if stdenv.targetPlatform.isVc4 then fetchFromGitHub {
owner = "itszor";
repo = "gcc-vc4";
rev = "e90ff43f9671c760cf0d1dd62f569a0fb9bf8918";
sha256 = "0gxf66hwqk26h8f853sybphqa5ca0cva2kmrw5jsiv6139g0qnp8";
} else fetchurl {
url = "mirror://gnu/gcc/gcc-${version}/gcc-${version}.tar.xz"; url = "mirror://gnu/gcc/gcc-${version}/gcc-${version}.tar.xz";
sha256 = "0i89fksfp6wr1xg9l8296aslcymv2idn60ip31wr9s4pwin7kwby"; sha256 = "0i89fksfp6wr1xg9l8296aslcymv2idn60ip31wr9s4pwin7kwby";
}; };
@ -173,7 +179,8 @@ stdenv.mkDerivation ({
depsBuildBuild = [ buildPackages.stdenv.cc ]; depsBuildBuild = [ buildPackages.stdenv.cc ];
nativeBuildInputs = [ texinfo which gettext ] nativeBuildInputs = [ texinfo which gettext ]
++ (optional (perl != null) perl) ++ (optional (perl != null) perl)
++ (optional javaAwtGtk pkgconfig); ++ (optional javaAwtGtk pkgconfig)
++ (optional (stdenv.targetPlatform.isVc4) flex);
# For building runtime libs # For building runtime libs
depsBuildTarget = depsBuildTarget =

View File

@ -16,7 +16,7 @@
}: }:
runCommand "configured-ghcjs-src" { runCommand "configured-ghcjs-src" {
buildInputs = [ nativeBuildInputs = [
perl perl
autoconf autoconf
automake automake

View File

@ -1,12 +1,12 @@
{ stdenv, fetchurl, makeWrapper, jre, ncurses }: { stdenv, fetchurl, makeWrapper, jre, ncurses }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
version = "0.14.0-RC1"; version = "0.20.0-RC1";
pname = "dotty-bare"; pname = "dotty-bare";
src = fetchurl { src = fetchurl {
url = "https://github.com/lampepfl/dotty/releases/download/${version}/dotty-${version}.tar.gz"; url = "https://github.com/lampepfl/dotty/releases/download/${version}/dotty-${version}.tar.gz";
sha256 = "0nrgsyhqjlpvnjqgb18pryr8q7knq3dq25jhp98s4wh76nssm1zr"; sha256 = "08qs3m32cbh6516gcwraa1b5k935awmjxls6kg6xll722hkdd9l6";
}; };
propagatedBuildInputs = [ jre ncurses.dev ] ; propagatedBuildInputs = [ jre ncurses.dev ] ;
@ -35,6 +35,6 @@ stdenv.mkDerivation rec {
homepage = http://dotty.epfl.ch/; homepage = http://dotty.epfl.ch/;
license = licenses.bsd3; license = licenses.bsd3;
platforms = platforms.all; platforms = platforms.all;
maintainers = [maintainers.karolchmist]; maintainers = [maintainers.karolchmist maintainers.virusdave];
}; };
} }

View File

@ -2,11 +2,11 @@
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "clojure"; pname = "clojure";
version = "1.10.1.469"; version = "1.10.1.489";
src = fetchurl { src = fetchurl {
url = "https://download.clojure.org/install/clojure-tools-${version}.tar.gz"; url = "https://download.clojure.org/install/clojure-tools-${version}.tar.gz";
sha256 = "0hpb6rixmgllss69vl9zlpb41svm4mx4xmfbq1q7y12jsxckzgpq"; sha256 = "12ks7adh5cx99l5vydppkqknk5nvv9vsj2k0afcwwxd897m794kz";
}; };
buildInputs = [ makeWrapper ]; buildInputs = [ makeWrapper ];

View File

@ -2,11 +2,11 @@
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "armadillo"; pname = "armadillo";
version = "9.800.1"; version = "9.800.2";
src = fetchurl { src = fetchurl {
url = "mirror://sourceforge/arma/armadillo-${version}.tar.xz"; url = "mirror://sourceforge/arma/armadillo-${version}.tar.xz";
sha256 = "1vnshgkz4d992kk2fwqigqfx7gx3145ryb8d2794hn2667h5gkzb"; sha256 = "0mslyfzwb8zdhchhj7szj25qi2ain7cnlsrzccrfm2mr4a6jv5h9";
}; };
nativeBuildInputs = [ cmake ]; nativeBuildInputs = [ cmake ];

View File

@ -0,0 +1,43 @@
{ stdenv
, fetchFromGitHub
, fetchpatch
, cmake
}:
stdenv.mkDerivation rec {
pname = "bcg729";
version = "1.0.4";
src = fetchFromGitHub {
owner = "BelledonneCommunications";
repo = pname;
rev = version;
sha256 = "05s0c5ps3a763y0v34wg5zghj0cdjnq4ch7g81848xxry7q90fwa";
};
patches = [
(fetchpatch {
url = "https://github.com/BelledonneCommunications/bcg729/commit/a5907daf1b111e4ad7aab4f558f57e2af1e37e55.patch";
sha256 = "0445syfwj4w4chh8ak80rq77iqcr27924n1ld5snshk3d21nxd64";
})
(fetchpatch {
url = "https://github.com/BelledonneCommunications/bcg729/commit/697bf6653a8c7421f0e821ee8d42471246e6850f.patch";
sha256 = "1h3gf5sj2sg5cs5iv1lcav3lkqmd5jf4agvjzz83l89wd5f5hp5l";
})
(fetchpatch {
url = "https://github.com/BelledonneCommunications/bcg729/commit/d63ce04a93711820d9a6985b1d11d8d91ed8e6b6.patch";
sha256 = "1piwf63ci2gma6jd6b4adkvxirysvazf0vklb5pc6vx1g93nkgxs";
})
];
nativeBuildInputs = [ cmake ];
meta = with stdenv.lib; {
description = "Opensource implementation of both encoder and decoder of the ITU G729 Annex A/B speech codec";
homepage = "https://linphone.org/technical-corner/bcg729";
changelog = "https://gitlab.linphone.org/BC/public/bcg729/raw/${version}/NEWS";
license = licenses.gpl2Plus;
maintainers = with maintainers; [ c0bw3b ];
platforms = platforms.all;
};
}

View File

@ -1,19 +1,23 @@
{stdenv, fetchFromGitHub, cmake, mbedtls, bcunit, srtp}: { stdenv, fetchFromGitHub, cmake, bcunit, mbedtls }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "${baseName}-${version}"; pname = "bctoolbox";
baseName = "bctoolbox";
version = "0.6.0"; version = "0.6.0";
buildInputs = [cmake mbedtls bcunit srtp];
nativeBuildInputs = [ cmake bcunit ];
buildInputs = [ mbedtls ];
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "BelledonneCommunications"; owner = "BelledonneCommunications";
repo = baseName; repo = pname;
rev = version; rev = version;
sha256 = "1cxx243wyzkd4xnvpyqf97n0rjhfckpvw1vhwnbwshq3q6fra909"; sha256 = "1cxx243wyzkd4xnvpyqf97n0rjhfckpvw1vhwnbwshq3q6fra909";
}; };
meta = { meta = {
inherit version; inherit version;
description = ''Utilities library for Linphone''; description = "Utilities library for Linphone";
homepage = "https://github.com/BelledonneCommunications/bctoolbox";
license = stdenv.lib.licenses.gpl2Plus ; license = stdenv.lib.licenses.gpl2Plus ;
maintainers = [stdenv.lib.maintainers.raskin]; maintainers = [stdenv.lib.maintainers.raskin];
platforms = stdenv.lib.platforms.linux; platforms = stdenv.lib.platforms.linux;

View File

@ -1,15 +1,14 @@
{ stdenv, antlr3_4, libantlr3c, jre, polarssl, fetchFromGitHub { stdenv, antlr3_4, libantlr3c, jre, mbedtls, fetchFromGitHub
, cmake, zlib, bctoolbox , cmake, zlib, bctoolbox
}: }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
baseName = "belle-sip"; pname = "belle-sip";
version = "1.6.3"; version = "1.6.3";
name = "${baseName}-${version}";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "BelledonneCommunications"; owner = "BelledonneCommunications";
repo = baseName; repo = pname;
rev = version; rev = version;
sha256 = "0q70db1klvhca1af29bm9paka3gyii5hfbzrj4178gclsg7cj8fk"; sha256 = "0q70db1klvhca1af29bm9paka3gyii5hfbzrj4178gclsg7cj8fk";
}; };
@ -24,18 +23,14 @@ stdenv.mkDerivation rec {
"-Wno-error=cast-function-type" "-Wno-error=cast-function-type"
]; ];
propagatedBuildInputs = [ antlr3_4 libantlr3c polarssl bctoolbox ]; propagatedBuildInputs = [ antlr3_4 libantlr3c mbedtls bctoolbox ];
configureFlags = [
"--with-polarssl=${polarssl}"
];
# Fails to build with lots of parallel jobs # Fails to build with lots of parallel jobs
enableParallelBuilding = false; enableParallelBuilding = false;
meta = with stdenv.lib; { meta = with stdenv.lib; {
homepage = http://www.linphone.org/index.php/eng; homepage = https://linphone.org/technical-corner/belle-sip;
description = "A Voice-over-IP phone"; description = "Modern library implementing SIP (RFC 3261) transport, transaction and dialog layers";
license = licenses.gpl2; license = licenses.gpl2;
platforms = platforms.all; platforms = platforms.all;
}; };

View File

@ -2,13 +2,13 @@
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "catch2"; pname = "catch2";
version = "2.10.2"; version = "2.11.0";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "catchorg"; owner = "catchorg";
repo = "Catch2"; repo = "Catch2";
rev = "v${version}"; rev = "v${version}";
sha256="01ldfv4337s3vdhsx415d49jchpvqy61c77dhnri30ip5af0ipjs"; sha256="1b07drrclvxj17s67ivypr9vr27rg0m36jqnrbci6f4wsp1b0gbl";
}; };
nativeBuildInputs = [ cmake ]; nativeBuildInputs = [ cmake ];

View File

@ -48,7 +48,7 @@ let
# Propagate $dev so that this setup hook is propagated # Propagate $dev so that this setup hook is propagated
# But only if there is a separate $dev output # But only if there is a separate $dev output
if [ "''${outputDev:?}" != out ]; then if [ "''${outputDev:?}" != out ]; then
propagatedBuildInputs="$propagatedBuildInputs @dev@" propagatedBuildInputs="''${propagatedBuildInputs-} @dev@"
fi fi
fi fi
''; '';

View File

@ -3,13 +3,13 @@
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "libmodule"; pname = "libmodule";
version = "4.2.0"; version = "5.0.0";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "FedeDP"; owner = "FedeDP";
repo = "libmodule"; repo = "libmodule";
rev = version; rev = version;
sha256 = "1qn54pysdm0q7v1gnisd43i5i4ylf8s8an77jk6jd8qimysv08mx"; sha256 = "1cf81sl33xmfn5g150iqcdrjn0lpjlgp53mganwi6x7jda2qk7r6";
}; };
nativeBuildInputs = [ nativeBuildInputs = [

View File

@ -1,17 +1,16 @@
{ stdenv, pkgconfig, intltool, alsaLib, libpulseaudio, speex, gsm { stdenv, pkgconfig, intltool, alsaLib, libpulseaudio, speex, gsm
, libopus, ffmpeg, libX11, libXv, libGLU, libGL, glew, libtheora, libvpx, SDL, libupnp , libopus, ffmpeg, libX11, libXv, libGLU, libGL, glew, libtheora, libvpx, SDL, libupnp
, ortp, libv4l, libpcap, srtp, fetchFromGitHub, cmake, bctoolbox, doxygen , ortp, libv4l, libpcap, srtp, fetchFromGitHub, cmake, bctoolbox, doxygen
, python, libXext, libmatroska, openssl, fetchpatch , python, libXext, libmatroska, fetchpatch
}: }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
baseName = "mediastreamer2"; pname = "mediastreamer2";
version = "2.16.1"; version = "2.16.1";
name = "${baseName}-${version}";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "BelledonneCommunications"; owner = "BelledonneCommunications";
repo = baseName; repo = pname;
rev = version; rev = version;
sha256 = "02745bzl2r1jqvdqzyv94fjd4w92zr976la4c4nfvsy52waqah7j"; sha256 = "02745bzl2r1jqvdqzyv94fjd4w92zr976la4c4nfvsy52waqah7j";
}; };
@ -31,19 +30,18 @@ stdenv.mkDerivation rec {
alsaLib libpulseaudio speex gsm libopus alsaLib libpulseaudio speex gsm libopus
ffmpeg libX11 libXv libGLU libGL glew libtheora libvpx SDL libupnp ffmpeg libX11 libXv libGLU libGL glew libtheora libvpx SDL libupnp
ortp libv4l libpcap srtp bctoolbox libXext libmatroska ortp libv4l libpcap srtp bctoolbox libXext libmatroska
openssl
]; ];
NIX_CFLAGS_COMPILE = [ NIX_CFLAGS_COMPILE = [
"-DGIT_VERSION=\"v2.14.0\"" "-DGIT_VERSION=\"v${version}\""
"-Wno-error=deprecated-declarations" "-Wno-error=deprecated-declarations"
"-Wno-error=cast-function-type" "-Wno-error=cast-function-type"
]; ];
NIX_LDFLAGS = "-lXext -lssl"; NIX_LDFLAGS = "-lXext";
meta = with stdenv.lib; { meta = with stdenv.lib; {
description = "A powerful and lightweight streaming engine specialized for voice/video telephony applications"; description = "A powerful and lightweight streaming engine specialized for voice/video telephony applications";
homepage = http://www.linphone.org/technical-corner/mediastreamer2/overview; homepage = http://www.linphone.org/technical-corner/mediastreamer2;
license = licenses.gpl2; license = licenses.gpl2;
platforms = platforms.linux; platforms = platforms.linux;
}; };

View File

@ -1,23 +1,30 @@
{ stdenv, autoreconfHook, pkgconfig, mediastreamer, openh264 { stdenv, autoreconfHook, pkgconfig, mediastreamer, openh264
, fetchgit, cmake , fetchurl, fetchpatch, cmake
}: }:
stdenv.mkDerivation { stdenv.mkDerivation rec {
pname = "mediastreamer-openh264"; pname = "mediastreamer-openh264";
version = "0.0pre20160801"; version = "1.2.1";
src = fetchgit { src = fetchurl {
url = "git://git.linphone.org/msopenh264.git"; url = "https://www.linphone.org/releases/sources/plugins/msopenh264/msopenh264-${version}.tar.gz";
rev = "4cb4b134bf0f1538fd0c2c928eee2d5388115abc"; sha256 = "0rdxgazm52560g52pp6mp3mwx6j1z3h2zyizzfycp8y8zi92fqm8";
sha256 = "001km4xy1ifwbg1c19ncc75h867fzfcxy9pxvl4pxqb64169xc1k";
}; };
patches = [
(fetchpatch {
name = "msopenh264-build-with-openh264-v2.patch";
url = "https://git.pld-linux.org/?p=packages/mediastreamer-plugin-msopenh264.git;a=blob_plain;f=mediastreamer-plugin-msopenh264-openh264.patch;hb=344b8af379701a7e58b4ffb3cbac1517eff079fd";
sha256 = "10c24b0afchx78q28176pd8iz7i1nlf57f6v6lyqxpz60fm5nrcc";
})
];
nativeBuildInputs = [ autoreconfHook cmake pkgconfig ]; nativeBuildInputs = [ autoreconfHook cmake pkgconfig ];
buildInputs = [ mediastreamer openh264 ]; buildInputs = [ mediastreamer openh264 ];
meta = with stdenv.lib; { meta = with stdenv.lib; {
description = "H.264 encoder/decoder plugin for mediastreamer2"; description = "H.264 encoder/decoder plugin for mediastreamer2";
homepage = http://www.linphone.org/technical-corner/mediastreamer2/overview; homepage = "https://www.linphone.org/technical-corner/mediastreamer2";
license = licenses.gpl2; license = licenses.gpl2;
platforms = platforms.linux; platforms = platforms.linux;
}; };

View File

@ -1,13 +1,12 @@
{ stdenv, cmake, fetchFromGitHub, bctoolbox }: { stdenv, cmake, fetchFromGitHub, bctoolbox }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
baseName = "ortp"; pname = "ortp";
version = "1.0.2"; version = "1.0.2";
name = "${baseName}-${version}";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "BelledonneCommunications"; owner = "BelledonneCommunications";
repo = baseName; repo = pname;
rev = version; rev = version;
sha256 = "12cwv593bsdnxs0zfcp07vwyk7ghlz2wv7vdbs1ksv293w3vj2rv"; sha256 = "12cwv593bsdnxs0zfcp07vwyk7ghlz2wv7vdbs1ksv293w3vj2rv";
}; };
@ -17,8 +16,8 @@ stdenv.mkDerivation rec {
meta = with stdenv.lib; { meta = with stdenv.lib; {
description = "A Real-Time Transport Protocol (RFC3550) stack"; description = "A Real-Time Transport Protocol (RFC3550) stack";
homepage = http://www.linphone.org/index.php/eng/code_review/ortp; homepage = https://linphone.org/technical-corner/ortp;
license = licenses.lgpl21; license = licenses.gpl2Plus;
platforms = platforms.all; platforms = platforms.all;
}; };
} }

Some files were not shown because too many files have changed in this diff Show More