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 = {
enable = mkEnableOption "fetch wallpaper";
predicate = mkOption {
type = with types; nullOr path;
default = null;
};
url = mkOption {
type = types.str;
};
@ -33,16 +29,20 @@ let
type = types.str;
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" ''
#! ${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}
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
@ -76,7 +76,6 @@ let
URL = cfg.url;
DISPLAY = cfg.display;
};
restartIfChanged = true;
serviceConfig = {
@ -84,6 +83,8 @@ let
ExecStart = fetchWallpaperScript;
User = "fetchWallpaper";
};
unitConfig = cfg.unitConfig;
};
};
in out

View File

@ -85,7 +85,7 @@ let
EXTERNAL_FOLDER = external_dir;
INTERNAL_FOLDER = internal_dir;
GEODB = cfg.geodbPath;
TINC_HOSTPATH=config.krebs.retiolum.hosts;
TINC_HOSTPATH = config.krebs.retiolum.hostsPackage;
};
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/mail-client.nix
../2configs/printer.nix
#../2configs/virtualization.nix
../2configs/virtualization.nix
../2configs/virtualization-virtualbox.nix
../2configs/wwan.nix
@ -35,33 +34,13 @@
# ../2configs/mediawiki.nix
#../2configs/wordpress.nix
];
hardware.sane.enable = true;
hardware.sane.extraBackends = [ pkgs.samsungUnifiedLinuxDriver ];
nixpkgs.config.packageOverrides = pkgs: {
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
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"'';
networking.firewall.enable = false;
networking.firewall.enable = true;
networking.firewall.allowedTCPPorts = [
25
];

View File

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

View File

@ -4,16 +4,57 @@
[ # Include the results of the hardware scan.
../2configs/main-laptop.nix
];
krebs = {
enable = true;
retiolum.enable = true;
build.host = config.krebs.hosts.wbob;
};
boot.loader.grub.device = "/dev/sda";
boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "usbhid" "usb_storage" ];
boot.kernelModules = [ "kvm-intel" ];
fileSystems."/" = {
device = "/dev/sda1";
fsType = "ext4";
};
krebs = {
enable = true;
retiolum.enable = true;
build.host = config.krebs.hosts.wbob;
};
# rt2870.bin wifi card, part of linux-unfree
hardware.enableAllFirmware = true;
nixpkgs.config.allowUnfree = true;
networking.wireless.enable = true;
# 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;
desktopManager.xterm.enable = false;
};
# lid switch is handled via button presses
services.logind.extraConfig = mkDefault "HandleLidSwitch=ignore";
nixpkgs.config.packageOverrides = pkgs: rec {
awesome = pkgs.stdenv.lib.overrideDerivation pkgs.awesome (oldAttrs : {
postFixup = ''

View File

@ -23,7 +23,7 @@ with lib;
source = mapAttrs (_: mkDefault) {
upstream-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}/";
stockholm = "/home/makefu/stockholm";
@ -87,6 +87,7 @@ with lib;
environment.systemPackages = with pkgs; [
jq
git
get
gnumake
rxvt_unicode.terminfo
htop

View File

@ -1,24 +1,15 @@
{ 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 = {
enable = true;
display = ":0";
predicate = weaksauce-internet;
unitConfig.ConditionPathExists = "!/var/run/ppp0.pid";
timerConfig = {
OnCalendar = "*:0/30";
};
url = "http://echelon/wallpaper.png";
};
}

View File

@ -16,10 +16,16 @@ with lib;
};
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 Button" 8 2
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" 8 1
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-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;
speed = 220;
emulateWheel = true;
};
};
services.tlp.enable = true;
services.tlp.extraConfig = ''
START_CHARGE_THRESH_BAT0=80
START_CHARGE_THRESH_BAT0=80
CPU_SCALING_GOVERNOR_ON_AC=performance
CPU_SCALING_GOVERNOR_ON_BAT=ondemand
CPU_MIN_PERF_ON_AC=0
CPU_MAX_PERF_ON_AC=100
CPU_MIN_PERF_ON_BAT=0
CPU_MAX_PERF_ON_BAT=30
CPU_SCALING_GOVERNOR_ON_AC=performance
CPU_SCALING_GOVERNOR_ON_BAT=ondemand
CPU_MIN_PERF_ON_AC=0
CPU_MAX_PERF_ON_AC=100
CPU_MIN_PERF_ON_BAT=0
CPU_MAX_PERF_ON_BAT=30
'';
}

View File

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

View File

@ -7,4 +7,8 @@
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;
systemd.targets.network-umts = {
description = "System is running on UMTS";
unitConfig.StopWhenUnneeded = true;
};
systemd.services.umts = {
description = "UMTS wvdial Service";
before = [ "network-umts.target" ];
serviceConfig = {
Type = "simple";
Restart = "always";
RestartSec = "4s";
RestartSec = "10s";
ExecStart = "${pkgs.wvdial}/bin/wvdial -n";
};
};

View File

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

View File

@ -12,10 +12,10 @@
testslave = "krebspass";
};
change_source.stockholm = ''
stockholm_repo = 'http://cgit.gum/stockholm'
stockholm_repo = 'http://cgit.wolf/stockholm-mirror'
cs.append(changes.GitPoller(
stockholm_repo,
workdir='stockholm-poller', branch='master',
workdir='stockholm-poller', branches=True,
project='stockholm',
pollinterval=120))
'';
@ -28,7 +28,9 @@
fast-tests-scheduler = ''
# test the master real quick
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
name="fast-master-test",
builderNames=["fast-tests"]))
@ -52,7 +54,6 @@
};
builder_pre = ''
# prepare grab_repo step for stockholm
stockholm_repo = "http://cgit.gum.retiolum/stockholm"
grab_repo = steps.Git(repourl=stockholm_repo, mode='incremental')
env = {"LOGNAME": "shared", "NIX_REMOTE": "daemon"}
@ -78,8 +79,11 @@
f.addStep(grab_repo)
for i in [ "test-centos7", "wolf", "test-failing" ]:
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,
command=nixshell + \
["touch retiolum.rsa_key.priv; \