Merge remote-tracking branch 'gum/master'

This commit is contained in:
tv 2016-02-11 23:59:07 +01:00
commit 2b6a54c31c
16 changed files with 133 additions and 90 deletions

View File

@ -12,10 +12,6 @@ let
api = { api = {
enable = mkEnableOption "fetch wallpaper"; enable = mkEnableOption "fetch wallpaper";
predicate = mkOption {
type = with types; nullOr path;
default = null;
};
url = mkOption { url = mkOption {
type = types.str; type = types.str;
}; };
@ -33,16 +29,20 @@ let
type = types.str; type = types.str;
default = ":11"; default = ":11";
}; };
unitConfig = mkOption {
type = types.attrsOf types.str;
description = "Extra unit configuration for fetchWallpaper to define conditions and assertions for the unit";
example = literalExample ''
# do not start when running on umts
{ ConditionPathExists = "!/var/run/ppp0.pid"; }
'';
default = {};
};
}; };
fetchWallpaperScript = pkgs.writeScript "fetchWallpaper" '' fetchWallpaperScript = pkgs.writeScript "fetchWallpaper" ''
#! ${pkgs.bash}/bin/bash #! ${pkgs.bash}/bin/bash
${optionalString (cfg.predicate != null) ''
if ! ${cfg.predicate}; then
echo "predicate failed - will not fetch from remote"
exit 0
fi
''}
mkdir -p ${shell.escape cfg.stateDir} mkdir -p ${shell.escape cfg.stateDir}
curl -s -o ${shell.escape cfg.stateDir}/wallpaper -z ${shell.escape cfg.stateDir}/wallpaper ${shell.escape cfg.url} curl -s -o ${shell.escape cfg.stateDir}/wallpaper -z ${shell.escape cfg.stateDir}/wallpaper ${shell.escape cfg.url}
feh --no-fehbg --bg-scale ${shell.escape cfg.stateDir}/wallpaper feh --no-fehbg --bg-scale ${shell.escape cfg.stateDir}/wallpaper
@ -76,7 +76,6 @@ let
URL = cfg.url; URL = cfg.url;
DISPLAY = cfg.display; DISPLAY = cfg.display;
}; };
restartIfChanged = true; restartIfChanged = true;
serviceConfig = { serviceConfig = {
@ -84,6 +83,8 @@ let
ExecStart = fetchWallpaperScript; ExecStart = fetchWallpaperScript;
User = "fetchWallpaper"; User = "fetchWallpaper";
}; };
unitConfig = cfg.unitConfig;
}; };
}; };
in out in out

View File

@ -85,7 +85,7 @@ let
EXTERNAL_FOLDER = external_dir; EXTERNAL_FOLDER = external_dir;
INTERNAL_FOLDER = internal_dir; INTERNAL_FOLDER = internal_dir;
GEODB = cfg.geodbPath; GEODB = cfg.geodbPath;
TINC_HOSTPATH=config.krebs.retiolum.hosts; TINC_HOSTPATH = config.krebs.retiolum.hostsPackage;
}; };
restartIfChanged = true; restartIfChanged = true;

View File

@ -0,0 +1,19 @@
{ lib, pkgs, python3Packages, fetchurl, ... }:
with python3Packages; buildPythonPackage rec {
name = "repo-sync-${version}";
version = "0.1.1";
disabled = isPy26 || isPy27;
propagatedBuildInputs = [
docopt
GitPython
];
src = fetchurl {
url = "https://pypi.python.org/packages/source/r/repo-sync/repo-sync-${version}.tar.gz";
sha256 = "01r30l2bbsld90ps13ip0zi2a41b53dv4q6fxrzvkfrprr64c0vv";
};
meta = {
homepage = http://github.com/makefu/repo-sync;
description = "Sync remotes to other remotes.";
license = lib.licenses.mit;
};
}

View File

@ -18,7 +18,6 @@
../2configs/exim-retiolum.nix ../2configs/exim-retiolum.nix
../2configs/mail-client.nix ../2configs/mail-client.nix
../2configs/printer.nix ../2configs/printer.nix
#../2configs/virtualization.nix
../2configs/virtualization.nix ../2configs/virtualization.nix
../2configs/virtualization-virtualbox.nix ../2configs/virtualization-virtualbox.nix
../2configs/wwan.nix ../2configs/wwan.nix
@ -35,33 +34,13 @@
# ../2configs/mediawiki.nix # ../2configs/mediawiki.nix
#../2configs/wordpress.nix #../2configs/wordpress.nix
]; ];
hardware.sane.enable = true;
hardware.sane.extraBackends = [ pkgs.samsungUnifiedLinuxDriver ];
nixpkgs.config.packageOverrides = pkgs: { nixpkgs.config.packageOverrides = pkgs: {
tinc = pkgs.tinc_pre; tinc = pkgs.tinc_pre;
}; };
krebs.Reaktor = {
enable = false;
nickname = "makefu|r";
plugins = with pkgs.ReaktorPlugins; [ nixos-version random-emoji ];
};
# nix.binaryCaches = [ "http://acng.shack/nixos" "https://cache.nixos.org" ];
environment.systemPackages = with pkgs;[
get
virtmanager
gnome3.dconf
krebspaste
];
services.logind.extraConfig = "HandleLidSwitch=ignore";
# configure pulseAudio to provide a HDMI sink as well # configure pulseAudio to provide a HDMI sink as well
hardware.pulseaudio.configFile = pkgs.writeText "pulse-default-pa" '' networking.firewall.enable = true;
${builtins.readFile "${config.hardware.pulseaudio.package}/etc/pulse/default.pa"}
load-module module-alsa-sink device=hw:0,3 sink_properties=device.description="HDMIOutput" sink_name="HDMI"'';
networking.firewall.enable = false;
networking.firewall.allowedTCPPorts = [ networking.firewall.allowedTCPPorts = [
25 25
]; ];

View File

@ -17,8 +17,8 @@
tinc = pkgs.tinc_pre; tinc = pkgs.tinc_pre;
}; };
krebs.build.source.nixpkgs = { krebs.build.source.upstream-nixpkgs = {
# url = https://github.com/nixos/nixpkgs; url = https://github.com/makefu/nixpkgs;
# HTTP Everywhere + libredir # HTTP Everywhere + libredir
rev = "8239ac6"; rev = "8239ac6";
}; };
@ -38,7 +38,6 @@
buildbot buildbot
buildbot-slave buildbot-slave
get get
genid
logstash logstash
]; ];

View File

@ -4,16 +4,57 @@
[ # Include the results of the hardware scan. [ # Include the results of the hardware scan.
../2configs/main-laptop.nix ../2configs/main-laptop.nix
]; ];
krebs = { krebs = {
enable = true; enable = true;
retiolum.enable = true; retiolum.enable = true;
build.host = config.krebs.hosts.wbob; build.host = config.krebs.hosts.wbob;
}; };
boot.loader.grub.device = "/dev/sda";
boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "usbhid" "usb_storage" ]; # rt2870.bin wifi card, part of linux-unfree
boot.kernelModules = [ "kvm-intel" ]; hardware.enableAllFirmware = true;
fileSystems."/" = { nixpkgs.config.allowUnfree = true;
device = "/dev/sda1"; networking.wireless.enable = true;
fsType = "ext4"; # rt2870 with nonfree creates wlp2s0 from wlp0s20u2
}; # not explicitly setting the interface results in wpa_supplicant to crash
networking.wireless.interfaces = [ "wlp2s0" ];
# nuc hardware
boot.loader.grub.device = "/dev/sda";
hardware.cpu.intel.updateMicrocode = true;
boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ];
boot.kernelModules = [ "kvm-intel" ];
fileSystems."/" = {
device = "/dev/sda1";
fsType = "ext4";
};
# DualHead on NUC
services.xserver = {
# xrandrHeads = [ "HDMI1" "HDMI2" ];
# prevent screen from turning off, disable dpms
displayManager.sessionCommands = ''
xset s off -dpms
xrandr --output HDMI2 --right-of HDMI1
'';
};
## TODO Awesomecfg + autostart chrome
#
#local current_screen = 1
#awful.rules.rules = {
# { rule = { class = "chromium-browser" },
# callback = function()
# awful.client.movetotag(tags[current_screen][1],c)
# if (current_screen == 1) then
# current_screen = current_screen+1
# else
# current_screen = current_screen-1
# end
# end
# },
#}
#awful.util.spawn_with_shell("chromium --new-window --kiosk http://wolf:3000/dashboard/db/soc-critical-values")
# prevent Race Condition
#awful.util.spawn_with_shell("sleep 0.5;chromium --new-window --kiosk http://wolf:3000/dashboard/db/aralast")
} }

View File

@ -44,6 +44,8 @@ in
displayManager.auto.user = mainUser; displayManager.auto.user = mainUser;
desktopManager.xterm.enable = false; desktopManager.xterm.enable = false;
}; };
# lid switch is handled via button presses
services.logind.extraConfig = mkDefault "HandleLidSwitch=ignore";
nixpkgs.config.packageOverrides = pkgs: rec { nixpkgs.config.packageOverrides = pkgs: rec {
awesome = pkgs.stdenv.lib.overrideDerivation pkgs.awesome (oldAttrs : { awesome = pkgs.stdenv.lib.overrideDerivation pkgs.awesome (oldAttrs : {
postFixup = '' postFixup = ''

View File

@ -23,7 +23,7 @@ with lib;
source = mapAttrs (_: mkDefault) { source = mapAttrs (_: mkDefault) {
upstream-nixpkgs = { upstream-nixpkgs = {
url = https://github.com/nixos/nixpkgs; url = https://github.com/nixos/nixpkgs;
rev = "93d8671e2c6d1d25f126ed30e5e6f16764330119"; # unstable @ 2015-01-03, tested on filepimp rev = "77f8f35d57618c1ba456d968524f2fb2c3448295"; # unstable @ 2015-01-27, tested on wry
}; };
secrets = "/home/makefu/secrets/${config.krebs.build.host.name}/"; secrets = "/home/makefu/secrets/${config.krebs.build.host.name}/";
stockholm = "/home/makefu/stockholm"; stockholm = "/home/makefu/stockholm";
@ -87,6 +87,7 @@ with lib;
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
jq jq
git git
get
gnumake gnumake
rxvt_unicode.terminfo rxvt_unicode.terminfo
htop htop

View File

@ -1,24 +1,15 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
let {
# check if laptop runs on umts
weaksauce-internet = with pkgs;writeScript "weaksauce-internet" ''
#! /bin/sh
if ${iproute}/bin/ip addr show dev ppp0 2>/dev/null \
| ${gnugrep}/bin/grep -q inet;then
exit 1
fi
'';
in {
krebs.fetchWallpaper = { krebs.fetchWallpaper = {
enable = true; enable = true;
display = ":0"; display = ":0";
predicate = weaksauce-internet; unitConfig.ConditionPathExists = "!/var/run/ppp0.pid";
timerConfig = { timerConfig = {
OnCalendar = "*:0/30"; OnCalendar = "*:0/30";
}; };
url = "http://echelon/wallpaper.png"; url = "http://echelon/wallpaper.png";
}; };
} }

View File

@ -16,10 +16,16 @@ with lib;
}; };
services.xserver.displayManager.sessionCommands ='' services.xserver.displayManager.sessionCommands =''
xinput set-int-prop "TPPS/2 IBM TrackPoint" "Evdev Wheel Emulation" 8 1 xinput set-int-prop "TPPS/2 IBM TrackPoint" "Evdev Wheel Emulation" 8 1
xinput set-int-prop "TPPS/2 IBM TrackPoint" "Evdev Wheel Emulation Button" 8 2 xinput set-int-prop "TPPS/2 IBM TrackPoint" "Evdev Wheel Emulation Button" 8 2
xinput set-prop "TPPS/2 IBM TrackPoint" "Evdev Wheel Emulation Axes" 6 7 4 5 xinput set-prop "TPPS/2 IBM TrackPoint" "Evdev Wheel Emulation Axes" 6 7 4 5
# xinput set-int-prop "TPPS/2 IBM TrackPoint" "Evdev Wheel Emulation Timeout" 8 200 # xinput set-int-prop "TPPS/2 IBM TrackPoint" "Evdev Wheel Emulation Timeout" 8 200
'';
# enable HDMI output switching with pulseaudio
hardware.pulseaudio.configFile = pkgs.writeText "pulse-default-pa" ''
${builtins.readFile "${config.hardware.pulseaudio.package}/etc/pulse/default.pa"}
load-module module-alsa-sink device=hw:0,3 sink_properties=device.description="HDMIOutput" sink_name="HDMI"
''; '';
} }

View File

@ -18,18 +18,18 @@ with lib;
sensitivity = 220; sensitivity = 220;
speed = 220; speed = 220;
emulateWheel = true; emulateWheel = true;
}; };
services.tlp.enable = true; services.tlp.enable = true;
services.tlp.extraConfig = '' services.tlp.extraConfig = ''
START_CHARGE_THRESH_BAT0=80 START_CHARGE_THRESH_BAT0=80
CPU_SCALING_GOVERNOR_ON_AC=performance CPU_SCALING_GOVERNOR_ON_AC=performance
CPU_SCALING_GOVERNOR_ON_BAT=ondemand CPU_SCALING_GOVERNOR_ON_BAT=ondemand
CPU_MIN_PERF_ON_AC=0 CPU_MIN_PERF_ON_AC=0
CPU_MAX_PERF_ON_AC=100 CPU_MAX_PERF_ON_AC=100
CPU_MIN_PERF_ON_BAT=0 CPU_MIN_PERF_ON_BAT=0
CPU_MAX_PERF_ON_BAT=30 CPU_MAX_PERF_ON_BAT=30
''; '';
} }

View File

@ -3,6 +3,7 @@
# stuff for the main laptop # stuff for the main laptop
# this is pretty much nice-to-have and does # this is pretty much nice-to-have and does
# not fit into base-gui # not fit into base-gui
# TODO split generic desktop stuff and laptop-specifics like lidswitching
with lib; with lib;
{ {
@ -17,8 +18,10 @@ with lib;
chromium chromium
keepassx keepassx
ntfs3g ntfs3g
at_spi2_core
gnome3.dconf
virtmanager virtmanager
at_spi2_core # dep for virtmanager? krebspaste
]; ];
services.redshift = { services.redshift = {

View File

@ -7,4 +7,8 @@
pkgs.samsungUnifiedLinuxDriver pkgs.samsungUnifiedLinuxDriver
]; ];
}; };
# scanners are printers just in reverse anyway
hardware.sane.enable = true;
hardware.sane.extraBackends = [ pkgs.samsungUnifiedLinuxDriver ];
} }

View File

@ -56,19 +56,12 @@ let
environment.wvdial.dialerDefaults = wvdial-defaults; environment.wvdial.dialerDefaults = wvdial-defaults;
systemd.targets.network-umts = {
description = "System is running on UMTS";
unitConfig.StopWhenUnneeded = true;
};
systemd.services.umts = { systemd.services.umts = {
description = "UMTS wvdial Service"; description = "UMTS wvdial Service";
before = [ "network-umts.target" ];
serviceConfig = { serviceConfig = {
Type = "simple"; Type = "simple";
Restart = "always"; Restart = "always";
RestartSec = "4s"; RestartSec = "10s";
ExecStart = "${pkgs.wvdial}/bin/wvdial -n"; ExecStart = "${pkgs.wvdial}/bin/wvdial -n";
}; };
}; };

View File

@ -18,7 +18,7 @@ with lib;
krebs.build.source = { krebs.build.source = {
upstream-nixpkgs = mkDefault { upstream-nixpkgs = mkDefault {
url = https://github.com/NixOS/nixpkgs; url = https://github.com/NixOS/nixpkgs;
rev = "d0e3cca"; rev = "77f8f35d57618c1ba456d968524f2fb2c3448295"; # for urlwatch-minidb
}; };
secrets = mkDefault "${getEnv "HOME"}/secrets/krebs/${config.krebs.build.host.name}"; secrets = mkDefault "${getEnv "HOME"}/secrets/krebs/${config.krebs.build.host.name}";
stockholm = mkDefault "${getEnv "HOME"}/stockholm"; stockholm = mkDefault "${getEnv "HOME"}/stockholm";

View File

@ -12,10 +12,10 @@
testslave = "krebspass"; testslave = "krebspass";
}; };
change_source.stockholm = '' change_source.stockholm = ''
stockholm_repo = 'http://cgit.gum/stockholm' stockholm_repo = 'http://cgit.wolf/stockholm-mirror'
cs.append(changes.GitPoller( cs.append(changes.GitPoller(
stockholm_repo, stockholm_repo,
workdir='stockholm-poller', branch='master', workdir='stockholm-poller', branches=True,
project='stockholm', project='stockholm',
pollinterval=120)) pollinterval=120))
''; '';
@ -28,7 +28,9 @@
fast-tests-scheduler = '' fast-tests-scheduler = ''
# test the master real quick # test the master real quick
sched.append(schedulers.SingleBranchScheduler( sched.append(schedulers.SingleBranchScheduler(
change_filter=util.ChangeFilter(branch="master"), ## all branches
change_filter=util.ChangeFilter(branch_re=".*"),
# change_filter=util.ChangeFilter(branch="master"),
treeStableTimer=10, #only test the latest push treeStableTimer=10, #only test the latest push
name="fast-master-test", name="fast-master-test",
builderNames=["fast-tests"])) builderNames=["fast-tests"]))
@ -52,7 +54,6 @@
}; };
builder_pre = '' builder_pre = ''
# prepare grab_repo step for stockholm # prepare grab_repo step for stockholm
stockholm_repo = "http://cgit.gum.retiolum/stockholm"
grab_repo = steps.Git(repourl=stockholm_repo, mode='incremental') grab_repo = steps.Git(repourl=stockholm_repo, mode='incremental')
env = {"LOGNAME": "shared", "NIX_REMOTE": "daemon"} env = {"LOGNAME": "shared", "NIX_REMOTE": "daemon"}
@ -78,8 +79,11 @@
f.addStep(grab_repo) f.addStep(grab_repo)
for i in [ "test-centos7", "wolf", "test-failing" ]: for i in [ "test-centos7", "wolf", "test-failing" ]:
addShell(f,name="populate-{}".format(i),env=env, addShell(f,name="populate-{}".format(i),env=env,
command=nixshell + ["set -o pipefail;{}( nix-instantiate --arg configuration shared/1systems/{}.nix --eval --readonly-mode --show-trace -A config.krebs.build.populate --strict | jq -r .)".format("!" if "failing" in i else "",i)]) command=nixshell + \
["{}( make system={} eval.config.krebs.build.populate \
| jq -er .)".format("!" if "failing" in i else "",i)])
# XXX we must prepare ./retiolum.rsa_key.priv for secrets to work
addShell(f,name="instantiate-test-all-modules",env=env, addShell(f,name="instantiate-test-all-modules",env=env,
command=nixshell + \ command=nixshell + \
["touch retiolum.rsa_key.priv; \ ["touch retiolum.rsa_key.priv; \