From 28ea7e3745540c432b03d387ad2193a134a1eed4 Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 10 Feb 2016 15:34:41 +0100 Subject: [PATCH 1/9] ma 1 vbob: deployable again --- makefu/1systems/vbob.nix | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/makefu/1systems/vbob.nix b/makefu/1systems/vbob.nix index f4a22d720..b1e5ef8b5 100644 --- a/makefu/1systems/vbob.nix +++ b/makefu/1systems/vbob.nix @@ -18,8 +18,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"; }; @@ -39,7 +39,6 @@ buildbot buildbot-slave get - genid logstash ]; From a649befbfafaff80d1d1a10896bfc4343021797b Mon Sep 17 00:00:00 2001 From: makefu Date: Thu, 11 Feb 2016 11:04:19 +0100 Subject: [PATCH 2/9] k 3 fetchWallpaper: scrap predicate, use unitConfig --- krebs/3modules/fetchWallpaper.nix | 23 ++++++++++++----------- makefu/2configs/fetchWallpaper.nix | 15 +++------------ 2 files changed, 15 insertions(+), 23 deletions(-) diff --git a/krebs/3modules/fetchWallpaper.nix b/krebs/3modules/fetchWallpaper.nix index f320c7505..225f00803 100644 --- a/krebs/3modules/fetchWallpaper.nix +++ b/krebs/3modules/fetchWallpaper.nix @@ -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 diff --git a/makefu/2configs/fetchWallpaper.nix b/makefu/2configs/fetchWallpaper.nix index b071a128d..786df6d40 100644 --- a/makefu/2configs/fetchWallpaper.nix +++ b/makefu/2configs/fetchWallpaper.nix @@ -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"; }; + } From 908837089ce22e83eae2df6518ad499090d0e1ae Mon Sep 17 00:00:00 2001 From: makefu Date: Thu, 11 Feb 2016 17:05:00 +0100 Subject: [PATCH 3/9] ma 1 wbob: cleanup, add awesomerc todo --- makefu/1systems/wbob.nix | 65 ++++++++++++++++++++++++++++++++-------- 1 file changed, 53 insertions(+), 12 deletions(-) diff --git a/makefu/1systems/wbob.nix b/makefu/1systems/wbob.nix index d6916f006..8917e4339 100644 --- a/makefu/1systems/wbob.nix +++ b/makefu/1systems/wbob.nix @@ -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") + } From ab52655e941f49be7f2b479bac264c030dda061d Mon Sep 17 00:00:00 2001 From: makefu Date: Thu, 11 Feb 2016 17:06:50 +0100 Subject: [PATCH 4/9] ma: refactoring --- makefu/1systems/pornocauster.nix | 25 ++----------------------- makefu/2configs/base-gui.nix | 2 ++ makefu/2configs/hw/tp-x220.nix | 14 ++++++++++---- makefu/2configs/hw/tp-x2x0.nix | 16 ++++++++-------- makefu/2configs/main-laptop.nix | 5 ++++- makefu/2configs/printer.nix | 4 ++++ makefu/3modules/umts.nix | 9 +-------- 7 files changed, 31 insertions(+), 44 deletions(-) diff --git a/makefu/1systems/pornocauster.nix b/makefu/1systems/pornocauster.nix index d7fa8edc5..d8ccc5846 100644 --- a/makefu/1systems/pornocauster.nix +++ b/makefu/1systems/pornocauster.nix @@ -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 ]; diff --git a/makefu/2configs/base-gui.nix b/makefu/2configs/base-gui.nix index 1d6750284..da3ad4afe 100644 --- a/makefu/2configs/base-gui.nix +++ b/makefu/2configs/base-gui.nix @@ -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 = '' diff --git a/makefu/2configs/hw/tp-x220.nix b/makefu/2configs/hw/tp-x220.nix index f03922150..0c90e6fde 100644 --- a/makefu/2configs/hw/tp-x220.nix +++ b/makefu/2configs/hw/tp-x220.nix @@ -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" ''; } diff --git a/makefu/2configs/hw/tp-x2x0.nix b/makefu/2configs/hw/tp-x2x0.nix index ebc72a06e..1033f69c0 100644 --- a/makefu/2configs/hw/tp-x2x0.nix +++ b/makefu/2configs/hw/tp-x2x0.nix @@ -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 ''; } diff --git a/makefu/2configs/main-laptop.nix b/makefu/2configs/main-laptop.nix index b725f661d..32f194e6b 100644 --- a/makefu/2configs/main-laptop.nix +++ b/makefu/2configs/main-laptop.nix @@ -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 = { diff --git a/makefu/2configs/printer.nix b/makefu/2configs/printer.nix index 35ad54bd9..d288748f9 100644 --- a/makefu/2configs/printer.nix +++ b/makefu/2configs/printer.nix @@ -7,4 +7,8 @@ pkgs.samsungUnifiedLinuxDriver ]; }; + + # scanners are printers just in reverse anyway + hardware.sane.enable = true; + hardware.sane.extraBackends = [ pkgs.samsungUnifiedLinuxDriver ]; } diff --git a/makefu/3modules/umts.nix b/makefu/3modules/umts.nix index d7be45f62..1bf3ba0b5 100644 --- a/makefu/3modules/umts.nix +++ b/makefu/3modules/umts.nix @@ -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"; }; }; From 3f85a043e9c1a9cf2c24f8838e436719cd61ff44 Mon Sep 17 00:00:00 2001 From: makefu Date: Thu, 11 Feb 2016 17:27:53 +0100 Subject: [PATCH 5/9] ma 2 default: bump to newest unstable --- makefu/2configs/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/makefu/2configs/default.nix b/makefu/2configs/default.nix index 2b4e31119..5acc7f0a5 100644 --- a/makefu/2configs/default.nix +++ b/makefu/2configs/default.nix @@ -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 From cb9ff724b6420c9ef54ec0b620710c3632ce5be7 Mon Sep 17 00:00:00 2001 From: makefu Date: Thu, 11 Feb 2016 21:03:30 +0100 Subject: [PATCH 6/9] s 2 buildbot: poll stockholm-mirror --- shared/2configs/shared-buildbot.nix | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/shared/2configs/shared-buildbot.nix b/shared/2configs/shared-buildbot.nix index 50b279036..af877f5d8 100644 --- a/shared/2configs/shared-buildbot.nix +++ b/shared/2configs/shared-buildbot.nix @@ -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; \ From 8ecdb889dd3081ba29c6ea7eb35f60b30420d201 Mon Sep 17 00:00:00 2001 From: makefu Date: Thu, 11 Feb 2016 21:23:04 +0100 Subject: [PATCH 7/9] k 5 repo-sync: init --- krebs/5pkgs/repo-sync/default.nix | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 krebs/5pkgs/repo-sync/default.nix diff --git a/krebs/5pkgs/repo-sync/default.nix b/krebs/5pkgs/repo-sync/default.nix new file mode 100644 index 000000000..90f838de9 --- /dev/null +++ b/krebs/5pkgs/repo-sync/default.nix @@ -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; + }; +} From 5e8b9fd3d7f06751efca31cf76c5c62a0630e89a Mon Sep 17 00:00:00 2001 From: makefu Date: Thu, 11 Feb 2016 23:23:50 +0100 Subject: [PATCH 8/9] k 3 tinc_graphs: use new tinc-hosts --- krebs/3modules/tinc_graphs.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/krebs/3modules/tinc_graphs.nix b/krebs/3modules/tinc_graphs.nix index 1f32c2e59..dc0484a8b 100644 --- a/krebs/3modules/tinc_graphs.nix +++ b/krebs/3modules/tinc_graphs.nix @@ -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; From e8a0058f8cd654247eb0b08326dd34c3ac9cff6a Mon Sep 17 00:00:00 2001 From: makefu Date: Thu, 11 Feb 2016 23:38:12 +0100 Subject: [PATCH 9/9] s 2 base: bump revision --- shared/2configs/base.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared/2configs/base.nix b/shared/2configs/base.nix index dd698ba97..715397ed5 100644 --- a/shared/2configs/base.nix +++ b/shared/2configs/base.nix @@ -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";