k 5 snapraid: is part of upstream

This commit is contained in:
makefu 2016-01-05 16:07:13 +01:00
parent 6cb83cd174
commit d73c8df6e4
2 changed files with 28 additions and 54 deletions

View file

@ -1,33 +0,0 @@
{stdenv, fetchurl}:
let
s = # Generated upstream information
rec {
baseName="jq";
version="1.5";
name="${baseName}-${version}";
url=https://github.com/stedolan/jq/releases/download/jq-1.5/jq-1.5.tar.gz;
sha256="0g29kyz4ykasdcrb0zmbrp2jqs9kv1wz9swx849i2d1ncknbzln4";
};
buildInputs = [
];
in
stdenv.mkDerivation {
inherit (s) name version;
inherit buildInputs;
src = fetchurl {
inherit (s) url sha256;
};
# jq is linked to libjq:
configureFlags = [
"LDFLAGS=-Wl,-rpath,\\\${libdir}"
];
meta = {
inherit (s) version;
description = ''A lightweight and flexible command-line JSON processor'';
license = stdenv.lib.licenses.mit ;
maintainers = [stdenv.lib.maintainers.raskin];
platforms = stdenv.lib.platforms.linux ++ stdenv.lib.platforms.darwin;
};
}

View file

@ -2,9 +2,18 @@
# your system. Help is available in the configuration.nix(5) man page # your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help). # and in the NixOS manual (accessible by running nixos-help).
{ config, pkgs, ... }: { config, pkgs, lib, ... }:
let
{ byid = dev: "/dev/disk/by-id/" + dev;
keyFile = "/dev/disk/by-id/usb-Verbatim_STORE_N_GO_070B3CEE0B223954-0:0";
rootDisk = byid "ata-INTEL_SSDSA2M080G2GC_CVPO003402PB080BGN";
homePartition = byid "ata-INTEL_SSDSA2M080G2GC_CVPO003402PB080BGN-part3";
cryptDisk0 = byid "ata-ST2000DM001-1CH164_Z240XTT6";
cryptDisk1 = byid "ata-TP02000GB_TPW151006050068";
cryptDisk2 = byid "ata-WDC_WD20EARS-00MVWB0_WD-WCAZA5548487";
# all physical disks
allDisks = [ rootDisk cryptDisk0 cryptDisk1 cryptDisk2 ];
in {
imports = imports =
[ [
# TODO: unlock home partition via ssh # TODO: unlock home partition via ssh
@ -16,35 +25,33 @@
../2configs/mail-client.nix ../2configs/mail-client.nix
]; ];
krebs.build.host = config.krebs.hosts.omo; krebs.build.host = config.krebs.hosts.omo;
services.smartd.devices = [ services.smartd.devices = builtins.map (x: { device = x; }) allDisks;
{ device = "/dev/sda"; }
{ device = "/dev/sdb"; }
{ device = "/dev/sdc"; }
{ device = "/dev/sdd"; }
{ device = "/dev/sde"; }
];
# AMD E350 # AMD E350
fileSystems."/home" = { fileSystems."/home" = {
device = "/dev/mapper/home"; device = "/dev/mapper/home";
fsType = "ext4"; fsType = "ext4";
}; };
powerManagement.powerUpCommands = '' powerManagement.powerUpCommands = lib.concatStrings (map (disk: ''
for i in a b c d e f g h i;do ${pkgs.hdparm}/sbin/hdparm -S 100 ${disk}
${pkgs.hdparm}/sbin/hdparm -S 100 /dev/sd$i ${pkgs.hdparm}/sbin/hdparm -B 127 ${disk}
${pkgs.hdparm}/sbin/hdparm -B 127 /dev/sd$i ${pkgs.hdparm}/sbin/hdparm -y ${disk}
${pkgs.hdparm}/sbin/hdparm -y /dev/sd$i '') allDisks);
'';
boot = { boot = {
initrd.luks = { initrd.luks = {
devices = [ devices = let
{ name = "home"; usbkey = name: device: {
device = "/dev/disk/by-uuid/85bff22e-dcbb-4246-b030-faf6c1782995"; inherit name device keyFile;
keyFileSize = 4096; keyFileSize = 4096;
keyFile = "/dev/disk/by-id/usb-Verbatim_STORE_N_GO_070B3CEE0B223954-0:0"; } };
in [
(usbkey "home" homePartition)
(usbkey "crypt0" cryptDisk0)
(usbkey "crypt1" cryptDisk1)
(usbkey "crypt2" cryptDisk2)
]; ];
}; };
loader.grub.device = "/dev/disk/by-id/ata-INTEL_SSDSA2M080G2GC_CVPO003402PB080BGN"; loader.grub.device = rootDisk;
initrd.availableKernelModules = [ initrd.availableKernelModules = [
"ahci" "ahci"