From bd37251904c3d0b4ab004d40a869acc9b6e0650f Mon Sep 17 00:00:00 2001 From: makefu Date: Sun, 30 Apr 2017 13:05:59 +0200 Subject: m 5: cleanup old packages --- makefu/5pkgs/f3/default.nix | 26 -------------------------- makefu/5pkgs/mergerfs/default.nix | 26 -------------------------- makefu/5pkgs/ps3netsrv/default.nix | 29 ----------------------------- 3 files changed, 81 deletions(-) delete mode 100644 makefu/5pkgs/f3/default.nix delete mode 100644 makefu/5pkgs/mergerfs/default.nix delete mode 100644 makefu/5pkgs/ps3netsrv/default.nix diff --git a/makefu/5pkgs/f3/default.nix b/makefu/5pkgs/f3/default.nix deleted file mode 100644 index e7f20b1e6..000000000 --- a/makefu/5pkgs/f3/default.nix +++ /dev/null @@ -1,26 +0,0 @@ -{ stdenv, fetchFromGitHub }: - -stdenv.mkDerivation rec { - name = "f3-${version}"; - version = "6.0"; - - enableParallelBuilding = true; - - src = fetchFromGitHub { - owner = "AltraMayor"; - repo = "f3"; - rev = "v${version}"; - sha256 = "1azi10ba0h9z7m0gmfnyymmfqb8380k9za8hn1rrw1s442hzgnz2"; - }; - - makeFlags = [ "PREFIX=$(out)" ]; - patchPhase = "sed -i 's/-oroot -groot//' Makefile"; - - meta = { - description = "Fight Flash Fraud"; - homepage = http://oss.digirati.com.br/f3/; - license = stdenv.lib.licenses.gpl2; - platforms = stdenv.lib.platforms.linux; - maintainers = with stdenv.lib.maintainers; [ makefu ]; - }; -} diff --git a/makefu/5pkgs/mergerfs/default.nix b/makefu/5pkgs/mergerfs/default.nix deleted file mode 100644 index cfb7b0ae7..000000000 --- a/makefu/5pkgs/mergerfs/default.nix +++ /dev/null @@ -1,26 +0,0 @@ -{ stdenv, fetchgit, fuse, pkgconfig, which, attr, pandoc, git }: - -stdenv.mkDerivation rec { - name = "mergerfs-${version}"; - version = "2.16.1"; - - # not using fetchFromGitHub because of changelog being built with git log - src = fetchgit { - url = "https://github.com/trapexit/mergerfs"; - rev = "refs/tags/${version}"; - sha256 = "12fqgk54fnnibqiq82p4g2k6qnw3iy6dd64csmlf73yi67za5iwf"; - deepClone = true; - }; - - buildInputs = [ fuse pkgconfig which attr pandoc git ]; - - makeFlags = [ "PREFIX=$(out)" "XATTR_AVAILABLE=1" ]; - - - meta = { - homepage = https://github.com/trapexit/mergerfs; - description = "a FUSE based union filesystem"; - license = stdenv.lib.licenses.isc; - maintainers = [ stdenv.lib.maintainers.makefu ]; - }; -} diff --git a/makefu/5pkgs/ps3netsrv/default.nix b/makefu/5pkgs/ps3netsrv/default.nix deleted file mode 100644 index f62ee0c9a..000000000 --- a/makefu/5pkgs/ps3netsrv/default.nix +++ /dev/null @@ -1,29 +0,0 @@ -{ stdenv, fetchgit, clang, makeWrapper, gnugrep }: - -stdenv.mkDerivation rec { - name = "ps3netsrv-${version}"; - version = "1.1.0"; - - enableParallelBuilding = true; - - src = fetchgit { - url = "https://github.com/dirkvdb/ps3netsrv--"; - fetchSubmodules = true; - rev = "e54a66cbf142b86e2cffc1701984b95adb921e81"; # latest @ 2016-05-24 - sha256 = "09hvmfzqy2jckpsml0z1gkcnar8sigmgs1q66k718fph2d3g54sa"; - }; - - nativeBuildInputs = [ gnugrep ]; - buildPhase = "make CXX=g++"; - installPhase = '' - mkdir -p $out/bin - cp ps3netsrv++ $out/bin - ''; - meta = { - description = "C++ implementation of the ps3netsrv server"; - homepage = https://github.com/dirkvdb/ps3netsrv--; - license = stdenv.lib.licenses.mit; - platforms = stdenv.lib.platforms.linux; - maintainers = with stdenv.lib.maintainers; [ makefu ]; - }; -} -- cgit v1.2.3 From 1785e96ba966253f09b7d5d904ef3d5d99ced587 Mon Sep 17 00:00:00 2001 From: makefu Date: Sun, 30 Apr 2017 13:08:16 +0200 Subject: m 5 libcoap: init --- makefu/5pkgs/libcoap/default.nix | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 makefu/5pkgs/libcoap/default.nix diff --git a/makefu/5pkgs/libcoap/default.nix b/makefu/5pkgs/libcoap/default.nix new file mode 100644 index 000000000..7e8d03edd --- /dev/null +++ b/makefu/5pkgs/libcoap/default.nix @@ -0,0 +1,27 @@ +{ lib, stdenv, fetchFromGitHub, autoreconfHook, autoconf-archive, pkgconfig, +gettext, asciidoc, doxygen, libxml2, libxslt, docbook_xsl, ... }: +stdenv.mkDerivation rec { + name = "libcoap-${version}"; + version = "4.1.2"; + + src = fetchFromGitHub { + owner = "obgm"; + repo = "libcoap"; + rev = "v${version}"; + sha256 = "0f0qq15480ja1s03vn8lzw4b3mzdgy46hng4aigi6i6qbzf29kf5"; + }; + + patchPhase = '' + sed -i 's/$(A2X)/& --no-xmllint/' examples/Makefile.am + ''; + buildInputs = [ gettext asciidoc doxygen libxml2.bin libxslt docbook_xsl]; + nativeBuildInputs = [ autoreconfHook autoconf-archive pkgconfig ]; + + meta = { + description = ""; + homepage = http://coap.technology; + license = stdenv.lib.licenses.gpl2; + platforms = stdenv.lib.platforms.linux; + maintainers = with stdenv.lib.maintainers; [ makefu ]; + }; +} -- cgit v1.2.3 From cc8efe15822d15d0cb4315b0d0c308474ef3343f Mon Sep 17 00:00:00 2001 From: makefu Date: Tue, 2 May 2017 00:12:33 +0200 Subject: m 1 iso: init --- makefu/1systems/iso.nix | 50 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 makefu/1systems/iso.nix diff --git a/makefu/1systems/iso.nix b/makefu/1systems/iso.nix new file mode 100644 index 000000000..ee1046f79 --- /dev/null +++ b/makefu/1systems/iso.nix @@ -0,0 +1,50 @@ +{ config, pkgs, lib, ... }: + +with import ; +{ + imports = [ + ../. + + + ../2configs/tools/core.nix + ]; + # TODO: NIX_PATH and nix.nixPath are being set by default.nix right now + # cd ~/stockholm ; nix-build -A config.system.build.isoImage -I nixos-config=makefu/1systems/iso.nix -I secrets=/home/makefu/secrets/iso /var/src/nixpkgs/nixos + krebs.build.host = config.krebs.hosts.iso; + krebs.hidden-ssh.enable = true; + environment.systemPackages = with pkgs; [ + aria2 + ddrescue + ]; + environment.extraInit = '' + EDITOR=vim + ''; + # iso-specific + boot.kernelParams = [ "copytoram" ]; + services.openssh = { + enable = true; + hostKeys = [ + { bits = 8192; type = "ed25519"; path = "/etc/ssh/ssh_host_ed25519_key"; } + ]; + }; + # enable ssh in the iso boot process + systemd.services.sshd.wantedBy = lib.mkForce [ "multi-user.target" ]; + # hack `tee` behavior + nixpkgs.config.packageOverrides = super: { + irc-announce = super.callPackage { + pkgs = pkgs // { coreutils = pkgs.concat "coreutils-hack" [ + pkgs.coreutils + (pkgs.writeDashBin "tee" '' + if test "$1" = /dev/stderr; then + while read -r line; do + echo "$line" + echo "$line" >&2 + done + else + ${super.coreutils}/bin/tee "$@" + fi + '') + ];}; + }; + }; +} -- cgit v1.2.3 From 5cfbfd46bf7f4470f4fe6a8ba5e97e05a55c1254 Mon Sep 17 00:00:00 2001 From: makefu Date: Tue, 2 May 2017 14:03:25 +0200 Subject: m gum: move to netcup --- krebs/3modules/makefu/default.nix | 6 +++--- makefu/1systems/gum.nix | 26 +++++++++++++++++--------- 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/krebs/3modules/makefu/default.nix b/krebs/3modules/makefu/default.nix index 651b9a3c6..650344981 100644 --- a/krebs/3modules/makefu/default.nix +++ b/krebs/3modules/makefu/default.nix @@ -427,7 +427,7 @@ with import ; }; gum = rec { - cores = 1; + cores = 2; extraZones = { "krebsco.de" = '' @@ -448,7 +448,7 @@ with import ; }; nets = rec { internet = { - ip4.addr = "195.154.108.70"; + ip4.addr = "188.68.40.19"; aliases = [ "gum.i" ]; @@ -456,7 +456,7 @@ with import ; retiolum = { via = internet; ip4.addr = "10.243.0.211"; - # ip6.addr = "42:f9f0:0000:0000:0000:0000:0000:70d2"; + ip6.addr = "42:f9f0:0000:0000:0000:0000:0000:70d2"; aliases = [ "gum.r" "cgit.gum.r" diff --git a/makefu/1systems/gum.nix b/makefu/1systems/gum.nix index 95d092822..93ca8f643 100644 --- a/makefu/1systems/gum.nix +++ b/makefu/1systems/gum.nix @@ -2,23 +2,32 @@ with import ; let + external-mac = "3a:66:48:8e:82:b2"; external-ip = config.krebs.build.host.nets.internet.ip4.addr; + external-gw = "188.68.40.1"; + external-netmask = 22; internal-ip = config.krebs.build.host.nets.retiolum.ip4.addr; + main-disk = "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi0-0-0-0"; in { imports = [ ../. + ../2configs/headless.nix - ../2configs/fs/simple-swap.nix ../2configs/fs/single-partition-ext4.nix ../2configs/smart-monitor.nix ../2configs/git/cgit-retiolum.nix ../2configs/backup.nix # ../2configs/mattermost-docker.nix - ../2configs/disable_v6.nix + # ../2configs/disable_v6.nix ../2configs/exim-retiolum.nix ../2configs/tinc/retiolum.nix ../2configs/urlwatch.nix + # Tools + ../2configs/tools/core.nix + ../2configs/tools/dev.nix + ../2configs/tools/sec.nix + # services ../2configs/gum-share.nix ../2configs/sabnzbd.nix @@ -46,7 +55,7 @@ in { # ../2configs/logging/central-logging-client.nix ]; - services.smartd.devices = [ { device = "/dev/sda";} ]; + services.smartd.devices = [ { device = main-disk;} ]; makefu.dl-dir = "/var/download"; @@ -83,16 +92,15 @@ in { get ]; services.bitlbee.enable = true; - systemd.services.bitlbee.environment.BITLBEE_DEBUG="1"; # Hardware - boot.loader.grub.device = "/dev/sda"; - boot.initrd.availableKernelModules = [ "pata_via" "uhci_hcd" ]; + boot.loader.grub.device = main-disk; + boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "virtio_pci" "sd_mod" "sr_mod" ]; boot.kernelModules = [ "kvm-intel" ]; # Network services.udev.extraRules = '' - SUBSYSTEM=="net", ATTR{address}=="c8:0a:a9:c8:ee:dd", NAME="et0" + SUBSYSTEM=="net", ATTR{address}=="${external-mac}", NAME="et0" ''; boot.kernelParams = [ ]; networking = { @@ -124,9 +132,9 @@ in { }; interfaces.et0.ip4 = [{ address = external-ip; - prefixLength = 24; + prefixLength = external-netmask; }]; - defaultGateway = "195.154.108.1"; + defaultGateway = external-gw; nameservers = [ "8.8.8.8" ]; }; -- cgit v1.2.3 From 6baf8704a4ce643cc8bdab8d122d187225afb6ca Mon Sep 17 00:00:00 2001 From: makefu Date: Tue, 2 May 2017 14:04:01 +0200 Subject: m 2 tools: shuffle --- makefu/2configs/tools/core-gui.nix | 1 + makefu/2configs/tools/core.nix | 31 ++++++++++++++++++++----------- makefu/2configs/tools/dev.nix | 10 ++++++++-- makefu/2configs/tools/extra-gui.nix | 7 ++++--- makefu/2configs/tools/media.nix | 1 + makefu/2configs/tools/sec.nix | 3 ++- 6 files changed, 36 insertions(+), 17 deletions(-) diff --git a/makefu/2configs/tools/core-gui.nix b/makefu/2configs/tools/core-gui.nix index 0538647ae..f409b68a2 100644 --- a/makefu/2configs/tools/core-gui.nix +++ b/makefu/2configs/tools/core-gui.nix @@ -20,5 +20,6 @@ xdotool xorg.xbacklight scrot + wireshark ]; } diff --git a/makefu/2configs/tools/core.nix b/makefu/2configs/tools/core.nix index 6ae2951eb..8a15ae2e7 100644 --- a/makefu/2configs/tools/core.nix +++ b/makefu/2configs/tools/core.nix @@ -12,11 +12,11 @@ rsync exif file + # fs ntfs3g + dosfstools pv - proot sshpass - populate usbutils p7zip hdparm @@ -27,21 +27,30 @@ sysstat which weechat - curl - wget wol tmux + iftop + mkpasswd + # storage smartmontools cifs-utils - iftop - taskwarrior - mplayer + # net + wget + curl - cac-api - cac-panel + # stockholm + git + gnumake + jq + parallel + proot + populate + + rxvt_unicode.terminfo krebspaste - krebszones - ledger + + # TODO: + taskwarrior pass ]; } diff --git a/makefu/2configs/tools/dev.nix b/makefu/2configs/tools/dev.nix index 8acc25fcc..8e4e3270d 100644 --- a/makefu/2configs/tools/dev.nix +++ b/makefu/2configs/tools/dev.nix @@ -2,9 +2,15 @@ { krebs.per-user.makefu.packages = with pkgs;[ - nodemcu-uploader - esptool python35Packages.virtualenv + # embedded flashrom + mosquitto + libcoap + nodemcu-uploader + esptool + cac-api + cac-panel + krebszones ]; } diff --git a/makefu/2configs/tools/extra-gui.nix b/makefu/2configs/tools/extra-gui.nix index 596734dd5..56cdccd1f 100644 --- a/makefu/2configs/tools/extra-gui.nix +++ b/makefu/2configs/tools/extra-gui.nix @@ -2,12 +2,13 @@ { krebs.per-user.makefu.packages = with pkgs;[ - inkscape gimp + inkscape libreoffice + saleae-logic skype - virtmanager synergy - saleae-logic + tdesktop + virtmanager ]; } diff --git a/makefu/2configs/tools/media.nix b/makefu/2configs/tools/media.nix index 4fc3413e8..4de2b545e 100644 --- a/makefu/2configs/tools/media.nix +++ b/makefu/2configs/tools/media.nix @@ -8,5 +8,6 @@ calibre vlc mumble + mplayer ]; } diff --git a/makefu/2configs/tools/sec.nix b/makefu/2configs/tools/sec.nix index e53d9ee8e..5fb9a5fc8 100644 --- a/makefu/2configs/tools/sec.nix +++ b/makefu/2configs/tools/sec.nix @@ -11,6 +11,7 @@ nmap msf thc-hydra - wireshark + borgbackup + ledger ]; } -- cgit v1.2.3 From 0fdb899e5de50cdaf9cb6e2297dd80ba8d04b1d2 Mon Sep 17 00:00:00 2001 From: makefu Date: Tue, 2 May 2017 14:04:39 +0200 Subject: m 1 omo: add mqtt --- makefu/1systems/omo.nix | 3 +++ makefu/2configs/mqtt.nix | 9 +++++++++ 2 files changed, 12 insertions(+) create mode 100644 makefu/2configs/mqtt.nix diff --git a/makefu/1systems/omo.nix b/makefu/1systems/omo.nix index ff34ee843..91785a078 100644 --- a/makefu/1systems/omo.nix +++ b/makefu/1systems/omo.nix @@ -55,7 +55,10 @@ in { ../2configs/logging/central-stats-server.nix # ../2configs/logging/central-logging-server.nix ../2configs/logging/central-stats-client.nix + + # services ../2configs/syncthing.nix + ../2configs/mqtt.nix # ../2configs/logging/central-logging-client.nix # ../2configs/torrent.nix diff --git a/makefu/2configs/mqtt.nix b/makefu/2configs/mqtt.nix new file mode 100644 index 000000000..39c9fdfdd --- /dev/null +++ b/makefu/2configs/mqtt.nix @@ -0,0 +1,9 @@ +{ ... }: +{ + services.mosquitto = { + enable = true; + host = "0.0.0.0"; + users = {}; + allowAnonymous = true; + }; +} -- cgit v1.2.3 From 22188f14d3e4eb309fba69a65049cb2c1ec05e2d Mon Sep 17 00:00:00 2001 From: makefu Date: Tue, 2 May 2017 14:05:06 +0200 Subject: m 2 default: extraUsers -> users --- makefu/2configs/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/makefu/2configs/default.nix b/makefu/2configs/default.nix index 0865c3a31..6cc891047 100644 --- a/makefu/2configs/default.nix +++ b/makefu/2configs/default.nix @@ -4,7 +4,7 @@ with import ; { imports = [ { - users.extraUsers = + users.users = mapAttrs (_: h: { hashedPassword = h; }) (import ); } @@ -134,6 +134,7 @@ with import ; }; environment.shellAliases = { + # TODO: see .aliases lsl = "ls -lAtr"; psg = "ps -ef | grep"; nmap = "nmap -oN $HOME/loot/scan-`date +\%s`.nmap -oX $HOME/loot/scan-`date +%s`.xml"; -- cgit v1.2.3