Skip to content

Commit

Permalink
Merge master into staging-next
Browse files Browse the repository at this point in the history
  • Loading branch information
FRidh committed Feb 7, 2020
2 parents 38cf6ea + 4506f4a commit 30f0909
Show file tree
Hide file tree
Showing 101 changed files with 5,873 additions and 5,333 deletions.
8 changes: 6 additions & 2 deletions nixos/modules/programs/tmux.nix
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ let
set -s escape-time ${toString cfg.escapeTime}
set -g history-limit ${toString cfg.historyLimit}
${cfg.extraTmuxConf}
${cfg.extraConfig}
'';

in {
Expand Down Expand Up @@ -102,7 +102,7 @@ in {
description = "Time in milliseconds for which tmux waits after an escape is input.";
};

extraTmuxConf = mkOption {
extraConfig = mkOption {
default = "";
description = ''
Additional contents of /etc/tmux.conf
Expand Down Expand Up @@ -181,4 +181,8 @@ in {
};
};
};

imports = [
(lib.mkRenamedOptionModule [ "programs" "tmux" "extraTmuxConf" ] [ "programs" "tmux" "extraConfig" ])
];
}
56 changes: 50 additions & 6 deletions nixos/modules/services/backup/restic.nix
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,34 @@ in
Create the repository if it doesn't exist.
'';
};

pruneOpts = mkOption {
type = types.listOf types.str;
default = [];
description = ''
A list of options (--keep-* et al.) for 'restic forget
--prune', to automatically prune old snapshots. The
'forget' command is run *after* the 'backup' command, so
keep that in mind when constructing the --keep-* options.
'';
example = [
"--keep-daily 7"
"--keep-weekly 5"
"--keep-monthly 12"
"--keep-yearly 75"
];
};

dynamicFilesFrom = mkOption {
type = with types; nullOr str;
default = null;
description = ''
A script that produces a list of files to back up. The
results of this command are given to the '--files-from'
option.
'';
example = "find /home/matt/git -type d -name .git";
};
};
}));
default = {};
Expand Down Expand Up @@ -134,25 +162,41 @@ in
let
extraOptions = concatMapStrings (arg: " -o ${arg}") backup.extraOptions;
resticCmd = "${pkgs.restic}/bin/restic${extraOptions}";
filesFromTmpFile = "/run/restic-backups-${name}/includes";
backupPaths = if (backup.dynamicFilesFrom == null)
then concatStringsSep " " backup.paths
else "--files-from ${filesFromTmpFile}";
pruneCmd = optionals (builtins.length backup.pruneOpts > 0) [
( resticCmd + " forget --prune " + (concatStringsSep " " backup.pruneOpts) )
( resticCmd + " check" )
];
in nameValuePair "restic-backups-${name}" ({
environment = {
RESTIC_PASSWORD_FILE = backup.passwordFile;
RESTIC_REPOSITORY = backup.repository;
};
path = with pkgs; [
openssh
];
path = [ pkgs.openssh ];
restartIfChanged = false;
serviceConfig = {
Type = "oneshot";
ExecStart = "${resticCmd} backup ${concatStringsSep " " backup.extraBackupArgs} ${concatStringsSep " " backup.paths}";
ExecStart = [ "${resticCmd} backup ${concatStringsSep " " backup.extraBackupArgs} ${backupPaths}" ] ++ pruneCmd;
User = backup.user;
RuntimeDirectory = "restic-backups-${name}";
} // optionalAttrs (backup.s3CredentialsFile != null) {
EnvironmentFile = backup.s3CredentialsFile;
};
} // optionalAttrs backup.initialize {
} // optionalAttrs (backup.initialize || backup.dynamicFilesFrom != null) {
preStart = ''
${resticCmd} snapshots || ${resticCmd} init
${optionalString (backup.initialize) ''
${resticCmd} snapshots || ${resticCmd} init
''}
${optionalString (backup.dynamicFilesFrom != null) ''
${pkgs.writeScript "dynamicFilesFromScript" backup.dynamicFilesFrom} > ${filesFromTmpFile}
''}
'';
} // optionalAttrs (backup.dynamicFilesFrom != null) {
postStart = ''
rm ${filesFromTmpFile}
'';
})
) config.services.restic.backups;
Expand Down
5 changes: 4 additions & 1 deletion nixos/modules/services/hardware/fwupd.nix
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ in {

blacklistPlugins = mkOption {
type = types.listOf types.str;
default = [ "test" ];
default = [];
example = [ "udev" ];
description = ''
Allow blacklisting specific plugins
Expand Down Expand Up @@ -91,6 +91,9 @@ in {

###### implementation
config = mkIf cfg.enable {
# Disable test related plug-ins implicitly so that users do not have to care about them.
services.fwupd.blacklistPlugins = cfg.package.defaultBlacklistedPlugins;

environment.systemPackages = [ cfg.package ];

environment.etc = {
Expand Down
11 changes: 8 additions & 3 deletions nixos/modules/services/x11/desktop-managers/xfce.nix
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,14 @@ in
"/share/gtksourceview-4.0"
];

services.xserver.displayManager.sessionPackages = [
pkgs.xfce.xfce4-session
];
services.xserver.desktopManager.session = [{
name = "xfce";
bgSupport = true;
start = ''
${pkgs.runtimeShell} ${pkgs.xfce.xfce4-session.xinitrc} &
waitPID=$!
'';
}];

services.xserver.updateDbusEnvironment = true;
services.xserver.gdk-pixbuf.modulePackages = [ pkgs.librsvg ];
Expand Down
1 change: 1 addition & 0 deletions nixos/tests/all-tests.nix
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ in
radicale = handleTest ./radicale.nix {};
redis = handleTest ./redis.nix {};
redmine = handleTest ./redmine.nix {};
restic = handleTest ./restic.nix {};
roundcube = handleTest ./roundcube.nix {};
rspamd = handleTest ./rspamd.nix {};
rss2email = handleTest ./rss2email.nix {};
Expand Down
4 changes: 2 additions & 2 deletions nixos/tests/installed-tests/fwupd.nix
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{ pkgs, makeInstalledTest, ... }:
{ pkgs, lib, makeInstalledTest, ... }:

makeInstalledTest {
tested = pkgs.fwupd;

testConfig = {
services.fwupd.enable = true;
services.fwupd.blacklistPlugins = []; # don't blacklist test plugin
services.fwupd.blacklistPlugins = lib.mkForce []; # don't blacklist test plugin
services.fwupd.enableTestRemote = true;
virtualisation.memorySize = 768;
};
Expand Down
63 changes: 63 additions & 0 deletions nixos/tests/restic.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
import ./make-test-python.nix (
{ pkgs, ... }:

let
password = "some_password";
repository = "/tmp/restic-backup";
passwordFile = pkgs.writeText "password" "correcthorsebatterystaple";
in
{
name = "restic";

meta = with pkgs.stdenv.lib.maintainers; {
maintainers = [ bbigras ];
};

nodes = {
server =
{ ... }:
{
services.restic.backups = {
remotebackup = {
inherit repository;
passwordFile = "${passwordFile}";
initialize = true;
paths = [ "/opt" ];
pruneOpts = [
"--keep-daily 2"
"--keep-weekly 1"
"--keep-monthly 1"
"--keep-yearly 99"
];
};
};
};
};

testScript = ''
server.start()
server.wait_for_unit("dbus.socket")
server.fail(
"${pkgs.restic}/bin/restic -r ${repository} -p ${passwordFile} snapshots"
)
server.succeed(
"mkdir -p /opt",
"touch /opt/some_file",
"timedatectl set-time '2016-12-13 13:45'",
"systemctl start restic-backups-remotebackup.service",
'${pkgs.restic}/bin/restic -r ${repository} -p ${passwordFile} snapshots -c | grep -e "^1 snapshot"',
"timedatectl set-time '2017-12-13 13:45'",
"systemctl start restic-backups-remotebackup.service",
"timedatectl set-time '2018-12-13 13:45'",
"systemctl start restic-backups-remotebackup.service",
"timedatectl set-time '2018-12-14 13:45'",
"systemctl start restic-backups-remotebackup.service",
"timedatectl set-time '2018-12-15 13:45'",
"systemctl start restic-backups-remotebackup.service",
"timedatectl set-time '2018-12-16 13:45'",
"systemctl start restic-backups-remotebackup.service",
'${pkgs.restic}/bin/restic -r ${repository} -p ${passwordFile} snapshots -c | grep -e "^4 snapshot"',
)
'';
}
)
4 changes: 2 additions & 2 deletions pkgs/applications/audio/gpodder/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@

python3Packages.buildPythonApplication rec {
pname = "gpodder";
version = "3.10.12";
version = "3.10.13";
format = "other";

src = fetchFromGitHub {
owner = pname;
repo = pname;
rev = version;
sha256 = "0q95am079gg01dkivr972mm2k87y8z296a9yf7amzsf9hxfycdra";
sha256 = "1h542syaxsx1hslfzlk3fx1nbp190zjw35kigw7a1kx1jwvfwapg";
};

patches = [
Expand Down
4 changes: 2 additions & 2 deletions pkgs/applications/audio/padthv1/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

mkDerivation rec {
pname = "padthv1";
version = "0.9.11";
version = "0.9.12";

src = fetchurl {
url = "mirror://sourceforge/padthv1/${pname}-${version}.tar.gz";
sha256 = "02yfwyirjqxa075yqdnci9b9k57kdmkjvn9gnpdbnjp887pds76g";
sha256 = "1zz3rz990k819q0rlzllqdwvag0x9k63443lb0mp8lwlczxnza6l";
};

buildInputs = [ libjack2 alsaLib libsndfile liblo lv2 qt5.qtbase qt5.qttools fftw ];
Expand Down
4 changes: 2 additions & 2 deletions pkgs/applications/audio/samplv1/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

stdenv.mkDerivation rec {
pname = "samplv1";
version = "0.9.11";
version = "0.9.12";

src = fetchurl {
url = "mirror://sourceforge/samplv1/${pname}-${version}.tar.gz";
sha256 = "17zs8kvvwqv00bm4lxpn09a5hxjlbz7k5mkl3k7jspw7rqn3djf2";
sha256 = "0xzjxiqzcf1ygabrjsy0iachhnpy85rp9519fmj2f568r6ml6hzg";
};

buildInputs = [ libjack2 alsaLib liblo libsndfile lv2 qt5.qtbase qt5.qttools];
Expand Down
4 changes: 2 additions & 2 deletions pkgs/applications/audio/synthv1/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

mkDerivation rec {
pname = "synthv1";
version = "0.9.11";
version = "0.9.12";

src = fetchurl {
url = "mirror://sourceforge/synthv1/${pname}-${version}.tar.gz";
sha256 = "116k2vca9dygvsd684wvxm61p0l1xrrgdph4qrrprlsr6vj0llgm";
sha256 = "1amxrl1cqwgncw5437r572frgf6xhss3cfpbgh178i8phlq1q731";
};

buildInputs = [ qtbase qttools libjack2 alsaLib liblo lv2 ];
Expand Down
4 changes: 2 additions & 2 deletions pkgs/applications/blockchains/bitcoin-abc.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ with stdenv.lib;
mkDerivation rec {

name = "bitcoin" + (toString (optional (!withGui) "d")) + "-abc-" + version;
version = "0.20.9";
version = "0.20.12";

src = fetchFromGitHub {
owner = "bitcoin-ABC";
repo = "bitcoin-abc";
rev = "v${version}";
sha256 = "1dmk7vm4r9n0yia8dazlx4fmr8i1r8cz8p1pj11glpa3pwda3669";
sha256 = "0ar3syrz7psf83bh24hn2y0mxjgn7cjqk2h8q4cgdp7mq55v8ynj";
};

patches = [ ./fix-bitcoin-qt-build.patch ];
Expand Down
4 changes: 2 additions & 2 deletions pkgs/applications/blockchains/pivx.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
with stdenv.lib;
stdenv.mkDerivation rec {
name = "pivx-${version}";
version = "4.0.0";
version = "4.0.2";

src = fetchFromGitHub {
owner = "PIVX-Project";
repo= "PIVX";
rev = "v${version}";
sha256 = "0m85nc7c8cppdysqz4m12rgmzacrcbwnvf7wy90wzfvfr3xkbapd";
sha256 = "12lnp318k8dx1sar24zfmv2imnzs30srssnlpb31y7hcxhz0wpc5";
};

nativeBuildInputs = [ pkgconfig autoreconfHook ] ++ optionals withGui [ wrapQtAppsHook ];
Expand Down
4 changes: 2 additions & 2 deletions pkgs/applications/editors/rednotebook/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@

buildPythonApplication rec {
pname = "rednotebook";
version = "2.15";
version = "2.16";

src = fetchFromGitHub {
owner = "jendrikseipp";
repo = "rednotebook";
rev = "v${version}";
sha256 = "1p43xncqb898rgfx4vv1nxy6dj57pvxpc0b5j3kgs58ir70rg1js";
sha256 = "1cziac9pmhpxvs8qg54wbckzgjpplqb55hykg5vdwdqqs7j054aj";
};

# We have not packaged tests.
Expand Down
4 changes: 2 additions & 2 deletions pkgs/applications/editors/thonny/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ with python3.pkgs;

buildPythonApplication rec {
pname = "thonny";
version = "3.2.4";
version = "3.2.6";

src = fetchFromGitHub {
owner = pname;
repo = pname;
rev = "v${version}";
sha256 = "1hfpjw4fac0kq3n9jqwfzbys6h35qjbh5rpc4jzhlln200h6zvwj";
sha256 = "19krnxpp3i1n65zafazvdm9mvnjry5rml0y9imj4365q4bkj20g2";
};

propagatedBuildInputs = with python3.pkgs; [
Expand Down
4 changes: 2 additions & 2 deletions pkgs/applications/graphics/drawio/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@

stdenv.mkDerivation rec {
pname = "drawio";
version = "12.5.3";
version = "12.6.5";

src = fetchurl {
url = "https://github.com/jgraph/drawio-desktop/releases/download/v${version}/draw.io-x86_64-${version}.rpm";
sha256 = "048lksq2akkyi5jg1fiz455n2nv6w58kv8xb9y41qms5dshpww2q";
sha256 = "14x4h680q3w9wsdmivy2k1bggb09vdm3a3wrpfwd79dbaagjk4lc";
};

nativeBuildInputs = [
Expand Down
8 changes: 4 additions & 4 deletions pkgs/applications/graphics/tev/default.nix
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
{ stdenv, fetchFromGitHub
, cmake, wrapGAppsHook
, libX11, xorg, libzip, glfw, gnome3
, libX11, libzip, glfw, libpng, xorg, gnome3
}:

stdenv.mkDerivation rec {
pname = "tev";
version = "1.13";
version = "1.14";

src = fetchFromGitHub {
owner = "Tom94";
repo = pname;
rev = "v${version}";
fetchSubmodules = true;
sha256 = "0c8md6yv1q449aszs05xfby6a2aiw8pac7x0zs169i5mpqrrbfa9";
sha256 = "1g86wl0sdn0wprfxff2q1yc1hiq9fndmzhyvj09cw51lzbab5faw";
};

nativeBuildInputs = [ cmake wrapGAppsHook ];
buildInputs = [ libX11 libzip glfw ]
buildInputs = [ libX11 libzip glfw libpng ]
++ (with xorg; [ libXrandr libXinerama libXcursor libXi libXxf86vm ]);

dontWrapGApps = true; # We also need zenity (see below)
Expand Down
Loading

0 comments on commit 30f0909

Please sign in to comment.