Merge branch 'pr/vmd32387-upgrade' into 'master'

vmd32387 upgrade to NixOs 20.03 and tune backup

See merge request steveeJ/infra!37
This commit is contained in:
steveej 2020-03-16 17:09:27 +00:00
commit a2070b4d3b
8 changed files with 52 additions and 90 deletions

View file

@ -126,6 +126,8 @@ in args // {
'';
script = ''
#! ${pkgs.bash}/bin/bash
set -Eeuxo pipefail
export RUST_BACKTRACE=1
export TIMESTAMP=$(date +"%Y%m%d.%H%M%S")
@ -133,12 +135,17 @@ in args // {
for d in `ls -1 ${bkpSource}`; do
echo Determining backup source size ${bkpSource}/$d...
du -hs ${bkpSource}/$d
set -x
rdup -x /dev/null ${bkpSource}/$d | rdedup -v -ttt --dir=${bkpDestination}/rdedup store $d-''${TIMESTAMP}
set +x
done
sync
echo Finished rdup/rdedup backup...
echo Removing all previous backups...
rdedup --dir=${bkpDestination}/rdedup list | grep -v ''${TIMESTAMP} | xargs echo rdedup --dir=${bkpDestination}/rdedup remove
echo Running rdedup garbage-collector...
time rdedup -v -ttt --dir=${bkpDestination}/rdedup gc
echo Determining backup destination size ${bkpDestination}/rdedup...
du -hs ${bkpDestination}/rdedup
'';

View file

@ -36,20 +36,28 @@ in args // {
'';
};
services.phpfpm.phpPackage = pkgs.php56;
nixpkgs.config.php = {
imap = false;
openssl = false;
curl = false;
ldap = false;
};
services.phpfpm.poolConfigs.mypool = ''
listen = 127.0.0.1:9000
user = nobody
pm = dynamic
pm.max_children = 5
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3
pm.max_requests = 500
services.phpfpm.pools.mypool = {
phpPackage = pkgs.php56;
listen = "127.0.0.1:9000";
user = "nobody";
settings = {
"pm" = "dynamic";
"pm.max_children" = 5;
"pm.start_servers" = 2;
"pm.min_spare_servers" = 1;
"pm.max_spare_servers" = 3;
"pm.max_requests" = 500;
php_admin_value[error_reporting] = E_ALL & ~E_NOTICE & ~E_WARNING & ~E_STRICT & ~E_DEPRECATED
'';
"php_admin_value[error_reporting]" = "E_ALL & ~E_NOTICE & ~E_WARNING & ~E_STRICT & ~E_DEPRECATED";
};
};
services.mysql = {
enable = true;

View file

@ -12,5 +12,6 @@
./system.nix
./hw.nix
./pkg.nix
./boot.nix
];
}

View file

@ -1,15 +1,20 @@
{
channelsNixosStable = {
ref = "nixos-19.03";
rev = "07e2b59812de95deeedde95fb6ba22d581d12fbc";
ref = "nixos-20.03";
rev = "730453919bdc191496eb5dda04d69c4c99c724b9";
};
channelsNixosUnstable = {
ref = "nixos-unstable";
rev = "34aa254f9ebf5899636a9927ceefbc9df80230f4";
rev = "0729b8c55e0dfaf302af4c57546871d47a652048";
};
nixpkgsMaster = {
url = "https://github.com/NixOS/nixpkgs/";
ref = "master";
rev = "641e1029748a8ccd5fc052f0029e2fee89ebd0ef";
};
homeManagerModule = {
url = "https://github.com/rycee/home-manager";
ref = "master";
rev = "465d08d99f5b72b38cecb7ca1865b7255de3ee86";
ref = "release-19.09";
rev = "0d1ca254d0f213a118459c5be8ae465018132f74";
};
}

View file

@ -35,8 +35,6 @@ in rec {
pkgs.recurseIntoAttrs (pkgs.linuxPackagesFor linux_sgx);
linuxPackages_sgx_latest = linuxPackages_sgx_540rc3;
rdedup = pkgs.callPackages ../pkgs/rdedup {};
busyboxStatic = pkgs.busybox.override {
enableStatic = true;
extraConfig = ''
@ -50,7 +48,9 @@ in rec {
};
php56 = (pkgs.callPackages
"${nixpkgsWithPhp5}/pkgs/development/interpreters/php/default.nix" {})
"${nixpkgsWithPhp5}/pkgs/development/interpreters/php/default.nix" {
icu = pkgs.icu60;
})
.php56.overrideAttrs(drv: rec {
# See https://secure.php.net/ChangeLog-5.php
version = "5.6.40";

View file

@ -1,35 +0,0 @@
{ stdenv, fetchFromGitHub, rustPlatform, pkgconfig, openssl, libsodium
, llvmPackages, clang_39, lzma }:
rustPlatform.buildRustPackage rec {
name = "rdedup-${version}";
version = "3.1.1";
src = fetchFromGitHub {
owner = "dpc";
repo = "rdedup";
rev = "rdedup-v${version}";
sha256 = "0y34a3mpghdmcb2rx4z62q0s351bfmy1287d75mm07ryfgglgsd7";
};
patches = [
./v3.1.1-fix-Cargo.lock.patch
];
cargoSha256 = "0p19qcz2ph6axfccjwc6z72hrlb48l7sf1n0hc1gfq8hj2s3k2s1";
nativeBuildInputs = [ pkgconfig llvmPackages.libclang clang_39 ];
buildInputs = [ openssl libsodium lzma ];
configurePhase = ''
export LIBCLANG_PATH="${llvmPackages.libclang}/lib"
'';
meta = with stdenv.lib; {
description = "Data deduplication with compression and public key encryption";
homepage = https://github.com/dpc/rdedup;
license = licenses.mpl20;
maintainers = with maintainers; [ dywedir ];
platforms = platforms.all;
};
}

View file

@ -1,28 +0,0 @@
diff --git a/Cargo.lock b/Cargo.lock
index 96be83a..fe07471 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -880,12 +880,12 @@ dependencies = [
[[package]]
name = "rdedup"
-version = "3.1.0"
+version = "3.1.1"
dependencies = [
"clap 2.32.0 (registry+https://github.com/rust-lang/crates.io-index)",
"hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
- "rdedup-lib 3.0.0",
+ "rdedup-lib 3.1.0",
"rpassword 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"slog 2.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
"slog-async 2.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -900,7 +900,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "rdedup-lib"
-version = "3.0.0"
+version = "3.1.0"
dependencies = [
"backblaze-b2 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
"base64 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)",

View file

@ -1,20 +1,24 @@
{
channelsNixosStable = {
ref = "nixos-20.03";
rev = "730453919bdc191496eb5dda04d69c4c99c724b9";
};
channelsNixos1909 = {
ref = "nixos-19.09";
rev = "c5aabb0d603e2c1ea05f5a93b3be82437f5ebf31";
rev = "64565f9d8ffe5bc3737ebd5f6b97756fac16d23b";
};
channelsNixosUnstable = {
ref = "nixos-unstable";
rev = "7827d3f4497ed722fedca57fd4d5ca1a65c38256";
rev = "0729b8c55e0dfaf302af4c57546871d47a652048";
};
nixpkgsMaster = {
url = "https://github.com/NixOS/nixpkgs/";
ref = "master";
rev = "abe853b84c58ddbb7c5c07e80090d47480d56c11";
rev = "47f61c9d7f116701ad9ca0d4b894ebb5f36ef5cf";
};
homeManagerModule = {
url = "https://github.com/rycee/home-manager";
ref = "master";
rev = "450571056552c9311fcb2894328696b535265593";
ref = "release-19.09";
rev = "0d1ca254d0f213a118459c5be8ae465018132f74";
};
}