From 4cf1dfeef28e3571eac3e8a4495347f778e9c0a5 Mon Sep 17 00:00:00 2001 From: makefu Date: Sun, 30 Sep 2018 01:25:06 +0200 Subject: ma pkgs._4nxci: re-package 4nxci's version of mbedtls --- makefu/5pkgs/4nxci/default.nix | 52 ----------------------------------------- makefu/5pkgs/_4nxci/default.nix | 50 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 52 deletions(-) delete mode 100644 makefu/5pkgs/4nxci/default.nix create mode 100644 makefu/5pkgs/_4nxci/default.nix (limited to 'makefu') diff --git a/makefu/5pkgs/4nxci/default.nix b/makefu/5pkgs/4nxci/default.nix deleted file mode 100644 index 3aba3be45..000000000 --- a/makefu/5pkgs/4nxci/default.nix +++ /dev/null @@ -1,52 +0,0 @@ -{ stdenv, lib, fetchFromGitHub, mbedtls, python2 }: -let - - mymbedtls = lib.overrideDerivation mbedtls (old: rec { - name = "mbedtls-${version}"; - version = "2.13.0"; - src = fetchFromGitHub { - owner = "ARMmbed"; - repo = "mbedtls"; - rev = name; - sha256 = "1257kp7yxkwwbx5v14kmrmgk1f9zagiddg5alm4wbj0pmgbrm14j"; - }; - buildInputs = old.buildInputs ++ [ python2 ]; - postConfigure = '' - perl scripts/config.pl set MBEDTLS_CMAC_C - ''; - doCheck = false; - - }); -in stdenv.mkDerivation rec { - name = "4nxci-${version}"; - version = "1.30"; - - src = fetchFromGitHub { - owner = "The-4n"; - repo = "4NXCI"; - rev = "v${version}"; - sha256 = "0nrd19z88iahxcdx468lzgxlvkl65smwx8f9s19431cszyhvpxyh"; - }; - - buildPhase = '' - cp config.mk.template config.mk - sed -i 's#\(INCLUDE =\).*#\1${mymbedtls}/include#' Makefile - sed -i 's#\(LIBDIR =\).*#\1${mymbedtls}/lib#' Makefile - make 4nxci - ''; - - installPhase = '' - install -m755 -D 4nxci $out/bin/4nxci - ''; - - #preInstall = '' - # mkdir -p $out/bin - #''; - - buildInputs = [ mymbedtls ]; - - meta = { - description = "convert xci to nsp"; - license = lib.licenses.isc; - }; -} diff --git a/makefu/5pkgs/_4nxci/default.nix b/makefu/5pkgs/_4nxci/default.nix new file mode 100644 index 000000000..dafa37ff6 --- /dev/null +++ b/makefu/5pkgs/_4nxci/default.nix @@ -0,0 +1,50 @@ +{ stdenv, lib, fetchFromGitHub, mbedtls, python2, perl }: +let + version = "1.35"; + src = fetchFromGitHub { + owner = "The-4n"; + repo = "4NXCI"; + rev = "v${version}"; + sha256 = "0yq0irxzi4wi71ajw8ld01zfpkrgknpq7g3m76pbnwmdzkm7dra6"; + }; + + mymbedtls = stdenv.mkDerivation { + name = "mbedtls-${version}"; + version = "2.6.1"; + doCheck = false; + inherit src; + buildInputs = [ perl ]; + phases = [ "unpackPhase" "buildPhase" "installPhase" ]; + makeFlags = [ "DESTDIR=$(out)" ]; + buildPhase = '' + cp config.mk.template config.mk + cd mbedtls + make + ''; + }; +in stdenv.mkDerivation rec { + name = "4nxci-${version}"; + + inherit src version; + buildPhase = '' + cp config.mk.template config.mk + sed -i 's#\(INCLUDE =\).*#\1${mymbedtls}/include#' Makefile + sed -i 's#\(LIBDIR =\).*#\1${mymbedtls}/lib#' Makefile + make 4nxci + ''; + + installPhase = '' + install -m755 -D 4nxci $out/bin/4nxci + ''; + + #preInstall = '' + # mkdir -p $out/bin + #''; + + buildInputs = [ mymbedtls ]; + + meta = { + description = "convert xci to nsp"; + license = lib.licenses.isc; + }; +} -- cgit v1.2.3 From 4c73914d128e8d5b36a0644834db7cbd09be7434 Mon Sep 17 00:00:00 2001 From: lassulus Date: Sun, 7 Oct 2018 17:08:01 +0200 Subject: krops: import from submodules --- makefu/krops.nix | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'makefu') diff --git a/makefu/krops.nix b/makefu/krops.nix index ddb4afece..4f55915af 100644 --- a/makefu/krops.nix +++ b/makefu/krops.nix @@ -1,8 +1,5 @@ { config ? config, name, target ? name }: let - krops = builtins.fetchGit { - url = https://cgit.krebsco.de/krops/; - rev = "4e466eaf05861b47365c5ef46a31a188b70f3615"; - }; + krops = ../submodules/krops; nixpkgs-src = lib.importJSON ./nixpkgs.json; lib = import "${krops}/lib"; -- cgit v1.2.3 From 9104af869e8c8ce299fc2ddbf7f2631bbbf48b1e Mon Sep 17 00:00:00 2001 From: makefu Date: Sun, 7 Oct 2018 23:09:27 +0200 Subject: ma pkgs: rip zj-58 and jd-gui --- makefu/5pkgs/jd-gui/default.nix | 36 ------------------------------------ makefu/5pkgs/zj-58/default.nix | 30 ------------------------------ 2 files changed, 66 deletions(-) delete mode 100644 makefu/5pkgs/jd-gui/default.nix delete mode 100644 makefu/5pkgs/zj-58/default.nix (limited to 'makefu') diff --git a/makefu/5pkgs/jd-gui/default.nix b/makefu/5pkgs/jd-gui/default.nix deleted file mode 100644 index adefd80dd..000000000 --- a/makefu/5pkgs/jd-gui/default.nix +++ /dev/null @@ -1,36 +0,0 @@ -{ stdenv, lib, pkgs, fetchurl, jre, makeWrapper, unzip }: -stdenv.mkDerivation rec { - name = "${packageName}-${version}"; - packageName = "jd-gui"; - version = "1.4.0"; - - src = fetchurl { - url = "https://github.com/java-decompiler/jd-gui/releases/download/v${version}/${name}.jar"; - sha256 = "0rvbplkhafb6s9aiwgcq4ffz4bvzyp7q511pd46hx4ahhzfg7lmx"; - }; - - nativeBuildInputs = [ makeWrapper unzip ]; - - phases = [ "installPhase" ]; - - installPhase = '' - f=$out/lib/jd-gui/ - bin=$out/bin - name=$(basename $src) - mkdir -p $f $bin - - # fixup path to java - cp $src $f - cat > $bin/jd-gui < Date: Mon, 8 Oct 2018 00:58:45 +0200 Subject: nixpkgs: 86fb1e9 -> 86fb1e9 --- makefu/nixpkgs.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'makefu') diff --git a/makefu/nixpkgs.json b/makefu/nixpkgs.json index f39bb6688..c5cd0ac30 100644 --- a/makefu/nixpkgs.json +++ b/makefu/nixpkgs.json @@ -1,7 +1,7 @@ { "url": "https://github.com/makefu/nixpkgs", - "rev": "8f991294288b27b9dec05cc1e07ec6a360bb39c8", - "date": "2018-08-06T14:29:01+02:00", - "sha256": "0zan8kdjk1pwdzm1rwc3ka87k11j0zmw4mdnj70r6pm38x2fa9n6", + "rev": "86fb1e9ae6ba6dfedc814b82abd8db5cfa4f4687", + "date": "2018-10-07T23:33:42+02:00", + "sha256": "015yxs3qj299mgqfmz5vgszj2gxqwazifsdsjw6xadris3ri41d3", "fetchSubmodules": true } -- cgit v1.2.3 From e51aa863c5c7b6403b2b8dcbe064697476f200ea Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 8 Oct 2018 20:31:31 +0200 Subject: ma printer: use upstream zj-58 --- makefu/2configs/printer.nix | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'makefu') diff --git a/makefu/2configs/printer.nix b/makefu/2configs/printer.nix index d5fa65ef9..fb1a67358 100644 --- a/makefu/2configs/printer.nix +++ b/makefu/2configs/printer.nix @@ -5,11 +5,11 @@ let in { services.printing = { enable = true; - drivers = [ - pkgs.samsungUnifiedLinuxDriver - pkgs.cups-dymo # dymo labelwriter - pkgs.foo2zjs # magicolor 1690mf - pkgs.zj-58 + drivers = with pkgs; [ + samsungUnifiedLinuxDriver + cups-dymo # dymo labelwriter + foo2zjs # magicolor 1690mf + cups-zj-58 ]; }; -- cgit v1.2.3 From 77bf84d5ffdab0f930c125ae8daaa15e25e4c879 Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 8 Oct 2018 23:39:41 +0200 Subject: ma pkgs.inkscape: share/extensions solves the issue see ee44a46c858b5a80c1888ab5d38aef43a9577783 in https://gitlab.com/inkscape/extensions --- makefu/2configs/rtorrent.nix | 19 ------------------- makefu/5pkgs/custom/inkscape/dxf_fix.patch | 12 ------------ makefu/5pkgs/default.nix | 3 --- 3 files changed, 34 deletions(-) delete mode 100644 makefu/2configs/rtorrent.nix delete mode 100644 makefu/5pkgs/custom/inkscape/dxf_fix.patch (limited to 'makefu') diff --git a/makefu/2configs/rtorrent.nix b/makefu/2configs/rtorrent.nix deleted file mode 100644 index 9e2990cab..000000000 --- a/makefu/2configs/rtorrent.nix +++ /dev/null @@ -1,19 +0,0 @@ -_: -let - listenPort = 60123; - xml-port = 5000; - authfile = ; -in { - makefu.rtorrent = { - enable = true; - web = { - enable = true; - enableAuth = true; - inherit authfile; - }; - rutorrent.enable = true; - enableXMLRPC = true; - logLevel = "debug"; - inherit listenPort; - }; -} diff --git a/makefu/5pkgs/custom/inkscape/dxf_fix.patch b/makefu/5pkgs/custom/inkscape/dxf_fix.patch deleted file mode 100644 index b7b491d4e..000000000 --- a/makefu/5pkgs/custom/inkscape/dxf_fix.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- ./share/extensions/dxf_outlines.py 2017-10-08 17:28:45.553368917 +0200 -+++ ./share/extensions/dxf_outlines.py.new 2017-10-08 17:29:20.172554152 +0200 -@@ -341,7 +341,7 @@ - if not scale: - scale = 25.4/96 # if no scale is specified, assume inch as baseunit - scale /= self.unittouu('1px') -- h = self.unittouu(self.document.getroot().xpath('@height', namespaces=inkex.NSS)[0]) -+ h = self.unittouu(self.documentHeight()) - self.groupmat = [[[scale, 0.0, 0.0], [0.0, -scale, h*scale]]] - doc = self.document.getroot() - self.process_group(doc) - diff --git a/makefu/5pkgs/default.nix b/makefu/5pkgs/default.nix index 390aabd73..6e86f4264 100644 --- a/makefu/5pkgs/default.nix +++ b/makefu/5pkgs/default.nix @@ -30,9 +30,6 @@ in { qcma = super.pkgs.libsForQt5.callPackage ./custom/qcma { }; inherit (callPackage ./devpi {}) devpi-web ; nodemcu-uploader = super.pkgs.callPackage ./nodemcu-uploader {}; - inkscape = super.pkgs.stdenv.lib.overrideDerivation super.inkscape (old: { - patches = [ ./custom/inkscape/dxf_fix.patch ]; - }); } // (mapAttrs (_: flip callPackage {}) -- cgit v1.2.3 From 9b638b239aa37038b0223840cdf4e5885d1565ea Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 10 Oct 2018 00:08:16 +0200 Subject: ma pkgs.esniper: replaced by upstream --- .../deployment/events-publisher/default.nix | 49 ---------------------- makefu/2configs/shack/events-publisher/default.nix | 49 ++++++++++++++++++++++ makefu/5pkgs/esniper/default.nix | 32 -------------- makefu/5pkgs/esniper/find-ca-bundle.patch | 26 ------------ 4 files changed, 49 insertions(+), 107 deletions(-) delete mode 100644 makefu/2configs/deployment/events-publisher/default.nix create mode 100644 makefu/2configs/shack/events-publisher/default.nix delete mode 100644 makefu/5pkgs/esniper/default.nix delete mode 100644 makefu/5pkgs/esniper/find-ca-bundle.patch (limited to 'makefu') diff --git a/makefu/2configs/deployment/events-publisher/default.nix b/makefu/2configs/deployment/events-publisher/default.nix deleted file mode 100644 index 37d74c282..000000000 --- a/makefu/2configs/deployment/events-publisher/default.nix +++ /dev/null @@ -1,49 +0,0 @@ -{ pkgs, ... }: -with import ; -let - shack-announce = pkgs.callPackage (builtins.fetchTarball { - url = "https://github.com/makefu/events-publisher/archive/c5218195e6afdc646cb7682d8f355a7ec2b90716.tar.gz"; - sha256 = "0xk74q7gah3l5zy3bkvih3k9fr1hclvf71rm3ixcmslhicl7khav"; - }) {} ; - home = "/var/lib/shackannounce"; - user = "shackannounce"; - creds = (toString ) + "/shack-announce.json"; - LOL = "DEBUG"; -in -{ - users.users.${user}= { - uid = genid user; - inherit home; - createHome = true; - }; - systemd.services.shack-announce = { - description = "Announce shack events"; - startAt = "*:0/30"; - path = [ shack-announce ]; - serviceConfig = { - WorkingDirectory = home; - User = user; - PermissionsStartOnly = true; - ExecStartPre = pkgs.writeDash "shack-announce-pre" '' - set -eu - cp ${creds} creds.json - chown ${user} creds.json - ''; - ExecStart = pkgs.writeDash "shack-announce" '' - if test ! -e announce.state; then - echo "initializing state" - announce-daemon \ - --lol ${LOL} \ - --creds creds.json \ - --state announce.state \ - --clean --init - fi - echo "Running announce" - announce-daemon \ - --lol ${LOL} \ - --creds creds.json \ - --state announce.state - ''; - }; - }; -} diff --git a/makefu/2configs/shack/events-publisher/default.nix b/makefu/2configs/shack/events-publisher/default.nix new file mode 100644 index 000000000..37d74c282 --- /dev/null +++ b/makefu/2configs/shack/events-publisher/default.nix @@ -0,0 +1,49 @@ +{ pkgs, ... }: +with import ; +let + shack-announce = pkgs.callPackage (builtins.fetchTarball { + url = "https://github.com/makefu/events-publisher/archive/c5218195e6afdc646cb7682d8f355a7ec2b90716.tar.gz"; + sha256 = "0xk74q7gah3l5zy3bkvih3k9fr1hclvf71rm3ixcmslhicl7khav"; + }) {} ; + home = "/var/lib/shackannounce"; + user = "shackannounce"; + creds = (toString ) + "/shack-announce.json"; + LOL = "DEBUG"; +in +{ + users.users.${user}= { + uid = genid user; + inherit home; + createHome = true; + }; + systemd.services.shack-announce = { + description = "Announce shack events"; + startAt = "*:0/30"; + path = [ shack-announce ]; + serviceConfig = { + WorkingDirectory = home; + User = user; + PermissionsStartOnly = true; + ExecStartPre = pkgs.writeDash "shack-announce-pre" '' + set -eu + cp ${creds} creds.json + chown ${user} creds.json + ''; + ExecStart = pkgs.writeDash "shack-announce" '' + if test ! -e announce.state; then + echo "initializing state" + announce-daemon \ + --lol ${LOL} \ + --creds creds.json \ + --state announce.state \ + --clean --init + fi + echo "Running announce" + announce-daemon \ + --lol ${LOL} \ + --creds creds.json \ + --state announce.state + ''; + }; + }; +} diff --git a/makefu/5pkgs/esniper/default.nix b/makefu/5pkgs/esniper/default.nix deleted file mode 100644 index a6aac5748..000000000 --- a/makefu/5pkgs/esniper/default.nix +++ /dev/null @@ -1,32 +0,0 @@ -{ stdenv, fetchurl , openssl, curl, coreutils, gawk, bash, which }: - -stdenv.mkDerivation rec { - name = "${pname}-2-35-0"; - pname = "esniper"; - version = "2.35.0"; - src = fetchurl { - url = "mirror://sourceforge/${pname}/${name}.tgz"; - sha256 = "04iwjb42lw90c03125bjdpnm0fp78dmwf2j35r7mah0nwcrlagd9"; - }; - - - buildInputs = [ openssl curl ]; - - # Add support for CURL_CA_BUNDLE variable. - # Fix . - patches = [ ./find-ca-bundle.patch ]; - - postInstall = '' - sed <"frontends/snipe" >"$out/bin/snipe" \ - -e "2i export PATH=\"$out/bin:${stdenv.lib.makeBinPath [ coreutils gawk bash which ]}:\$PATH\"" - chmod 555 "$out/bin/snipe" - ''; - - meta = with stdenv.lib; { - description = "Simple, lightweight tool for sniping eBay auctions"; - homepage = http://esniper.sourceforge.net; - license = licenses.gpl2; - maintainers = with maintainers; [ lovek323 peti ]; - platforms = platforms.all; - }; -} diff --git a/makefu/5pkgs/esniper/find-ca-bundle.patch b/makefu/5pkgs/esniper/find-ca-bundle.patch deleted file mode 100644 index e4df272a0..000000000 --- a/makefu/5pkgs/esniper/find-ca-bundle.patch +++ /dev/null @@ -1,26 +0,0 @@ -diff -ubr '--exclude=*.o' esniper-2-27-0-orig/http.c esniper-2-27-0-patched/http.c ---- esniper-2-27-0-orig/http.c 2012-02-06 22:04:06.000000000 +0100 -+++ esniper-2-27-0-patched/http.c 2012-07-27 10:54:20.893054646 +0200 -@@ -200,6 +200,9 @@ - int - initCurlStuff(void) - { -+ /* Path to OpenSSL bundle file. */ -+ const char *ssl_capath=NULL; -+ - /* list for custom headers */ - struct curl_slist *slist=NULL; - -@@ -241,6 +244,12 @@ - if ((curlrc = curl_easy_setopt(easyhandle, CURLOPT_COOKIEFILE, ""))) - return initCurlStuffFailed(); - -+ /* If the environment variable CURL_CA_BUNDLE is set, pass through its -+ * contents to curl. */ -+ if ((ssl_capath = getenv("CURL_CA_BUNDLE"))) -+ if ((curlrc = curl_easy_setopt(easyhandle, CURLOPT_CAINFO, ssl_capath))) -+ return initCurlStuffFailed(); -+ - slist = curl_slist_append(slist, "Accept: text/*"); - slist = curl_slist_append(slist, "Accept-Language: en"); - slist = curl_slist_append(slist, "Accept-Charset: iso-8859-1,*,utf-8"); -- cgit v1.2.3 From a083d352b416ba6d13bd15534473053a29ede50b Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 10 Oct 2018 14:07:42 +0200 Subject: ma pkgs.ifdnfc: rip --- makefu/5pkgs/ifdnfc/default.nix | 45 ----------------------------------------- 1 file changed, 45 deletions(-) delete mode 100644 makefu/5pkgs/ifdnfc/default.nix (limited to 'makefu') diff --git a/makefu/5pkgs/ifdnfc/default.nix b/makefu/5pkgs/ifdnfc/default.nix deleted file mode 100644 index cc7956c8c..000000000 --- a/makefu/5pkgs/ifdnfc/default.nix +++ /dev/null @@ -1,45 +0,0 @@ -{ stdenv, fetchFromGitHub , pkgconfig -, pcsclite -, autoreconfHook -, libnfc -}: - -stdenv.mkDerivation rec { - name = "ifdnfc-${version}"; - version = "2016-03-01"; - - src = fetchFromGitHub { - owner = "nfc-tools"; - repo = "ifdnfc"; - rev = "0e48e8e"; - sha256 = "1cxnvhhlcbm8h49rlw5racspb85fmwqqhd3gzzpzy68vrs0b37vg"; - }; - nativeBuildInputs = [ pkgconfig autoreconfHook ]; - buildInputs = [ pcsclite libnfc ]; - - configureFlags = [ "--prefix=$(out)" ]; - makeFlags = [ "DESTDIR=/" "usbdropdir=$(out)/pcsc/drivers" ]; - - meta = with stdenv.lib; { - description = "PC/SC IFD Handler based on libnfc"; - long_description = - '' libnfc Interface Plugin to be used in services.pcscd.plugins. - It provides support for all readers which are not supported by ccid but by libnfc. - - For activating your reader you need to run - ifdnfc-activate yes with this package in your - environment.systemPackages - - To use your reader you may need to blacklist your reader kernel modules: - boot.blacklistedKernelModules = [ "pn533" "pn533_usb" "nfc" ]; - - Supports the pn533 smart-card reader chip which is for example used in - the SCM SCL3711. - ''; - homepage = https://github.com/nfc-tools/ifdnfc; - license = licenses.gpl3; - platforms = platforms.linux; - maintainers = with maintainers; [ makefu ]; - }; -} - -- cgit v1.2.3 From f97f63deab36b7ff774c4f132c1a87daecc8e9f5 Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 10 Oct 2018 14:08:18 +0200 Subject: ma events-publisher: bump version --- makefu/2configs/shack/events-publisher/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'makefu') diff --git a/makefu/2configs/shack/events-publisher/default.nix b/makefu/2configs/shack/events-publisher/default.nix index 37d74c282..93a965e95 100644 --- a/makefu/2configs/shack/events-publisher/default.nix +++ b/makefu/2configs/shack/events-publisher/default.nix @@ -2,8 +2,8 @@ with import ; let shack-announce = pkgs.callPackage (builtins.fetchTarball { - url = "https://github.com/makefu/events-publisher/archive/c5218195e6afdc646cb7682d8f355a7ec2b90716.tar.gz"; - sha256 = "0xk74q7gah3l5zy3bkvih3k9fr1hclvf71rm3ixcmslhicl7khav"; + url = "https://github.com/makefu/events-publisher/archive/1e98edfabfe5574586b4eb8d30d315ae2afb1f9f.tar.gz"; + sha256 = "013ca4dkkzc7q49cwad6fxpxv01hd8va02025pazlz5q223nk70z"; }) {} ; home = "/var/lib/shackannounce"; user = "shackannounce"; -- cgit v1.2.3 From 431cf1348b97fe6364ece67616f345b887f34b75 Mon Sep 17 00:00:00 2001 From: makefu Date: Sun, 14 Oct 2018 23:46:51 +0200 Subject: ma omo.r: enable airdcpp --- makefu/1systems/omo/config.nix | 43 ++++++++++++++++++++++++++++++------------ 1 file changed, 31 insertions(+), 12 deletions(-) (limited to 'makefu') diff --git a/makefu/1systems/omo/config.nix b/makefu/1systems/omo/config.nix index be49db024..9eb8cbf49 100644 --- a/makefu/1systems/omo/config.nix +++ b/makefu/1systems/omo/config.nix @@ -8,11 +8,11 @@ let in { imports = [ - #./hw/omo.nix - ./hw/tsp.nix + ./hw/omo.nix + #./hw/tsp.nix - + # @@ -25,6 +25,22 @@ in { # # + + { krebs.airdcpp.dcpp.shares = let + d = path: "/media/cryptX/${path}"; + in { + emu.path = d "emu"; + audiobooks.path = lib.mkForce (d "audiobooks"); + incoming.path = lib.mkForce (d "torrent"); + anime.path = d "anime"; + }; + krebs.airdcpp.dcpp.DownloadDirectory = "/media/cryptX/torrent/dcpp"; + } + { + # copy config from to /var/lib/sabnzbd/ + #services.sabnzbd.enable = true; + #systemd.services.sabnzbd.environment.SSL_CERT_FILE = "${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt"; + } # @@ -41,12 +57,22 @@ in { # services - + { + services.nginx.enable = true; + networking.firewall.allowedTCPPorts = [ 80 ]; + } + # + { + makefu.ps3netsrv = { + enable = true; + servedir = "/media/cryptX/emu/ps3"; + }; + } { hardware.pulseaudio.systemWide = true; makefu.mpd.musicDirectory = "/media/cryptX/music"; @@ -74,7 +100,7 @@ in { krebs.rtorrent = (builtins.trace (builtins.toJSON config.services.telegraf.extraConfig)) { downloadDir = lib.mkForce "/media/cryptX/torrent"; extraConfig = '' - upload_rate = 200 + upload_rate = 500 ''; }; users.groups.share = { @@ -83,14 +109,7 @@ in { }; networking.firewall.trustedInterfaces = [ primaryInterface ]; - # copy config from to /var/lib/sabnzbd/ - services.sabnzbd.enable = true; - systemd.services.sabnzbd.environment.SSL_CERT_FILE = "${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt"; - makefu.ps3netsrv = { - enable = true; - servedir = "/media/cryptX/emu/ps3"; - }; users.users.misa = { uid = 9002; -- cgit v1.2.3 From 0cfc9b54a0d588dadef3642aa6b3872f0392a220 Mon Sep 17 00:00:00 2001 From: makefu Date: Sun, 14 Oct 2018 23:47:18 +0200 Subject: ma airdcpp: enable state tracking --- makefu/2configs/dcpp/airdcpp.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'makefu') diff --git a/makefu/2configs/dcpp/airdcpp.nix b/makefu/2configs/dcpp/airdcpp.nix index fe05effd9..ad62babc3 100644 --- a/makefu/2configs/dcpp/airdcpp.nix +++ b/makefu/2configs/dcpp/airdcpp.nix @@ -44,5 +44,6 @@ ''; }; - + state = map (f: "${config.krebs.airdcpp.stateDir}/${f}") + [ "Favorites.xml" "DCPlusPlus.xml" "WebServer.xml" "Recents.xml" "IgnoredUsers.xml" ]; } -- cgit v1.2.3 From efc70c213c464d0a4eecd80e1acf886c8deb787a Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 17 Oct 2018 00:34:46 +0200 Subject: ma homeautomation: cleanup, add flurlicht --- makefu/2configs/deployment/bureautomation/home.nix | 67 ----------- .../2configs/deployment/homeautomation/default.nix | 127 +++++++++++++++++---- 2 files changed, 102 insertions(+), 92 deletions(-) delete mode 100644 makefu/2configs/deployment/bureautomation/home.nix (limited to 'makefu') diff --git a/makefu/2configs/deployment/bureautomation/home.nix b/makefu/2configs/deployment/bureautomation/home.nix deleted file mode 100644 index 28edb6af2..000000000 --- a/makefu/2configs/deployment/bureautomation/home.nix +++ /dev/null @@ -1,67 +0,0 @@ -{ pkgs, lib, ... }: -let - firetv = "192.168.1.238"; -in { - systemd.services.firetv = { - wantedBy = [ "multi-user.target" ]; - serviceConfig = { - User = "nobody"; - ExecStart = "${pkgs.python-firetv}/bin/firetv-server -d ${firetv}:5555"; - }; - }; - services.home-assistant = { - #panel_iframe: - #configurator: - # title: Configurator - # icon: mdi:wrench - # url: http://hassio.local:3218 - # sensor: - # - platform: random - enable = true; - config = { - homeassistant = { - name = "Bureautomation"; - time_zone = "Europe/Berlin"; - }; - panel_iframe = { - euer_blog = { - title = "Euer Blog"; - icon = "mdi:wrench"; - url = "https://euer.krebsco.de"; - }; - }; - media_player = [ - { platform = "kodi"; - host = firetv; - } - { platform = "firetv"; - # assumes python-firetv running - } - ]; - sensor = [ - { - platform = "luftdaten"; - name = "Shack 1"; - sensorid = "50"; - monitored_conditions = [ "P1" "P2" ]; - } - { - platform = "luftdaten"; - name = "Shack 2"; - sensorid = "658"; - monitored_conditions = [ "P1" "P2" ]; - } - { - platform = "luftdaten"; - name = "Ditzingen"; - sensorid = "5341"; - monitored_conditions = [ "P1" "P2" ]; - } - { platform = "random"; } - ]; - frontend = { }; - http = { }; - feedreader.urls = [ "https://nixos.org/blogs.xml" ]; - }; - }; -} diff --git a/makefu/2configs/deployment/homeautomation/default.nix b/makefu/2configs/deployment/homeautomation/default.nix index f2a3b36e2..5da0dba2e 100644 --- a/makefu/2configs/deployment/homeautomation/default.nix +++ b/makefu/2configs/deployment/homeautomation/default.nix @@ -1,9 +1,60 @@ -{ pkgs, config, ... }: +{ pkgs, lib, config, ... }: # Ideas: ## wake-on-lan server ## let + tasmota_rgb = name: topic: +# LED WS2812b +# effect_state_topic: "stat/led/Scheme" +# effect_command_topic: "cmnd/led/Scheme" +# effect_value_template: "{{ value_json.Scheme }}" + { platform = "mqtt"; + inherit name; + retain = false; + qos = 1; + optimistic = false; + # state + # TODO: currently broken, will not use the custom state topic + #state_topic = "/ham/${topic}/stat/POWER"; + state_topic = "stat/${topic}/POWER"; + command_topic = "/ham/${topic}/cmnd/POWER"; + availability_topic = "/ham/${topic}/tele/LWT"; + payload_on= "ON"; + payload_off= "OFF"; + payload_available= "Online"; + payload_not_available= "Offline"; + # brightness + brightness_state_topic = "/ham/${topic}/stat/Dimmer"; + brightness_command_topic = "/ham/${topic}/cmnd/Dimmer"; + brightness_value_template = "{{ value_json.Dimmer }}"; + brightness_scale = 100; + # color + rgb_state_topic = "/ham/${topic}/stat/Color"; + rgb_command_topic = "/ham/${topic}/cmnd/Color2"; + rgb_command_mode = "hex"; + rgb_command_template = "{{ '%02x%02x%02x' | format(red, green, blue)}}"; + # effects + effect_state_topic = "/ham/${topic}/stat/Scheme"; + effect_command_topic = "/ham/${topic}/cmnd/Scheme"; + effect_value_template = "{{ value_json.Scheme }}"; + effect_list = [ 0 1 2 3 4 5 6 7 8 9 10 11 12 ]; +}; + # switchmode 1 - also toggle power + # switchtopic flurlicht + tasmota_motion = name: topic: + { platform = "mqtt"; + device_class = "motion"; + inherit name; + # TODO: currently broken, will not use the custom state topic + state_topic = "stat/${topic}/POWER"; + payload_on = "ON"; + payload_off = "OFF"; + availability_topic = "/ham/${topic}/tele/LWT"; + payload_available = "Online"; + payload_not_available = "Offline"; + }; + firetv = "192.168.1.238"; tasmota_plug = name: topic: { platform = "mqtt"; @@ -40,16 +91,13 @@ in { imports = [ ./mqtt.nix ]; - systemd.services.firetv = { - wantedBy = [ "multi-user.target" ]; - serviceConfig = { - User = "nobody"; - ExecStart = "${pkgs.python-firetv}/bin/firetv-server -d ${firetv}:5555"; - }; - }; - nixpkgs.config.permittedInsecurePackages = [ - "homeassistant-0.65.5" - ]; + #systemd.services.firetv = { + # wantedBy = [ "multi-user.target" ]; + # serviceConfig = { + # User = "nobody"; + # ExecStart = "${pkgs.python-firetv}/bin/firetv-server -d ${firetv}:5555"; + # }; + #}; services.home-assistant = { config = { homeassistant = { @@ -58,7 +106,7 @@ in { longitude = "9.2478"; elevation = 247; }; - discovery = {}; + #discovery = {}; conversation = {}; history = {}; logbook = {}; @@ -71,16 +119,16 @@ in { { platform = "kodi"; host = firetv; } - { platform = "firetv"; - # assumes python-firetv running - } + #{ platform = "firetv"; + # # assumes python-firetv running + #} ]; mqtt = { broker = "localhost"; port = 1883; client_id = "home-assistant"; username = "hass"; - password = builtins.readFile ; + password = lib.removeSuffix "\n" (builtins.readFile ); keepalive = 60; protocol = 3.1; birth_message = { @@ -96,10 +144,14 @@ in { retain = true; }; }; + binary_sensor = [ + (tasmota_motion "Flur Bewegung" "flurlicht") + ]; sensor = [ - { platform = "speedtest"; - monitored_conditions = [ "ping" "download" "upload" ]; - } + # broken + #{ platform = "speedtest"; + # monitored_conditions = [ "ping" "download" "upload" ]; + #} { platform = "luftdaten"; name = "Ditzingen"; sensorid = "663"; @@ -107,7 +159,8 @@ in { } # https://www.home-assistant.io/cookbook/automation_for_rainy_days/ { platform = "darksky"; - api_key = "c73619e6ea79e553a585be06aacf3679"; + api_key = lib.removeSuffix "\n" + (builtins.readFile ); language = "de"; monitored_conditions = [ "summary" "icon" "nearest_storm_distance" "precip_probability" @@ -125,15 +178,39 @@ in { } ] ++ (tasmota_bme "Schlafzimmer" "schlafzimmer"); frontend = { }; - #group = [ - # { default_view = { view = "yes"; entities = [ - # "sensor.luftdaten" - # ]} - #]; + group = + { default_view = + { view = "yes"; + entities = [ + "group.flur" + "group.schlafzimmer" + "group.draussen" + "group.wohnzimmer" + ]; + }; + flur = [ + "light.flurlicht" + "binary_sensor.flur_bewegung" + ]; + wohnzimmer = [ + "media_player.kodi" + ]; + draussen = [ + "sensor.dark_sky_temperature" + "sensor.dark_sky_hourly_summary" + ]; + schlafzimmer = [ + "sensor.schlafzimmer_temperatur" + "sensor.schlafzimmer_luftdruck" + "sensor.schlafzimmer_luftfeuchtigkeit" + "switch.lichterkette_schlafzimmer" + ]; + }; http = { }; switch = [ (tasmota_plug "Lichterkette Schlafzimmer" "schlafzimmer") ]; + light = [ (tasmota_rgb "Flurlicht" "flurlicht" ) ]; }; enable = true; #configDir = "/var/lib/hass"; -- cgit v1.2.3 From c6de0074ebe4197fbcdd9665cc597b455312b32c Mon Sep 17 00:00:00 2001 From: makefu Date: Sat, 20 Oct 2018 21:39:26 +0200 Subject: ma pkgs.ns-atmosphere-programmer: init --- makefu/5pkgs/ns-atmosphere-programmer/default.nix | 36 +++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 makefu/5pkgs/ns-atmosphere-programmer/default.nix (limited to 'makefu') diff --git a/makefu/5pkgs/ns-atmosphere-programmer/default.nix b/makefu/5pkgs/ns-atmosphere-programmer/default.nix new file mode 100644 index 000000000..1e1cb1d86 --- /dev/null +++ b/makefu/5pkgs/ns-atmosphere-programmer/default.nix @@ -0,0 +1,36 @@ +{ stdenv, fetchzip +, makeWrapper +, autoPatchelfHook +, xlibs +, gnome3 +, libpng12 +}: +stdenv.mkDerivation rec { + name = "ns-atmosphere-programmer-${version}"; + version = "0.1"; + + src = fetchzip { + url = "http://www.ns-atmosphere.com/media/content/ns-atmosphere-programmer-linux-v01.zip"; + sha256 = "0g2fxbirgi0lm0mi69cmknqj7626fxjkwn98bqx5pcalxplww8k0"; + }; + + buildInputs = with xlibs; [ libX11 libXxf86vm libSM gnome3.gtk libpng12 ]; + nativeBuildInputs = [ autoPatchelfHook makeWrapper ]; + + installPhase = '' + install -D -m755 NS-Atmosphere-Programmer-Linux-v0.1/NS-Atmosphere $out/bin/NS-Atmosphere + wrapProgram $out/bin/NS-Atmosphere --prefix XDG_DATA_DIRS : "$GSETTINGS_SCHEMAS_PATH" \ +--suffix XDG_DATA_DIRS : '${gnome3.defaultIconTheme}/share' + ''; + + dontStrip = true; + + meta = with stdenv.lib; { + description = "Payload programmer for ns-atmosphere injector"; + homepage = http://www.ns-atmosphere.com; + maintainers = [ maintainers.makefu ]; + platforms = platforms.linux; + license = with licenses; [ unfree ]; + }; + +} -- cgit v1.2.3 From 72a009b6a5593ca6885ca83517dfd99cefe2d3cb Mon Sep 17 00:00:00 2001 From: makefu Date: Sun, 21 Oct 2018 00:16:12 +0200 Subject: ma shack/events-publisher: bump to latest version --- makefu/2configs/shack/events-publisher/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'makefu') diff --git a/makefu/2configs/shack/events-publisher/default.nix b/makefu/2configs/shack/events-publisher/default.nix index 93a965e95..531d2525e 100644 --- a/makefu/2configs/shack/events-publisher/default.nix +++ b/makefu/2configs/shack/events-publisher/default.nix @@ -2,8 +2,8 @@ with import ; let shack-announce = pkgs.callPackage (builtins.fetchTarball { - url = "https://github.com/makefu/events-publisher/archive/1e98edfabfe5574586b4eb8d30d315ae2afb1f9f.tar.gz"; - sha256 = "013ca4dkkzc7q49cwad6fxpxv01hd8va02025pazlz5q223nk70z"; + url = "https://github.com/makefu/events-publisher/archive/670f4d7182a41b6763296e301612499d2986f213.tar.gz"; + sha256 = "1yf9cb08v4rc6x992yx5lcyn62sm3p8i2b48rsmr4m66xdi4bpnd"; }) {} ; home = "/var/lib/shackannounce"; user = "shackannounce"; -- cgit v1.2.3 From cea8403dc5eb48792c9ccd4c4fc9584a84ba4238 Mon Sep 17 00:00:00 2001 From: makefu Date: Sun, 21 Oct 2018 00:18:59 +0200 Subject: ma shack/gitlab-ci: maintain own config --- makefu/2configs/shack/gitlab-runner/default.nix | 31 +++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 makefu/2configs/shack/gitlab-runner/default.nix (limited to 'makefu') diff --git a/makefu/2configs/shack/gitlab-runner/default.nix b/makefu/2configs/shack/gitlab-runner/default.nix new file mode 100644 index 000000000..55dc50fa8 --- /dev/null +++ b/makefu/2configs/shack/gitlab-runner/default.nix @@ -0,0 +1,31 @@ + +{ + systemd.services.gitlab-runner.path = [ + "/run/wrappers" # /run/wrappers/bin/su + "/" # /bin/sh + ]; + services.gitlab-runner = { + enable = true; + configOptions = + { concurrent = 1; + runners = [ + { builds_dir = ""; + #docker = + #{ cache_dir = ""; + # disable_cache = true; + # host = ""; image = "nixos/nix:2.1.3"; + # privileged = true; + #}; + #executor = "docker"; + # name = "docker-nix"; + name = "gum-shell"; + executor = "shell"; + 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" ]; + # generate via `gitlab-runner register` + token = import ; + url = "https://git.shackspace.de/"; + } + ]; + }; + }; +} -- cgit v1.2.3 From 489d3924307171751b174d62f64ce29a5c2550cf Mon Sep 17 00:00:00 2001 From: makefu Date: Sun, 21 Oct 2018 23:04:27 +0200 Subject: ma backup: init --- makefu/2configs/backup/server.nix | 11 +++++++++++ makefu/2configs/backup/ssh/gum.pub | 1 + makefu/2configs/backup/ssh/nextgum.pub | 1 + makefu/2configs/backup/ssh/omo.pub | 1 + makefu/2configs/backup/ssh/x.pub | 1 + makefu/2configs/backup/state.nix | 25 +++++++++++++++++++++++++ 6 files changed, 40 insertions(+) create mode 100644 makefu/2configs/backup/server.nix create mode 100644 makefu/2configs/backup/ssh/gum.pub create mode 100644 makefu/2configs/backup/ssh/nextgum.pub create mode 100644 makefu/2configs/backup/ssh/omo.pub create mode 100644 makefu/2configs/backup/ssh/x.pub create mode 100644 makefu/2configs/backup/state.nix (limited to 'makefu') diff --git a/makefu/2configs/backup/server.nix b/makefu/2configs/backup/server.nix new file mode 100644 index 000000000..f157e715f --- /dev/null +++ b/makefu/2configs/backup/server.nix @@ -0,0 +1,11 @@ +{lib, ... }: +let + hosts = lib.mapAttrsToList (f: _: lib.removeSuffix ".pub" f) (builtins.readDir ./ssh ); +in { + # TODO: for all enabled machines + services.borgbackup.repos = lib.genAttrs hosts (host: { + authorizedKeys = [ (builtins.readFile (./ssh + "/${host}.pub") ) ]; + path = "/var/lib/borgbackup/${host}"; + user = "borg-${host}"; + }) ; +} diff --git a/makefu/2configs/backup/ssh/gum.pub b/makefu/2configs/backup/ssh/gum.pub new file mode 100644 index 000000000..ed203d544 --- /dev/null +++ b/makefu/2configs/backup/ssh/gum.pub @@ -0,0 +1 @@ +ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOSCJe7DQkKbL58pL78ImO+nVI/aaNFP8Zyqgo8EbNhW makefu@x diff --git a/makefu/2configs/backup/ssh/nextgum.pub b/makefu/2configs/backup/ssh/nextgum.pub new file mode 100644 index 000000000..52d56d956 --- /dev/null +++ b/makefu/2configs/backup/ssh/nextgum.pub @@ -0,0 +1 @@ +ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOUZcfi2SXxCo1if0oU3x9qPK8/O5FmiXy2HFZyTp/P1 makefu@x diff --git a/makefu/2configs/backup/ssh/omo.pub b/makefu/2configs/backup/ssh/omo.pub new file mode 100644 index 000000000..053b4da87 --- /dev/null +++ b/makefu/2configs/backup/ssh/omo.pub @@ -0,0 +1 @@ +ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAtA3XzpjByYQ9uSHQr0dkNUyi6nROjwv1S2IQtUu4pi makefu@x diff --git a/makefu/2configs/backup/ssh/x.pub b/makefu/2configs/backup/ssh/x.pub new file mode 100644 index 000000000..fe894df33 --- /dev/null +++ b/makefu/2configs/backup/ssh/x.pub @@ -0,0 +1 @@ +ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBRfhUv9twYbO7tUe2r2LOXEMNxW14GO3Q0RTkUWeMxw makefu@x diff --git a/makefu/2configs/backup/state.nix b/makefu/2configs/backup/state.nix new file mode 100644 index 000000000..1143708bf --- /dev/null +++ b/makefu/2configs/backup/state.nix @@ -0,0 +1,25 @@ +{ config, ... }: +# back up all state +let + sec = toString ; + sshkey = sec + "/borg.priv"; + phrase = sec + "/borg.pw"; +in +{ + services.borgbackup.jobs.state = { + repo = "borg-${config.krebs.build.host.name}@backup.makefu.r:."; + paths = config.state; + encryption = { + mode = "repokey"; + passCommand = "cat ${phrase}"; + }; + environment.BORG_RSH = "ssh -i ${sshkey}"; + prune.keep = + { daily = 7; + weekly = 4; + monthly = -1; # Keep at least one archive for each month + }; + compression = "auto,lzma"; + startAt = "daily"; + }; +} -- cgit v1.2.3 From 23d99c1ae27744d00b25e0615797c357642c4112 Mon Sep 17 00:00:00 2001 From: makefu Date: Sun, 21 Oct 2018 23:05:21 +0200 Subject: ma backup: streamline, RIP old rsync --- makefu/2configs/backup.nix | 52 --------------------------------------- makefu/2configs/laptop-backup.nix | 12 --------- 2 files changed, 64 deletions(-) delete mode 100644 makefu/2configs/backup.nix delete mode 100644 makefu/2configs/laptop-backup.nix (limited to 'makefu') diff --git a/makefu/2configs/backup.nix b/makefu/2configs/backup.nix deleted file mode 100644 index a4d02af6b..000000000 --- a/makefu/2configs/backup.nix +++ /dev/null @@ -1,52 +0,0 @@ -{ config, lib, pkgs, ... }: -with import ; -let - # preparation: - # mkdir -p defaultBackupDir/host.name/src - # as root on omo: - # ssh-copy-id root@src - startAt = "0,6,12,18:00"; - defaultBackupServer = config.krebs.hosts.omo; - defaultBackupDir = "/home/backup"; - defaultPull = host: src: { - method = "pull"; - src = { - inherit host; - path = src; - }; - dst = { - host = defaultBackupServer; - path = "${defaultBackupDir}/${host.name}${src}"; - }; - startAt = "0,6,12,18:00"; - snapshots = { - hourly = { format = "%Y-%m-%dT%H"; retain = 4; }; - daily = { format = "%Y-%m-%d"; retain = 7; }; - weekly = { format = "%YW%W"; retain = 4; }; - monthly = { format = "%Y-%m"; retain = 12; }; - yearly = { format = "%Y"; }; - }; - }; -in { - krebs.backup.plans = { - # wry-to-omo_root = defaultPull config.krebs.hosts.wry "/"; - gum-to-omo_root = defaultPull config.krebs.hosts.gum "/"; - gum-dl-to-omo_external = (defaultPull config.krebs.hosts.gum "/var/download" )// - { - dst.path = "/media/cryptX/backup/gum/var-download"; - dst.host = defaultBackupServer; - startAt = "19:00"; - }; - gum-owncloud-to-omo_external = (defaultPull config.krebs.hosts.gum "/var/www/o.euer.krebsco.de" )// - { - dst.path = "/media/cryptX/backup/gum/var-www-o.euer.krebsco.de"; - dst.host = defaultBackupServer; - - startAt = "05:00"; - }; - # wolf-to-omo_root = defaultPull config.krebs.hosts.wolf "/"; - }; - environment.systemPackages = [ - pkgs.borgbackup - ]; -} diff --git a/makefu/2configs/laptop-backup.nix b/makefu/2configs/laptop-backup.nix deleted file mode 100644 index 8df7043c8..000000000 --- a/makefu/2configs/laptop-backup.nix +++ /dev/null @@ -1,12 +0,0 @@ -{config, lib, pkgs, ... }: - -{ - systemd.user.services.duply-secrets = { - description = "run daily secrets backup"; - startAt = "daily"; - serviceConfig = { - Type = "oneshot"; - ExecStart = "{pkgs.duply}/bin/duply omo-secrets backup"; - }; - }; -} -- cgit v1.2.3 From 102d394330ae8212907380b284c07bea4edd69e1 Mon Sep 17 00:00:00 2001 From: makefu Date: Sun, 21 Oct 2018 23:09:24 +0200 Subject: ma krops: bump home-manager --- makefu/krops.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'makefu') diff --git a/makefu/krops.nix b/makefu/krops.nix index 4f55915af..2f6f3a3d7 100644 --- a/makefu/krops.nix +++ b/makefu/krops.nix @@ -69,7 +69,7 @@ (lib.mkIf ( host-src.home-manager ) { home-manager.git = { url = https://github.com/rycee/home-manager; - ref = "6eea2a4"; + ref = "f947faf"; }; }) ]; -- cgit v1.2.3 From 8845ee8363feff8d944db4dd954bae9fda6345f1 Mon Sep 17 00:00:00 2001 From: makefu Date: Sun, 21 Oct 2018 23:09:48 +0200 Subject: ma pkgs.switch-launcher: init --- makefu/5pkgs/switch-launcher/default.nix | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 makefu/5pkgs/switch-launcher/default.nix (limited to 'makefu') diff --git a/makefu/5pkgs/switch-launcher/default.nix b/makefu/5pkgs/switch-launcher/default.nix new file mode 100644 index 000000000..cc7905a31 --- /dev/null +++ b/makefu/5pkgs/switch-launcher/default.nix @@ -0,0 +1,24 @@ +{ lib, pkgs, python3Packages, ... }: + +with python3Packages; buildPythonPackage rec { + name = "nodemcu-uploader-${version}"; + version = "0.1.0"; + + src = pkgs.fetchFromGitHub { + owner = "ksmit799"; + repo = "switch-launcher"; + rev = version; + sha256 = "0j24dwiqqjiks59s8gilnplsls130mp1jssg2rpjrvj0jg0w52zz"; + }; + + + propagatedBuildInputs = [ + pyusb + ]; + + meta = { + homepage = https://github.com/ksmit799/switch-launcher; + description = "Desktop switch payload launcher based on a modified reswitched injector"; + license = lib.licenses.bsd3; + }; +} -- cgit v1.2.3 From 29752c0970c2964a7b1a5434fb7a583dd302ef43 Mon Sep 17 00:00:00 2001 From: makefu Date: Sun, 21 Oct 2018 23:10:25 +0200 Subject: ma pkgs.target-cli: init at 2.1 --- makefu/5pkgs/targetcli/default.nix | 64 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 makefu/5pkgs/targetcli/default.nix (limited to 'makefu') diff --git a/makefu/5pkgs/targetcli/default.nix b/makefu/5pkgs/targetcli/default.nix new file mode 100644 index 000000000..927c34c5a --- /dev/null +++ b/makefu/5pkgs/targetcli/default.nix @@ -0,0 +1,64 @@ +{ pkgs, fetchFromGitHub, ... }: +with pkgs.python2Packages; +let + version = "2.1"; + rtslib = buildPythonPackage rec { + pname = "rtslib"; + inherit version; + src = fetchFromGitHub { + owner = "datera"; + repo = "rtslib"; + rev = version; + sha256 = "1d58k9i4xigfqgycyismsqzkz65ssjdri2v9fg0wpica1klyyv22"; + }; + propagatedBuildInputs = [ ipaddr netifaces configobj ]; + }; + configshell = buildPythonPackage rec { + pname = "configshell"; + version = "1.6"; + src = fetchFromGitHub { + owner = "datera"; + repo = "configshell"; + rev = version; + sha256 = "14n7xbcaicsvwajv1aihz727dlkn6zfaqjbnn7mcpns83c2hms7y"; + }; + propagatedBuildInputs = [ pyparsing ]; + }; + + tcm-py = buildPythonPackage rec { + pname = "tcm-py"; + version = "0ac9091c1ff7a52d5435a4f4449e82637142e06e"; + src = fetchFromGitHub { + owner = "datera"; + repo = "lio-utils"; + rev = "0ac9091c1ff7a52d5435a4f4449e82637142e06e"; + sha256 = "0fc922kxvgr7rwg1y875vqvkipcrixmlafsp5g8mipmq90i8zcq0"; + } + "/tcm-py"; + propagatedBuildInputs = [ ]; + }; + + lio-py = buildPythonPackage rec { + pname = "lio-py"; + version = "0ac9091c1ff7a52d5435a4f4449e82637142e06e"; + src = fetchFromGitHub { + owner = "datera"; + repo = "lio-utils"; + rev = "0ac9091c1ff7a52d5435a4f4449e82637142e06e"; + sha256 = "0fc922kxvgr7rwg1y875vqvkipcrixmlafsp5g8mipmq90i8zcq0"; + } + "/lio-py"; + propagatedBuildInputs = [ ]; + }; + +in buildPythonApplication rec { + pname = "targetcli"; + inherit version; + + propagatedBuildInputs = [ rtslib configshell lio-py tcm-py ]; + + src = fetchFromGitHub { + owner = "datera"; + repo = "targetcli"; + rev = version; + sha256 = "10nax7761g93qzky01y3hra8i4s11cgyy9w5w6l8781lj21lgi3d"; + }; +} -- cgit v1.2.3 From 56945ee3f2e16719943b8429d85ae3d61d8ee61f Mon Sep 17 00:00:00 2001 From: makefu Date: Sun, 21 Oct 2018 23:10:56 +0200 Subject: ma hw/switch: init udev rules --- makefu/2configs/hw/switch.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 makefu/2configs/hw/switch.nix (limited to 'makefu') diff --git a/makefu/2configs/hw/switch.nix b/makefu/2configs/hw/switch.nix new file mode 100644 index 000000000..d46e8cf3f --- /dev/null +++ b/makefu/2configs/hw/switch.nix @@ -0,0 +1,10 @@ +{ config, lib, pkgs, ... }: + +{ + + users.extraUsers.${config.krebs.build.user.name}.extraGroups = [ "plugdev" ]; + + services.udev.extraRules = '' + SUBSYSTEM=="usb", ATTR{idVendor}=="0955", MODE="0664", GROUP="plugdev" + ''; +} -- cgit v1.2.3 From 8c3e92d9eb51f4eae4bca0e11839be652cc142ad Mon Sep 17 00:00:00 2001 From: makefu Date: Sun, 21 Oct 2018 23:11:23 +0200 Subject: ma mcomix: rip --- makefu/5pkgs/mcomix/default.nix | 24 ------------------------ 1 file changed, 24 deletions(-) delete mode 100644 makefu/5pkgs/mcomix/default.nix (limited to 'makefu') diff --git a/makefu/5pkgs/mcomix/default.nix b/makefu/5pkgs/mcomix/default.nix deleted file mode 100644 index 7fb9cd375..000000000 --- a/makefu/5pkgs/mcomix/default.nix +++ /dev/null @@ -1,24 +0,0 @@ -{ pkgs, lib ,python2Packages, fetchurl, gtk3}: -python2Packages.buildPythonPackage rec { - name = "mcomix-${version}"; - version = "1.2.1"; - - src = fetchurl { - url = "mirror://sourceforge/mcomix/${name}.tar.bz2"; - sha256 = "0fzsf9pklhfs1rzwzj64c0v30b74nk94p93h371rpg45qnfiahvy"; - }; - - propagatedBuildInputs = with python2Packages; - [ python2Packages.pygtk gtk3 python2Packages.pillow ]; - - # for module in sys.modules.itervalues(): - # RuntimeError: dictionary changed size during iteration - doCheck = false; - - meta = { - homepage = https://github.com/pyload/pyload; - description = "Free and Open Source download manager written in Python"; - license = lib.licenses.gpl3; - maintainers = with lib.maintainers; [ makefu ]; - }; -} -- cgit v1.2.3 From d8e481ac79f7d65fdede7cb553da8f27d7ccbfb8 Mon Sep 17 00:00:00 2001 From: makefu Date: Sun, 21 Oct 2018 23:16:34 +0200 Subject: ma nginx/euer.{blog,wiki}: add state dirs --- makefu/2configs/nginx/euer.blog.nix | 1 + makefu/2configs/nginx/euer.wiki.nix | 1 + 2 files changed, 2 insertions(+) (limited to 'makefu') diff --git a/makefu/2configs/nginx/euer.blog.nix b/makefu/2configs/nginx/euer.blog.nix index 65d36d9b6..14d1285db 100644 --- a/makefu/2configs/nginx/euer.blog.nix +++ b/makefu/2configs/nginx/euer.blog.nix @@ -39,4 +39,5 @@ in { }; }; }; + state = [ base-dir ]; } diff --git a/makefu/2configs/nginx/euer.wiki.nix b/makefu/2configs/nginx/euer.wiki.nix index 99533b25c..280622259 100644 --- a/makefu/2configs/nginx/euer.wiki.nix +++ b/makefu/2configs/nginx/euer.wiki.nix @@ -21,6 +21,7 @@ let tw-pass-file = "${sec}/tw-pass.ini"; in { + state = [ base-dir ]; services.phpfpm = { # phpfpm does not have an enable option poolConfigs = { -- cgit v1.2.3 From 851c0e47d1ac7073ea5a38a656f93054b20d4b44 Mon Sep 17 00:00:00 2001 From: makefu Date: Sun, 21 Oct 2018 23:17:37 +0200 Subject: ma bureautomation: add tasks for shutting down monitor --- makefu/2configs/deployment/bureautomation/hass.nix | 32 +++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) (limited to 'makefu') diff --git a/makefu/2configs/deployment/bureautomation/hass.nix b/makefu/2configs/deployment/bureautomation/hass.nix index 4605e8933..b1eba22b4 100644 --- a/makefu/2configs/deployment/bureautomation/hass.nix +++ b/makefu/2configs/deployment/bureautomation/hass.nix @@ -11,6 +11,11 @@ let payload_available= "Online"; payload_not_available= "Offline"; }; + tasmota_stecki = name: topic: + ( tasmota_plug name topic) // + { state_topic = "/bam/${topic}/stat/POWER"; + command_topic = "/bam/${topic}/cmnd/POWER"; + }; espeasy_dht22 = name: [ { platform = "mqtt"; name = "${name} DHT22 Temperature"; @@ -72,7 +77,7 @@ in { switch = [ (tasmota_plug "Bauarbeiterlampe" "plug") (tasmota_plug "Blitzdings" "plug2") - (tasmota_plug "Fernseher" "plug3") + (tasmota_stecki "Fernseher" "fernseher") (tasmota_plug "Pluggy" "plug4") ]; binary_sensor = [ @@ -116,6 +121,31 @@ in { frontend = { }; http = { }; feedreader.urls = [ "http://www.heise.de/security/rss/news-atom.xml" ]; + automation = [ + { alias = "Turn on Fernseher on movement"; + trigger = { + platform = "state"; + entity_id = "binary_sensor.motion"; + to = "on"; + }; + action = { + service= "homeassistant.turn_on"; + entity_id= "switch.fernseher"; + }; + } + { alias = "Turn off Fernseher 10 minutes after last movement"; + trigger = { + platform = "state"; + entity_id = "binary_sensor.motion"; + to = "off"; + for.minutes = 10; + }; + action = { + service= "homeassistant.turn_off"; + entity_id= "switch.fernseher"; + }; + } + ]; }; }; } -- cgit v1.2.3 From 99b737e3e554b866fef2a9ba5fa58107e6c75aac Mon Sep 17 00:00:00 2001 From: makefu Date: Sun, 21 Oct 2018 23:19:09 +0200 Subject: ma bepasty-dual: unauthorized on error --- makefu/2configs/bepasty-dual.nix | 5 +++++ makefu/2configs/deployment/graphs.nix | 5 ----- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'makefu') diff --git a/makefu/2configs/bepasty-dual.nix b/makefu/2configs/bepasty-dual.nix index 890652285..f63dbefd8 100644 --- a/makefu/2configs/bepasty-dual.nix +++ b/makefu/2configs/bepasty-dual.nix @@ -32,6 +32,11 @@ in { "paste.${config.krebs.build.host.name}" "paste.r" ]; + extraConfig = '' + if ( $server_addr = "${external-ip}" ) { + return 403; + } + ''; }; defaultPermissions = "admin,list,create,read,delete"; secretKeyFile = secKey; diff --git a/makefu/2configs/deployment/graphs.nix b/makefu/2configs/deployment/graphs.nix index bde9892cd..e7dc54dd0 100644 --- a/makefu/2configs/deployment/graphs.nix +++ b/makefu/2configs/deployment/graphs.nix @@ -6,11 +6,6 @@ let internal-ip = config.krebs.build.host.nets.retiolum.ip4.addr; hn = config.krebs.build.host.name; in { - krebs.bepasty.servers."paste.r".nginx.extraConfig = '' - if ( $server_addr = "${external-ip}" ) { - return 403; - } - ''; krebs.tinc_graphs = { enable = true; nginx = { -- cgit v1.2.3 From 4a445704512f50032747e73e10c5afeaa5cce6fc Mon Sep 17 00:00:00 2001 From: makefu Date: Sun, 21 Oct 2018 23:19:46 +0200 Subject: ma pkgs.cozy: now upstream --- makefu/5pkgs/cozy-audiobooks/default.nix | 95 -------------------------------- 1 file changed, 95 deletions(-) delete mode 100644 makefu/5pkgs/cozy-audiobooks/default.nix (limited to 'makefu') diff --git a/makefu/5pkgs/cozy-audiobooks/default.nix b/makefu/5pkgs/cozy-audiobooks/default.nix deleted file mode 100644 index 870fa8ce2..000000000 --- a/makefu/5pkgs/cozy-audiobooks/default.nix +++ /dev/null @@ -1,95 +0,0 @@ -{ stdenv, fetchFromGitHub -, ninja -, boost -, meson -, pkgconfig -, wrapGAppsHook -, appstream-glib -, desktop-file-utils -, gtk3 -, glib -, gst_all_1 -, gobjectIntrospection -, python3Packages -, file -, cairo , sqlite , gettext -, gnome3 -}: - -let - peewee = with python3Packages; buildPythonPackage rec { - # https://git.archlinux.org/svntogit/community.git/tree/trunk/PKGBUILD?h=packages/python-peewee - pname = "peewee"; - version = "3.6.4"; - src = fetchPypi { - inherit pname version; - sha256 = "1fi4z9n86ri79gllwav0gv3hmwipzmkvivzfyszfqn9fi5zpp3ak"; - }; - doCheck = false; - - checkPhase = '' - python runtests.py - ''; - - buildInputs = [ - cython - sqlite - # psycopg2 - # mysql-connector - ]; - meta.license = stdenv.lib.licenses.mit; - }; -in -stdenv.mkDerivation rec { - name = "cozy-${version}"; - version = "0.6.0"; - - src = fetchFromGitHub { - owner = "geigi"; - repo = "cozy"; - rev = version; - sha256 = "1afl3qsn9h4k8fgp63z0ab9p5ashrg3g936a9rh3i9qydv6s3srd"; - }; - - postPatch = '' - chmod +x data/meson_post_install.py - patchShebangs data/meson_post_install.py - substituteInPlace cozy/magic/magic.py --replace "ctypes.util.find_library('magic')" "'${file}/lib/libmagic${stdenv.hostPlatform.extensions.sharedLibrary}'" - ''; - postInstall = '' - wrapProgram $out/bin/com.github.geigi.cozy \ - --prefix PYTHONPATH : "$PYTHONPATH:$(toPythonPath $out)" - - ''; - wrapPrefixVariables = [ "PYTHONPATH" ]; - - - nativeBuildInputs = [ - meson ninja pkgconfig - wrapGAppsHook - appstream-glib - desktop-file-utils - gobjectIntrospection - - ]; - buildInputs = with gst_all_1; [ gtk3 glib - gstreamer gst-plugins-good gst-plugins-ugly gst-plugins-base cairo gettext - gnome3.defaultIconTheme gnome3.gsettings-desktop-schemas - ] - ++ (with python3Packages; [ - python gst-python pygobject3 dbus-python mutagen peewee magic - - ]); - - checkPhase = '' - ninja test - ''; - - meta = with stdenv.lib; { - description = '' - A modern audio book player for Linux using GTK+ 3 - ''; - maintainers = [ maintainers.makefu ]; - license = licenses.mit; - }; -} -- cgit v1.2.3 From f2b532c7ea8a87e46b3d0c8107c33bd631ff08ab Mon Sep 17 00:00:00 2001 From: makefu Date: Sun, 21 Oct 2018 23:20:19 +0200 Subject: ma torrent: add state, torrent..r --- makefu/2configs/torrent.nix | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) (limited to 'makefu') diff --git a/makefu/2configs/torrent.nix b/makefu/2configs/torrent.nix index 3df0ddbfe..ca368dbf0 100644 --- a/makefu/2configs/torrent.nix +++ b/makefu/2configs/torrent.nix @@ -3,12 +3,11 @@ with import ; let - daemon-user = "tor"; basicAuth = import ; peer-port = 51412; web-port = 8112; daemon-port = 58846; - base-dir = config.makefu.dl-dir; + base-dir = config.krebs.rtorrent.workDir; in { users.users = { @@ -23,17 +22,6 @@ in { }; }; - # todo: race condition, do this after download user has been created - system.activationScripts."download-dir-chmod" = '' - for i in finished watch; do - if test ! -d $i;then - mkdir -p "${base-dir}/$i" - chown rtorrent:download "${base-dir}/$i" - chmod 775 "${base-dir}/$i" - fi - done - ''; - users.extraGroups = { download = { gid = lib.mkDefault (genid "download"); @@ -57,15 +45,17 @@ in { rutorrent.enable = true; enableXMLRPC = true; listenPort = peer-port; - downloadDir = base-dir + "/finished"; - watchDir = base-dir + "/watch"; + downloadDir = config.makefu.dl-dir; # dump old torrents into watch folder to have them re-added }; + services.nginx.virtualHosts."torrent.${config.krebs.build.host.name}.r".locations."/" = { proxyPass = "http://localhost:${toString web-port}/"; }; + networking.firewall.extraCommands = '' iptables -A INPUT -i retiolum -p tcp --dport ${toString web-port} -j ACCEPT ''; networking.firewall.allowedTCPPorts = [ peer-port ]; networking.firewall.allowedUDPPorts = [ peer-port ]; + state = [ config.krebs.rtorrent.sessionDir ]; # state which torrents were loaded } -- cgit v1.2.3 From 8f10933423df2f4dd71e13ef28a006e2fad67405 Mon Sep 17 00:00:00 2001 From: makefu Date: Sun, 21 Oct 2018 23:20:51 +0200 Subject: ma tools: shuffle --- makefu/2configs/tools/android-pentest.nix | 2 +- makefu/2configs/tools/desktop.nix | 2 +- makefu/2configs/tools/extra-gui.nix | 1 - makefu/2configs/tools/media.nix | 2 +- makefu/2configs/tools/mobility.nix | 2 ++ makefu/2configs/tools/secrets.nix | 2 +- 6 files changed, 6 insertions(+), 5 deletions(-) (limited to 'makefu') diff --git a/makefu/2configs/tools/android-pentest.nix b/makefu/2configs/tools/android-pentest.nix index da8a357ae..9dedafdd2 100644 --- a/makefu/2configs/tools/android-pentest.nix +++ b/makefu/2configs/tools/android-pentest.nix @@ -9,7 +9,7 @@ dex2jar apktool jd-gui - android-studio + # android-studio jdk jre openssl diff --git a/makefu/2configs/tools/desktop.nix b/makefu/2configs/tools/desktop.nix index bb14c3eb5..924668803 100644 --- a/makefu/2configs/tools/desktop.nix +++ b/makefu/2configs/tools/desktop.nix @@ -3,7 +3,7 @@ { users.users.makefu.packages = with pkgs; [ taskwarrior - pass + (pass.withExtensions (ext: [ ext.pass-otp ])) gopass mutt weechat diff --git a/makefu/2configs/tools/extra-gui.nix b/makefu/2configs/tools/extra-gui.nix index 1c28eeffd..3d26cc574 100644 --- a/makefu/2configs/tools/extra-gui.nix +++ b/makefu/2configs/tools/extra-gui.nix @@ -6,7 +6,6 @@ gimp inkscape libreoffice - quodlibet # skype synergy tdesktop diff --git a/makefu/2configs/tools/media.nix b/makefu/2configs/tools/media.nix index a61b6c88e..988550655 100644 --- a/makefu/2configs/tools/media.nix +++ b/makefu/2configs/tools/media.nix @@ -7,7 +7,7 @@ vlc mumble mplayer - quodlibet + quodlibet # exfalso plowshare streamripper diff --git a/makefu/2configs/tools/mobility.nix b/makefu/2configs/tools/mobility.nix index 8a559dbbd..11151003d 100644 --- a/makefu/2configs/tools/mobility.nix +++ b/makefu/2configs/tools/mobility.nix @@ -7,6 +7,8 @@ rclone exfat (pkgs.callPackage ./secrets.nix {}) + + opensc pcsctools libu2f-host ]; # boot.extraModulePackages = [ config.boot.kernelPackages.exfat-nofuse ]; diff --git a/makefu/2configs/tools/secrets.nix b/makefu/2configs/tools/secrets.nix index f88618cbc..7d10983c7 100644 --- a/makefu/2configs/tools/secrets.nix +++ b/makefu/2configs/tools/secrets.nix @@ -1,7 +1,7 @@ { pass, write, writeDash, ... }: write "secrets" { - "/bin/secrets".link = writeDash "brain" '' + "/bin/secrets".link = writeDash "secrets" '' PASSWORD_STORE_DIR=$HOME/.secrets-pass/ \ exec ${pass}/bin/pass $@ ''; -- cgit v1.2.3 From 90da0939308ac0b7e3d73370ee6c12b5901990b7 Mon Sep 17 00:00:00 2001 From: makefu Date: Sun, 21 Oct 2018 23:21:22 +0200 Subject: ma cgit-retiolum: add secrets repo --- makefu/2configs/git/cgit-retiolum.nix | 1 + 1 file changed, 1 insertion(+) (limited to 'makefu') diff --git a/makefu/2configs/git/cgit-retiolum.nix b/makefu/2configs/git/cgit-retiolum.nix index 1a7f3d987..4890e4afe 100644 --- a/makefu/2configs/git/cgit-retiolum.nix +++ b/makefu/2configs/git/cgit-retiolum.nix @@ -41,6 +41,7 @@ let autosync = { }; fenkins = { }; pass = { }; + secrets = { }; }; connector-repos = mapAttrs make-priv-repo { -- cgit v1.2.3 From f1bd2ce84d820d0b35c56245d820beffd7d2eb5b Mon Sep 17 00:00:00 2001 From: makefu Date: Sun, 21 Oct 2018 23:21:58 +0200 Subject: ma gui: do not use antialiased fonts --- makefu/2configs/gui/base.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'makefu') diff --git a/makefu/2configs/gui/base.nix b/makefu/2configs/gui/base.nix index 861a9327e..6bcd09826 100644 --- a/makefu/2configs/gui/base.nix +++ b/makefu/2configs/gui/base.nix @@ -66,7 +66,7 @@ in cat |derp <