From b95e15654d66607a416b2ba0e87a5d9dd0fe09ed Mon Sep 17 00:00:00 2001 From: lassulus Date: Mon, 31 Jul 2017 23:55:08 +0200 Subject: krebs: keep correct host (build -> cgit) --- krebs/3modules/lass/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/krebs/3modules/lass/default.nix b/krebs/3modules/lass/default.nix index 27009981..4e50ef57 100644 --- a/krebs/3modules/lass/default.nix +++ b/krebs/3modules/lass/default.nix @@ -96,8 +96,8 @@ with import ; ip6.addr = "42:0000:0000:0000:0000:0000:0000:15ab"; aliases = [ "prism.r" - "build.prism.r" "cache.prism.r" + "cgit.prism.r" "paste.r" "p.r" ]; -- cgit v1.2.3 From 67def2c04a8ce910033c5d4d22dda25b6fa85b7b Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 1 Aug 2017 10:47:44 +0200 Subject: tv: add krebs-pages mirror at krebs.xu.r --- krebs/3modules/tv/default.nix | 1 + tv/1systems/xu/config.nix | 1 + 2 files changed, 2 insertions(+) diff --git a/krebs/3modules/tv/default.nix b/krebs/3modules/tv/default.nix index 60827d58..26e8e2f3 100644 --- a/krebs/3modules/tv/default.nix +++ b/krebs/3modules/tv/default.nix @@ -323,6 +323,7 @@ with import ; aliases = [ "xu.r" "cgit.xu.r" + "krebs.xu.r" ]; tinc.pubkey = '' -----BEGIN RSA PUBLIC KEY----- diff --git a/tv/1systems/xu/config.nix b/tv/1systems/xu/config.nix index 2bffdddb..e7516a45 100644 --- a/tv/1systems/xu/config.nix +++ b/tv/1systems/xu/config.nix @@ -13,6 +13,7 @@ with import ; + -- cgit v1.2.3 From bcc1a72d6a604533e025ad579e0dfca0a83c2716 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 1 Aug 2017 10:57:36 +0200 Subject: makeScriptWriter: forward check parameter to writeOut --- krebs/5pkgs/writers.nix | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/krebs/5pkgs/writers.nix b/krebs/5pkgs/writers.nix index f1626078..850ee6f1 100644 --- a/krebs/5pkgs/writers.nix +++ b/krebs/5pkgs/writers.nix @@ -29,10 +29,11 @@ with import ; execveBin = name: cfg: pkgs.execve name (cfg // { destination = "/bin/${name}"; }); - makeScriptWriter = interpreter: name: text: + makeScriptWriter = { interpreter, check ? null }: name: text: assert (with types; either absolute-pathname filename).check name; pkgs.writeOut (baseNameOf name) { ${optionalString (types.absolute-pathname.check name) name} = { + inherit check; executable = true; text = "#! ${interpreter}\n${text}"; }; @@ -69,7 +70,9 @@ with import ; strip --strip-unneeded "$exe" ''; - writeDash = pkgs.makeScriptWriter "${pkgs.dash}/bin/dash"; + writeDash = pkgs.makeScriptWriter { + interpreter = "${pkgs.dash}/bin/dash"; + }; writeDashBin = name: assert types.filename.check name; @@ -305,5 +308,7 @@ with import ; }; }; - writeSed = pkgs.makeScriptWriter "${pkgs.gnused}/bin/sed -f"; + writeSed = pkgs.makeScriptWriter { + interpreter = "${pkgs.gnused}/bin/sed -f"; + }; } -- cgit v1.2.3 From 5742f322891d380b15b6570bf523e50c17c45212 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 1 Aug 2017 11:27:03 +0200 Subject: krebs.sitemap: init --- krebs/3modules/default.nix | 6 ++++++ lib/types.nix | 16 +++++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/krebs/3modules/default.nix b/krebs/3modules/default.nix index b0ad2baf..abb3d37e 100644 --- a/krebs/3modules/default.nix +++ b/krebs/3modules/default.nix @@ -70,6 +70,12 @@ let type = types.hostname; default = "r"; }; + + sitemap = mkOption { + default = {}; + type = types.attrsOf types.sitemap.entry; + }; + zone-head-config = mkOption { type = with types; attrsOf str; description = '' diff --git a/lib/types.nix b/lib/types.nix index 236190cc..8c684688 100644 --- a/lib/types.nix +++ b/lib/types.nix @@ -5,7 +5,7 @@ let all any concatMapStringsSep concatStringsSep const filter flip genid hasSuffix head isInt isString length mergeOneOption mkOption mkOptionType optional optionalAttrs optionals range splitString - stringLength substring test typeOf; + stringLength substring test testString typeOf; inherit (lib.types) attrsOf bool either enum int listOf nullOr path str string submodule; in @@ -357,6 +357,20 @@ rec { pgp-pubkey = str; + sitemap.entry = submodule ({ config, ... }: { + options = { + desc = mkOption { + default = null; + type = nullOr str; + }; + href = mkOption { + ${if testString "https?://.*" config._module.args.name + then "default" else null} = config._module.args.name; + type = nullOr str; # TODO nullOr uri? + }; + }; + }); + ssh-pubkey = str; ssh-privkey = submodule { options = { -- cgit v1.2.3 From 3d53636ab2ee3835f3cc823761843e22347d892d Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 1 Aug 2017 11:27:27 +0200 Subject: tv: add cgit.krebsco.de and krebs.xu.r to sitemap --- krebs/3modules/tv/default.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/krebs/3modules/tv/default.nix b/krebs/3modules/tv/default.nix index 26e8e2f3..81db2d41 100644 --- a/krebs/3modules/tv/default.nix +++ b/krebs/3modules/tv/default.nix @@ -375,6 +375,14 @@ with import ; ssh.pubkey = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDNjHxyUC7afNGSwfwBfQizmDnHTNLWDRHE8SY9W4oiw2lPhCFGTN8Jz84CKtnABbZhbNY1E8T58emF2h45WzDg/OGi8DPAk4VsXSkIhyvAto+nkTy2L4atjqfvXDvqxTDC9sui+t8p5OqOK+sghe4kiy+Vx1jhnjSnkQsx9Kocu24BYTkNqYxG7uwOz6t262XYNwMn13Y2K/yygDR3Uw3wTnEjpaYnObRxxJS3iTECDzgixiQ6ewXwYNggpzO/+EfW1BTz5vmuEVf4GbQ9iEc7IsVXHhR+N0boCscvSgae9KW9MBun0A2veRFXNkkfBEMfzelz+S63oeVfelkBq6N5aLsHYYGC4VQjimScelHYVwxR7O4fV+NttJaFF7H06FJeFzPt3NYZeoPKealD5y2Muh1UnewpmkMgza9hQ9EmI4/G1fMowqeMq0U6Hu0QMDUAagyalizN97AfsllY2cs0qLNg7+zHMPwc5RgLzs73oPUsF3umz0O42I5p5733vveUlWi5IZeI8CA1ZKdpwyMXXNhIOHs8u+yGsOLfSy3RgjVKp2GjN4lfnFd0LI+p7iEsEWDRkIAvGCOFepsebyVpBjGP+Kqs10bPGpk5dMcyn9iBJejoz9ka+H9+JAG04LnXwt6Rf1CRV3VRCRX1ayZEjRv9czV7U9ZpuFQcIlVRJQ== root@zu"; }; }; + sitemap = { + "http://cgit.krebsco.de" = { + desc = "Git repositories"; + }; + "http://krebs.xu.r" = { + desc = "krebs-pages mirror"; + }; + }; users = { dv = { mail = "dv@alnus.r"; -- cgit v1.2.3 From 8f5fc9bc4fff53936e8bba5b2a4de3d362b94f09 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 1 Aug 2017 11:28:25 +0200 Subject: tv sudo: env_keep += XMONAD_SPAWN_WORKSPACE --- tv/2configs/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tv/2configs/default.nix b/tv/2configs/default.nix index b5931109..420548bc 100644 --- a/tv/2configs/default.nix +++ b/tv/2configs/default.nix @@ -47,7 +47,7 @@ in { { security.hideProcessInformation = true; security.sudo.extraConfig = '' - Defaults env_keep+="SSH_CLIENT" + Defaults env_keep+="SSH_CLIENT XMONAD_SPAWN_WORKSPACE" Defaults mailto="${config.krebs.users.tv.mail}" Defaults !lecture ''; -- cgit v1.2.3 From 2f52158dec91a87cddd3e643f29870a6acc233f6 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 1 Aug 2017 11:30:16 +0200 Subject: tv: drop explicit stockholm deps --- tv/2configs/default.nix | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/tv/2configs/default.nix b/tv/2configs/default.nix index 420548bc..834a8908 100644 --- a/tv/2configs/default.nix +++ b/tv/2configs/default.nix @@ -21,16 +21,6 @@ in { ./sshd.nix ./vim.nix ./xdg.nix - { - # stockholm dependencies - environment.systemPackages = with pkgs; [ - git - gnumake - hashPassword - populate - whatsupnix - ]; - } { users = { defaultUserShell = "/run/current-system/sw/bin/bash"; @@ -142,6 +132,8 @@ in { { environment.systemPackages = [ pkgs.get + pkgs.git + pkgs.hashPassword pkgs.htop pkgs.kpaste pkgs.krebspaste -- cgit v1.2.3 From e19b506f36c8848ece02d7796a91ff0634191609 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 1 Aug 2017 12:15:45 +0200 Subject: tv retiolum: LocalDiscovery = yes --- tv/2configs/retiolum.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tv/2configs/retiolum.nix b/tv/2configs/retiolum.nix index a914dad4..9940b102 100644 --- a/tv/2configs/retiolum.nix +++ b/tv/2configs/retiolum.nix @@ -10,6 +10,9 @@ with import ; "ni" "prism" ]; + extraConfig = '' + LocalDiscovery = yes + ''; tincPackage = pkgs.tinc_pre; }; tv.iptables.input-internet-accept-tcp = singleton "tinc"; -- cgit v1.2.3 From dfcb663af9b116d07ec09603a6837230419a2785 Mon Sep 17 00:00:00 2001 From: lassulus Date: Tue, 1 Aug 2017 13:47:10 +0200 Subject: l mail: show html mails --- lass/2configs/mail.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lass/2configs/mail.nix b/lass/2configs/mail.nix index fe82fea5..cfc17984 100644 --- a/lass/2configs/mail.nix +++ b/lass/2configs/mail.nix @@ -15,6 +15,10 @@ let ${pkgs.msmtp}/bin/msmtp -C ${msmtprc} "$@" ''; + mailcap = pkgs.writeText "mailcap" '' + text/html; ${pkgs.elinks}/bin/elinks -dump ; copiousoutput; + ''; + muttrc = pkgs.writeText "muttrc" '' # gpg source ${pkgs.neomutt}/share/doc/mutt/samples/gpg.rc @@ -37,6 +41,9 @@ let set crypt_verify_sig=\$my_crypt_verify_sig" \ 'Verify PGP signature' + # read html mails + auto_view text/html + set mailcap_path = ${mailcap} # notmuch set nm_default_uri="notmuch://$HOME/Maildir" # path to the maildir -- cgit v1.2.3 From e740022bc524a57dd671a5c714ab117b6331cf27 Mon Sep 17 00:00:00 2001 From: lassulus Date: Tue, 1 Aug 2017 14:15:45 +0200 Subject: l mail: use ISO date format --- lass/2configs/mail.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lass/2configs/mail.nix b/lass/2configs/mail.nix index cfc17984..afd90315 100644 --- a/lass/2configs/mail.nix +++ b/lass/2configs/mail.nix @@ -66,7 +66,7 @@ let recipent="$(echo $1 | sed 's/[^,]*<\([^>]*\)[^,]*/ \1/g')" # output to mutt # V - echo "%4C %Z %?GI?%GI& ? %[%d/%b] %-20.20a %?M?(%3M)& ? %s %> $recipent %?g?%g?%" + echo "%4C %Z %?GI?%GI& ? %[%y-%m-%d] %-20.20a %?M?(%3M)& ? %s %> $recipent %?g?%g?%" # args to mutt-index dash script # V ''} %r |" -- cgit v1.2.3 From d56a90778408a199cc79ab47e1c2313a68cd2451 Mon Sep 17 00:00:00 2001 From: lassulus Date: Tue, 1 Aug 2017 18:06:13 +0200 Subject: l mail: activate indexbar in mailview --- lass/2configs/mail.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lass/2configs/mail.nix b/lass/2configs/mail.nix index afd90315..a90890aa 100644 --- a/lass/2configs/mail.nix +++ b/lass/2configs/mail.nix @@ -126,6 +126,8 @@ let bind pager t noop macro index t "+TODO\n" # tag as Archived + # top index bar in email view + set pager_index_lines=7 # sidebar set sidebar_width = 20 -- cgit v1.2.3 From e4042e132a50c343d3b42039140abb0695724e69 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 1 Aug 2017 19:28:47 +0200 Subject: move subdirsOf from lib to makefu --- lib/default.nix | 4 ---- makefu/5pkgs/default.nix | 5 ++++- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/default.nix b/lib/default.nix index 4c54f60a..e5e40975 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -20,10 +20,6 @@ let then lib.lpad n c (c + s) else s; - subdirsOf = path: - lib.mapAttrs (name: _: path + "/${name}") - (filterAttrs (_: eq "directory") (readDir path)); - genAttrs' = names: f: listToAttrs (map f names); getAttrs = names: set: diff --git a/makefu/5pkgs/default.nix b/makefu/5pkgs/default.nix index 99f8cf86..bb776ef2 100644 --- a/makefu/5pkgs/default.nix +++ b/makefu/5pkgs/default.nix @@ -15,6 +15,10 @@ self: super: let override else override; + subdirsOf = path: + mapAttrs (name: _: path + "/${name}") + (filterAttrs (_: eq "directory") (readDir path)); + in { alsa-hdspconf = callPackage ./alsa-tools { alsaToolTarget="hdspconf";}; alsa-hdspmixer = callPackage ./alsa-tools { alsaToolTarget="hdspmixer";}; @@ -27,7 +31,6 @@ in { sha256 = "18ddzyh11bywrhzdkzvrl7nvgp5gdb4k1s0zxbz2bkhd14vi72bb"; }; }; - } // mapAttrs (_: flip callPackage {}) -- cgit v1.2.3 From fc59b6c395ffd68d7cd0504d1745fdc08e521525 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 1 Aug 2017 19:56:42 +0200 Subject: tv test system: RIP It was committed by accident. --- tv/1systems/test/source.nix | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 tv/1systems/test/source.nix diff --git a/tv/1systems/test/source.nix b/tv/1systems/test/source.nix deleted file mode 100644 index f756b858..00000000 --- a/tv/1systems/test/source.nix +++ /dev/null @@ -1,3 +0,0 @@ -import { - name = "test"; -} -- cgit v1.2.3 From f51f58f5ede75767b27354646d055649d7e37d82 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 1 Aug 2017 20:07:17 +0200 Subject: tv: only xu is a virtualbox host --- tv/1systems/wu/config.nix | 2 -- tv/1systems/xu/config.nix | 4 ++-- tv/1systems/zu/config.nix | 2 -- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/tv/1systems/wu/config.nix b/tv/1systems/wu/config.nix index 1e28cc78..9767f467 100644 --- a/tv/1systems/wu/config.nix +++ b/tv/1systems/wu/config.nix @@ -169,6 +169,4 @@ with import ; KERNEL=="rtc0", GROUP="audio" KERNEL=="hpet", GROUP="audio" ''; - - virtualisation.virtualbox.host.enable = true; } diff --git a/tv/1systems/xu/config.nix b/tv/1systems/xu/config.nix index e7516a45..2c5e827a 100644 --- a/tv/1systems/xu/config.nix +++ b/tv/1systems/xu/config.nix @@ -167,9 +167,9 @@ with import ; #services.bitlbee.enable = true; #services.tor.client.enable = true; #services.tor.enable = true; - #services.virtualboxHost.enable = true; - # The NixOS release to be compatible with for stateful data such as databases. system.stateVersion = "15.09"; + + virtualisation.virtualbox.host.enable = true; } diff --git a/tv/1systems/zu/config.nix b/tv/1systems/zu/config.nix index d2aab8c5..8eb64a27 100644 --- a/tv/1systems/zu/config.nix +++ b/tv/1systems/zu/config.nix @@ -162,8 +162,6 @@ with import ; #services.bitlbee.enable = true; #services.tor.client.enable = true; #services.tor.enable = true; - #services.virtualboxHost.enable = true; - # The NixOS release to be compatible with for stateful data such as databases. system.stateVersion = "15.09"; -- cgit v1.2.3 From 11a65914542870cf5326ea602926b55553362b17 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 1 Aug 2017 20:09:48 +0200 Subject: tv zu: drop test secret-file --- tv/1systems/zu/config.nix | 6 ------ 1 file changed, 6 deletions(-) diff --git a/tv/1systems/zu/config.nix b/tv/1systems/zu/config.nix index 8eb64a27..272fba88 100644 --- a/tv/1systems/zu/config.nix +++ b/tv/1systems/zu/config.nix @@ -6,12 +6,6 @@ with import ; krebs.build.host = config.krebs.hosts.zu; imports = [ - { - options.tv.test.sercret-file = mkOption { - type = types.secret-file; - default = {}; - }; - } -- cgit v1.2.3 From e749d26c4fd2401b7f8e0293aaf780b4700af3c1 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 1 Aug 2017 20:11:14 +0200 Subject: tv public_html: add server aliases for gg23 --- tv/2configs/nginx/public_html.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/tv/2configs/nginx/public_html.nix b/tv/2configs/nginx/public_html.nix index a686d281..cc7a3989 100644 --- a/tv/2configs/nginx/public_html.nix +++ b/tv/2configs/nginx/public_html.nix @@ -9,6 +9,7 @@ with import ; serverAliases = [ "localhost" "${config.krebs.build.host.name}" + "${config.krebs.build.host.name}.gg23" "${config.krebs.build.host.name}.r" ]; locations."~ ^/~(.+?)(/.*)?\$".extraConfig = '' -- cgit v1.2.3 From 06d2c2d773559c0c059768e1ab8a350ae2a82c0e Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 1 Aug 2017 20:12:04 +0200 Subject: tv vim: colorize search results --- tv/2configs/vim.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tv/2configs/vim.nix b/tv/2configs/vim.nix index f0b1cf52..85283238 100644 --- a/tv/2configs/vim.nix +++ b/tv/2configs/vim.nix @@ -70,6 +70,8 @@ let { hi diffSubname ctermfg=207 hi diffAdded ctermfg=010 hi diffRemoved ctermfg=009 + + hi Search cterm=NONE ctermbg=216 ''; }))) ((rtp: rtp // { inherit rtp; }) (pkgs.writeTextFile (let -- cgit v1.2.3 From 5aad878c525c16e98922858bbc85eade10365526 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 1 Aug 2017 20:13:30 +0200 Subject: tv vim: relaxt sh.extraStart for variable names --- tv/2configs/vim.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tv/2configs/vim.nix b/tv/2configs/vim.nix index 85283238..ca471864 100644 --- a/tv/2configs/vim.nix +++ b/tv/2configs/vim.nix @@ -229,7 +229,7 @@ let { lua = {}; sed.extraStart = ''writeSed[^ \t\r\n]*[ \t\r\n]*"[^"]*"''; sh.extraStart = concatStringsSep ''\|'' [ - ''write\(Ba\|Da\)sh[^ \t\r\n]*[ \t\r\n]*"[^"]*"'' + ''write\(Ba\|Da\)sh[^ \t\r\n]*[ \t\r\n]*\("[^"]*"\|[a-z]\+\)'' ''[a-z]*Phase[ \t\r\n]*='' ]; yaml = {}; -- cgit v1.2.3 From ad0f78278968b3cd0656a72be8db9a287bd6398a Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 1 Aug 2017 20:27:36 +0200 Subject: tv djbdns: RIP --- tv/5pkgs/simple/djbdns/default.nix | 20 -------------------- 1 file changed, 20 deletions(-) delete mode 100644 tv/5pkgs/simple/djbdns/default.nix diff --git a/tv/5pkgs/simple/djbdns/default.nix b/tv/5pkgs/simple/djbdns/default.nix deleted file mode 100644 index ad5a530b..00000000 --- a/tv/5pkgs/simple/djbdns/default.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ coreutils, gawk, fetchurl, stdenv, ... }: - -with stdenv.lib; - -stdenv.mkDerivation rec { - name = "djbdns-1.05"; - src = fetchurl { - url = "http://cr.yp.to/djbdns/djbdns-1.05.tar.gz"; - sha256 = "0j3baf92vkczr5fxww7rp1b7gmczxmmgrqc8w2dy7kgk09m85k9w"; - }; - configurePhase = '' - echo $out > conf-home - echo gcc -O2 -include errno.h > conf-cc - ''; - patchPhase = '' - sed -i 's:c("/","etc","dnsroots.global",-1,-1,0644);:// &:' hier.c - sed -i '1s@^@PATH=${makeBinPath [ coreutils gawk ]}\n@' dnstracesort.sh - ''; - installTargets = "setup check"; -} -- cgit v1.2.3 From bcd8c5a9661634a53c88029fc9028e1dbf2228b2 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 1 Aug 2017 20:46:32 +0200 Subject: tv tarantool: RIP --- krebs/5pkgs/simple/tarantool/default.nix | 21 --------------------- 1 file changed, 21 deletions(-) delete mode 100644 krebs/5pkgs/simple/tarantool/default.nix diff --git a/krebs/5pkgs/simple/tarantool/default.nix b/krebs/5pkgs/simple/tarantool/default.nix deleted file mode 100644 index 9e22fd4f..00000000 --- a/krebs/5pkgs/simple/tarantool/default.nix +++ /dev/null @@ -1,21 +0,0 @@ -{ stdenv, fetchgit, cmake, ncurses, openssl, readline, ... }: - -stdenv.mkDerivation rec { - name = "tarantool-1.7.1-164-g0fd0239"; - src = fetchgit { - url = https://github.com/tarantool/tarantool; - rev = builtins.elemAt (builtins.match ".*-g([0-9a-f]+)" name) 0; - sha256 = "1jnaiizbl9j4a8vsihqx75iqa9bkh1kpwsyrgmim8ikiyzfw54dz"; - fetchSubmodules = true; - }; - buildInputs = [ - cmake - ncurses - openssl - readline - ]; - preConfigure = '' - echo ${(builtins.parseDrvName name).version} > VERSION - sed -i 's/NAMES termcap/NAMES ncurses/' cmake/FindTermcap.cmake - ''; -} -- cgit v1.2.3 From 95aef46c56564ce82e3f0e864cc0508e310a0825 Mon Sep 17 00:00:00 2001 From: lassulus Date: Tue, 1 Aug 2017 20:18:38 +0200 Subject: l statig_nginx: RIP --- lass/3modules/static_nginx.nix | 78 ------------------------------------------ 1 file changed, 78 deletions(-) delete mode 100644 lass/3modules/static_nginx.nix diff --git a/lass/3modules/static_nginx.nix b/lass/3modules/static_nginx.nix deleted file mode 100644 index cd33a2cf..00000000 --- a/lass/3modules/static_nginx.nix +++ /dev/null @@ -1,78 +0,0 @@ -{ config, lib, pkgs, ... }: - -with import ; - -let - cfg = config.lass.staticPage; - - out = { - options.lass.staticPage = api; - config = imp; - }; - - api = mkOption { - type = with types; attrsOf (submodule ({ config, ... }: { - options = { - domain = mkOption { - type = str; - default = config._module.args.name; - }; - folder = mkOption { - type = str; - default = "/srv/http/${config.domain}"; - }; - #sslEnable = mkEnableOption "ssl"; - #certificate = mkOption { - # type = str; - #}; - #certificate_key = mkOption { - # type = str; - #}; - #ciphers = mkOption { - # type = str; - # default = "AES128+EECDH:AES128+EDH"; - #}; - ssl = mkOption { - type = with types; submodule ({ - options = { - enable = mkEnableOption "ssl"; - certificate = mkOption { - type = str; - }; - certificate_key = mkOption { - type = str; - }; - }; - }); - default = {}; - }; - }; - })); - default = {}; - }; - - user = config.services.nginx.user; - group = config.services.nginx.group; - - external-ip = config.krebs.build.host.nets.internet.ip4.addr; - - imp = { - krebs.nginx.servers = flip mapAttrs cfg ( name: { domain, folder, ssl, ... }: { - server-names = [ - "${domain}" - "www.${domain}" - ]; - locations = [ - (nameValuePair "/" '' - root ${folder}; - '') - (nameValuePair "~ /\\." '' - deny all; - '') - ]; - inherit ssl; - - }); - }; - -in out -- cgit v1.2.3 From 8c9e0ad35d330e980a59c57b89715c21971c1819 Mon Sep 17 00:00:00 2001 From: lassulus Date: Tue, 1 Aug 2017 20:47:34 +0200 Subject: l websites: add default.nix for 404 --- lass/2configs/websites/default.nix | 26 ++++++++++++++++++++++++++ lass/2configs/websites/domsen.nix | 1 + lass/2configs/websites/fritz.nix | 1 + lass/2configs/websites/lassulus.nix | 1 + 4 files changed, 29 insertions(+) create mode 100644 lass/2configs/websites/default.nix diff --git a/lass/2configs/websites/default.nix b/lass/2configs/websites/default.nix new file mode 100644 index 00000000..1ffa105a --- /dev/null +++ b/lass/2configs/websites/default.nix @@ -0,0 +1,26 @@ +{ config, lib, ... }: + +with import ; + +{ + services.nginx = { + recommendedGzipSettings = true; + recommendedOptimisation = true; + recommendedTlsSettings = true; + + virtualHosts._http = { + default = true; + extraConfig = '' + return 404; + ''; + }; + + virtualHosts.default = { + locations."= /etc/os-release".extraConfig = '' + default_type text/plain; + alias /etc/os-release; + ''; + }; + }; +} + diff --git a/lass/2configs/websites/domsen.nix b/lass/2configs/websites/domsen.nix index b0e5375c..10ff142f 100644 --- a/lass/2configs/websites/domsen.nix +++ b/lass/2configs/websites/domsen.nix @@ -23,6 +23,7 @@ let in { imports = [ + ./default.nix ./sqlBackup.nix (servePage [ "reich-gebaeudereinigung.de" "www.reich-gebaeudereinigung.de" ]) (servePage [ diff --git a/lass/2configs/websites/fritz.nix b/lass/2configs/websites/fritz.nix index 45927b10..aa57a985 100644 --- a/lass/2configs/websites/fritz.nix +++ b/lass/2configs/websites/fritz.nix @@ -26,6 +26,7 @@ in { services.nginx.enable = true; imports = [ + ./default.nix ./sqlBackup.nix (serveWordpress [ "radical-dreamers.de" "www.radical-dreamers.de" ]) diff --git a/lass/2configs/websites/lassulus.nix b/lass/2configs/websites/lassulus.nix index 0771570c..93b817c3 100644 --- a/lass/2configs/websites/lassulus.nix +++ b/lass/2configs/websites/lassulus.nix @@ -8,6 +8,7 @@ let in { imports = [ + ./default.nix ../git.nix ]; -- cgit v1.2.3 From 24a515c4a0069828bc84ac60d239f88f9b637524 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 1 Aug 2017 22:22:10 +0200 Subject: tv {wu,zu}: remove extra systemPackages --- tv/1systems/wu/config.nix | 92 --------------------------------------------- tv/1systems/zu/config.nix | 96 ----------------------------------------------- 2 files changed, 188 deletions(-) diff --git a/tv/1systems/wu/config.nix b/tv/1systems/wu/config.nix index 9767f467..5ec6a462 100644 --- a/tv/1systems/wu/config.nix +++ b/tv/1systems/wu/config.nix @@ -17,91 +17,6 @@ with import ; - { - environment.systemPackages = with pkgs; [ - # root - cryptsetup - - # tv - bc - bind # dig - cac-api - dic - file - get - gnupg1compat - haskellPackages.hledger - jq - mkpasswd - netcat - nix-repl - nmap - p7zip - push - qrencode - tmux - - #ack - #apache-httpd - #ascii - #emacs - #es - #esniper - #gcc - #gptfdisk - #graphviz - #haskellPackages.cabal2nix - #haskellPackages.ghc - #haskellPackages.shake - #hdparm - #i7z - #iftop - #imagemagick - #inotifyTools - #iodine - #iotop - #lshw - #lsof - #minicom - #mtools - #ncmpc - #neovim - #nethogs - #nix-prefetch-scripts #cvs bug - #openssl - #openswan - #parted - #perl - #powertop - #ppp - #proot - #pythonPackages.arandr - #pythonPackages.youtube-dl - #racket - #rxvt_unicode-with-plugins - #scrot - #sec - #silver-searcher - #sloccount - #smartmontools - #socat - #sshpass - #strongswan - #sysdig - #sysstat - #tcpdump - #tlsdate - #unetbootin - #utillinuxCurses - #wvdial - #xdotool - #xkill - #xl2tpd - #xsel - - unison - ]; - } ]; boot.initrd.luks = { @@ -143,13 +58,6 @@ with import ; hardware.enableRedistributableFirmware= true; hardware.opengl.driSupport32Bit = true; - environment.systemPackages = with pkgs; [ - ethtool - tinc_pre - iptables - #jack2 - ]; - security.wrappers = { sendmail.source = "${pkgs.exim}/bin/sendmail"; # for cron }; diff --git a/tv/1systems/zu/config.nix b/tv/1systems/zu/config.nix index 272fba88..5936ddfe 100644 --- a/tv/1systems/zu/config.nix +++ b/tv/1systems/zu/config.nix @@ -16,93 +16,6 @@ with import ; - { - environment.systemPackages = with pkgs; [ - - # root - cryptsetup - - # tv - bc - bind # dig - cac-api - dic - file - gnupg1compat - haskellPackages.hledger - jq - mkpasswd - netcat - nix-repl - nmap - p7zip - pass - q - qrencode - # XXX fails at systemd.services.dbus.unitConfig - #texlive - tmux - - #ack - #apache-httpd - #ascii - #emacs - #es - #esniper - #gcc - #gptfdisk - #graphviz - #haskellPackages.cabal2nix - #haskellPackages.ghc - #haskellPackages.shake - #hdparm - #i7z - #iftop - #imagemagick - #inotifyTools - #iodine - #iotop - #lshw - #lsof - #minicom - #mtools - #ncmpc - #nethogs - #nix-prefetch-scripts #cvs bug - #openssl - #openswan - #parted - #perl - #powertop - #ppp - #proot - #pythonPackages.arandr - #pythonPackages.youtube-dl - #racket - #rxvt_unicode-with-plugins - #scrot - #sec - #silver-searcher - #sloccount - #smartmontools - #socat - #sshpass - #strongswan - #sysdig - #sysstat - #tcpdump - #tlsdate - #unetbootin - #utillinuxCurses - #wvdial - #xdotool - #xkill - #xl2tpd - #xsel - - unison - ]; - } ]; boot.initrd.luks = { @@ -133,15 +46,6 @@ with import ; }; }; - environment.systemPackages = with pkgs; [ - ethtool - tinc_pre - iptables - #jack2 - - gptfdisk - ]; - security.wrappers = { sendmail.source = "${pkgs.exim}/bin/sendmail"; # for cron }; -- cgit v1.2.3 From 0b4d3edff8f3e0e33756355f1b3121cf311bafdb Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 1 Aug 2017 22:32:14 +0200 Subject: tv: boot.tmpOnTmpfs = true --- tv/1systems/mu/config.nix | 10 ---------- tv/1systems/nomic/config.nix | 3 --- tv/1systems/wu/config.nix | 10 ---------- tv/1systems/xu/config.nix | 10 ---------- tv/1systems/zu/config.nix | 10 ---------- tv/2configs/default.nix | 2 ++ 6 files changed, 2 insertions(+), 43 deletions(-) diff --git a/tv/1systems/mu/config.nix b/tv/1systems/mu/config.nix index 4c6d1632..01de9ee6 100644 --- a/tv/1systems/mu/config.nix +++ b/tv/1systems/mu/config.nix @@ -50,11 +50,6 @@ with import ; "/boot" = { device = "/dev/sda1"; }; - "/tmp" = { - device = "tmpfs"; - fsType = "tmpfs"; - options = [ "nosuid" "nodev" "noatime" ]; - }; }; swapDevices =[ ]; @@ -152,9 +147,4 @@ with import ; "networkmanager" ]; }; - - # see tmpfiles.d(5) - systemd.tmpfiles.rules = [ - "d /tmp 1777 root root - -" # does this work with mounted /tmp? - ]; } diff --git a/tv/1systems/nomic/config.nix b/tv/1systems/nomic/config.nix index d0144986..64cccde0 100644 --- a/tv/1systems/nomic/config.nix +++ b/tv/1systems/nomic/config.nix @@ -52,9 +52,6 @@ with import ; swapDevices = [ ]; - # TODO base - boot.tmpOnTmpfs = true; - environment.systemPackages = with pkgs; [ (writeDashBin "play" '' set -euf diff --git a/tv/1systems/wu/config.nix b/tv/1systems/wu/config.nix index 5ec6a462..cdcaa98d 100644 --- a/tv/1systems/wu/config.nix +++ b/tv/1systems/wu/config.nix @@ -45,11 +45,6 @@ with import ; "/boot" = { device = "/dev/sda1"; }; - "/tmp" = { - device = "tmpfs"; - fsType = "tmpfs"; - options = ["nosuid" "nodev" "noatime"]; - }; }; krebs.nixpkgs.allowUnfreePredicate = pkg: hasPrefix "nvidia-x11-" pkg.name; @@ -64,11 +59,6 @@ with import ; services.printing.enable = true; - # see tmpfiles.d(5) - systemd.tmpfiles.rules = [ - "d /tmp 1777 root root - -" # does this work with mounted /tmp? - ]; - services.udev.extraRules = '' SUBSYSTEM=="net", ATTR{address}=="00:90:f5:da:aa:c3", NAME="en0" SUBSYSTEM=="net", ATTR{address}=="a0:88:b4:1b:ae:6c", NAME="wl0" diff --git a/tv/1systems/xu/config.nix b/tv/1systems/xu/config.nix index 2c5e827a..0525be85 100644 --- a/tv/1systems/xu/config.nix +++ b/tv/1systems/xu/config.nix @@ -137,11 +137,6 @@ with import ; "/boot" = { device = "/dev/sda1"; }; - "/tmp" = { - device = "tmpfs"; - fsType = "tmpfs"; - options = ["nosuid" "nodev" "noatime"]; - }; }; environment.systemPackages = with pkgs; [ @@ -159,11 +154,6 @@ with import ; services.printing.enable = true; - # see tmpfiles.d(5) - systemd.tmpfiles.rules = [ - "d /tmp 1777 root root - -" # does this work with mounted /tmp? - ]; - #services.bitlbee.enable = true; #services.tor.client.enable = true; #services.tor.enable = true; diff --git a/tv/1systems/zu/config.nix b/tv/1systems/zu/config.nix index 5936ddfe..7267bbc9 100644 --- a/tv/1systems/zu/config.nix +++ b/tv/1systems/zu/config.nix @@ -39,11 +39,6 @@ with import ; "/boot" = { device = "/dev/sda1"; }; - "/tmp" = { - device = "tmpfs"; - fsType = "tmpfs"; - options = ["nosuid" "nodev" "noatime"]; - }; }; security.wrappers = { @@ -52,11 +47,6 @@ with import ; services.printing.enable = true; - # see tmpfiles.d(5) - systemd.tmpfiles.rules = [ - "d /tmp 1777 root root - -" # does this work with mounted /tmp? - ]; - #services.bitlbee.enable = true; #services.tor.client.enable = true; #services.tor.enable = true; diff --git a/tv/2configs/default.nix b/tv/2configs/default.nix index 834a8908..c58525e9 100644 --- a/tv/2configs/default.nix +++ b/tv/2configs/default.nix @@ -4,6 +4,8 @@ with import ; then "buildbot" else "tv"; in { + boot.tmpOnTmpfs = true; + krebs.enable = true; krebs.build.user = config.krebs.users.tv; -- cgit v1.2.3 From f58b49aa82769b4f3eca5ee0e63de407224c7dd9 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 1 Aug 2017 22:34:14 +0200 Subject: tv config: drop unused "builder" variable --- tv/2configs/default.nix | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/tv/2configs/default.nix b/tv/2configs/default.nix index c58525e9..730b055a 100644 --- a/tv/2configs/default.nix +++ b/tv/2configs/default.nix @@ -1,9 +1,6 @@ with import ; -{ config, lib, pkgs, ... }: let - builder = if getEnv "dummy_secrets" == "true" - then "buildbot" - else "tv"; -in { +{ config, pkgs, ... }: { + boot.tmpOnTmpfs = true; krebs.enable = true; -- cgit v1.2.3 From 9b62b9d74ba298b10823d5b71aa46d6ea46f0e13 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 1 Aug 2017 22:37:41 +0200 Subject: tv systems: normalize head --- tv/1systems/alnus/config.nix | 4 +--- tv/1systems/mu/config.nix | 4 +--- tv/1systems/nomic/config.nix | 4 +--- tv/1systems/wu/config.nix | 4 +--- tv/1systems/xu/config.nix | 4 +--- tv/1systems/zu/config.nix | 4 +--- 6 files changed, 6 insertions(+), 18 deletions(-) diff --git a/tv/1systems/alnus/config.nix b/tv/1systems/alnus/config.nix index dd9e594f..b53a8ea9 100644 --- a/tv/1systems/alnus/config.nix +++ b/tv/1systems/alnus/config.nix @@ -1,8 +1,6 @@ -{ config, pkgs, ... }: - with import ; +{ config, pkgs, ... }: { -{ imports = [ diff --git a/tv/1systems/mu/config.nix b/tv/1systems/mu/config.nix index 01de9ee6..11715c14 100644 --- a/tv/1systems/mu/config.nix +++ b/tv/1systems/mu/config.nix @@ -1,8 +1,6 @@ -{ config, pkgs, ... }: - with import ; +{ config, pkgs, ... }: { -{ imports = [ diff --git a/tv/1systems/nomic/config.nix b/tv/1systems/nomic/config.nix index 64cccde0..e9669980 100644 --- a/tv/1systems/nomic/config.nix +++ b/tv/1systems/nomic/config.nix @@ -1,8 +1,6 @@ -{ config, lib, pkgs, ... }: - with import ; +{ config, pkgs, ... }: { -{ krebs.build.host = config.krebs.hosts.nomic; imports = [ diff --git a/tv/1systems/wu/config.nix b/tv/1systems/wu/config.nix index cdcaa98d..24a1141b 100644 --- a/tv/1systems/wu/config.nix +++ b/tv/1systems/wu/config.nix @@ -1,8 +1,6 @@ -{ config, lib, pkgs, ... }: - with import ; +{ config, pkgs, ... }: { -{ krebs.build.host = config.krebs.hosts.wu; imports = [ diff --git a/tv/1systems/xu/config.nix b/tv/1systems/xu/config.nix index 0525be85..0444b95c 100644 --- a/tv/1systems/xu/config.nix +++ b/tv/1systems/xu/config.nix @@ -1,8 +1,6 @@ -{ config, lib, pkgs, ... }: - with import ; +{ config, pkgs, ... }: { -{ krebs.build.host = config.krebs.hosts.xu; imports = [ diff --git a/tv/1systems/zu/config.nix b/tv/1systems/zu/config.nix index 7267bbc9..1a924a47 100644 --- a/tv/1systems/zu/config.nix +++ b/tv/1systems/zu/config.nix @@ -1,8 +1,6 @@ -{ config, lib, pkgs, ... }: - with import ; +{ config, pkgs, ... }: { -{ krebs.build.host = config.krebs.hosts.zu; imports = [ -- cgit v1.2.3 From 91e48fae045a8b00239ae65bb027143ef9fcc50c Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 1 Aug 2017 22:47:08 +0200 Subject: tv: drop redundant swapDevices defs --- tv/1systems/alnus/config.nix | 2 -- tv/1systems/mu/config.nix | 2 -- tv/1systems/nomic/config.nix | 2 -- 3 files changed, 6 deletions(-) diff --git a/tv/1systems/alnus/config.nix b/tv/1systems/alnus/config.nix index b53a8ea9..71302d59 100644 --- a/tv/1systems/alnus/config.nix +++ b/tv/1systems/alnus/config.nix @@ -79,8 +79,6 @@ with import ; }; }; - swapDevices =[ ]; - users.users.dv = { inherit (config.krebs.users.dv) home uid; isNormalUser = true; diff --git a/tv/1systems/mu/config.nix b/tv/1systems/mu/config.nix index 11715c14..0c1e7923 100644 --- a/tv/1systems/mu/config.nix +++ b/tv/1systems/mu/config.nix @@ -50,8 +50,6 @@ with import ; }; }; - swapDevices =[ ]; - nixpkgs.config.allowUnfree = true; hardware.opengl.driSupport32Bit = true; diff --git a/tv/1systems/nomic/config.nix b/tv/1systems/nomic/config.nix index e9669980..996a5e7e 100644 --- a/tv/1systems/nomic/config.nix +++ b/tv/1systems/nomic/config.nix @@ -48,8 +48,6 @@ with import ; fsType = "btrfs"; }; - swapDevices = [ ]; - environment.systemPackages = with pkgs; [ (writeDashBin "play" '' set -euf -- cgit v1.2.3 From 4580d831a889b6260210ec2abb01ca387f35f801 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 1 Aug 2017 22:55:16 +0200 Subject: tv zu: add fileSystems."/bku" --- tv/1systems/zu/config.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tv/1systems/zu/config.nix b/tv/1systems/zu/config.nix index 1a924a47..05c14299 100644 --- a/tv/1systems/zu/config.nix +++ b/tv/1systems/zu/config.nix @@ -29,6 +29,11 @@ with import ; fsType = "btrfs"; options = ["defaults" "noatime" "ssd" "compress=lzo"]; }; + "/bku" = { + device = "/dev/mapper/zuvga-bku"; + fsType = "btrfs"; + options = ["defaults" "noatime" "ssd" "compress=lzo"]; + }; "/home" = { device = "/dev/mapper/zuvga-home"; fsType = "btrfs"; -- cgit v1.2.3 From 51042442288c2d27a2fb7ce073801932c5457813 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 1 Aug 2017 23:28:21 +0200 Subject: tv: drop security.wrappers.sendmail --- tv/1systems/mu/config.nix | 1 - tv/1systems/wu/config.nix | 4 ---- tv/1systems/xu/config.nix | 4 ---- tv/1systems/zu/config.nix | 4 ---- 4 files changed, 13 deletions(-) diff --git a/tv/1systems/mu/config.nix b/tv/1systems/mu/config.nix index 0c1e7923..95b01bff 100644 --- a/tv/1systems/mu/config.nix +++ b/tv/1systems/mu/config.nix @@ -88,7 +88,6 @@ with import ; programs.ssh.startAgent = false; security.wrappers = { - sendmail.source = "${pkgs.exim}/bin/sendmail"; # for cron slock.source = "${pkgs.slock}/bin/slock"; }; diff --git a/tv/1systems/wu/config.nix b/tv/1systems/wu/config.nix index 24a1141b..79b5aa26 100644 --- a/tv/1systems/wu/config.nix +++ b/tv/1systems/wu/config.nix @@ -51,10 +51,6 @@ with import ; hardware.enableRedistributableFirmware= true; hardware.opengl.driSupport32Bit = true; - security.wrappers = { - sendmail.source = "${pkgs.exim}/bin/sendmail"; # for cron - }; - services.printing.enable = true; services.udev.extraRules = '' diff --git a/tv/1systems/xu/config.nix b/tv/1systems/xu/config.nix index 0444b95c..0abd544c 100644 --- a/tv/1systems/xu/config.nix +++ b/tv/1systems/xu/config.nix @@ -146,10 +146,6 @@ with import ; gptfdisk ]; - security.wrappers = { - sendmail.source = "${pkgs.exim}/bin/sendmail"; # for cron - }; - services.printing.enable = true; #services.bitlbee.enable = true; diff --git a/tv/1systems/zu/config.nix b/tv/1systems/zu/config.nix index 05c14299..414d2f22 100644 --- a/tv/1systems/zu/config.nix +++ b/tv/1systems/zu/config.nix @@ -44,10 +44,6 @@ with import ; }; }; - security.wrappers = { - sendmail.source = "${pkgs.exim}/bin/sendmail"; # for cron - }; - services.printing.enable = true; #services.bitlbee.enable = true; -- cgit v1.2.3 From c5fae75443a7f13b54a0952d12275e9016628db2 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 1 Aug 2017 23:28:41 +0200 Subject: mv: drop security.wrappers.sendmail --- mv/1systems/stro.nix | 4 ---- 1 file changed, 4 deletions(-) diff --git a/mv/1systems/stro.nix b/mv/1systems/stro.nix index c8035b88..bb37aedd 100644 --- a/mv/1systems/stro.nix +++ b/mv/1systems/stro.nix @@ -143,10 +143,6 @@ with import ; }; }; - security.wrappers = { - sendmail.source = "${pkgs.exim}/bin/sendmail"; # for cron - }; - security.sudo.extraConfig = '' Defaults env_keep+="SSH_CLIENT" Defaults mailto="${config.krebs.users.mv.mail}" -- cgit v1.2.3 From 13b161949cee6f1fb97781fcfa0a700ac4f5b352 Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 2 Aug 2017 00:22:49 +0200 Subject: tv mu: drop boot.extraModprobeConfig --- tv/1systems/mu/config.nix | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tv/1systems/mu/config.nix b/tv/1systems/mu/config.nix index 95b01bff..32143f37 100644 --- a/tv/1systems/mu/config.nix +++ b/tv/1systems/mu/config.nix @@ -31,10 +31,6 @@ with import ; boot.kernelModules = [ "fbcon" "kvm-intel" ]; boot.extraModulePackages = [ ]; - boot.extraModprobeConfig = '' - options kvm_intel nested=1 - ''; - fileSystems = { "/" = { device = "/dev/vgmu1/nixroot"; -- cgit v1.2.3 From 26b88c04c59ed05ae29b9a65563322aa01527b96 Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 2 Aug 2017 02:13:21 +0200 Subject: tv: add x0vncserver module --- tv/3modules/default.nix | 1 + tv/3modules/x0vncserver.nix | 52 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 tv/3modules/x0vncserver.nix diff --git a/tv/3modules/default.nix b/tv/3modules/default.nix index 397ee8e8..83dc212a 100644 --- a/tv/3modules/default.nix +++ b/tv/3modules/default.nix @@ -6,5 +6,6 @@ _: ./ejabberd ./hosts.nix ./iptables.nix + ./x0vncserver.nix ]; } diff --git a/tv/3modules/x0vncserver.nix b/tv/3modules/x0vncserver.nix new file mode 100644 index 00000000..44fed590 --- /dev/null +++ b/tv/3modules/x0vncserver.nix @@ -0,0 +1,52 @@ +with import ; +{ config, pkgs, ... }: let + + cfg = config.tv.x0vncserver; + +in { + options.tv.x0vncserver = { + display = mkOption { + default = ":${toString config.services.xserver.display}"; + type = types.str; + }; + enable = mkEnableOption "tv.x0vncserver"; + pwfile = mkOption { + default = { + owner = cfg.user; + path = "${cfg.user.home}/.vncpasswd"; + source-path = toString + "/vncpasswd"; + }; + description = '' + Use vncpasswd to edit pwfile. + See: nix-shell -p tigervnc --run 'man vncpasswd' + ''; + type = types.secret-file; + }; + rfbport = mkOption { + default = 5900; + type = types.int; + }; + user = mkOption { + default = config.krebs.build.user; + type = types.user; + }; + }; + config = mkIf cfg.enable { + krebs.secret.files = { + x0vncserver-pwfile = cfg.pwfile; + }; + systemd.services.x0vncserver = { + after = [ "graphical.target" "secret.service" ]; + requires = [ "graphical.target" "secret.service" ]; + serviceConfig = { + ExecStart = "${pkgs.tigervnc}/bin/x0vncserver ${toString [ + "-display ${cfg.display}" + "-passwordfile ${cfg.pwfile.path}" + "-rfbport ${toString cfg.rfbport}" + ]}"; + User = cfg.user.name; + }; + }; + tv.iptables.input-retiolum-accept-tcp = singleton (toString cfg.rfbport); + }; +} -- cgit v1.2.3 From f607ba46109e11466988b980ff36e395aa0c4049 Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 2 Aug 2017 02:13:57 +0200 Subject: tv mu: drop udev extraRules --- tv/1systems/mu/config.nix | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/tv/1systems/mu/config.nix b/tv/1systems/mu/config.nix index 32143f37..42fcfdb2 100644 --- a/tv/1systems/mu/config.nix +++ b/tv/1systems/mu/config.nix @@ -12,16 +12,6 @@ with import ; krebs.build.host = config.krebs.hosts.mu; krebs.build.user = mkForce config.krebs.users.vv; - services.udev.extraRules = '' - SUBSYSTEM=="net", ATTR{address}=="00:90:f5:da:aa:c3", NAME="en0" - SUBSYSTEM=="net", ATTR{address}=="a0:88:b4:1b:ae:6c", NAME="wl0" - - # for jack - KERNEL=="rtc0", GROUP="audio" - KERNEL=="hpet", GROUP="audio" - ''; - - # hardware configuration boot.initrd.luks.devices = [ { name = "vgmu1"; device = "/dev/sda2"; } -- cgit v1.2.3 From d97d86eddec8002a7a7e5b01320e33121a6ff27f Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 2 Aug 2017 02:14:23 +0200 Subject: tv mu: boot.loader.{gummiboot => systemd-boot} --- tv/1systems/mu/config.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tv/1systems/mu/config.nix b/tv/1systems/mu/config.nix index 42fcfdb2..96ccd321 100644 --- a/tv/1systems/mu/config.nix +++ b/tv/1systems/mu/config.nix @@ -43,8 +43,8 @@ with import ; hardware.enableRedistributableFirmware = true; - boot.loader.gummiboot.enable = true; boot.loader.efi.canTouchEfiVariables = true; + boot.loader.systemd-boot.enable = true; networking.networkmanager.enable = true; -- cgit v1.2.3 From 87c7d8dcf933c2de783098dfe9b6f1b383062daf Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 2 Aug 2017 02:14:49 +0200 Subject: tv mu: enable x0vncserver --- tv/1systems/mu/config.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tv/1systems/mu/config.nix b/tv/1systems/mu/config.nix index 96ccd321..08948187 100644 --- a/tv/1systems/mu/config.nix +++ b/tv/1systems/mu/config.nix @@ -12,6 +12,8 @@ with import ; krebs.build.host = config.krebs.hosts.mu; krebs.build.user = mkForce config.krebs.users.vv; + tv.x0vncserver.enable = true; + # hardware configuration boot.initrd.luks.devices = [ { name = "vgmu1"; device = "/dev/sda2"; } -- cgit v1.2.3 From 37373468839e8b734d0ea9ddabb49d2196206d4f Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 2 Aug 2017 01:08:12 +0200 Subject: ma sane-extra: init --- makefu/3modules/default.nix | 1 + makefu/3modules/sane-extra.nix | 45 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 makefu/3modules/sane-extra.nix diff --git a/makefu/3modules/default.nix b/makefu/3modules/default.nix index 2981e0fa..00df56be 100644 --- a/makefu/3modules/default.nix +++ b/makefu/3modules/default.nix @@ -9,6 +9,7 @@ _: ./opentracker.nix ./ps3netsrv.nix ./logging-config.nix + ./sane-extra.nix ./server-config.nix ./snapraid.nix ./torrent.nix diff --git a/makefu/3modules/sane-extra.nix b/makefu/3modules/sane-extra.nix new file mode 100644 index 00000000..2e0ce8f2 --- /dev/null +++ b/makefu/3modules/sane-extra.nix @@ -0,0 +1,45 @@ +{ config, lib, pkgs, ... }: +# https://github.com/michalrus/dotfiles/blob/d943be3089aa436e07cea5f22d829402936a9229/.nixos-config.symlink/modules/sane-extra-config.nix +# via https://github.com/NixOS/nixpkgs/issues/17411 +# via https://unix.stackexchange.com/questions/321954/install-epson-v39-on-nixos +with lib; + +let + + cfg = config.hardware.sane; + + pkg = if cfg.snapshot + then pkgs.sane-backends-git + else pkgs.sane-backends; + + backends = [ pkg ] ++ cfg.extraBackends; + + saneConfig = pkgs.mkSaneConfig { paths = backends; }; + + saneExtraConfig = pkgs.runCommand "sane-extra-config" {} '' + cp -Lr '${pkgs.mkSaneConfig { paths = [ pkgs.sane-backends ]; }}'/etc/sane.d $out + chmod +w $out + ${concatMapStrings (c: '' + f="$out/${c.name}.conf" + [ ! -e "$f" ] || chmod +w "$f" + cat ${builtins.toFile "" (c.value + "\n")} >>"$f" + chmod -w "$f" + '') (mapAttrsToList nameValuePair cfg.extraConfig)} + chmod -w $out + ''; + +in + +{ + options = { + hardware.sane.extraConfig = mkOption { + type = types.attrsOf types.lines; + default = {}; + example = { "some-backend" = "# some lines to add to its .conf"; }; + }; + }; + + config = mkIf (cfg.enable && cfg.extraConfig != {}) { + hardware.sane.configDir = saneExtraConfig.outPath; + }; +} -- cgit v1.2.3 From a5c7310cc24145aee4f8c7fc3f89dde9b95fe7f9 Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 2 Aug 2017 11:49:27 +0200 Subject: ma printer: add support for magicolor --- makefu/2configs/printer.nix | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/makefu/2configs/printer.nix b/makefu/2configs/printer.nix index 509ed512..0865a084 100644 --- a/makefu/2configs/printer.nix +++ b/makefu/2configs/printer.nix @@ -1,15 +1,30 @@ -{ pkgs, ... }: +{ config, pkgs, ... }: -{ +let + mainUser = config.krebs.build.user.name; +in { services.printing = { enable = true; drivers = [ pkgs.samsungUnifiedLinuxDriver - pkgs.cups-dymo + pkgs.cups-dymo # dymo labelwriter + pkgs.foo2zjs # magicolor 1690mf ]; }; # scanners are printers just in reverse anyway - hardware.sane.enable = true; - hardware.sane.extraBackends = [ pkgs.samsungUnifiedLinuxDriver ]; + services.saned.enable = true; + users.users."${mainUser}".extraGroups = [ "scanner" ]; + + hardware.sane = { + enable = true; + extraBackends = [ pkgs.samsungUnifiedLinuxDriver ]; + + # $ scanimage -p --format=jpg --mode=Gray --source="Automatic Document Feeder" -v --batch="lol%d.jpg" --resolution=150 + + # requires 'sane-extra', scan via: + extraConfig."magicolor" = '' + net 10.42.20.30 0x2098 + ''; # 10.42.20.30: uhrenkind.shack magicolor 1690mf + }; } -- cgit v1.2.3 From a00db299ace1d0950d7d8030a9684fec3b3b2c43 Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 2 Aug 2017 22:17:41 +0200 Subject: ma x: enable stk1160 --- makefu/1systems/x/config.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/makefu/1systems/x/config.nix b/makefu/1systems/x/config.nix index 969e78be..36865557 100644 --- a/makefu/1systems/x/config.nix +++ b/makefu/1systems/x/config.nix @@ -54,7 +54,7 @@ with import ; - # + # # Filesystem @@ -62,6 +62,9 @@ with import ; # Security + { + programs.adb.enable = true; + } ]; -- cgit v1.2.3 From 1310375624b7fbcb6c165a032edc9d3ef336d57b Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 2 Aug 2017 22:38:26 +0200 Subject: ma stk1160: revert to hacky override --- makefu/2configs/hw/stk1160.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/makefu/2configs/hw/stk1160.nix b/makefu/2configs/hw/stk1160.nix index e73741e2..b3a9e1a5 100644 --- a/makefu/2configs/hw/stk1160.nix +++ b/makefu/2configs/hw/stk1160.nix @@ -1,8 +1,9 @@ { pkgs, ... }: { # TODO: un-pin linuxPackages somehow + boot.kernelPackages = builtins.trace "Warning: overriding kernel Packages with 4.9" pkgs.linuxPackages; nixpkgs.config.packageOverrides = pkgs: { - linux_latest = pkgs.linux_latest.override { + linux_4_9 = pkgs.linux_4_9.override { extraConfig = '' MEDIA_ANALOG_TV_SUPPORT y VIDEO_STK1160_COMMON m -- cgit v1.2.3