From 8a185125754aa89890eb1746c748138a6eb7c2ab Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 16 Aug 2017 13:56:27 +0200 Subject: [PATCH 01/67] gitlab-ci: init --- .gitlab-ci.yml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 000000000..e6ee187cb --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,4 @@ +nix-shell test: + script: + - nix-shell --pure --command 'true' -p stdenv && echo success + - nix-shell --pure --command 'false' -p stdenv || echo success From d608f17c4c87db745878160bbe22d4c8a806ac2a Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 16 Aug 2017 15:09:38 +0200 Subject: [PATCH 02/67] gitlab-runner-shackspace: init --- krebs/1systems/hotdog/config.nix | 1 + krebs/2configs/gitlab-runner-shackspace.nix | 33 +++++++++++++++++++ .../secrets/shackspace-gitlab-ci-token.nix | 1 + 3 files changed, 35 insertions(+) create mode 100644 krebs/2configs/gitlab-runner-shackspace.nix create mode 100644 krebs/6tests/data/secrets/shackspace-gitlab-ci-token.nix diff --git a/krebs/1systems/hotdog/config.nix b/krebs/1systems/hotdog/config.nix index 4807307ff..2ad22f49c 100644 --- a/krebs/1systems/hotdog/config.nix +++ b/krebs/1systems/hotdog/config.nix @@ -10,6 +10,7 @@ + ]; diff --git a/krebs/2configs/gitlab-runner-shackspace.nix b/krebs/2configs/gitlab-runner-shackspace.nix new file mode 100644 index 000000000..7794f1dd2 --- /dev/null +++ b/krebs/2configs/gitlab-runner-shackspace.nix @@ -0,0 +1,33 @@ +{ config, ... }: +let + url = "https://git.shackspace.de/"; + # generate token from CI-token via: + ## gitlab-runner register + ## cat /etc/gitlab-runner/config.toml + token = import ; +in { + systemd.services.gitlab-runner.path = [ + "/run/wrappers" # /run/wrappers/bin/su + "/" # /bin/sh + ]; + virtualisation.docker.enable = true; + services.gitlab-runner = { + enable = true; + # configFile, configOptions and gracefulTimeout not yet in stable + # gracefulTimeout = "120min"; + configText = '' + concurrent = 1 + check_interval = 0 + + [[runners]] + name = "krebs-shell" + url = "${url}" + token = "${token}" + executor = "shell" + shell = "sh" + environment = ["PATH=/bin:/run/wrappers/bin:/etc/per-user/gitlab-runner/bin:/etc/per-user-pkgs/gitlab-runner/bin:/nix/var/nix/profiles/default/bin:/run/current-system/sw/bin"] + [runners.cache] + + ''; + }; +} diff --git a/krebs/6tests/data/secrets/shackspace-gitlab-ci-token.nix b/krebs/6tests/data/secrets/shackspace-gitlab-ci-token.nix new file mode 100644 index 000000000..963e6db8b --- /dev/null +++ b/krebs/6tests/data/secrets/shackspace-gitlab-ci-token.nix @@ -0,0 +1 @@ +"lol" From dc6fd2531f30c5850a9b8a44bcce0a5f2ef67ea4 Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 16 Aug 2017 15:10:06 +0200 Subject: [PATCH 03/67] gitlab-ci: test env --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e6ee187cb..3f2f28d65 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,4 +1,5 @@ nix-shell test: script: + - env - nix-shell --pure --command 'true' -p stdenv && echo success - nix-shell --pure --command 'false' -p stdenv || echo success From 1623c03f12ce175d934e5b2b0d9577e1eeaf1abe Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 16 Aug 2017 15:20:37 +0200 Subject: [PATCH 04/67] gitlab-runner: use PrivateTmp to avoid clash with buildbot --- krebs/2configs/gitlab-runner-shackspace.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/krebs/2configs/gitlab-runner-shackspace.nix b/krebs/2configs/gitlab-runner-shackspace.nix index 7794f1dd2..d9b4cd589 100644 --- a/krebs/2configs/gitlab-runner-shackspace.nix +++ b/krebs/2configs/gitlab-runner-shackspace.nix @@ -10,6 +10,7 @@ in { "/run/wrappers" # /run/wrappers/bin/su "/" # /bin/sh ]; + systemd.services.gitlab-runner.serviceConfig.PrivateTmp = true; virtualisation.docker.enable = true; services.gitlab-runner = { enable = true; From 589b5fa8bde55032779541020a4b4dd520d01db8 Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 21 Aug 2017 21:01:55 +0200 Subject: [PATCH 05/67] ma git: add euer_blog --- makefu/2configs/git/cgit-retiolum.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/makefu/2configs/git/cgit-retiolum.nix b/makefu/2configs/git/cgit-retiolum.nix index b89bfadfd..30c0b0b87 100644 --- a/makefu/2configs/git/cgit-retiolum.nix +++ b/makefu/2configs/git/cgit-retiolum.nix @@ -22,6 +22,7 @@ let cgit.desc = "Build new Stockholm hosts"; }; cac-api = { }; + euer_blog = { }; ampel = { }; init-stockholm = { cgit.desc = "Init stuff for stockholm"; From 84646ba41595e3410fdd38b9d27312b33d4474f7 Mon Sep 17 00:00:00 2001 From: makefu Date: Tue, 22 Aug 2017 10:59:49 +0200 Subject: [PATCH 06/67] newsbot-js module: add package option this will be used for the wiki-irc-bot to override the patchPhase --- krebs/3modules/newsbot-js.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/krebs/3modules/newsbot-js.nix b/krebs/3modules/newsbot-js.nix index 2ff9a5ebb..dd3e5647a 100644 --- a/krebs/3modules/newsbot-js.nix +++ b/krebs/3modules/newsbot-js.nix @@ -13,6 +13,11 @@ let api = { enable = mkEnableOption "Enable krebs newsbot"; + package = mkOption { + type = types.package; + default = pkgs.newsbot-js; + description = "newsbot package to use"; + }; ircServer = mkOption { type = types.str; default = "echelon.retiolum"; @@ -79,7 +84,7 @@ let serviceConfig = { User = "newsbot-js"; Restart = "always"; - ExecStart = "${pkgs.newsbot-js}/bin/newsbot"; + ExecStart = "${cfg.package}/bin/newsbot"; }; }; }; From 7fa9cb75cbadd9e16c0616ee3ee16f731e647d19 Mon Sep 17 00:00:00 2001 From: makefu Date: Tue, 22 Aug 2017 11:20:25 +0200 Subject: [PATCH 07/67] pkgs.newsbot-js: enable patchPhase required for overriding the patchPhase --- krebs/5pkgs/simple/newsbot-js/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/krebs/5pkgs/simple/newsbot-js/default.nix b/krebs/5pkgs/simple/newsbot-js/default.nix index b52454ca4..fa39823d3 100644 --- a/krebs/5pkgs/simple/newsbot-js/default.nix +++ b/krebs/5pkgs/simple/newsbot-js/default.nix @@ -32,6 +32,7 @@ in np.buildNodePackage { phases = [ "unpackPhase" + "patchPhase" "installPhase" ]; From bbdbee4d2785c5e7a7ae99aba515556a856f4511 Mon Sep 17 00:00:00 2001 From: makefu Date: Tue, 22 Aug 2017 11:21:32 +0200 Subject: [PATCH 08/67] ma wiki-irc-bot: use newsbot-js instead of logstash --- .../deployment/wiki-irc-bot/default.nix | 74 ++++--------------- .../wiki-irc-bot/irc-out-notice.patch | 26 ------- .../deployment/wiki-irc-bot/wiki-output.patch | 45 +++++++++++ 3 files changed, 58 insertions(+), 87 deletions(-) delete mode 100644 makefu/2configs/deployment/wiki-irc-bot/irc-out-notice.patch create mode 100644 makefu/2configs/deployment/wiki-irc-bot/wiki-output.patch diff --git a/makefu/2configs/deployment/wiki-irc-bot/default.nix b/makefu/2configs/deployment/wiki-irc-bot/default.nix index 7ab31e698..12686efba 100644 --- a/makefu/2configs/deployment/wiki-irc-bot/default.nix +++ b/makefu/2configs/deployment/wiki-irc-bot/default.nix @@ -1,67 +1,19 @@ -{ pkgs, lib, ... }: +{ config, pkgs, ... }: -with lib; let - port = 18872; + pkg = pkgs.lib.overrideDerivation pkgs.newsbot-js (original: { + patches = [ ./wiki-output.patch ]; + }); + newsfile = pkgs.writeText "feeds" '' + nixoswiki-bot|https://nixos.wiki/api.php?days=7&limit=50&hidecategorization=1&action=feedrecentchanges&feedformat=rss|#krebs + ''; in { - nixpkgs.config.packageOverrides = pkgs: with pkgs; { - logstash = pkgs.stdenv.lib.overrideDerivation pkgs.logstash (old: { - patches = [ ./irc-out-notice.patch ]; }); - }; - services.logstash = { + krebs.newsbot-js = { enable = true; - inputConfig = '' - http { - port => ${toString port} - host => "127.0.0.1" - } - ''; - filterConfig = '' - if ([pages]) { - ruby { - code => ' - require "net/http" - require "net/https" - http = Net::HTTP.new("git.io", 443) - http.use_ssl = true - lines = [] - event["pages"].each {|p| - url = "#{p["html_url"]}/_compare/#{p["sha"]}" - short_url = begin - request = Net::HTTP::Post.new "/" - request.set_form_data ({"url" => url }) - response = http.request(request) - response["location"] - end - lines << "\"#{p["title"]}\" #{p["action"]} by #{event["sender"]["login"]} #{short_url}" - } - event["output"] = lines.join("\n") - ' - } - } - ''; - outputConfig = '' - file { path => "/tmp/logs.json" codec => "json_lines" } - if [output] { - irc { - channels => [ "#krebs", "#nixos" ] - host => "irc.freenode.net" - nick => "nixos-users-wiki" - format => "%{output}" - notice => true - } - } - ''; - plugins = [ ]; - }; - - services.nginx = { - enable = lib.mkDefault true; - virtualHosts."ghook.krebsco.de" = { - locations."/".proxyPass = "http://localhost:${toString port}/"; - enableSSL = true; - enableACME = true; - forceSSL = true; - }; + package = pkg; + ircServer = "chat.freenode.net"; + feeds = newsfile; + urlShortenerHost = "go"; + urlShortenerPort = "80"; }; } diff --git a/makefu/2configs/deployment/wiki-irc-bot/irc-out-notice.patch b/makefu/2configs/deployment/wiki-irc-bot/irc-out-notice.patch deleted file mode 100644 index 040643f81..000000000 --- a/makefu/2configs/deployment/wiki-irc-bot/irc-out-notice.patch +++ /dev/null @@ -1,26 +0,0 @@ -index b63339d..8c8c747 100644 ---- a/vendor/bundle/jruby/1.9/gems/logstash-output-irc-2.0.4/lib/logstash/outputs/irc.rb -+++ b/vendor/bundle/jruby/1.9/gems/logstash-output-irc-2.0.4/lib/logstash/outputs/irc.rb -@@ -48,6 +48,9 @@ class LogStash::Outputs::Irc < LogStash::Outputs::Base - # Static string after event - config :post_string, :validate => :string, :required => false - -+ # Set this to true to send messages as notice -+ config :notice, :validate => :boolean, :default => false -+ - public - - def inject_bot(bot) -@@ -90,9 +93,9 @@ class LogStash::Outputs::Irc < LogStash::Outputs::Base - - @bot.channels.each do |channel| - @logger.debug("Sending to...", :channel => channel, :text => text) -- channel.msg(pre_string) if !@pre_string.nil? -- channel.msg(text) -- channel.msg(post_string) if !@post_string.nil? -+ channel.send(pre_string, :notice => @notice) if !@pre_string.nil? -+ channel.send(text, :notice => @notice) -+ channel.send(post_string, :notice => @notice) if !@post_string.nil? - end # channels.each - end # def receive - end # class LogStash::Outputs::Irc diff --git a/makefu/2configs/deployment/wiki-irc-bot/wiki-output.patch b/makefu/2configs/deployment/wiki-irc-bot/wiki-output.patch new file mode 100644 index 000000000..6e1e27853 --- /dev/null +++ b/makefu/2configs/deployment/wiki-irc-bot/wiki-output.patch @@ -0,0 +1,45 @@ +diff --git a/newsbot.js b/newsbot.js +index 42d0666..a284011 100644 +--- a/newsbot.js ++++ b/newsbot.js +@@ -92,8 +92,9 @@ function create_feedbot (nick, uri, channels) { + } + + function broadcast_new_item (item) { ++ console.log('Broadcasting item ',item.link) + return getShortLink(item.link, function (error, shortlink) { +- return broadcast(item.title + ' ' + shortlink) ++ return broadcast('"'+ item.title + '" edited by ' + item.author + ' ' + shortlink) + }) + } + +@@ -152,15 +153,18 @@ function create_feedbot (nick, uri, channels) { + + if (client.lastItems) { + items.forEach(function (item) { +- if (!client.lastItems.hasOwnProperty(item.title)) { ++ ++ if (!client.lastItems.hasOwnProperty(item.guid)) { + broadcast_new_item(item) ++ }else { ++ console.log("Item already seen:",item.guid) + } + }) + } + + client.lastItems = {} + items.forEach(function (item) { +- client.lastItems[item.title] = true ++ client.lastItems[item.guid] = true + }) + + return continue_loop() +@@ -199,6 +203,8 @@ function run_command (methodname, params, callback) { + } + + function getShortLink (link, callback) { ++ callback(null,link) ++ return + var form = new FormData() + try { + form.append('uri', link) From d209ea74a53d90d664aa42a5536ffcf604ef9d79 Mon Sep 17 00:00:00 2001 From: makefu Date: Tue, 22 Aug 2017 11:40:10 +0200 Subject: [PATCH 09/67] ma vim: update listchars --- makefu/2configs/vim.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/makefu/2configs/vim.nix b/makefu/2configs/vim.nix index 524caf8f5..9f3a59717 100644 --- a/makefu/2configs/vim.nix +++ b/makefu/2configs/vim.nix @@ -22,7 +22,7 @@ in { set nocompatible syntax on set list - set listchars=tab:▸ + set listchars=tab:▸\ "set list listchars=tab:>-,trail:.,extends:> filetype off From 9a834c1b9749dddebabd317daa518267c6bf55d8 Mon Sep 17 00:00:00 2001 From: makefu Date: Tue, 22 Aug 2017 11:40:28 +0200 Subject: [PATCH 10/67] ma vpngate: add france --- makefu/2configs/vpn/vpngate.nix | 108 ++++++++++++++++++++++++++++++++ 1 file changed, 108 insertions(+) diff --git a/makefu/2configs/vpn/vpngate.nix b/makefu/2configs/vpn/vpngate.nix index bf3101b19..acf9e9cfe 100644 --- a/makefu/2configs/vpn/vpngate.nix +++ b/makefu/2configs/vpn/vpngate.nix @@ -1,5 +1,113 @@ { pkgs, ... }: { + services.openvpn.servers.vpngate-france = { + config = '' + dev tun + proto udp + remote coreeu1.opengw.net 1194 + cipher AES-128-CBC + auth SHA1 + resolv-retry infinite + nobind + persist-key + persist-tun + client + verb 3 + + + -----BEGIN CERTIFICATE----- + MIIF2DCCA8CgAwIBAgIQTKr5yttjb+Af907YWwOGnTANBgkqhkiG9w0BAQwFADCB + hTELMAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4G + A1UEBxMHU2FsZm9yZDEaMBgGA1UEChMRQ09NT0RPIENBIExpbWl0ZWQxKzApBgNV + BAMTIkNPTU9ETyBSU0EgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMTAwMTE5 + MDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCBhTELMAkGA1UEBhMCR0IxGzAZBgNVBAgT + EkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgGA1UEChMR + Q09NT0RPIENBIExpbWl0ZWQxKzApBgNVBAMTIkNPTU9ETyBSU0EgQ2VydGlmaWNh + dGlvbiBBdXRob3JpdHkwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCR + 6FSS0gpWsawNJN3Fz0RndJkrN6N9I3AAcbxT38T6KhKPS38QVr2fcHK3YX/JSw8X + pz3jsARh7v8Rl8f0hj4K+j5c+ZPmNHrZFGvnnLOFoIJ6dq9xkNfs/Q36nGz637CC + 9BR++b7Epi9Pf5l/tfxnQ3K9DADWietrLNPtj5gcFKt+5eNu/Nio5JIk2kNrYrhV + /erBvGy2i/MOjZrkm2xpmfh4SDBF1a3hDTxFYPwyllEnvGfDyi62a+pGx8cgoLEf + Zd5ICLqkTqnyg0Y3hOvozIFIQ2dOciqbXL1MGyiKXCJ7tKuY2e7gUYPDCUZObT6Z + +pUX2nwzV0E8jVHtC7ZcryxjGt9XyD+86V3Em69FmeKjWiS0uqlWPc9vqv9JWL7w + qP/0uK3pN/u6uPQLOvnoQ0IeidiEyxPx2bvhiWC4jChWrBQdnArncevPDt09qZah + SL0896+1DSJMwBGB7FY79tOi4lu3sgQiUpWAk2nojkxl8ZEDLXB0AuqLZxUpaVIC + u9ffUGpVRr+goyhhf3DQw6KqLCGqR84onAZFdr+CGCe01a60y1Dma/RMhnEw6abf + Fobg2P9A3fvQQoh/ozM6LlweQRGBY84YcWsr7KaKtzFcOmpH4MN5WdYgGq/yapiq + crxXStJLnbsQ/LBMQeXtHT1eKJ2czL+zUdqnR+WEUwIDAQABo0IwQDAdBgNVHQ4E + FgQUu69+Aj36pvE8hI6t7jiY7NkyMtQwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB + /wQFMAMBAf8wDQYJKoZIhvcNAQEMBQADggIBAArx1UaEt65Ru2yyTUEUAJNMnMvl + wFTPoCWOAvn9sKIN9SCYPBMtrFaisNZ+EZLpLrqeLppysb0ZRGxhNaKatBYSaVqM + 4dc+pBroLwP0rmEdEBsqpIt6xf4FpuHA1sj+nq6PK7o9mfjYcwlYRm6mnPTXJ9OV + 2jeDchzTc+CiR5kDOF3VSXkAKRzH7JsgHAckaVd4sjn8OoSgtZx8jb8uk2Intzna + FxiuvTwJaP+EmzzV1gsD41eeFPfR60/IvYcjt7ZJQ3mFXLrrkguhxuhoqEwWsRqZ + CuhTLJK7oQkYdQxlqHvLI7cawiiFwxv/0Cti76R7CZGYZ4wUAc1oBmpjIXUDgIiK + boHGhfKppC3n9KUkEEeDys30jXlYsQab5xoq2Z0B15R97QNKyvDb6KkBPvVWmcke + jkk9u+UJueBPSZI9FoJAzMxZxuY67RIuaTxslbH9qh17f4a+Hg4yRvv7E491f0yL + S0Zj/gA0QHDBw7mh3aZw4gSzQbzpgJHqZJx64SIDqZxubw5lT2yHh17zbqD5daWb + QOhTsiedSrnAdyGN/4fy3ryM7xfft0kL0fJuMAsaDk527RH89elWsn2/x20Kk4yl + 0MC2Hb46TpSi125sC8KKfPog88Tk5c0NqMuRkrF8hey1FGlmDoLnzc7ILaZRfyHB + NVOFBkpdn627G190 + -----END CERTIFICATE----- + + + + + + -----BEGIN CERTIFICATE----- + MIICxjCCAa4CAQAwDQYJKoZIhvcNAQEFBQAwKTEaMBgGA1UEAxMRVlBOR2F0ZUNs + aWVudENlcnQxCzAJBgNVBAYTAkpQMB4XDTEzMDIxMTAzNDk0OVoXDTM3MDExOTAz + MTQwN1owKTEaMBgGA1UEAxMRVlBOR2F0ZUNsaWVudENlcnQxCzAJBgNVBAYTAkpQ + MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5h2lgQQYUjwoKYJbzVZA + 5VcIGd5otPc/qZRMt0KItCFA0s9RwReNVa9fDRFLRBhcITOlv3FBcW3E8h1Us7RD + 4W8GmJe8zapJnLsD39OSMRCzZJnczW4OCH1PZRZWKqDtjlNca9AF8a65jTmlDxCQ + CjntLIWk5OLLVkFt9/tScc1GDtci55ofhaNAYMPiH7V8+1g66pGHXAoWK6AQVH67 + XCKJnGB5nlQ+HsMYPV/O49Ld91ZN/2tHkcaLLyNtywxVPRSsRh480jju0fcCsv6h + p/0yXnTB//mWutBGpdUlIbwiITbAmrsbYnjigRvnPqX1RNJUbi9Fp6C2c/HIFJGD + ywIDAQABMA0GCSqGSIb3DQEBBQUAA4IBAQChO5hgcw/4oWfoEFLu9kBa1B//kxH8 + hQkChVNn8BRC7Y0URQitPl3DKEed9URBDdg2KOAz77bb6ENPiliD+a38UJHIRMqe + UBHhllOHIzvDhHFbaovALBQceeBzdkQxsKQESKmQmR832950UCovoyRB61UyAV7h + +mZhYPGRKXKSJI6s0Egg/Cri+Cwk4bjJfrb5hVse11yh4D9MHhwSfCOH+0z4hPUT + Fku7dGavURO5SVxMn/sL6En5D+oSeXkadHpDs+Airym2YHh15h0+jPSOoR6yiVp/ + 6zZeZkrN43kuS73KpKDFjfFPh8t4r1gOIjttkNcQqBccusnplQ7HJpsk + -----END CERTIFICATE----- + + + + + -----BEGIN RSA PRIVATE KEY----- + MIIEpAIBAAKCAQEA5h2lgQQYUjwoKYJbzVZA5VcIGd5otPc/qZRMt0KItCFA0s9R + wReNVa9fDRFLRBhcITOlv3FBcW3E8h1Us7RD4W8GmJe8zapJnLsD39OSMRCzZJnc + zW4OCH1PZRZWKqDtjlNca9AF8a65jTmlDxCQCjntLIWk5OLLVkFt9/tScc1GDtci + 55ofhaNAYMPiH7V8+1g66pGHXAoWK6AQVH67XCKJnGB5nlQ+HsMYPV/O49Ld91ZN + /2tHkcaLLyNtywxVPRSsRh480jju0fcCsv6hp/0yXnTB//mWutBGpdUlIbwiITbA + mrsbYnjigRvnPqX1RNJUbi9Fp6C2c/HIFJGDywIDAQABAoIBAERV7X5AvxA8uRiK + k8SIpsD0dX1pJOMIwakUVyvc4EfN0DhKRNb4rYoSiEGTLyzLpyBc/A28Dlkm5eOY + fjzXfYkGtYi/Ftxkg3O9vcrMQ4+6i+uGHaIL2rL+s4MrfO8v1xv6+Wky33EEGCou + QiwVGRFQXnRoQ62NBCFbUNLhmXwdj1akZzLU4p5R4zA3QhdxwEIatVLt0+7owLQ3 + lP8sfXhppPOXjTqMD4QkYwzPAa8/zF7acn4kryrUP7Q6PAfd0zEVqNy9ZCZ9ffho + zXedFj486IFoc5gnTp2N6jsnVj4LCGIhlVHlYGozKKFqJcQVGsHCqq1oz2zjW6LS + oRYIHgECgYEA8zZrkCwNYSXJuODJ3m/hOLVxcxgJuwXoiErWd0E42vPanjjVMhnt + KY5l8qGMJ6FhK9LYx2qCrf/E0XtUAZ2wVq3ORTyGnsMWre9tLYs55X+ZN10Tc75z + 4hacbU0hqKN1HiDmsMRY3/2NaZHoy7MKnwJJBaG48l9CCTlVwMHocIECgYEA8jby + dGjxTH+6XHWNizb5SRbZxAnyEeJeRwTMh0gGzwGPpH/sZYGzyu0SySXWCnZh3Rgq + 5uLlNxtrXrljZlyi2nQdQgsq2YrWUs0+zgU+22uQsZpSAftmhVrtvet6MjVjbByY + DADciEVUdJYIXk+qnFUJyeroLIkTj7WYKZ6RjksCgYBoCFIwRDeg42oK89RFmnOr + LymNAq4+2oMhsWlVb4ejWIWeAk9nc+GXUfrXszRhS01mUnU5r5ygUvRcarV/T3U7 + TnMZ+I7Y4DgWRIDd51znhxIBtYV5j/C/t85HjqOkH+8b6RTkbchaX3mau7fpUfds + Fq0nhIq42fhEO8srfYYwgQKBgQCyhi1N/8taRwpk+3/IDEzQwjbfdzUkWWSDk9Xs + H/pkuRHWfTMP3flWqEYgW/LW40peW2HDq5imdV8+AgZxe/XMbaji9Lgwf1RY005n + KxaZQz7yqHupWlLGF68DPHxkZVVSagDnV/sztWX6SFsCqFVnxIXifXGC4cW5Nm9g + va8q4QKBgQCEhLVeUfdwKvkZ94g/GFz731Z2hrdVhgMZaU/u6t0V95+YezPNCQZB + wmE9Mmlbq1emDeROivjCfoGhR3kZXW1pTKlLh6ZMUQUOpptdXva8XxfoqQwa3enA + M7muBbF0XN7VO80iJPv+PmIZdEIAkpwKfi201YB+BafCIuGxIF50Vg== + -----END RSA PRIVATE KEY----- + + + ''; + autoStart = false; + updateResolvConf = false; + }; services.openvpn.servers.vpngate-japan = { config = '' dev tun From 915df1538dea848fe8fd3b034915f909f6a41eb6 Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 23 Aug 2017 14:37:06 +0200 Subject: [PATCH 11/67] ma default: remove nix-defexpr activation --- makefu/2configs/default.nix | 9 --------- 1 file changed, 9 deletions(-) diff --git a/makefu/2configs/default.nix b/makefu/2configs/default.nix index 547b73597..8fe2160c4 100644 --- a/makefu/2configs/default.nix +++ b/makefu/2configs/default.nix @@ -145,15 +145,6 @@ with import ; "net.ipv6.conf.default.use_tempaddr" = 2; }; - system.activationScripts.nix-defexpr = '' - (set -euf - for i in /home/makefu /root/;do - f="$i/.nix-defexpr" - rm -fr "$f" - ln -s /var/src/nixpkgs "$f" - done) - ''; - i18n = { consoleKeyMap = "us"; defaultLocale = "en_US.UTF-8"; From 294a62b35526036e795ba1172c90a703c7507714 Mon Sep 17 00:00:00 2001 From: makefu Date: Fri, 1 Sep 2017 10:42:43 +0200 Subject: [PATCH 12/67] ma tools/studio: init --- makefu/2configs/tools/studio.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 makefu/2configs/tools/studio.nix diff --git a/makefu/2configs/tools/studio.nix b/makefu/2configs/tools/studio.nix new file mode 100644 index 000000000..add021acd --- /dev/null +++ b/makefu/2configs/tools/studio.nix @@ -0,0 +1,10 @@ +{ pkgs, ... }: + +{ + users.users.makefu.packages = with pkgs; [ + obs-studio + studio-link + audacity + owncloudclient + ]; +} From 27a0aff4a2e5c924b8a288a0402c7d1141932596 Mon Sep 17 00:00:00 2001 From: makefu Date: Fri, 1 Sep 2017 10:45:52 +0200 Subject: [PATCH 13/67] ma pkgs.u3_tool: init at 0.3 --- makefu/5pkgs/u3_tool/default.nix | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 makefu/5pkgs/u3_tool/default.nix diff --git a/makefu/5pkgs/u3_tool/default.nix b/makefu/5pkgs/u3_tool/default.nix new file mode 100644 index 000000000..e8c5573a8 --- /dev/null +++ b/makefu/5pkgs/u3_tool/default.nix @@ -0,0 +1,22 @@ +{ stdenv, fetchurl }: + +stdenv.mkDerivation rec { + proj = "u3-tool"; + name = "${proj}-${version}"; + version = "0.3"; + + enableParallelBuilding = true; + + src = fetchurl { + url = "mirror://sourceforge/${proj}/${name}.tar.gz"; + sha256 = "1p9c9kibd1pdbdfa0nd0i3n7bvzi3xg0chm38jg3xfl8gsn0390f"; + }; + + meta = { + description = "Tool for controlling the special features of a 'U3 smart drive' USB Flash disk."; + homepage = https://sourceforge.net/projects/u3-tool/ ; + license = stdenv.lib.licenses.gpl2; + platforms = stdenv.lib.platforms.linux; + maintainers = with stdenv.lib.maintainers; [ makefu ]; + }; +} From 53aa798dd7339353706d51f2d5fc7faba860f1c8 Mon Sep 17 00:00:00 2001 From: makefu Date: Fri, 1 Sep 2017 21:40:17 +0200 Subject: [PATCH 14/67] ma omo: Rip Reaktor|krebs --- makefu/1systems/omo/config.nix | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/makefu/1systems/omo/config.nix b/makefu/1systems/omo/config.nix index 0df2ba6e6..4c93a7a3e 100644 --- a/makefu/1systems/omo/config.nix +++ b/makefu/1systems/omo/config.nix @@ -194,16 +194,6 @@ in { zramSwap.enable = true; - krebs.Reaktor.reaktor = { - nickname = "Reaktor|krebs"; - workdir = "/var/lib/Reaktor/krebs"; - channels = [ "#krebs" ]; - plugins = with pkgs.ReaktorPlugins;[ - stockholm-issue - nixos-version - sed-plugin - random-emoji ]; - }; krebs.Reaktor.reaktor-shack = { nickname = "Reaktor|shack"; workdir = "/var/lib/Reaktor/shack"; From 2892494730b30c93a836a9a80cd543c88e0c99e4 Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 4 Sep 2017 09:02:51 +0200 Subject: [PATCH 15/67] ma dnscrypt: prepare client/server --- makefu/2configs/{dnscrypt.nix => dnscrypt/client.nix} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename makefu/2configs/{dnscrypt.nix => dnscrypt/client.nix} (100%) diff --git a/makefu/2configs/dnscrypt.nix b/makefu/2configs/dnscrypt/client.nix similarity index 100% rename from makefu/2configs/dnscrypt.nix rename to makefu/2configs/dnscrypt/client.nix From 848acb85ccecbe25987bf6da45a96fc4eaaa74e9 Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 4 Sep 2017 09:03:09 +0200 Subject: [PATCH 16/67] ma source: bump to latest unstable --- makefu/source.nix | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/makefu/source.nix b/makefu/source.nix index 31243c2fd..a63427535 100644 --- a/makefu/source.nix +++ b/makefu/source.nix @@ -11,10 +11,8 @@ let then "buildbot" else "makefu"; _file = + "/makefu/1systems/${name}/source.nix"; - ref = "9d4bd6b"; # unstable @ 2017-07-31 + ref = "a035602"; # unstable @ 2017-09-04 # + graceful requests2 (a772c3aa) - # + libpurple bitlbee ( ce6fe1a, 65e38b7 ) - # + buildbot-runner ( f3cecc5 ) in evalSource (toString _file) [ From 50e450d06554457cbec6f43b21109dc25006297c Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 4 Sep 2017 10:11:07 +0200 Subject: [PATCH 17/67] ma dnscrypt: provide client and server config --- makefu/2configs/dnscrypt/client.nix | 18 +++++++++++++++--- makefu/2configs/dnscrypt/server.nix | 26 ++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 3 deletions(-) create mode 100644 makefu/2configs/dnscrypt/server.nix diff --git a/makefu/2configs/dnscrypt/client.nix b/makefu/2configs/dnscrypt/client.nix index 6e7ef0f82..988fb4a7d 100644 --- a/makefu/2configs/dnscrypt/client.nix +++ b/makefu/2configs/dnscrypt/client.nix @@ -1,6 +1,18 @@ -{ - services.dnscrypt-proxy.enable = true; - services.dnscrypt-proxy.resolverName = "cs-de"; +{ config, ... }: +let + customResolver = { + # TODO: put this somewhere else + address = config.krebs.hosts.gum.nets.internet.ip4.addr; + port = 15251; + name = "2.dnscrypt-cert.euer.krebsco.de"; + # dnscrypt-wrapper --show-provider-publickey --provider-publickey-file public.key + key = "1AFC:E58D:F242:0FBB:9EE9:4E51:47F4:5373:D9AE:C2AB:DD96:8448:333D:5D79:272C:A44C"; + }; +in { + services.dnscrypt-proxy = { + enable = true; + inherit customResolver; + }; networking.extraResolvconfConf = '' name_servers='127.0.0.1' ''; diff --git a/makefu/2configs/dnscrypt/server.nix b/makefu/2configs/dnscrypt/server.nix new file mode 100644 index 000000000..79305e727 --- /dev/null +++ b/makefu/2configs/dnscrypt/server.nix @@ -0,0 +1,26 @@ +{ config, ... }: +let + # TODO: dataDir is currently not provided by upstream + # data = config.services.dnscrypt-wrapper.dataDir; + data = "/var/lib/dnscrypt-wrapper"; + sec = toString ; + port = 15251; + user = "dnscrypt-wrapper"; +in { + services.dnscrypt-wrapper = { + enable = true; + address = "0.0.0.0"; + upstream.address = "8.8.8.8"; + providerName = "2.dnscrypt-cert.euer.krebsco.de"; + inherit port; + }; + networking.firewall.allowedUDPPorts = [ port ]; + systemd.services.prepare-dnscrypt-wrapper-keys = { + wantedBy = [ "dnscrypt-wrapper.service" ]; + before = [ "dnscrypt-wrapper.service" ]; + script = '' + install -m700 -o ${user} -v ${sec}/dnscrypt-public.key ${data}/public.key + install -m700 -o ${user} -v ${sec}/dnscrypt-secret.key ${data}/secret.key + ''; + }; +} From 82e12ed9914c45a45825228c9f14efe917dde5d7 Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 4 Sep 2017 10:11:32 +0200 Subject: [PATCH 18/67] ma gum: enable dnscrypt server --- makefu/1systems/gum/config.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/makefu/1systems/gum/config.nix b/makefu/1systems/gum/config.nix index 110edc130..934bfa685 100644 --- a/makefu/1systems/gum/config.nix +++ b/makefu/1systems/gum/config.nix @@ -43,6 +43,7 @@ in { + ## Web @@ -55,9 +56,7 @@ in { - - { services.taskserver.enable = true; services.taskserver.fqdn = config.krebs.build.host.name; From bb5446ecfff591874303cde18e5432d0a43688bf Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 4 Sep 2017 10:12:30 +0200 Subject: [PATCH 19/67] ma x: use new dnscrypt client --- makefu/1systems/x/config.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/makefu/1systems/x/config.nix b/makefu/1systems/x/config.nix index 8e8c8a736..d6a595c99 100644 --- a/makefu/1systems/x/config.nix +++ b/makefu/1systems/x/config.nix @@ -12,7 +12,7 @@ with import ; - + # Debugging From 8566c70dd0c9097ed5dbf7e8ae12292e9459157a Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 4 Sep 2017 10:12:51 +0200 Subject: [PATCH 20/67] ma x: enable tpm --- makefu/1systems/x/config.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/makefu/1systems/x/config.nix b/makefu/1systems/x/config.nix index d6a595c99..03ba1268e 100644 --- a/makefu/1systems/x/config.nix +++ b/makefu/1systems/x/config.nix @@ -33,6 +33,7 @@ with import ; # applications + @@ -54,6 +55,7 @@ with import ; # Services + # From 8caeb60777b230ccf0db1a00c9c225e63425a81c Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 4 Sep 2017 10:37:40 +0200 Subject: [PATCH 21/67] ma umts module: add missing module from stable --- makefu/3modules/default.nix | 1 + makefu/3modules/wvdial.nix | 70 +++++++++++++++++++++++++++++++++++++ 2 files changed, 71 insertions(+) create mode 100644 makefu/3modules/wvdial.nix diff --git a/makefu/3modules/default.nix b/makefu/3modules/default.nix index 00df56bee..af0e81df5 100644 --- a/makefu/3modules/default.nix +++ b/makefu/3modules/default.nix @@ -15,6 +15,7 @@ _: ./torrent.nix ./udpt.nix ./umts.nix + ./wvdial.nix ]; } diff --git a/makefu/3modules/wvdial.nix b/makefu/3modules/wvdial.nix new file mode 100644 index 000000000..982f4a7db --- /dev/null +++ b/makefu/3modules/wvdial.nix @@ -0,0 +1,70 @@ +{ config, lib, pkgs, ... }: +# from 17.03/nixos/modules/programs/wvdial.nix + +with lib; + +let + + configFile = '' + [Dialer Defaults] + PPPD PATH = ${pkgs.ppp}/sbin/pppd + ${config.environment.wvdial.dialerDefaults} + ''; + + cfg = config.environment.wvdial; + +in +{ + ###### interface + + options = { + + environment.wvdial = { + + dialerDefaults = mkOption { + default = ""; + type = types.str; + example = ''Init1 = AT+CGDCONT=1,"IP","internet.t-mobile"''; + description = '' + Contents of the "Dialer Defaults" section of + /etc/wvdial.conf. + ''; + }; + + pppDefaults = mkOption { + default = '' + noipdefault + usepeerdns + defaultroute + persist + noauth + ''; + type = types.str; + description = "Default ppp settings for wvdial."; + }; + + }; + + }; + + ###### implementation + + config = mkIf (cfg.dialerDefaults != "") { + + environment = { + + etc = + [ + { source = pkgs.writeText "wvdial.conf" configFile; + target = "wvdial.conf"; + } + { source = pkgs.writeText "wvdial" cfg.pppDefaults; + target = "ppp/peers/wvdial"; + } + ]; + + }; + + }; + +} From 5898caa146e216a1e5462dddb943abe07aea1b4d Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 4 Sep 2017 14:35:56 +0200 Subject: [PATCH 22/67] ma hw: add tpm to x2x0 --- makefu/1systems/x/config.nix | 2 +- makefu/2configs/hw/tp-x2x0.nix | 3 +++ makefu/2configs/hw/tpm.nix | 6 ++++++ 3 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 makefu/2configs/hw/tpm.nix diff --git a/makefu/1systems/x/config.nix b/makefu/1systems/x/config.nix index 03ba1268e..faa29f3db 100644 --- a/makefu/1systems/x/config.nix +++ b/makefu/1systems/x/config.nix @@ -20,6 +20,7 @@ with import ; # Testing # + # # # @@ -33,7 +34,6 @@ with import ; # applications - diff --git a/makefu/2configs/hw/tp-x2x0.nix b/makefu/2configs/hw/tp-x2x0.nix index 02bd8bb01..81c4bf4c8 100644 --- a/makefu/2configs/hw/tp-x2x0.nix +++ b/makefu/2configs/hw/tp-x2x0.nix @@ -2,6 +2,9 @@ with import ; { + imports = [ + ./tpm.nix + ]; networking.wireless.enable = lib.mkDefault true; hardware.enableAllFirmware = true; diff --git a/makefu/2configs/hw/tpm.nix b/makefu/2configs/hw/tpm.nix new file mode 100644 index 000000000..29e19e916 --- /dev/null +++ b/makefu/2configs/hw/tpm.nix @@ -0,0 +1,6 @@ +{ pkgs, ... }: +{ + services.tcsd.enable = true; + # see https://wiki.archlinux.org/index.php/Trusted_Platform_Module + environment.systemPackages = with pkgs; [ opencryptoki tpm-tools ]; +} From ccd81aee6533bc642c77f172eb71d711ccb88040 Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 4 Sep 2017 14:37:00 +0200 Subject: [PATCH 23/67] ma tools: add sec-gui --- makefu/2configs/tools/all.nix | 2 ++ makefu/2configs/tools/core-gui.nix | 1 - makefu/2configs/tools/sec-gui.nix | 8 ++++++++ makefu/2configs/tools/sec.nix | 1 + 4 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 makefu/2configs/tools/sec-gui.nix diff --git a/makefu/2configs/tools/all.nix b/makefu/2configs/tools/all.nix index 31c959d47..c7a116918 100644 --- a/makefu/2configs/tools/all.nix +++ b/makefu/2configs/tools/all.nix @@ -8,5 +8,7 @@ ./games.nix ./media.nix ./sec.nix + ./sec-gui.nix + ./studio.nix ]; } diff --git a/makefu/2configs/tools/core-gui.nix b/makefu/2configs/tools/core-gui.nix index f409b68a2..0538647ae 100644 --- a/makefu/2configs/tools/core-gui.nix +++ b/makefu/2configs/tools/core-gui.nix @@ -20,6 +20,5 @@ xdotool xorg.xbacklight scrot - wireshark ]; } diff --git a/makefu/2configs/tools/sec-gui.nix b/makefu/2configs/tools/sec-gui.nix new file mode 100644 index 000000000..2db3e4391 --- /dev/null +++ b/makefu/2configs/tools/sec-gui.nix @@ -0,0 +1,8 @@ +{ pkgs, ... }: + +{ + krebs.per-user.makefu.packages = with pkgs; [ + tpmmanager + wireshark + ]; +} diff --git a/makefu/2configs/tools/sec.nix b/makefu/2configs/tools/sec.nix index 5fb9a5fc8..817cd9ead 100644 --- a/makefu/2configs/tools/sec.nix +++ b/makefu/2configs/tools/sec.nix @@ -13,5 +13,6 @@ thc-hydra borgbackup ledger + u3_tool ]; } From 99419cbdd80a0411a46d122a6f8d36fcf1523acd Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 4 Sep 2017 14:41:02 +0200 Subject: [PATCH 24/67] ma configs: use buildCores with maxJobs --- makefu/2configs/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/makefu/2configs/default.nix b/makefu/2configs/default.nix index 8fe2160c4..25f9f63bf 100644 --- a/makefu/2configs/default.nix +++ b/makefu/2configs/default.nix @@ -39,10 +39,10 @@ with import ; }; networking.hostName = config.krebs.build.host.name; - nix.maxJobs = config.krebs.build.host.cores; + nix.maxJobs = 2; + nix.buildCores = config.krebs.build.host.cores; time.timeZone = "Europe/Berlin"; - #nix.maxJobs = 1; programs.ssh = { startAgent = false; From df0baa5aa566d0660d627468050e3e41cf7fd774 Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 4 Sep 2017 15:00:06 +0200 Subject: [PATCH 25/67] ma zsh-user: krebs.per-user -> users.users --- makefu/2configs/zsh-user.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/makefu/2configs/zsh-user.nix b/makefu/2configs/zsh-user.nix index 7615f4c0c..f280fc852 100644 --- a/makefu/2configs/zsh-user.nix +++ b/makefu/2configs/zsh-user.nix @@ -88,7 +88,7 @@ in ''; }; - krebs.per-user.${mainUser}.packages = [ + users.users.${mainUser}.packages = [ pkgs.nix-zsh-completions pkgs.fzf ]; From 07b4c792224d756654f180e159a54bdccded5a08 Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 4 Sep 2017 17:47:36 +0200 Subject: [PATCH 26/67] ma android-pentest: disable due to broken dependency --- makefu/2configs/tools/android-pentest.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/makefu/2configs/tools/android-pentest.nix b/makefu/2configs/tools/android-pentest.nix index da8a357ae..dec2b034b 100644 --- a/makefu/2configs/tools/android-pentest.nix +++ b/makefu/2configs/tools/android-pentest.nix @@ -5,7 +5,8 @@ mitmproxy nmap msf - drozer + ## broken due to protobuf + # drozer dex2jar apktool jd-gui From f2b8e1f5f1ca45205c49ad9d8a6ef4dd23885b00 Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 4 Sep 2017 17:48:12 +0200 Subject: [PATCH 27/67] ma gen-oath-safe: fix typo --- makefu/5pkgs/gen-oath-safe/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/makefu/5pkgs/gen-oath-safe/default.nix b/makefu/5pkgs/gen-oath-safe/default.nix index 245e65174..bad4b08a8 100644 --- a/makefu/5pkgs/gen-oath-safe/default.nix +++ b/makefu/5pkgs/gen-oath-safe/default.nix @@ -1,7 +1,7 @@ { coreutils, makeWrapper, openssl, libcaca, qrencode, fetchFromGitHub, yubikey-manager, python, stdenv, ... }: stdenv.mkDerivation { - name = "geno-oath-safe-2017-06-30"; + name = "gen-oath-safe-2017-06-30"; src = fetchFromGitHub { owner = "mcepl"; repo = "gen-oath-safe"; From a9d06f940196fa38145414a58860b171c4754751 Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 4 Sep 2017 17:08:59 +0200 Subject: [PATCH 28/67] ma gen-oath-safe: do not build with yubikey-manager --- makefu/5pkgs/gen-oath-safe/default.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/makefu/5pkgs/gen-oath-safe/default.nix b/makefu/5pkgs/gen-oath-safe/default.nix index bad4b08a8..344dc1a02 100644 --- a/makefu/5pkgs/gen-oath-safe/default.nix +++ b/makefu/5pkgs/gen-oath-safe/default.nix @@ -1,6 +1,7 @@ { coreutils, makeWrapper, openssl, libcaca, qrencode, fetchFromGitHub, yubikey-manager, python, stdenv, ... }: -stdenv.mkDerivation { +builtins.trace "Warning: HTOP mode of gen-oath-safe is currently broken" + stdenv.mkDerivation { name = "gen-oath-safe-2017-06-30"; src = fetchFromGitHub { owner = "mcepl"; @@ -23,7 +24,7 @@ stdenv.mkDerivation { coreutils openssl qrencode - yubikey-manager + #yubikey-manager libcaca python ]; From f094ccbdd08f1c3b2413678c530986f665a1440a Mon Sep 17 00:00:00 2001 From: makefu Date: Tue, 5 Sep 2017 00:01:10 +0200 Subject: [PATCH 29/67] ma drozer: re-enable with protbuf3_2 --- makefu/2configs/tools/android-pentest.nix | 3 +-- makefu/5pkgs/drozer/default.nix | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/makefu/2configs/tools/android-pentest.nix b/makefu/2configs/tools/android-pentest.nix index dec2b034b..da8a357ae 100644 --- a/makefu/2configs/tools/android-pentest.nix +++ b/makefu/2configs/tools/android-pentest.nix @@ -5,8 +5,7 @@ mitmproxy nmap msf - ## broken due to protobuf - # drozer + drozer dex2jar apktool jd-gui diff --git a/makefu/5pkgs/drozer/default.nix b/makefu/5pkgs/drozer/default.nix index c63f1d0d8..f91d5b984 100644 --- a/makefu/5pkgs/drozer/default.nix +++ b/makefu/5pkgs/drozer/default.nix @@ -5,9 +5,10 @@ pythonPackages.buildPythonApplication rec { version = "2.4.3"; buildInputs = [ jdk7 ]; propagatedBuildInputs = with pythonPackages; [ - protobuf + protobuf3_2 pyopenssl pyyaml + ] ++ [ jre7 twisted ]; From 492b373673927c18585ffe768f90222e080afd2e Mon Sep 17 00:00:00 2001 From: makefu Date: Tue, 5 Sep 2017 00:05:45 +0200 Subject: [PATCH 30/67] ma source: apply mitmproxy --- makefu/source.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/makefu/source.nix b/makefu/source.nix index a63427535..e1714161f 100644 --- a/makefu/source.nix +++ b/makefu/source.nix @@ -11,8 +11,9 @@ let then "buildbot" else "makefu"; _file = + "/makefu/1systems/${name}/source.nix"; - ref = "a035602"; # unstable @ 2017-09-04 + ref = "2c566ee"; # unstable @ 2017-09-04 # + graceful requests2 (a772c3aa) + # + mitmproxy fix (eee2d174) in evalSource (toString _file) [ From a46564bf986829cd7372020ed4962af15a5c5983 Mon Sep 17 00:00:00 2001 From: makefu Date: Tue, 5 Sep 2017 11:59:41 +0200 Subject: [PATCH 31/67] ma source: add tpm-fix --- makefu/source.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/makefu/source.nix b/makefu/source.nix index e1714161f..fdd367cba 100644 --- a/makefu/source.nix +++ b/makefu/source.nix @@ -11,9 +11,10 @@ let then "buildbot" else "makefu"; _file = + "/makefu/1systems/${name}/source.nix"; - ref = "2c566ee"; # unstable @ 2017-09-04 + ref = "c91346e"; # unstable @ 2017-09-04 # + graceful requests2 (a772c3aa) # + mitmproxy fix (eee2d174) + # + tpm-tools fix (5cb9987) in evalSource (toString _file) [ From 04fbb9148fdde1e36d66dcb603d4e8b360b0e08a Mon Sep 17 00:00:00 2001 From: nin Date: Tue, 5 Sep 2017 22:55:24 +0200 Subject: [PATCH 32/67] nin hosts: enable ci --- krebs/3modules/nin/default.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/krebs/3modules/nin/default.nix b/krebs/3modules/nin/default.nix index d5d13cd1a..aab568352 100644 --- a/krebs/3modules/nin/default.nix +++ b/krebs/3modules/nin/default.nix @@ -3,7 +3,10 @@ with import ; { - hosts = mapAttrs (_: setAttr "owner" config.krebs.users.nin) { + hosts = mapAttrs (_: recursiveUpdate { + owner = config.krebs.users.nin; + ci = true; + }) { hiawatha = { cores = 2; nets = { From 6ed58852c0cea912f81b6bc2214289353e07101a Mon Sep 17 00:00:00 2001 From: nin Date: Wed, 6 Sep 2017 00:20:22 +0200 Subject: [PATCH 33/67] nin onondaga.r: into container --- nin/1systems/onondaga/config.nix | 65 +------------------------------- 1 file changed, 2 insertions(+), 63 deletions(-) diff --git a/nin/1systems/onondaga/config.nix b/nin/1systems/onondaga/config.nix index 242d67c26..3cd0773ae 100644 --- a/nin/1systems/onondaga/config.nix +++ b/nin/1systems/onondaga/config.nix @@ -7,7 +7,6 @@ { imports = [ - @@ -15,70 +14,10 @@ krebs.build.host = config.krebs.hosts.onondaga; - boot.loader.grub.enable = true; - boot.loader.grub.version = 2; - # boot.loader.grub.efiSupport = true; - # boot.loader.grub.efiInstallAsRemovable = true; - # boot.loader.efi.efiSysMountPoint = "/boot/efi"; - # Define on which hard drive you want to install Grub. - boot.loader.grub.device = "/dev/sda"; + boot.isContainer = true; + networking.useDHCP = false; - # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. - - # Select internationalisation properties. - # i18n = { - # consoleFont = "Lat2-Terminus16"; - # consoleKeyMap = "us"; - # defaultLocale = "en_US.UTF-8"; - # }; - - # Set your time zone. time.timeZone = "Europe/Amsterdam"; - # List packages installed in system profile. To search by name, run: - # $ nix-env -qaP | grep wget - # environment.systemPackages = with pkgs; [ - # wget - # ]; - - # List services that you want to enable: - - # Enable the OpenSSH daemon. services.openssh.enable = true; - - # Enable CUPS to print documents. - # services.printing.enable = true; - - # Enable the X11 windowing system. - # services.xserver.enable = true; - # services.xserver.layout = "us"; - # services.xserver.xkbOptions = "eurosign:e"; - - # Enable the KDE Desktop Environment. - # services.xserver.displayManager.kdm.enable = true; - # services.xserver.desktopManager.kde4.enable = true; - - # Define a user account. Don't forget to set a password with ‘passwd’. - # users.extraUsers.guest = { - # isNormalUser = true; - # uid = 1000; - # }; - - # The NixOS release to be compatible with for stateful data such as databases. - system.stateVersion = "16.09"; - - boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "ehci_pci" "sd_mod" "sr_mod" ]; - - fileSystems."/" = - { device = "/dev/disk/by-uuid/7238cc6e-4bea-4e52-9408-32d8aa05abff"; - fsType = "ext4"; - }; - - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/5e923175-854b-4bcf-97c8-f3a91806fa22"; - fsType = "ext2"; - }; - - nix.maxJobs = lib.mkDefault 1; - } From 425b67daf151bef8a8a423e06cbc600e76d3bb80 Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 21 Aug 2017 21:01:55 +0200 Subject: [PATCH 34/67] ma git: add euer_blog --- makefu/2configs/git/cgit-retiolum.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/makefu/2configs/git/cgit-retiolum.nix b/makefu/2configs/git/cgit-retiolum.nix index b89bfadfd..30c0b0b87 100644 --- a/makefu/2configs/git/cgit-retiolum.nix +++ b/makefu/2configs/git/cgit-retiolum.nix @@ -22,6 +22,7 @@ let cgit.desc = "Build new Stockholm hosts"; }; cac-api = { }; + euer_blog = { }; ampel = { }; init-stockholm = { cgit.desc = "Init stuff for stockholm"; From 164e22ca5fec8c1221b01648afe58481abf34eb4 Mon Sep 17 00:00:00 2001 From: makefu Date: Tue, 22 Aug 2017 10:59:49 +0200 Subject: [PATCH 35/67] newsbot-js module: add package option this will be used for the wiki-irc-bot to override the patchPhase --- krebs/3modules/newsbot-js.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/krebs/3modules/newsbot-js.nix b/krebs/3modules/newsbot-js.nix index 2ff9a5ebb..dd3e5647a 100644 --- a/krebs/3modules/newsbot-js.nix +++ b/krebs/3modules/newsbot-js.nix @@ -13,6 +13,11 @@ let api = { enable = mkEnableOption "Enable krebs newsbot"; + package = mkOption { + type = types.package; + default = pkgs.newsbot-js; + description = "newsbot package to use"; + }; ircServer = mkOption { type = types.str; default = "echelon.retiolum"; @@ -79,7 +84,7 @@ let serviceConfig = { User = "newsbot-js"; Restart = "always"; - ExecStart = "${pkgs.newsbot-js}/bin/newsbot"; + ExecStart = "${cfg.package}/bin/newsbot"; }; }; }; From 665021f4c1638a07358381ef30d5e2988c18d13e Mon Sep 17 00:00:00 2001 From: makefu Date: Tue, 22 Aug 2017 11:20:25 +0200 Subject: [PATCH 36/67] pkgs.newsbot-js: enable patchPhase required for overriding the patchPhase --- krebs/5pkgs/simple/newsbot-js/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/krebs/5pkgs/simple/newsbot-js/default.nix b/krebs/5pkgs/simple/newsbot-js/default.nix index b52454ca4..fa39823d3 100644 --- a/krebs/5pkgs/simple/newsbot-js/default.nix +++ b/krebs/5pkgs/simple/newsbot-js/default.nix @@ -32,6 +32,7 @@ in np.buildNodePackage { phases = [ "unpackPhase" + "patchPhase" "installPhase" ]; From 33dae609d012d971e2b46e2708a52c8972165138 Mon Sep 17 00:00:00 2001 From: makefu Date: Tue, 22 Aug 2017 11:21:32 +0200 Subject: [PATCH 37/67] ma wiki-irc-bot: use newsbot-js instead of logstash --- .../deployment/wiki-irc-bot/default.nix | 74 ++++--------------- .../wiki-irc-bot/irc-out-notice.patch | 26 ------- .../deployment/wiki-irc-bot/wiki-output.patch | 45 +++++++++++ 3 files changed, 58 insertions(+), 87 deletions(-) delete mode 100644 makefu/2configs/deployment/wiki-irc-bot/irc-out-notice.patch create mode 100644 makefu/2configs/deployment/wiki-irc-bot/wiki-output.patch diff --git a/makefu/2configs/deployment/wiki-irc-bot/default.nix b/makefu/2configs/deployment/wiki-irc-bot/default.nix index 7ab31e698..12686efba 100644 --- a/makefu/2configs/deployment/wiki-irc-bot/default.nix +++ b/makefu/2configs/deployment/wiki-irc-bot/default.nix @@ -1,67 +1,19 @@ -{ pkgs, lib, ... }: +{ config, pkgs, ... }: -with lib; let - port = 18872; + pkg = pkgs.lib.overrideDerivation pkgs.newsbot-js (original: { + patches = [ ./wiki-output.patch ]; + }); + newsfile = pkgs.writeText "feeds" '' + nixoswiki-bot|https://nixos.wiki/api.php?days=7&limit=50&hidecategorization=1&action=feedrecentchanges&feedformat=rss|#krebs + ''; in { - nixpkgs.config.packageOverrides = pkgs: with pkgs; { - logstash = pkgs.stdenv.lib.overrideDerivation pkgs.logstash (old: { - patches = [ ./irc-out-notice.patch ]; }); - }; - services.logstash = { + krebs.newsbot-js = { enable = true; - inputConfig = '' - http { - port => ${toString port} - host => "127.0.0.1" - } - ''; - filterConfig = '' - if ([pages]) { - ruby { - code => ' - require "net/http" - require "net/https" - http = Net::HTTP.new("git.io", 443) - http.use_ssl = true - lines = [] - event["pages"].each {|p| - url = "#{p["html_url"]}/_compare/#{p["sha"]}" - short_url = begin - request = Net::HTTP::Post.new "/" - request.set_form_data ({"url" => url }) - response = http.request(request) - response["location"] - end - lines << "\"#{p["title"]}\" #{p["action"]} by #{event["sender"]["login"]} #{short_url}" - } - event["output"] = lines.join("\n") - ' - } - } - ''; - outputConfig = '' - file { path => "/tmp/logs.json" codec => "json_lines" } - if [output] { - irc { - channels => [ "#krebs", "#nixos" ] - host => "irc.freenode.net" - nick => "nixos-users-wiki" - format => "%{output}" - notice => true - } - } - ''; - plugins = [ ]; - }; - - services.nginx = { - enable = lib.mkDefault true; - virtualHosts."ghook.krebsco.de" = { - locations."/".proxyPass = "http://localhost:${toString port}/"; - enableSSL = true; - enableACME = true; - forceSSL = true; - }; + package = pkg; + ircServer = "chat.freenode.net"; + feeds = newsfile; + urlShortenerHost = "go"; + urlShortenerPort = "80"; }; } diff --git a/makefu/2configs/deployment/wiki-irc-bot/irc-out-notice.patch b/makefu/2configs/deployment/wiki-irc-bot/irc-out-notice.patch deleted file mode 100644 index 040643f81..000000000 --- a/makefu/2configs/deployment/wiki-irc-bot/irc-out-notice.patch +++ /dev/null @@ -1,26 +0,0 @@ -index b63339d..8c8c747 100644 ---- a/vendor/bundle/jruby/1.9/gems/logstash-output-irc-2.0.4/lib/logstash/outputs/irc.rb -+++ b/vendor/bundle/jruby/1.9/gems/logstash-output-irc-2.0.4/lib/logstash/outputs/irc.rb -@@ -48,6 +48,9 @@ class LogStash::Outputs::Irc < LogStash::Outputs::Base - # Static string after event - config :post_string, :validate => :string, :required => false - -+ # Set this to true to send messages as notice -+ config :notice, :validate => :boolean, :default => false -+ - public - - def inject_bot(bot) -@@ -90,9 +93,9 @@ class LogStash::Outputs::Irc < LogStash::Outputs::Base - - @bot.channels.each do |channel| - @logger.debug("Sending to...", :channel => channel, :text => text) -- channel.msg(pre_string) if !@pre_string.nil? -- channel.msg(text) -- channel.msg(post_string) if !@post_string.nil? -+ channel.send(pre_string, :notice => @notice) if !@pre_string.nil? -+ channel.send(text, :notice => @notice) -+ channel.send(post_string, :notice => @notice) if !@post_string.nil? - end # channels.each - end # def receive - end # class LogStash::Outputs::Irc diff --git a/makefu/2configs/deployment/wiki-irc-bot/wiki-output.patch b/makefu/2configs/deployment/wiki-irc-bot/wiki-output.patch new file mode 100644 index 000000000..6e1e27853 --- /dev/null +++ b/makefu/2configs/deployment/wiki-irc-bot/wiki-output.patch @@ -0,0 +1,45 @@ +diff --git a/newsbot.js b/newsbot.js +index 42d0666..a284011 100644 +--- a/newsbot.js ++++ b/newsbot.js +@@ -92,8 +92,9 @@ function create_feedbot (nick, uri, channels) { + } + + function broadcast_new_item (item) { ++ console.log('Broadcasting item ',item.link) + return getShortLink(item.link, function (error, shortlink) { +- return broadcast(item.title + ' ' + shortlink) ++ return broadcast('"'+ item.title + '" edited by ' + item.author + ' ' + shortlink) + }) + } + +@@ -152,15 +153,18 @@ function create_feedbot (nick, uri, channels) { + + if (client.lastItems) { + items.forEach(function (item) { +- if (!client.lastItems.hasOwnProperty(item.title)) { ++ ++ if (!client.lastItems.hasOwnProperty(item.guid)) { + broadcast_new_item(item) ++ }else { ++ console.log("Item already seen:",item.guid) + } + }) + } + + client.lastItems = {} + items.forEach(function (item) { +- client.lastItems[item.title] = true ++ client.lastItems[item.guid] = true + }) + + return continue_loop() +@@ -199,6 +203,8 @@ function run_command (methodname, params, callback) { + } + + function getShortLink (link, callback) { ++ callback(null,link) ++ return + var form = new FormData() + try { + form.append('uri', link) From fca1cca6e8bf9478d3dadde009093d51e587108d Mon Sep 17 00:00:00 2001 From: makefu Date: Tue, 22 Aug 2017 11:40:10 +0200 Subject: [PATCH 38/67] ma vim: update listchars --- makefu/2configs/vim.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/makefu/2configs/vim.nix b/makefu/2configs/vim.nix index 524caf8f5..9f3a59717 100644 --- a/makefu/2configs/vim.nix +++ b/makefu/2configs/vim.nix @@ -22,7 +22,7 @@ in { set nocompatible syntax on set list - set listchars=tab:▸ + set listchars=tab:▸\ "set list listchars=tab:>-,trail:.,extends:> filetype off From 8980f4229ac9910daef7dd39ec0f80c276c66be3 Mon Sep 17 00:00:00 2001 From: makefu Date: Tue, 22 Aug 2017 11:40:28 +0200 Subject: [PATCH 39/67] ma vpngate: add france --- makefu/2configs/vpn/vpngate.nix | 108 ++++++++++++++++++++++++++++++++ 1 file changed, 108 insertions(+) diff --git a/makefu/2configs/vpn/vpngate.nix b/makefu/2configs/vpn/vpngate.nix index bf3101b19..acf9e9cfe 100644 --- a/makefu/2configs/vpn/vpngate.nix +++ b/makefu/2configs/vpn/vpngate.nix @@ -1,5 +1,113 @@ { pkgs, ... }: { + services.openvpn.servers.vpngate-france = { + config = '' + dev tun + proto udp + remote coreeu1.opengw.net 1194 + cipher AES-128-CBC + auth SHA1 + resolv-retry infinite + nobind + persist-key + persist-tun + client + verb 3 + + + -----BEGIN CERTIFICATE----- + MIIF2DCCA8CgAwIBAgIQTKr5yttjb+Af907YWwOGnTANBgkqhkiG9w0BAQwFADCB + hTELMAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4G + A1UEBxMHU2FsZm9yZDEaMBgGA1UEChMRQ09NT0RPIENBIExpbWl0ZWQxKzApBgNV + BAMTIkNPTU9ETyBSU0EgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMTAwMTE5 + MDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCBhTELMAkGA1UEBhMCR0IxGzAZBgNVBAgT + EkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgGA1UEChMR + Q09NT0RPIENBIExpbWl0ZWQxKzApBgNVBAMTIkNPTU9ETyBSU0EgQ2VydGlmaWNh + dGlvbiBBdXRob3JpdHkwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCR + 6FSS0gpWsawNJN3Fz0RndJkrN6N9I3AAcbxT38T6KhKPS38QVr2fcHK3YX/JSw8X + pz3jsARh7v8Rl8f0hj4K+j5c+ZPmNHrZFGvnnLOFoIJ6dq9xkNfs/Q36nGz637CC + 9BR++b7Epi9Pf5l/tfxnQ3K9DADWietrLNPtj5gcFKt+5eNu/Nio5JIk2kNrYrhV + /erBvGy2i/MOjZrkm2xpmfh4SDBF1a3hDTxFYPwyllEnvGfDyi62a+pGx8cgoLEf + Zd5ICLqkTqnyg0Y3hOvozIFIQ2dOciqbXL1MGyiKXCJ7tKuY2e7gUYPDCUZObT6Z + +pUX2nwzV0E8jVHtC7ZcryxjGt9XyD+86V3Em69FmeKjWiS0uqlWPc9vqv9JWL7w + qP/0uK3pN/u6uPQLOvnoQ0IeidiEyxPx2bvhiWC4jChWrBQdnArncevPDt09qZah + SL0896+1DSJMwBGB7FY79tOi4lu3sgQiUpWAk2nojkxl8ZEDLXB0AuqLZxUpaVIC + u9ffUGpVRr+goyhhf3DQw6KqLCGqR84onAZFdr+CGCe01a60y1Dma/RMhnEw6abf + Fobg2P9A3fvQQoh/ozM6LlweQRGBY84YcWsr7KaKtzFcOmpH4MN5WdYgGq/yapiq + crxXStJLnbsQ/LBMQeXtHT1eKJ2czL+zUdqnR+WEUwIDAQABo0IwQDAdBgNVHQ4E + FgQUu69+Aj36pvE8hI6t7jiY7NkyMtQwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB + /wQFMAMBAf8wDQYJKoZIhvcNAQEMBQADggIBAArx1UaEt65Ru2yyTUEUAJNMnMvl + wFTPoCWOAvn9sKIN9SCYPBMtrFaisNZ+EZLpLrqeLppysb0ZRGxhNaKatBYSaVqM + 4dc+pBroLwP0rmEdEBsqpIt6xf4FpuHA1sj+nq6PK7o9mfjYcwlYRm6mnPTXJ9OV + 2jeDchzTc+CiR5kDOF3VSXkAKRzH7JsgHAckaVd4sjn8OoSgtZx8jb8uk2Intzna + FxiuvTwJaP+EmzzV1gsD41eeFPfR60/IvYcjt7ZJQ3mFXLrrkguhxuhoqEwWsRqZ + CuhTLJK7oQkYdQxlqHvLI7cawiiFwxv/0Cti76R7CZGYZ4wUAc1oBmpjIXUDgIiK + boHGhfKppC3n9KUkEEeDys30jXlYsQab5xoq2Z0B15R97QNKyvDb6KkBPvVWmcke + jkk9u+UJueBPSZI9FoJAzMxZxuY67RIuaTxslbH9qh17f4a+Hg4yRvv7E491f0yL + S0Zj/gA0QHDBw7mh3aZw4gSzQbzpgJHqZJx64SIDqZxubw5lT2yHh17zbqD5daWb + QOhTsiedSrnAdyGN/4fy3ryM7xfft0kL0fJuMAsaDk527RH89elWsn2/x20Kk4yl + 0MC2Hb46TpSi125sC8KKfPog88Tk5c0NqMuRkrF8hey1FGlmDoLnzc7ILaZRfyHB + NVOFBkpdn627G190 + -----END CERTIFICATE----- + + + + + + -----BEGIN CERTIFICATE----- + MIICxjCCAa4CAQAwDQYJKoZIhvcNAQEFBQAwKTEaMBgGA1UEAxMRVlBOR2F0ZUNs + aWVudENlcnQxCzAJBgNVBAYTAkpQMB4XDTEzMDIxMTAzNDk0OVoXDTM3MDExOTAz + MTQwN1owKTEaMBgGA1UEAxMRVlBOR2F0ZUNsaWVudENlcnQxCzAJBgNVBAYTAkpQ + MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5h2lgQQYUjwoKYJbzVZA + 5VcIGd5otPc/qZRMt0KItCFA0s9RwReNVa9fDRFLRBhcITOlv3FBcW3E8h1Us7RD + 4W8GmJe8zapJnLsD39OSMRCzZJnczW4OCH1PZRZWKqDtjlNca9AF8a65jTmlDxCQ + CjntLIWk5OLLVkFt9/tScc1GDtci55ofhaNAYMPiH7V8+1g66pGHXAoWK6AQVH67 + XCKJnGB5nlQ+HsMYPV/O49Ld91ZN/2tHkcaLLyNtywxVPRSsRh480jju0fcCsv6h + p/0yXnTB//mWutBGpdUlIbwiITbAmrsbYnjigRvnPqX1RNJUbi9Fp6C2c/HIFJGD + ywIDAQABMA0GCSqGSIb3DQEBBQUAA4IBAQChO5hgcw/4oWfoEFLu9kBa1B//kxH8 + hQkChVNn8BRC7Y0URQitPl3DKEed9URBDdg2KOAz77bb6ENPiliD+a38UJHIRMqe + UBHhllOHIzvDhHFbaovALBQceeBzdkQxsKQESKmQmR832950UCovoyRB61UyAV7h + +mZhYPGRKXKSJI6s0Egg/Cri+Cwk4bjJfrb5hVse11yh4D9MHhwSfCOH+0z4hPUT + Fku7dGavURO5SVxMn/sL6En5D+oSeXkadHpDs+Airym2YHh15h0+jPSOoR6yiVp/ + 6zZeZkrN43kuS73KpKDFjfFPh8t4r1gOIjttkNcQqBccusnplQ7HJpsk + -----END CERTIFICATE----- + + + + + -----BEGIN RSA PRIVATE KEY----- + MIIEpAIBAAKCAQEA5h2lgQQYUjwoKYJbzVZA5VcIGd5otPc/qZRMt0KItCFA0s9R + wReNVa9fDRFLRBhcITOlv3FBcW3E8h1Us7RD4W8GmJe8zapJnLsD39OSMRCzZJnc + zW4OCH1PZRZWKqDtjlNca9AF8a65jTmlDxCQCjntLIWk5OLLVkFt9/tScc1GDtci + 55ofhaNAYMPiH7V8+1g66pGHXAoWK6AQVH67XCKJnGB5nlQ+HsMYPV/O49Ld91ZN + /2tHkcaLLyNtywxVPRSsRh480jju0fcCsv6hp/0yXnTB//mWutBGpdUlIbwiITbA + mrsbYnjigRvnPqX1RNJUbi9Fp6C2c/HIFJGDywIDAQABAoIBAERV7X5AvxA8uRiK + k8SIpsD0dX1pJOMIwakUVyvc4EfN0DhKRNb4rYoSiEGTLyzLpyBc/A28Dlkm5eOY + fjzXfYkGtYi/Ftxkg3O9vcrMQ4+6i+uGHaIL2rL+s4MrfO8v1xv6+Wky33EEGCou + QiwVGRFQXnRoQ62NBCFbUNLhmXwdj1akZzLU4p5R4zA3QhdxwEIatVLt0+7owLQ3 + lP8sfXhppPOXjTqMD4QkYwzPAa8/zF7acn4kryrUP7Q6PAfd0zEVqNy9ZCZ9ffho + zXedFj486IFoc5gnTp2N6jsnVj4LCGIhlVHlYGozKKFqJcQVGsHCqq1oz2zjW6LS + oRYIHgECgYEA8zZrkCwNYSXJuODJ3m/hOLVxcxgJuwXoiErWd0E42vPanjjVMhnt + KY5l8qGMJ6FhK9LYx2qCrf/E0XtUAZ2wVq3ORTyGnsMWre9tLYs55X+ZN10Tc75z + 4hacbU0hqKN1HiDmsMRY3/2NaZHoy7MKnwJJBaG48l9CCTlVwMHocIECgYEA8jby + dGjxTH+6XHWNizb5SRbZxAnyEeJeRwTMh0gGzwGPpH/sZYGzyu0SySXWCnZh3Rgq + 5uLlNxtrXrljZlyi2nQdQgsq2YrWUs0+zgU+22uQsZpSAftmhVrtvet6MjVjbByY + DADciEVUdJYIXk+qnFUJyeroLIkTj7WYKZ6RjksCgYBoCFIwRDeg42oK89RFmnOr + LymNAq4+2oMhsWlVb4ejWIWeAk9nc+GXUfrXszRhS01mUnU5r5ygUvRcarV/T3U7 + TnMZ+I7Y4DgWRIDd51znhxIBtYV5j/C/t85HjqOkH+8b6RTkbchaX3mau7fpUfds + Fq0nhIq42fhEO8srfYYwgQKBgQCyhi1N/8taRwpk+3/IDEzQwjbfdzUkWWSDk9Xs + H/pkuRHWfTMP3flWqEYgW/LW40peW2HDq5imdV8+AgZxe/XMbaji9Lgwf1RY005n + KxaZQz7yqHupWlLGF68DPHxkZVVSagDnV/sztWX6SFsCqFVnxIXifXGC4cW5Nm9g + va8q4QKBgQCEhLVeUfdwKvkZ94g/GFz731Z2hrdVhgMZaU/u6t0V95+YezPNCQZB + wmE9Mmlbq1emDeROivjCfoGhR3kZXW1pTKlLh6ZMUQUOpptdXva8XxfoqQwa3enA + M7muBbF0XN7VO80iJPv+PmIZdEIAkpwKfi201YB+BafCIuGxIF50Vg== + -----END RSA PRIVATE KEY----- + + + ''; + autoStart = false; + updateResolvConf = false; + }; services.openvpn.servers.vpngate-japan = { config = '' dev tun From eaa79454d443be6d5589d1bbd6b3a6d9f038ce07 Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 16 Aug 2017 13:56:27 +0200 Subject: [PATCH 40/67] gitlab-ci: init --- .gitlab-ci.yml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 000000000..e6ee187cb --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,4 @@ +nix-shell test: + script: + - nix-shell --pure --command 'true' -p stdenv && echo success + - nix-shell --pure --command 'false' -p stdenv || echo success From 40260dc2734981df05553171799c4dab5368651f Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 16 Aug 2017 15:09:38 +0200 Subject: [PATCH 41/67] gitlab-runner-shackspace: init --- krebs/1systems/hotdog/config.nix | 1 + krebs/2configs/gitlab-runner-shackspace.nix | 33 +++++++++++++++++++ .../secrets/shackspace-gitlab-ci-token.nix | 1 + 3 files changed, 35 insertions(+) create mode 100644 krebs/2configs/gitlab-runner-shackspace.nix create mode 100644 krebs/6tests/data/secrets/shackspace-gitlab-ci-token.nix diff --git a/krebs/1systems/hotdog/config.nix b/krebs/1systems/hotdog/config.nix index 4807307ff..2ad22f49c 100644 --- a/krebs/1systems/hotdog/config.nix +++ b/krebs/1systems/hotdog/config.nix @@ -10,6 +10,7 @@ + ]; diff --git a/krebs/2configs/gitlab-runner-shackspace.nix b/krebs/2configs/gitlab-runner-shackspace.nix new file mode 100644 index 000000000..7794f1dd2 --- /dev/null +++ b/krebs/2configs/gitlab-runner-shackspace.nix @@ -0,0 +1,33 @@ +{ config, ... }: +let + url = "https://git.shackspace.de/"; + # generate token from CI-token via: + ## gitlab-runner register + ## cat /etc/gitlab-runner/config.toml + token = import ; +in { + systemd.services.gitlab-runner.path = [ + "/run/wrappers" # /run/wrappers/bin/su + "/" # /bin/sh + ]; + virtualisation.docker.enable = true; + services.gitlab-runner = { + enable = true; + # configFile, configOptions and gracefulTimeout not yet in stable + # gracefulTimeout = "120min"; + configText = '' + concurrent = 1 + check_interval = 0 + + [[runners]] + name = "krebs-shell" + url = "${url}" + token = "${token}" + executor = "shell" + shell = "sh" + environment = ["PATH=/bin:/run/wrappers/bin:/etc/per-user/gitlab-runner/bin:/etc/per-user-pkgs/gitlab-runner/bin:/nix/var/nix/profiles/default/bin:/run/current-system/sw/bin"] + [runners.cache] + + ''; + }; +} diff --git a/krebs/6tests/data/secrets/shackspace-gitlab-ci-token.nix b/krebs/6tests/data/secrets/shackspace-gitlab-ci-token.nix new file mode 100644 index 000000000..963e6db8b --- /dev/null +++ b/krebs/6tests/data/secrets/shackspace-gitlab-ci-token.nix @@ -0,0 +1 @@ +"lol" From a627e844c3c9250c8c3938820e33cb8566cadcbb Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 16 Aug 2017 15:10:06 +0200 Subject: [PATCH 42/67] gitlab-ci: test env --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e6ee187cb..3f2f28d65 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,4 +1,5 @@ nix-shell test: script: + - env - nix-shell --pure --command 'true' -p stdenv && echo success - nix-shell --pure --command 'false' -p stdenv || echo success From 2f852df56a40e06588a726c329a05d8cd90c0370 Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 16 Aug 2017 15:20:37 +0200 Subject: [PATCH 43/67] gitlab-runner: use PrivateTmp to avoid clash with buildbot --- krebs/2configs/gitlab-runner-shackspace.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/krebs/2configs/gitlab-runner-shackspace.nix b/krebs/2configs/gitlab-runner-shackspace.nix index 7794f1dd2..d9b4cd589 100644 --- a/krebs/2configs/gitlab-runner-shackspace.nix +++ b/krebs/2configs/gitlab-runner-shackspace.nix @@ -10,6 +10,7 @@ in { "/run/wrappers" # /run/wrappers/bin/su "/" # /bin/sh ]; + systemd.services.gitlab-runner.serviceConfig.PrivateTmp = true; virtualisation.docker.enable = true; services.gitlab-runner = { enable = true; From a6c7102c0156d08e8c8a716b999207738969b746 Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 23 Aug 2017 14:37:06 +0200 Subject: [PATCH 44/67] ma default: remove nix-defexpr activation --- makefu/2configs/default.nix | 9 --------- 1 file changed, 9 deletions(-) diff --git a/makefu/2configs/default.nix b/makefu/2configs/default.nix index 547b73597..8fe2160c4 100644 --- a/makefu/2configs/default.nix +++ b/makefu/2configs/default.nix @@ -145,15 +145,6 @@ with import ; "net.ipv6.conf.default.use_tempaddr" = 2; }; - system.activationScripts.nix-defexpr = '' - (set -euf - for i in /home/makefu /root/;do - f="$i/.nix-defexpr" - rm -fr "$f" - ln -s /var/src/nixpkgs "$f" - done) - ''; - i18n = { consoleKeyMap = "us"; defaultLocale = "en_US.UTF-8"; From 45ed5102315aa56130bb1809f02e58c879378b78 Mon Sep 17 00:00:00 2001 From: makefu Date: Fri, 1 Sep 2017 10:42:43 +0200 Subject: [PATCH 45/67] ma tools/studio: init --- makefu/2configs/tools/studio.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 makefu/2configs/tools/studio.nix diff --git a/makefu/2configs/tools/studio.nix b/makefu/2configs/tools/studio.nix new file mode 100644 index 000000000..add021acd --- /dev/null +++ b/makefu/2configs/tools/studio.nix @@ -0,0 +1,10 @@ +{ pkgs, ... }: + +{ + users.users.makefu.packages = with pkgs; [ + obs-studio + studio-link + audacity + owncloudclient + ]; +} From ab30917d84942ebd3585ac6380b523cbcc6f20dd Mon Sep 17 00:00:00 2001 From: makefu Date: Fri, 1 Sep 2017 10:45:52 +0200 Subject: [PATCH 46/67] ma pkgs.u3_tool: init at 0.3 --- makefu/5pkgs/u3_tool/default.nix | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 makefu/5pkgs/u3_tool/default.nix diff --git a/makefu/5pkgs/u3_tool/default.nix b/makefu/5pkgs/u3_tool/default.nix new file mode 100644 index 000000000..e8c5573a8 --- /dev/null +++ b/makefu/5pkgs/u3_tool/default.nix @@ -0,0 +1,22 @@ +{ stdenv, fetchurl }: + +stdenv.mkDerivation rec { + proj = "u3-tool"; + name = "${proj}-${version}"; + version = "0.3"; + + enableParallelBuilding = true; + + src = fetchurl { + url = "mirror://sourceforge/${proj}/${name}.tar.gz"; + sha256 = "1p9c9kibd1pdbdfa0nd0i3n7bvzi3xg0chm38jg3xfl8gsn0390f"; + }; + + meta = { + description = "Tool for controlling the special features of a 'U3 smart drive' USB Flash disk."; + homepage = https://sourceforge.net/projects/u3-tool/ ; + license = stdenv.lib.licenses.gpl2; + platforms = stdenv.lib.platforms.linux; + maintainers = with stdenv.lib.maintainers; [ makefu ]; + }; +} From 736519b61dd8d48f1bc40c9353d14f6dc06c32ee Mon Sep 17 00:00:00 2001 From: makefu Date: Fri, 1 Sep 2017 21:40:17 +0200 Subject: [PATCH 47/67] ma omo: Rip Reaktor|krebs --- makefu/1systems/omo/config.nix | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/makefu/1systems/omo/config.nix b/makefu/1systems/omo/config.nix index 0df2ba6e6..4c93a7a3e 100644 --- a/makefu/1systems/omo/config.nix +++ b/makefu/1systems/omo/config.nix @@ -194,16 +194,6 @@ in { zramSwap.enable = true; - krebs.Reaktor.reaktor = { - nickname = "Reaktor|krebs"; - workdir = "/var/lib/Reaktor/krebs"; - channels = [ "#krebs" ]; - plugins = with pkgs.ReaktorPlugins;[ - stockholm-issue - nixos-version - sed-plugin - random-emoji ]; - }; krebs.Reaktor.reaktor-shack = { nickname = "Reaktor|shack"; workdir = "/var/lib/Reaktor/shack"; From ed75ad26bf136ae3760e16eaa5d7e22d9b7efe1c Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 4 Sep 2017 09:02:51 +0200 Subject: [PATCH 48/67] ma dnscrypt: prepare client/server --- makefu/2configs/{dnscrypt.nix => dnscrypt/client.nix} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename makefu/2configs/{dnscrypt.nix => dnscrypt/client.nix} (100%) diff --git a/makefu/2configs/dnscrypt.nix b/makefu/2configs/dnscrypt/client.nix similarity index 100% rename from makefu/2configs/dnscrypt.nix rename to makefu/2configs/dnscrypt/client.nix From f179880a0f93dcbcb364330366efd5188271bfe5 Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 4 Sep 2017 09:03:09 +0200 Subject: [PATCH 49/67] ma source: bump to latest unstable --- makefu/source.nix | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/makefu/source.nix b/makefu/source.nix index 31243c2fd..a63427535 100644 --- a/makefu/source.nix +++ b/makefu/source.nix @@ -11,10 +11,8 @@ let then "buildbot" else "makefu"; _file = + "/makefu/1systems/${name}/source.nix"; - ref = "9d4bd6b"; # unstable @ 2017-07-31 + ref = "a035602"; # unstable @ 2017-09-04 # + graceful requests2 (a772c3aa) - # + libpurple bitlbee ( ce6fe1a, 65e38b7 ) - # + buildbot-runner ( f3cecc5 ) in evalSource (toString _file) [ From 9125cd77dae78337b03e53f46e03fabd60845d73 Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 4 Sep 2017 10:11:07 +0200 Subject: [PATCH 50/67] ma dnscrypt: provide client and server config --- makefu/2configs/dnscrypt/client.nix | 18 +++++++++++++++--- makefu/2configs/dnscrypt/server.nix | 26 ++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 3 deletions(-) create mode 100644 makefu/2configs/dnscrypt/server.nix diff --git a/makefu/2configs/dnscrypt/client.nix b/makefu/2configs/dnscrypt/client.nix index 6e7ef0f82..988fb4a7d 100644 --- a/makefu/2configs/dnscrypt/client.nix +++ b/makefu/2configs/dnscrypt/client.nix @@ -1,6 +1,18 @@ -{ - services.dnscrypt-proxy.enable = true; - services.dnscrypt-proxy.resolverName = "cs-de"; +{ config, ... }: +let + customResolver = { + # TODO: put this somewhere else + address = config.krebs.hosts.gum.nets.internet.ip4.addr; + port = 15251; + name = "2.dnscrypt-cert.euer.krebsco.de"; + # dnscrypt-wrapper --show-provider-publickey --provider-publickey-file public.key + key = "1AFC:E58D:F242:0FBB:9EE9:4E51:47F4:5373:D9AE:C2AB:DD96:8448:333D:5D79:272C:A44C"; + }; +in { + services.dnscrypt-proxy = { + enable = true; + inherit customResolver; + }; networking.extraResolvconfConf = '' name_servers='127.0.0.1' ''; diff --git a/makefu/2configs/dnscrypt/server.nix b/makefu/2configs/dnscrypt/server.nix new file mode 100644 index 000000000..79305e727 --- /dev/null +++ b/makefu/2configs/dnscrypt/server.nix @@ -0,0 +1,26 @@ +{ config, ... }: +let + # TODO: dataDir is currently not provided by upstream + # data = config.services.dnscrypt-wrapper.dataDir; + data = "/var/lib/dnscrypt-wrapper"; + sec = toString ; + port = 15251; + user = "dnscrypt-wrapper"; +in { + services.dnscrypt-wrapper = { + enable = true; + address = "0.0.0.0"; + upstream.address = "8.8.8.8"; + providerName = "2.dnscrypt-cert.euer.krebsco.de"; + inherit port; + }; + networking.firewall.allowedUDPPorts = [ port ]; + systemd.services.prepare-dnscrypt-wrapper-keys = { + wantedBy = [ "dnscrypt-wrapper.service" ]; + before = [ "dnscrypt-wrapper.service" ]; + script = '' + install -m700 -o ${user} -v ${sec}/dnscrypt-public.key ${data}/public.key + install -m700 -o ${user} -v ${sec}/dnscrypt-secret.key ${data}/secret.key + ''; + }; +} From 35c12b1f70bcdec70f0605e0ab0b03bb12c3b579 Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 4 Sep 2017 10:11:32 +0200 Subject: [PATCH 51/67] ma gum: enable dnscrypt server --- makefu/1systems/gum/config.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/makefu/1systems/gum/config.nix b/makefu/1systems/gum/config.nix index 110edc130..934bfa685 100644 --- a/makefu/1systems/gum/config.nix +++ b/makefu/1systems/gum/config.nix @@ -43,6 +43,7 @@ in { + ## Web @@ -55,9 +56,7 @@ in { - - { services.taskserver.enable = true; services.taskserver.fqdn = config.krebs.build.host.name; From 7346a10e3250824baecd4bf298ab7db2df1517bd Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 4 Sep 2017 10:12:30 +0200 Subject: [PATCH 52/67] ma x: use new dnscrypt client --- makefu/1systems/x/config.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/makefu/1systems/x/config.nix b/makefu/1systems/x/config.nix index 8e8c8a736..d6a595c99 100644 --- a/makefu/1systems/x/config.nix +++ b/makefu/1systems/x/config.nix @@ -12,7 +12,7 @@ with import ; - + # Debugging From e28c8c3d3ec0d99f08a1330cbc2f6991c8b14878 Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 4 Sep 2017 10:12:51 +0200 Subject: [PATCH 53/67] ma x: enable tpm --- makefu/1systems/x/config.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/makefu/1systems/x/config.nix b/makefu/1systems/x/config.nix index d6a595c99..03ba1268e 100644 --- a/makefu/1systems/x/config.nix +++ b/makefu/1systems/x/config.nix @@ -33,6 +33,7 @@ with import ; # applications + @@ -54,6 +55,7 @@ with import ; # Services + # From 9646fa5cf7e90aef951d79948675ffb2f521fd52 Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 4 Sep 2017 10:37:40 +0200 Subject: [PATCH 54/67] ma umts module: add missing module from stable --- makefu/3modules/default.nix | 1 + makefu/3modules/wvdial.nix | 70 +++++++++++++++++++++++++++++++++++++ 2 files changed, 71 insertions(+) create mode 100644 makefu/3modules/wvdial.nix diff --git a/makefu/3modules/default.nix b/makefu/3modules/default.nix index 00df56bee..af0e81df5 100644 --- a/makefu/3modules/default.nix +++ b/makefu/3modules/default.nix @@ -15,6 +15,7 @@ _: ./torrent.nix ./udpt.nix ./umts.nix + ./wvdial.nix ]; } diff --git a/makefu/3modules/wvdial.nix b/makefu/3modules/wvdial.nix new file mode 100644 index 000000000..982f4a7db --- /dev/null +++ b/makefu/3modules/wvdial.nix @@ -0,0 +1,70 @@ +{ config, lib, pkgs, ... }: +# from 17.03/nixos/modules/programs/wvdial.nix + +with lib; + +let + + configFile = '' + [Dialer Defaults] + PPPD PATH = ${pkgs.ppp}/sbin/pppd + ${config.environment.wvdial.dialerDefaults} + ''; + + cfg = config.environment.wvdial; + +in +{ + ###### interface + + options = { + + environment.wvdial = { + + dialerDefaults = mkOption { + default = ""; + type = types.str; + example = ''Init1 = AT+CGDCONT=1,"IP","internet.t-mobile"''; + description = '' + Contents of the "Dialer Defaults" section of + /etc/wvdial.conf. + ''; + }; + + pppDefaults = mkOption { + default = '' + noipdefault + usepeerdns + defaultroute + persist + noauth + ''; + type = types.str; + description = "Default ppp settings for wvdial."; + }; + + }; + + }; + + ###### implementation + + config = mkIf (cfg.dialerDefaults != "") { + + environment = { + + etc = + [ + { source = pkgs.writeText "wvdial.conf" configFile; + target = "wvdial.conf"; + } + { source = pkgs.writeText "wvdial" cfg.pppDefaults; + target = "ppp/peers/wvdial"; + } + ]; + + }; + + }; + +} From 3e429bdead5eb70ca288f9a3898ff2fb5a5c161e Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 4 Sep 2017 14:35:56 +0200 Subject: [PATCH 55/67] ma hw: add tpm to x2x0 --- makefu/1systems/x/config.nix | 2 +- makefu/2configs/hw/tp-x2x0.nix | 3 +++ makefu/2configs/hw/tpm.nix | 6 ++++++ 3 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 makefu/2configs/hw/tpm.nix diff --git a/makefu/1systems/x/config.nix b/makefu/1systems/x/config.nix index 03ba1268e..faa29f3db 100644 --- a/makefu/1systems/x/config.nix +++ b/makefu/1systems/x/config.nix @@ -20,6 +20,7 @@ with import ; # Testing # + # # # @@ -33,7 +34,6 @@ with import ; # applications - diff --git a/makefu/2configs/hw/tp-x2x0.nix b/makefu/2configs/hw/tp-x2x0.nix index 02bd8bb01..81c4bf4c8 100644 --- a/makefu/2configs/hw/tp-x2x0.nix +++ b/makefu/2configs/hw/tp-x2x0.nix @@ -2,6 +2,9 @@ with import ; { + imports = [ + ./tpm.nix + ]; networking.wireless.enable = lib.mkDefault true; hardware.enableAllFirmware = true; diff --git a/makefu/2configs/hw/tpm.nix b/makefu/2configs/hw/tpm.nix new file mode 100644 index 000000000..29e19e916 --- /dev/null +++ b/makefu/2configs/hw/tpm.nix @@ -0,0 +1,6 @@ +{ pkgs, ... }: +{ + services.tcsd.enable = true; + # see https://wiki.archlinux.org/index.php/Trusted_Platform_Module + environment.systemPackages = with pkgs; [ opencryptoki tpm-tools ]; +} From 1874d353813f2bb596f91fb8aa593aa3656d6f59 Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 4 Sep 2017 14:37:00 +0200 Subject: [PATCH 56/67] ma tools: add sec-gui --- makefu/2configs/tools/all.nix | 2 ++ makefu/2configs/tools/core-gui.nix | 1 - makefu/2configs/tools/sec-gui.nix | 8 ++++++++ makefu/2configs/tools/sec.nix | 1 + 4 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 makefu/2configs/tools/sec-gui.nix diff --git a/makefu/2configs/tools/all.nix b/makefu/2configs/tools/all.nix index 31c959d47..c7a116918 100644 --- a/makefu/2configs/tools/all.nix +++ b/makefu/2configs/tools/all.nix @@ -8,5 +8,7 @@ ./games.nix ./media.nix ./sec.nix + ./sec-gui.nix + ./studio.nix ]; } diff --git a/makefu/2configs/tools/core-gui.nix b/makefu/2configs/tools/core-gui.nix index f409b68a2..0538647ae 100644 --- a/makefu/2configs/tools/core-gui.nix +++ b/makefu/2configs/tools/core-gui.nix @@ -20,6 +20,5 @@ xdotool xorg.xbacklight scrot - wireshark ]; } diff --git a/makefu/2configs/tools/sec-gui.nix b/makefu/2configs/tools/sec-gui.nix new file mode 100644 index 000000000..2db3e4391 --- /dev/null +++ b/makefu/2configs/tools/sec-gui.nix @@ -0,0 +1,8 @@ +{ pkgs, ... }: + +{ + krebs.per-user.makefu.packages = with pkgs; [ + tpmmanager + wireshark + ]; +} diff --git a/makefu/2configs/tools/sec.nix b/makefu/2configs/tools/sec.nix index 5fb9a5fc8..817cd9ead 100644 --- a/makefu/2configs/tools/sec.nix +++ b/makefu/2configs/tools/sec.nix @@ -13,5 +13,6 @@ thc-hydra borgbackup ledger + u3_tool ]; } From 3402b8faa4122a33779c8075fc52e2beaa95ab78 Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 4 Sep 2017 14:41:02 +0200 Subject: [PATCH 57/67] ma configs: use buildCores with maxJobs --- makefu/2configs/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/makefu/2configs/default.nix b/makefu/2configs/default.nix index 8fe2160c4..25f9f63bf 100644 --- a/makefu/2configs/default.nix +++ b/makefu/2configs/default.nix @@ -39,10 +39,10 @@ with import ; }; networking.hostName = config.krebs.build.host.name; - nix.maxJobs = config.krebs.build.host.cores; + nix.maxJobs = 2; + nix.buildCores = config.krebs.build.host.cores; time.timeZone = "Europe/Berlin"; - #nix.maxJobs = 1; programs.ssh = { startAgent = false; From 24eefb74537b518e2dadbc2de4609b43a022edd1 Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 4 Sep 2017 15:00:06 +0200 Subject: [PATCH 58/67] ma zsh-user: krebs.per-user -> users.users --- makefu/2configs/zsh-user.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/makefu/2configs/zsh-user.nix b/makefu/2configs/zsh-user.nix index 7615f4c0c..f280fc852 100644 --- a/makefu/2configs/zsh-user.nix +++ b/makefu/2configs/zsh-user.nix @@ -88,7 +88,7 @@ in ''; }; - krebs.per-user.${mainUser}.packages = [ + users.users.${mainUser}.packages = [ pkgs.nix-zsh-completions pkgs.fzf ]; From 507160be64bed56ad61544b3f6fc42735ca62aee Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 4 Sep 2017 17:47:36 +0200 Subject: [PATCH 59/67] ma android-pentest: disable due to broken dependency --- makefu/2configs/tools/android-pentest.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/makefu/2configs/tools/android-pentest.nix b/makefu/2configs/tools/android-pentest.nix index da8a357ae..dec2b034b 100644 --- a/makefu/2configs/tools/android-pentest.nix +++ b/makefu/2configs/tools/android-pentest.nix @@ -5,7 +5,8 @@ mitmproxy nmap msf - drozer + ## broken due to protobuf + # drozer dex2jar apktool jd-gui From 190c5946e4b0928a1d35a351fc9d76ae8edf0621 Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 4 Sep 2017 17:48:12 +0200 Subject: [PATCH 60/67] ma gen-oath-safe: fix typo --- makefu/5pkgs/gen-oath-safe/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/makefu/5pkgs/gen-oath-safe/default.nix b/makefu/5pkgs/gen-oath-safe/default.nix index 245e65174..bad4b08a8 100644 --- a/makefu/5pkgs/gen-oath-safe/default.nix +++ b/makefu/5pkgs/gen-oath-safe/default.nix @@ -1,7 +1,7 @@ { coreutils, makeWrapper, openssl, libcaca, qrencode, fetchFromGitHub, yubikey-manager, python, stdenv, ... }: stdenv.mkDerivation { - name = "geno-oath-safe-2017-06-30"; + name = "gen-oath-safe-2017-06-30"; src = fetchFromGitHub { owner = "mcepl"; repo = "gen-oath-safe"; From 0703c8a41d010ecb6636d91e3cf40152ac81b8c8 Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 4 Sep 2017 17:08:59 +0200 Subject: [PATCH 61/67] ma gen-oath-safe: do not build with yubikey-manager --- makefu/5pkgs/gen-oath-safe/default.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/makefu/5pkgs/gen-oath-safe/default.nix b/makefu/5pkgs/gen-oath-safe/default.nix index bad4b08a8..344dc1a02 100644 --- a/makefu/5pkgs/gen-oath-safe/default.nix +++ b/makefu/5pkgs/gen-oath-safe/default.nix @@ -1,6 +1,7 @@ { coreutils, makeWrapper, openssl, libcaca, qrencode, fetchFromGitHub, yubikey-manager, python, stdenv, ... }: -stdenv.mkDerivation { +builtins.trace "Warning: HTOP mode of gen-oath-safe is currently broken" + stdenv.mkDerivation { name = "gen-oath-safe-2017-06-30"; src = fetchFromGitHub { owner = "mcepl"; @@ -23,7 +24,7 @@ stdenv.mkDerivation { coreutils openssl qrencode - yubikey-manager + #yubikey-manager libcaca python ]; From 5964b74a65f605e63b2cfa1cc2b8f1d85ea90d74 Mon Sep 17 00:00:00 2001 From: makefu Date: Tue, 5 Sep 2017 00:01:10 +0200 Subject: [PATCH 62/67] ma drozer: re-enable with protbuf3_2 --- makefu/2configs/tools/android-pentest.nix | 3 +-- makefu/5pkgs/drozer/default.nix | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/makefu/2configs/tools/android-pentest.nix b/makefu/2configs/tools/android-pentest.nix index dec2b034b..da8a357ae 100644 --- a/makefu/2configs/tools/android-pentest.nix +++ b/makefu/2configs/tools/android-pentest.nix @@ -5,8 +5,7 @@ mitmproxy nmap msf - ## broken due to protobuf - # drozer + drozer dex2jar apktool jd-gui diff --git a/makefu/5pkgs/drozer/default.nix b/makefu/5pkgs/drozer/default.nix index c63f1d0d8..f91d5b984 100644 --- a/makefu/5pkgs/drozer/default.nix +++ b/makefu/5pkgs/drozer/default.nix @@ -5,9 +5,10 @@ pythonPackages.buildPythonApplication rec { version = "2.4.3"; buildInputs = [ jdk7 ]; propagatedBuildInputs = with pythonPackages; [ - protobuf + protobuf3_2 pyopenssl pyyaml + ] ++ [ jre7 twisted ]; From 1b5b59d826abd304c56424929a5ab004ff81cd17 Mon Sep 17 00:00:00 2001 From: makefu Date: Tue, 5 Sep 2017 00:05:45 +0200 Subject: [PATCH 63/67] ma source: apply mitmproxy --- makefu/source.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/makefu/source.nix b/makefu/source.nix index a63427535..e1714161f 100644 --- a/makefu/source.nix +++ b/makefu/source.nix @@ -11,8 +11,9 @@ let then "buildbot" else "makefu"; _file = + "/makefu/1systems/${name}/source.nix"; - ref = "a035602"; # unstable @ 2017-09-04 + ref = "2c566ee"; # unstable @ 2017-09-04 # + graceful requests2 (a772c3aa) + # + mitmproxy fix (eee2d174) in evalSource (toString _file) [ From 6218a259a9880368c71ecacddcf1e7c641bd5278 Mon Sep 17 00:00:00 2001 From: lassulus Date: Wed, 6 Sep 2017 09:50:39 +0200 Subject: [PATCH 64/67] rtorrent: track nginx changes --- krebs/3modules/rtorrent.nix | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/krebs/3modules/rtorrent.nix b/krebs/3modules/rtorrent.nix index d85518993..472accef9 100644 --- a/krebs/3modules/rtorrent.nix +++ b/krebs/3modules/rtorrent.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, ... }: +{ config, lib, pkgs, options, ... }: with import ; let @@ -73,6 +73,15 @@ let # authentication also applies to rtorrent.rutorrent enable = mkEnableOption "rtorrent nginx web RPC"; + addr = mkOption { + type = types.addr4; + default = "0.0.0.0"; + description = '' + the address to listen on + default is 0.0.0.0 + ''; + }; + port = mkOption { type = types.nullOr types.int; description ='' @@ -290,7 +299,7 @@ let services.nginx.enable = mkDefault true; services.nginx.virtualHosts.rtorrent = { default = mkDefault true; - inherit (webcfg) basicAuth port; + inherit (webcfg) basicAuth; root = optionalString rucfg.enable webdir; locations = { @@ -310,7 +319,15 @@ let include ${pkgs.nginx}/conf/fastcgi.conf; ''; } ); - }; + # workaround because upstream nginx api changed + # TODO remove when nobody uses 17.03 anymore + } // (if hasAttr "port" (head options.services.nginx.virtualHosts.type.getSubModules).submodule.options then { + port = webcfg.port; + } else { + listen = [ + { inherit (webcfg) addr port; } + ]; + }); }; rutorrent-imp = { From 99ecdb4dab32d5a5044cd439a9ce639801d1398b Mon Sep 17 00:00:00 2001 From: makefu Date: Tue, 5 Sep 2017 11:59:41 +0200 Subject: [PATCH 65/67] ma source: add tpm-fix --- makefu/source.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/makefu/source.nix b/makefu/source.nix index e1714161f..fdd367cba 100644 --- a/makefu/source.nix +++ b/makefu/source.nix @@ -11,9 +11,10 @@ let then "buildbot" else "makefu"; _file = + "/makefu/1systems/${name}/source.nix"; - ref = "2c566ee"; # unstable @ 2017-09-04 + ref = "c91346e"; # unstable @ 2017-09-04 # + graceful requests2 (a772c3aa) # + mitmproxy fix (eee2d174) + # + tpm-tools fix (5cb9987) in evalSource (toString _file) [ From b8434d30997c237a2ff5b8e6c02c7ac6a8b2ea65 Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 6 Sep 2017 11:32:10 +0200 Subject: [PATCH 66/67] ma nginx-config: forceSSL implies enableSSL --- makefu/2configs/bepasty-dual.nix | 1 - makefu/2configs/deployment/boot-euer.nix | 1 - makefu/2configs/deployment/graphs.nix | 1 - makefu/2configs/deployment/owncloud.nix | 1 - makefu/2configs/nginx/euer.blog.nix | 1 - makefu/2configs/nginx/euer.wiki.nix | 1 - makefu/2configs/nginx/share-download.nix | 1 - 7 files changed, 7 deletions(-) diff --git a/makefu/2configs/bepasty-dual.nix b/makefu/2configs/bepasty-dual.nix index ecf5f8a38..701bf5b1d 100644 --- a/makefu/2configs/bepasty-dual.nix +++ b/makefu/2configs/bepasty-dual.nix @@ -36,7 +36,6 @@ in { "${ext-dom}" = { nginx = { - enableSSL = true; forceSSL = true; enableACME = true; }; diff --git a/makefu/2configs/deployment/boot-euer.nix b/makefu/2configs/deployment/boot-euer.nix index be24209bc..f890ea7ad 100644 --- a/makefu/2configs/deployment/boot-euer.nix +++ b/makefu/2configs/deployment/boot-euer.nix @@ -16,7 +16,6 @@ in { services.nginx = { enable = mkDefault true; virtualHosts."boot.euer.krebsco.de" = { - enableSSL = true; forceSSL = true; enableACME = true; locations."/" = { diff --git a/makefu/2configs/deployment/graphs.nix b/makefu/2configs/deployment/graphs.nix index b33ddece0..bde9892cd 100644 --- a/makefu/2configs/deployment/graphs.nix +++ b/makefu/2configs/deployment/graphs.nix @@ -28,7 +28,6 @@ in { ]; }; anonymous = { - enableSSL = true; forceSSL = true; enableACME = true; }; diff --git a/makefu/2configs/deployment/owncloud.nix b/makefu/2configs/deployment/owncloud.nix index 65ac5c184..3a9d57dbb 100644 --- a/makefu/2configs/deployment/owncloud.nix +++ b/makefu/2configs/deployment/owncloud.nix @@ -21,7 +21,6 @@ let services.nginx.virtualHosts."${domain}" = { forceSSL = true; enableACME = true; - enableSSL = true; serverAliases = domains; extraConfig = '' diff --git a/makefu/2configs/nginx/euer.blog.nix b/makefu/2configs/nginx/euer.blog.nix index 3fb629394..65d36d9b6 100644 --- a/makefu/2configs/nginx/euer.blog.nix +++ b/makefu/2configs/nginx/euer.blog.nix @@ -33,7 +33,6 @@ in { virtualHosts = { "euer.krebsco.de" = { #serverAliases = [ "blog.euer.krebsco.de" "blog.${hostname}" ]; - enableSSL = true; enableACME = true; forceSSL = true; root = base-dir; diff --git a/makefu/2configs/nginx/euer.wiki.nix b/makefu/2configs/nginx/euer.wiki.nix index fefdd6dc7..ef2c17c63 100644 --- a/makefu/2configs/nginx/euer.wiki.nix +++ b/makefu/2configs/nginx/euer.wiki.nix @@ -79,7 +79,6 @@ in { # "wiki.makefu.retiolum" # "wiki.makefu" #]; - enableSSL = true; forceSSL = true; enableACME = true; # recommendedGzipSettings = true; diff --git a/makefu/2configs/nginx/share-download.nix b/makefu/2configs/nginx/share-download.nix index 65c44b294..828a66a74 100644 --- a/makefu/2configs/nginx/share-download.nix +++ b/makefu/2configs/nginx/share-download.nix @@ -10,7 +10,6 @@ with import ; root = config.makefu.dl-dir; extraConfig = "autoindex on;"; forceSSL = true; - enableSSL = true; enableACME = true; basicAuth = import ; }; From 46a3f4c24315836c1d82711d98f4d69be67d883d Mon Sep 17 00:00:00 2001 From: lassulus Date: Thu, 7 Sep 2017 10:36:42 +0200 Subject: [PATCH 67/67] l nixpkgs: fe46ffc -> d151161 --- lass/source.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lass/source.nix b/lass/source.nix index 52b0d99f2..01631bef1 100644 --- a/lass/source.nix +++ b/lass/source.nix @@ -15,7 +15,7 @@ in # 87a4615 & 334ac4f # + acme permissions for groups # fd7a8f1 - ref = "fe46ffc"; + ref = "d151161"; }; secrets.file = getAttr builder { buildbot = toString ;