From 00c9e4278b948fef73d32e572fa9d81e3518173c Mon Sep 17 00:00:00 2001 From: makefu Date: Sat, 16 Apr 2016 20:56:21 +0200 Subject: ma 1 vbob: remove proxies --- makefu/1systems/vbob.nix | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'makefu') diff --git a/makefu/1systems/vbob.nix b/makefu/1systems/vbob.nix index 5e2382f37..ce866cc4b 100644 --- a/makefu/1systems/vbob.nix +++ b/makefu/1systems/vbob.nix @@ -1,6 +1,3 @@ -# -# -# { lib, config, pkgs, ... }: { krebs.build.host = config.krebs.hosts.vbob; @@ -42,18 +39,17 @@ krebs.retiolum = { enable = true; - extraConfig = "Proxy = http global.proxy.alcatel-lucent.com 8000"; + #extraConfig = "Proxy = http global.proxy.alcatel-lucent.com 8000"; connectTo = [ "gum" ]; }; - networking.proxy.default = "http://global.proxy.alcatel-lucent.com:8000"; + #networking.proxy.default = "http://global.proxy.alcatel-lucent.com:8000"; fileSystems."/media/share" = { fsType = "vboxsf"; device = "share"; - options = "rw,uid=9001,gid=9001"; + options = [ "rw" "uid=9001" "gid=9001" ]; }; } - -- cgit v1.2.3 From bdce2137e713944e77b3e35f758c757a43a99d3e Mon Sep 17 00:00:00 2001 From: makefu Date: Sun, 17 Apr 2016 02:03:15 +0200 Subject: ma awesome: refactor into module --- makefu/1systems/vbob.nix | 1 + makefu/2configs/base-gui.nix | 10 +--------- makefu/3modules/awesome-extra.nix | 40 +++++++++++++++++++++++++++++++++++++++ makefu/3modules/default.nix | 1 + makefu/5pkgs/awesomecfg/full.cfg | 10 ++++------ 5 files changed, 47 insertions(+), 15 deletions(-) create mode 100644 makefu/3modules/awesome-extra.nix (limited to 'makefu') diff --git a/makefu/1systems/vbob.nix b/makefu/1systems/vbob.nix index ce866cc4b..36ae88d22 100644 --- a/makefu/1systems/vbob.nix +++ b/makefu/1systems/vbob.nix @@ -1,6 +1,7 @@ { lib, config, pkgs, ... }: { krebs.build.host = config.krebs.hosts.vbob; + makefu.awesome.modkey = "Mod1"; imports = [ # Include the results of the hardware scan. ../. diff --git a/makefu/2configs/base-gui.nix b/makefu/2configs/base-gui.nix index b807957ba..f7d6991c5 100644 --- a/makefu/2configs/base-gui.nix +++ b/makefu/2configs/base-gui.nix @@ -14,7 +14,6 @@ with config.krebs.lib; let mainUser = config.krebs.build.user.name; - awesomecfg = pkgs.awesomecfg.full; in { imports = [ ]; @@ -36,14 +35,7 @@ in }; # 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 = '' - cp ${awesomecfg} $out/etc/xdg/awesome/rc.lua - ''; - }); - }; - + makefu.awesome.enable = true; i18n.consoleFont = "Lat2-Terminus16"; fonts = { diff --git a/makefu/3modules/awesome-extra.nix b/makefu/3modules/awesome-extra.nix new file mode 100644 index 000000000..b12556486 --- /dev/null +++ b/makefu/3modules/awesome-extra.nix @@ -0,0 +1,40 @@ +{config, lib, pkgs, ... }: + +with config.krebs.lib; +let + cfg = config.makefu.awesome; + out = { + options.makefu.awesome = api; + config = lib.mkIf cfg.enable imp; + }; + api = { + enable = mkEnableOption "awesome custom config"; + modkey = mkOption { + type = types.str; + description = "Modkey to be used"; + default = "Mod4"; + }; + baseConfig = mkOption { + type = types.path; + description = '' + rc.lua file to be used as default + This module will use substituteAll to replace strings before writing to + /etc/xdg/awesome/rc.lua + ''; + default = pkgs.awesomecfg.full; + }; + }; + imp = { + # TODO: configure display manager as well + nixpkgs.config.packageOverrides = pkgs: rec { + awesome = pkgs.stdenv.lib.overrideDerivation pkgs.awesome (oldAttrs : { + postFixup = let + rclua = pkgs.substituteAll { + src = cfg.baseConfig; + inherit (cfg) modkey; + }; + in "cp ${rclua} $out/etc/xdg/awesome/rc.lua"; + }); + }; + }; +in out diff --git a/makefu/3modules/default.nix b/makefu/3modules/default.nix index 0a10b1532..853bdca04 100644 --- a/makefu/3modules/default.nix +++ b/makefu/3modules/default.nix @@ -5,6 +5,7 @@ _: ./snapraid.nix ./umts.nix ./taskserver.nix + ./awesome-extra.nix ]; } diff --git a/makefu/5pkgs/awesomecfg/full.cfg b/makefu/5pkgs/awesomecfg/full.cfg index c1b58aa90..f42aea003 100644 --- a/makefu/5pkgs/awesomecfg/full.cfg +++ b/makefu/5pkgs/awesomecfg/full.cfg @@ -83,13 +83,11 @@ vicious.register(batwidget, vicious.widgets.bat, "$2%", 61, "BAT0") -- {{{ Variable definitions -- Themes define colours, icons, and wallpapers -- beautiful.init("/usr/share/awesome/themes/default/theme.lua") --- ./qbx8r72yzaxpz41zq00902zwajl31b5h-awesome-3.5.6/share/awesome/lib/beautiful.lua --- --- Find the default theme --- --- beautiful.init("/nix/store/qbx8r72yzaxpz41zq00902zwajl31b5h-awesome-3.5.6/share/awesome/themes/default/theme.lua") +-- @awesome@/share/awesome/lib/beautiful.lua +-- beautiful.init("@awesome@/share/awesome/themes/default/theme.lua") +-- Find the default theme function find_default_theme() -- find the default lua theme in the package path for path in package.path:gmatch('([^;]+);') do @@ -115,7 +113,7 @@ browser = "firefox" -- If you do not like this or do not have such a key, -- I suggest you to remap Mod4 to another key using xmodmap or other tools. -- However, you can use another modifier like Mod1, but it may interact with others. -modkey = "Mod4" +modkey = "@modkey@" -- Table of layouts to cover with awful.layout.inc, order matters. local layouts = -- cgit v1.2.3 From df8b7fffb1d8f117e364129619e35dc61d6f565c Mon Sep 17 00:00:00 2001 From: makefu Date: Sun, 17 Apr 2016 21:19:44 +0200 Subject: ma 2 omo-share: add usenet-rw --- makefu/2configs/omo-share.nix | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'makefu') diff --git a/makefu/2configs/omo-share.nix b/makefu/2configs/omo-share.nix index 3a4dd456f..b8f0d8c86 100644 --- a/makefu/2configs/omo-share.nix +++ b/makefu/2configs/omo-share.nix @@ -61,6 +61,13 @@ in { browseable = "yes"; "guest ok" = "yes"; }; + usenet-rw = { + path = "/media/crypt0/usenet"; + "read only" = "no"; + browseable = "yes"; + "guest ok" = "no"; + "valid users" = "makefu"; + }; }; extraConfig = '' guest account = smbguest -- cgit v1.2.3 From c606288fbd405cd76b20479957bdf84cc93d71e2 Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 2 May 2016 16:00:39 +0200 Subject: ma 5 devpi: init --- makefu/5pkgs/default.nix | 1 + makefu/5pkgs/devpi/default.nix | 70 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 71 insertions(+) create mode 100644 makefu/5pkgs/devpi/default.nix (limited to 'makefu') diff --git a/makefu/5pkgs/default.nix b/makefu/5pkgs/default.nix index 8caab433e..d09d4a6e8 100644 --- a/makefu/5pkgs/default.nix +++ b/makefu/5pkgs/default.nix @@ -12,5 +12,6 @@ in nodemcu-uploader = callPackage ./nodemcu-uploader {}; mycube-flask = callPackage ./mycube-flask {}; tw-upload-plugin = callPackage ./tw-upload-plugin {}; + inherit (callPackage ./devpi {}) devpi-web devpi-server; }; } diff --git a/makefu/5pkgs/devpi/default.nix b/makefu/5pkgs/devpi/default.nix new file mode 100644 index 000000000..0df8ecd2c --- /dev/null +++ b/makefu/5pkgs/devpi/default.nix @@ -0,0 +1,70 @@ +{ pkgs ? import {} }: +with pkgs.stdenv.lib; +let + execnet14 = pkgs.python3Packages.buildPythonPackage rec { + name = "execnet-1.4.1"; + + src = pkgs.fetchurl { + url = "https://pypi.python.org/packages/source/e/execnet/${name}.tar.gz"; + sha256 = "1rpk1vyclhg911p3hql0m0nrpq7q7mysxnaaw6vs29cpa6kx8vgn"; + }; + + propagatedBuildInputs = with pkgs.python3Packages; + [ setuptools_scm apipkg ]; + meta = { + description = "rapid multi-Python deployment"; + license = licenses.gpl2; + }; + }; + + devpi-web = pkgs.python3Packages.buildPythonPackage rec { + name = "devpi-web"; + version = "3.0.0"; + + src = pkgs.fetchurl { + url = "https://pypi.python.org/packages/source/d/devpi-web/devpi-web-${version}.tar.gz"; + sha256 = "156abxyhj17a8cg38hpyr31qkjb61mb2kggsxij4p4xvy9jwkbwi"; + }; + + propagatedBuildInputs = with pkgs.python3Packages; + [ devpi-server pyramid_chameleon beautifulsoup4 Whoosh defusedxml ]; + + meta = { + homepage = https://bitbucket.org/hpk42/devpi; + description = "a web view for devpi-server"; + license = licenses.mit; + maintainers = with maintainers; [ makefu ]; + }; + }; + devpi-server = pkgs.python3Packages.buildPythonPackage rec { + name = "devpi-server"; + version = "3.0.2"; + + # original postFixup adds "import sys; sys.argv[0] = 'devpi-server'" to + # `.devpi-server-wrapped` which + # results in "not existing devpi-server: 'devpi-server'" + postFixup = ""; + + src = pkgs.fetchurl { + url = "https://pypi.python.org/packages/source/d/devpi-server/devpi-server-${version}.tar.gz"; + sha256 = "14r1024i3x2pb72khyzvi56sh9smpdswmrbc88xvjxnalmzfn99d"; + }; + + propagatedBuildInputs = with pkgs.python3Packages; + [ devpi-common execnet14 itsdangerous pluggy waitress pyramid ]; + buildInputs = with pkgs.python3Packages; [ pytest beautifulsoup4 webtest ]; + + meta = { + homepage = https://bitbucket.org/hpk42/devpi; + description = "Devpi Server"; + license = licenses.mit; + maintainers = with maintainers; [ makefu ]; + }; + }; + +in { + inherit devpi-server; + devpi-web = pkgs.python3.buildEnv.override { + extraLibs = [ devpi-web devpi-server ]; + }; +} -- cgit v1.2.3 From 3f77b6c89f4a3a28d62e9117712481489ac56fa1 Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 2 May 2016 16:02:15 +0200 Subject: ma 1 vbob: cleanup --- makefu/1systems/vbob.nix | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) (limited to 'makefu') diff --git a/makefu/1systems/vbob.nix b/makefu/1systems/vbob.nix index 748b08ef1..1fccbc1e1 100644 --- a/makefu/1systems/vbob.nix +++ b/makefu/1systems/vbob.nix @@ -15,15 +15,14 @@ ]; nixpkgs.config.allowUnfree = true; - krebs.build.source.upstream-nixpkgs = { - url = https://github.com/makefu/nixpkgs; - # HTTP Everywhere + libredir - rev = "8239ac6"; - }; fileSystems."/nix" = { device ="/dev/disk/by-label/nixstore"; fsType = "ext4"; }; + fileSystems."/var/lib/docker" = { + device ="/dev/disk/by-label/nix-docker"; + fsType = "ext4"; + }; #makefu.buildbot.master.enable = true; # allow vbob to deploy self users.extraUsers = { @@ -33,11 +32,14 @@ }; environment.systemPackages = with pkgs;[ fortclientsslvpn - buildbot - buildbot-slave get logstash + docker + devpi-web + devpi-client ]; + # virtualisation.docker.enable = true; + networking.firewall.allowedTCPPorts = [ 25 @@ -47,17 +49,21 @@ krebs.retiolum = { enable = true; - extraConfig = "Proxy = http global.proxy.alcatel-lucent.com 8000"; connectTo = [ + "omo" "gum" ]; }; - networking.proxy.default = "http://global.proxy.alcatel-lucent.com:8000"; + networking.extraHosts = '' + 172.17.20.190 gitlab + 172.17.62.27 svbittool01 tool + ''; + fileSystems."/media/share" = { fsType = "vboxsf"; device = "share"; - options = "rw,uid=9001,gid=9001"; + options = [ "rw" "uid=9001" "gid=9001" ]; }; } -- cgit v1.2.3 From 73e6fbc4c0479d684ffc40fc0add42cf0c4794ae Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 2 May 2016 17:37:14 +0200 Subject: ma 2 tp-x220: enable rngd --- makefu/2configs/hw/tp-x220.nix | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'makefu') diff --git a/makefu/2configs/hw/tp-x220.nix b/makefu/2configs/hw/tp-x220.nix index 0a471bde0..be3d1eb70 100644 --- a/makefu/2configs/hw/tp-x220.nix +++ b/makefu/2configs/hw/tp-x220.nix @@ -4,8 +4,10 @@ with config.krebs.lib; { imports = [ ./tp-x2x0.nix ]; - - boot.kernelModules = [ "kvm-intel" ]; + boot = { + kernelModules = [ "kvm-intel" "acpi_call" ]; + extraModulePackages = [ config.boot.kernelPackages.tp_smapi ]; + }; services.xserver = { videoDriver = "intel"; @@ -15,6 +17,8 @@ with config.krebs.lib; ''; }; + security.rngd.enable = true; + 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 -- cgit v1.2.3 From 5fdede9c672ebe4a8be845034a132bddcf09e92c Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 2 May 2016 17:37:48 +0200 Subject: ma 2 omo-share: export emu-rw --- makefu/2configs/omo-share.nix | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'makefu') diff --git a/makefu/2configs/omo-share.nix b/makefu/2configs/omo-share.nix index b8f0d8c86..5f6e6adae 100644 --- a/makefu/2configs/omo-share.nix +++ b/makefu/2configs/omo-share.nix @@ -13,6 +13,16 @@ in { omo-share = { listen = [ "${local-ip}:80" ]; locations = singleton (nameValuePair "/" '' + + access_log off; + # sendfile off; + # tcp_nopush on; + # aio on; + sendfile on; + sendfile_max_chunk 512k; + directio 512; + aio threads; + mp4; autoindex on; root /media; limit_rate_after 100m; @@ -24,7 +34,6 @@ in { keepalive_timeout 65; keepalive_requests 200; reset_timedout_connection on; - sendfile on; tcp_nopush on; gzip off; ''); @@ -48,7 +57,6 @@ in { browseable = "yes"; "guest ok" = "yes"; }; - emu = { path = "/media/crypt1/emu"; "read only" = "yes"; @@ -68,6 +76,13 @@ in { "guest ok" = "no"; "valid users" = "makefu"; }; + emu-rw = { + path = "/media/crypt1/emu"; + "read only" = "no"; + browseable = "yes"; + "guest ok" = "no"; + "valid users" = "makefu"; + }; }; extraConfig = '' guest account = smbguest -- cgit v1.2.3 From 2bb038c8115739c1ce4309b50c24e95f036fe4ff Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 2 May 2016 17:38:27 +0200 Subject: ma 2 default: auto-optimise-store --- makefu/2configs/default.nix | 3 +++ 1 file changed, 3 insertions(+) (limited to 'makefu') diff --git a/makefu/2configs/default.nix b/makefu/2configs/default.nix index 20faf7896..afdeec40e 100644 --- a/makefu/2configs/default.nix +++ b/makefu/2configs/default.nix @@ -138,6 +138,9 @@ with config.krebs.lib; "time.apple.com" "time.nist.gov" ]; + nix.extraOptions = '' + auto-optimise-store = true + ''; security.setuidPrograms = [ "sendmail" ]; services.journald.extraConfig = '' -- cgit v1.2.3