From cf0cdbc33d6751bd5c8d48ec0433b7db299a292d Mon Sep 17 00:00:00 2001 From: makefu Date: Fri, 12 Mar 2021 20:08:43 +0100 Subject: ma filepimp.r: clean up hardware, add disk --- makefu/1systems/filepimp/config.nix | 77 +++------------------------------- makefu/1systems/filepimp/hw.nix | 83 +++++++++++++++++++++++++++++++++++++ makefu/1systems/filepimp/source.nix | 1 + 3 files changed, 90 insertions(+), 71 deletions(-) create mode 100644 makefu/1systems/filepimp/hw.nix (limited to 'makefu/1systems') diff --git a/makefu/1systems/filepimp/config.nix b/makefu/1systems/filepimp/config.nix index e023c2885..346de10ba 100644 --- a/makefu/1systems/filepimp/config.nix +++ b/makefu/1systems/filepimp/config.nix @@ -1,26 +1,13 @@ { config, pkgs, lib, ... }: +# nix-shell -p wol --run 'wol C8:CB:B8:CF:E4:DC --passwd=CA-FE-BA-BE-13-37' let - byid = dev: "/dev/disk/by-id/" + dev; - part1 = disk: disk + "-part1"; - rootDisk = byid "ata-SanDisk_SDSSDP064G_140237402890"; - primary-interface = "enp3s0"; # c8:cb:b8:cf:e4:dc - # N54L Chassis: - # ____________________ - # |______FRONT_______| - # | [ ]| - # | [ d1 ** d3 d4 ]| - # |___[_____________]| - jDisk1 = byid "ata-ST4000DM000-1F2168_Z3040NEA"; - - # transfer to omo - # jDisk0 = byid "ata-ST4000DM000-1F2168_Z303HVSG"; - jDisk2 = byid "ata-WDC_WD40EFRX-68WT0N0_WD-WCC4E0621363"; - jDisk3 = byid "ata-TOSHIBA_MD04ACA400_156GK89OFSBA"; - allDisks = [ rootDisk jDisk1 jDisk2 jDisk3 ]; + itf = config.makefu.server.primary-itf; in { imports = [ # Include the results of the hardware scan. + ./hw.nix + @@ -28,64 +15,12 @@ in { ]; krebs.build.host = config.krebs.hosts.filepimp; - # AMD N54L - boot = { - loader.grub.device = rootDisk; - - initrd.availableKernelModules = [ - "ahci" - "ohci_pci" - "ehci_pci" - "pata_atiixp" - "usb_storage" - "usbhid" - ]; - - kernelModules = [ "kvm-amd" ]; - extraModulePackages = [ ]; - }; - hardware.enableRedistributableFirmware = true; - hardware.cpu.amd.updateMicrocode = true; - - zramSwap.enable = true; - - makefu.snapraid = let - toMedia = name: "/media/" + name; - in { - enable = true; - # todo combine creation when enabling the mount point - disks = map toMedia [ - # "j0" - "j1" - "j2" - ]; - parity = toMedia "par0"; - }; - # TODO: refactor, copy-paste from omo - services.smartd.devices = builtins.map (x: { device = x; }) allDisks; - powerManagement.powerUpCommands = lib.concatStrings (map (disk: '' - ${pkgs.hdparm}/sbin/hdparm -S 100 ${disk} - ${pkgs.hdparm}/sbin/hdparm -B 127 ${disk} - ${pkgs.hdparm}/sbin/hdparm -y ${disk} - '') allDisks); - fileSystems = let - xfsmount = name: dev: - { "/media/${name}" = { - device = dev; fsType = "xfs"; - options = [ "nofail" ]; - }; }; - in - # (xfsmount "j0" (part1 jDisk0)) // - (xfsmount "j1" (part1 jDisk1)) // - (xfsmount "j2" (part1 jDisk2)) // - (xfsmount "par0" (part1 jDisk3)) - ; - networking.firewall.trustedInterfaces = [ primary-interface ]; + networking.firewall.trustedInterfaces = [ itf ]; services.wakeonlan.interfaces = [ { - interface = primary-interface; + interface = itf ; method = "password"; password = "CA:FE:BA:BE:13:37"; } diff --git a/makefu/1systems/filepimp/hw.nix b/makefu/1systems/filepimp/hw.nix new file mode 100644 index 000000000..6f02d9b1b --- /dev/null +++ b/makefu/1systems/filepimp/hw.nix @@ -0,0 +1,83 @@ +{ config, pkgs, lib, ... }: + +let + byid = dev: "/dev/disk/by-id/" + dev; + part1 = disk: disk + "-part1"; + rootDisk = byid "ata-SanDisk_SDSSDP064G_140237402890"; + primary-interface = "enp3s0"; # c8:cb:b8:cf:e4:dc + # N54L Chassis: + # ____________________ + # |______FRONT_______| + # | [ ]| + # | [ d1 d0 d3 d4 ]| + # |___[_____________]| + jDisk1 = byid "ata-ST4000DM000-1F2168_Z3040NEA"; + + # transfer to omo + jDisk0 = byid "ata-ST4000DM000-1F2168_Z303HVSG"; + jDisk2 = byid "ata-WDC_WD40EFRX-68WT0N0_WD-WCC4E0621363"; + jDisk3 = byid "ata-TOSHIBA_MD04ACA400_156GK89OFSBA"; + allDisks = [ rootDisk jDisk0 jDisk1 jDisk2 jDisk3 ]; +in { + boot = { + loader.grub.device = rootDisk; + + initrd.availableKernelModules = [ + "ahci" + "ohci_pci" + "ehci_pci" + "pata_atiixp" + "usb_storage" + "usbhid" + ]; + + kernelModules = [ "kvm-amd" ]; + extraModulePackages = [ ]; + }; + makefu.server.primary-itf = primary-interface; + + hardware.enableRedistributableFirmware = true; + hardware.cpu.amd.updateMicrocode = true; + + zramSwap.enable = true; + + makefu.snapraid = let + toMedia = name: "/media/" + name; + in { + enable = true; + # todo combine creation when enabling the mount point + disks = map toMedia [ + "j0" + "j1" + "j2" + ]; + parity = toMedia "par0"; + }; + # TODO: refactor, copy-paste from omo + services.smartd.devices = builtins.map (x: { device = x; }) allDisks; + powerManagement.powerUpCommands = lib.concatStrings (map (disk: '' + ${pkgs.hdparm}/sbin/hdparm -S 100 ${disk} + ${pkgs.hdparm}/sbin/hdparm -B 127 ${disk} + ${pkgs.hdparm}/sbin/hdparm -y ${disk} + '') allDisks); + fileSystems = let + xfsmount = name: dev: + { "/media/${name}" = { + device = dev; fsType = "xfs"; + options = [ "nofail" ]; + }; }; + tomedia = id: "/media/${id}"; + in + (xfsmount "j0" (part1 jDisk0)) // + (xfsmount "j1" (part1 jDisk1)) // + (xfsmount "j2" (part1 jDisk2)) // + (xfsmount "par0" (part1 jDisk3)) // + { "/media/jX" = { + device = (lib.concatMapStringsSep ":" (d: (tomedia d)) ["j0" "j1" "j2" ]); + fsType = "mergerfs"; + noCheck = true; + options = [ "defaults" "allow_other" "nofail" "nonempty" ]; + }; + }; + environment.systemPackages = [ pkgs.mergerfs ]; +} diff --git a/makefu/1systems/filepimp/source.nix b/makefu/1systems/filepimp/source.nix index b81a2bf4a..9930f0e42 100644 --- a/makefu/1systems/filepimp/source.nix +++ b/makefu/1systems/filepimp/source.nix @@ -1,3 +1,4 @@ { name="filepimp"; + home-manager = true; } -- cgit v1.3.1 From 27e182f7f878721c665b92b287e0d5f8da5bd06a Mon Sep 17 00:00:00 2001 From: makefu Date: Fri, 12 Mar 2021 20:09:10 +0100 Subject: ma: deploy storj on omo, forward via gum --- makefu/1systems/gum/config.nix | 7 ++++++- makefu/2configs/storj/client.nix | 27 +++++++++++++++++++++++++++ makefu/2configs/storj/forward-port.nix | 22 ++++++++++++++++++++++ 3 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 makefu/2configs/storj/client.nix create mode 100644 makefu/2configs/storj/forward-port.nix (limited to 'makefu/1systems') diff --git a/makefu/1systems/gum/config.nix b/makefu/1systems/gum/config.nix index 2fd99122a..d81aefb67 100644 --- a/makefu/1systems/gum/config.nix +++ b/makefu/1systems/gum/config.nix @@ -43,6 +43,7 @@ in { + # # networking @@ -156,6 +157,7 @@ in { + # @@ -203,7 +205,10 @@ in { # Network networking = { firewall = { - allowedTCPPorts = [ 80 443 ]; + allowedTCPPorts = [ + 80 443 + 28967 # storj + ]; allowPing = true; logRefusedConnections = false; }; diff --git a/makefu/2configs/storj/client.nix b/makefu/2configs/storj/client.nix new file mode 100644 index 000000000..e37e2ce23 --- /dev/null +++ b/makefu/2configs/storj/client.nix @@ -0,0 +1,27 @@ +{ lib, ... }: +{ + networking.firewall.allowedTCPPorts = [ 28967 ]; + virtualisation.oci-containers.containers.storj-storagenode = { + image = "storjlabs/storagenode:latest"; + ports = [ + # TODO: omo ip + "0.0.0.0:28967:28967" + "127.0.0.1:14002:14002" + ]; + environment = { + # SETUP = "true"; # must be run only once ... + WALLET = "0xeD0d2a2B33F6812b45d2D9FF7a139A3fF65a24C0"; + EMAIL = "storj.io@syntax-fehler.de"; + ADDRESS = "euer.krebsco.de:28967"; + STORAGE = "3TB"; + }; + volumes = [ + "/media/cryptX/lib/storj/identity:/app/identity" + "/media/cryptX/lib/storj/storage:/app/config" + ]; + }; + systemd.services.docker-storj-storagenode.serviceConfig = { + StandardOutput = lib.mkForce "journal"; + StandardError = lib.mkForce "journal"; + }; +} diff --git a/makefu/2configs/storj/forward-port.nix b/makefu/2configs/storj/forward-port.nix new file mode 100644 index 000000000..213f77470 --- /dev/null +++ b/makefu/2configs/storj/forward-port.nix @@ -0,0 +1,22 @@ +{ + networking.firewall.allowedTCPPorts = [ 28967 ]; + #networking.nat.forwardPorts = [ + # { # storj + # destination = "10.243.0.89:28967"; + # proto = "tcp"; + # sourcePort = 28967; + # } + #]; + services.nginx.appendConfig = '' + stream { + upstream storj { + server omo.r:28967; + } + + server { + listen 28967; + proxy_pass storj; + } + } + ''; +} -- cgit v1.3.1 From ba614307cdc027dddd9aee2fecdaac86336957eb Mon Sep 17 00:00:00 2001 From: makefu Date: Fri, 12 Mar 2021 20:10:27 +0100 Subject: ma omo.r: deploy airsonic,photoprism,metube --- makefu/1systems/omo/config.nix | 28 +++++++++++++++++++--------- makefu/1systems/omo/hw/omo.nix | 4 ++++ makefu/2configs/home/airsonic.nix | 29 +++++++++++++++++++++++++++++ makefu/2configs/home/metube.nix | 35 +++++++++++++++++++++++++++++++++++ makefu/2configs/home/photoprism.nix | 9 +++++---- 5 files changed, 92 insertions(+), 13 deletions(-) create mode 100644 makefu/2configs/home/airsonic.nix create mode 100644 makefu/2configs/home/metube.nix (limited to 'makefu/1systems') diff --git a/makefu/1systems/omo/config.nix b/makefu/1systems/omo/config.nix index a9e307ddf..a04593715 100644 --- a/makefu/1systems/omo/config.nix +++ b/makefu/1systems/omo/config.nix @@ -28,9 +28,11 @@ in { + + # @@ -68,7 +70,7 @@ in { # statistics - + # # Logging #influx + grafana @@ -91,13 +93,18 @@ in { - + + + + { makefu.ps3netsrv = { enable = true; servedir = "/media/cryptX/emu/ps3"; }; } + + { hardware.pulseaudio.systemWide = true; makefu.mpd.musicDirectory = "/media/cryptX/music"; @@ -107,7 +114,15 @@ in { # - + # + { + #krebs.rtorrent = { + # downloadDir = lib.mkForce "/media/cryptX/torrent"; + # extraConfig = '' + # upload_rate = 500 + # ''; + #}; + } # # @@ -118,16 +133,11 @@ in { # Temporary: # + ]; makefu.full-populate = true; nixpkgs.config.allowUnfree = true; - krebs.rtorrent = { - downloadDir = lib.mkForce "/media/cryptX/torrent"; - extraConfig = '' - upload_rate = 500 - ''; - }; users.groups.share = { gid = (import ).genid "share"; members = [ "makefu" "misa" ]; diff --git a/makefu/1systems/omo/hw/omo.nix b/makefu/1systems/omo/hw/omo.nix index 586ad98c4..ae5b778bf 100644 --- a/makefu/1systems/omo/hw/omo.nix +++ b/makefu/1systems/omo/hw/omo.nix @@ -51,6 +51,10 @@ in { enable = true; disks = map toMapper [ 0 1 3 ]; parity = toMapper 2; # find -name PARITY_PARTITION + extraConfig = '' + exclude /lib/storj/ + exclude /.bitcoin/blocks/ + ''; }; fileSystems = let cryptMount = name: diff --git a/makefu/2configs/home/airsonic.nix b/makefu/2configs/home/airsonic.nix new file mode 100644 index 000000000..15e77438d --- /dev/null +++ b/makefu/2configs/home/airsonic.nix @@ -0,0 +1,29 @@ +{ config, ... }: +let + internal-ip = "192.168.1.11"; + port = 4040; +in +{ + # networking.firewall.allowedTCPPorts = [ 4040 ]; + services.airsonic = { + enable = true; + listenAddress = "0.0.0.0"; + inherit port; + }; + state = [ config.services.airsonic.home ]; + services.nginx.virtualHosts."airsonic" = { + serverAliases = [ + "airsonic.lan" + "music" "music.lan" + "musik" "musik.lan" + ]; + + locations."/".proxyPass = "http://localhost:${toString port}"; + locations."/".proxyWebsockets = true; + extraConfig = '' + if ( $server_addr != "${internal-ip}" ) { + return 403; + } + ''; + }; +} diff --git a/makefu/2configs/home/metube.nix b/makefu/2configs/home/metube.nix new file mode 100644 index 000000000..c872bea08 --- /dev/null +++ b/makefu/2configs/home/metube.nix @@ -0,0 +1,35 @@ +{ pkgs, lib, ...}: +# docker run -d -p 8081:8081 -v /path/to/downloads:/downloads --user 1001:1001 alexta69/metube +with import ; +let + port = "2348"; + dl-dir = "/media/cryptX/youtube/music"; + uid = 20421; + internal-ip = "192.168.1.11"; +in + { + systemd.tmpfiles.rules = [ + "d ${dl-dir} metube nogroup - -" + ]; + virtualisation.oci-containers.backend = "docker"; + + services.nginx.virtualHosts."tube" = { + serverAliases = [ "tube.lan" ]; + locations."/".proxyPass = "http://localhost:${port}"; + }; + + virtualisation.oci-containers.containers.metube = { + image = "alexta69/metube:latest"; + ports = [ "${port}:8081" ]; + volumes = [ + "${dl-dir}:/downloads" + ]; + user = "metube"; + }; + users.users.metube.uid = uid; + + systemd.services.docker-metube.serviceConfig = { + StandardOutput = lib.mkForce "journal"; + StandardError = lib.mkForce "journal"; + }; +} diff --git a/makefu/2configs/home/photoprism.nix b/makefu/2configs/home/photoprism.nix index aaccd7350..ef4200576 100644 --- a/makefu/2configs/home/photoprism.nix +++ b/makefu/2configs/home/photoprism.nix @@ -16,8 +16,8 @@ let port = "2347"; photodir = "/media/cryptX/photos"; - statedir = "/var/lib/photoprism/appsrv"; - db-dir = "/var/lib/photoprism/mysql"; + statedir = "/media/cryptX/lib/photoprism/appsrv"; + db-dir = "/media/cryptX/lib/photoprism/mysql"; internal-ip = "192.168.1.11"; sec = import ; in @@ -97,6 +97,7 @@ in PHOTOPRISM_SITE_CAPTION = "FeMi Fotos"; PHOTOPRISM_SITE_DESCRIPTION = "Unsere Fotos"; PHOTOPRISM_SITE_AUTHOR = "FeMi"; + PHOTOPRISM_SPONSOR = "true"; }; }; @@ -135,11 +136,11 @@ in # }; #}; - systemd.services.photoprism.serviceConfig = { + systemd.services.docker-photoprism.serviceConfig = { StandardOutput = lib.mkForce "journal"; StandardError = lib.mkForce "journal"; }; - systemd.services.mysql-photoprism.serviceConfig = { + systemd.services.docker-mysql-photoprism.serviceConfig = { StandardOutput = lib.mkForce "journal"; StandardError = lib.mkForce "journal"; }; -- cgit v1.3.1 From b30e99dfb2d040ec47e2e772ca0d25b97cf54e21 Mon Sep 17 00:00:00 2001 From: makefu Date: Fri, 12 Mar 2021 20:11:43 +0100 Subject: ma wbob.r: split config and hardware --- makefu/1systems/wbob/config.nix | 70 ++++-------------------------------- makefu/1systems/wbob/nuc/default.nix | 23 ++++++++++++ 2 files changed, 30 insertions(+), 63 deletions(-) create mode 100644 makefu/1systems/wbob/nuc/default.nix (limited to 'makefu/1systems') diff --git a/makefu/1systems/wbob/config.nix b/makefu/1systems/wbob/config.nix index 32dedbde2..b70b48449 100644 --- a/makefu/1systems/wbob/config.nix +++ b/makefu/1systems/wbob/config.nix @@ -1,14 +1,15 @@ { config, pkgs, lib, ... }: let - rootdisk = "/dev/disk/by-id/ata-TS256GMTS800_C613840115"; - datadisk = "/dev/disk/by-id/ata-HGST_HTS721010A9E630_JR10006PH3A02F"; user = config.makefu.gui.user; primaryIP = "192.168.8.11"; in { imports = - [ # Include the results of the hardware scan. + [ + # Include the results of the hardware scan. + ./nuc + @@ -37,13 +38,13 @@ in { # Sensors # - + # - + # # { environment.systemPackages = [ pkgs.vlc ]; } @@ -94,44 +95,6 @@ in { build.host = config.krebs.hosts.wbob; }; - swapDevices = [ { device = "/var/swap"; } ]; - services.collectd.extraConfig = lib.mkAfter '' - - #LoadPlugin ping - # does not work because it requires privileges - # - # Host "google.de" - # Host "heise.de" - # - - LoadPlugin curl - - Interval 300 - TotalTime true - NamelookupTime true - ConnectTime true - - - MeasureResponseTime true - MeasureResponseCode true - URL "https://google.de" - - - - MeasureResponseTime true - MeasureResponseCode true - URL "http://web.de" - - - - #LoadPlugin netlink - # - # Interface "enp0s25" - # Interface "wlp2s0" - # IgnoreSelected false - # - ''; - networking.firewall.allowedUDPPorts = [ 655 ]; networking.firewall.allowedTCPPorts = [ 655 @@ -146,7 +109,7 @@ in { # Port = 1655 # ''; #}; - + boot.kernelPackages = pkgs.linuxPackages_latest; # rt2870.bin wifi card, part of linux-unfree hardware.enableRedistributableFirmware = true; nixpkgs.config.allowUnfree = true; @@ -156,24 +119,5 @@ in { address = "10.8.8.11"; prefixLength = 24; }]; - - # nuc hardware - boot.loader.grub.device = rootdisk; - hardware.cpu.intel.updateMicrocode = true; - boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ]; - - boot.kernelModules = [ - "kvm-intel" "snd-seq" "snd-rawmidi" - ]; - fileSystems = { - "/" = { - device = rootdisk + "-part1"; - fsType = "ext4"; - }; - "/data" = { - device = datadisk + "-part1"; - fsType = "ext4"; - }; - }; } diff --git a/makefu/1systems/wbob/nuc/default.nix b/makefu/1systems/wbob/nuc/default.nix new file mode 100644 index 000000000..d4993dfd0 --- /dev/null +++ b/makefu/1systems/wbob/nuc/default.nix @@ -0,0 +1,23 @@ +let + rootdisk = "/dev/disk/by-id/ata-TS256GMTS800_C613840115"; + datadisk = "/dev/disk/by-id/ata-HGST_HTS721010A9E630_JR10006PH3A02F"; +in { + boot.loader.grub.device = rootdisk; + hardware.cpu.intel.updateMicrocode = true; + boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ]; + + boot.kernelModules = [ + "kvm-intel" "snd-seq" "snd-rawmidi" + ]; + fileSystems = { + "/" = { + device = rootdisk + "-part1"; + fsType = "ext4"; + }; + "/data" = { + device = datadisk + "-part1"; + fsType = "ext4"; + }; + }; + swapDevices = [ { device = "/var/swap"; } ]; +} -- cgit v1.3.1 From f20695084ed681adecb9fbfa459ffb46591812f2 Mon Sep 17 00:00:00 2001 From: makefu Date: Fri, 12 Mar 2021 20:12:04 +0100 Subject: ma tsp.r: refactor --- makefu/1systems/tsp/config.nix | 11 ++++++++--- makefu/1systems/tsp/hardware.nix | 9 +++++++++ 2 files changed, 17 insertions(+), 3 deletions(-) create mode 100644 makefu/1systems/tsp/hardware.nix (limited to 'makefu/1systems') diff --git a/makefu/1systems/tsp/config.nix b/makefu/1systems/tsp/config.nix index 7c65737f7..9586578d3 100644 --- a/makefu/1systems/tsp/config.nix +++ b/makefu/1systems/tsp/config.nix @@ -6,21 +6,26 @@ { imports = [ # Include the results of the hardware scan. + ./hardware.nix + + + # # hardware specifics are in here - # imports tp-x2x0.nix - + # - + + + diff --git a/makefu/1systems/tsp/hardware.nix b/makefu/1systems/tsp/hardware.nix new file mode 100644 index 000000000..2788eae04 --- /dev/null +++ b/makefu/1systems/tsp/hardware.nix @@ -0,0 +1,9 @@ +{ lib, ... }: +{ + imports = [ + # laptop is an acer aspire, but close enough i'd say + + ]; + # the laptop only has the touchpad + services.xserver.synaptics.additionalOptions = lib.mkForce ''Option "TouchpadOff" "0"''; +} -- cgit v1.3.1 From e377be755fa38b0ea4936b4c55dedfab4200bf21 Mon Sep 17 00:00:00 2001 From: makefu Date: Fri, 12 Mar 2021 20:12:56 +0100 Subject: ma x.r: cleanup input --- makefu/1systems/x/config.nix | 3 ++- makefu/1systems/x/x13/default.nix | 22 +++------------------- makefu/1systems/x/x13/input.nix | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 38 insertions(+), 20 deletions(-) (limited to 'makefu/1systems') diff --git a/makefu/1systems/x/config.nix b/makefu/1systems/x/config.nix index 6c0388e59..80655f998 100644 --- a/makefu/1systems/x/config.nix +++ b/makefu/1systems/x/config.nix @@ -158,7 +158,8 @@ # temporary # { services.redis.enable = true; } - # + { services.mongodb.enable = true; } + # # # # diff --git a/makefu/1systems/x/x13/default.nix b/makefu/1systems/x/x13/default.nix index b0400232e..ac601845a 100644 --- a/makefu/1systems/x/x13/default.nix +++ b/makefu/1systems/x/x13/default.nix @@ -8,6 +8,7 @@ # close enough # + ]; boot.zfs.requestEncryptionCredentials = true; networking.hostId = "f8b8e0a2"; @@ -19,32 +20,15 @@ services.xserver.videoDrivers = [ "amdgpu" ]; - hardware.opengl.extraPackages = [ pkgs.amdvlk ]; + hardware.opengl.extraPackages = [ pkgs.amdvlk pkgs.rocm-opencl-icd ]; # is required for amd graphics support ( xorg wont boot otherwise ) boot.kernelPackages = pkgs.linuxPackages_latest; + environment.variables.VK_ICD_FILENAMES = "/run/opengl-driver/share/vulkan/icd.d/amd_icd64.json"; programs.light.enable = true; - services.actkbd = { - enable = true; - bindings = [ - { keys = [ 225 ]; events = [ "key" ]; command = "${pkgs.light}/bin/light -A 10"; } - { keys = [ 224 ]; events = [ "key" ]; command = "${pkgs.light}/bin/light -U 10"; } - { keys = [ 227 ]; events = [ "key" ]; command = builtins.toString ( - pkgs.writers.writeDash "toggle_lcdshadow" '' - proc=/proc/acpi/ibm/lcdshadow - status=$(${pkgs.gawk}/bin/awk '/status:/{print $2}' "$proc") - if [ "$status" -eq 0 ];then - echo 1 > "$proc" - else - echo 0 > "$proc" - fi - ''); - } - ]; - }; users.groups.video = {}; users.users.makefu.extraGroups = [ "video" ]; diff --git a/makefu/1systems/x/x13/input.nix b/makefu/1systems/x/x13/input.nix index 68b855d8e..775e19303 100644 --- a/makefu/1systems/x/x13/input.nix +++ b/makefu/1systems/x/x13/input.nix @@ -1,3 +1,4 @@ +{ pkgs, lib, ... }: { # current issues: # 1. for pressing insert hold shift+fn+Fin @@ -9,5 +10,37 @@ xinput set-prop "ETPS/2 Elantech TrackPoint" "Evdev Wheel Emulation Axes" 6 7 4 5 # configure timeout of pressing and holding middle button # xinput set-int-prop "ETPS/2 Elantech TrackPoint" "Evdev Wheel Emulation Timeout" 8 200 + xinput disable 'ETPS/2 Elantech Touchpad' ''; + boot.kernelParams = [ + #"psmouse.proto=imps" + #"psmouse.proto=bare" + #"psmouse.resetafter=0" + "psmouse.synaptics_intertouch=1" # echo 1 > /sys/devices/platform/i8042/serio1/reg_07 + ]; + + programs.light.enable = true; + services.actkbd = { + enable = true; + bindings = [ + { keys = [ 225 ]; events = [ "key" ]; command = "${pkgs.light}/bin/light -A 10"; } # fn - F5 + { keys = [ 224 ]; events = [ "key" ]; command = "${pkgs.light}/bin/light -U 10"; } # fn - F6 + # fn - 4 => suspend + # fn - d => lcdshadow + { keys = [ 227 ]; events = [ "key" ]; command = builtins.toString ( # fn - F7 + pkgs.writers.writeDash "toggle_touchpad" '' + PATH=${lib.makeBinPath [ pkgs.xorg.xinput pkgs.gnugrep ]} + DISPLAY=:0 + export DISPLAY PATH + + device=$(xinput list --name-only | grep Touchpad) + if [ "$(xinput list-props "$device" | grep -P ".*Device Enabled.*\K.(?=$)" -o)" -eq 1 ];then + xinput disable "$device" + else + xinput enable "$device" + fi + ''); + } + ]; + }; } -- cgit v1.3.1 From 821239422fe86973e37acb05e50e76b748c77d0c Mon Sep 17 00:00:00 2001 From: makefu Date: Fri, 12 Mar 2021 20:24:09 +0100 Subject: ma wbob.r: deploy bureautomation with unstable branch --- makefu/1systems/wbob/source.nix | 1 + makefu/2configs/bureautomation/default.nix | 10 ++++++++++ 2 files changed, 11 insertions(+) (limited to 'makefu/1systems') diff --git a/makefu/1systems/wbob/source.nix b/makefu/1systems/wbob/source.nix index 6568b8a45..36c7b67bb 100644 --- a/makefu/1systems/wbob/source.nix +++ b/makefu/1systems/wbob/source.nix @@ -2,4 +2,5 @@ name="wbob"; # musnix = true; home-manager = true; + unstable = true; } diff --git a/makefu/2configs/bureautomation/default.nix b/makefu/2configs/bureautomation/default.nix index 7e8b6a4d3..7ac90f5c5 100644 --- a/makefu/2configs/bureautomation/default.nix +++ b/makefu/2configs/bureautomation/default.nix @@ -1,12 +1,15 @@ { config, pkgs, lib, ... }: let kodi-host = "192.168.8.11"; + unstable = import {}; in { imports = [ ./ota.nix ./comic-updater.nix ./puppy-proxy.nix + ./zigbee2mqtt + # hass config ## complex configs ./multi/daily-standup.nix @@ -39,15 +42,22 @@ in { ./automation/bureau-shutdown.nix ./automation/nachtlicht.nix ./automation/schlechteluft.nix + ./automation/philosophische-tuer.nix ./automation/hass-restart.nix ./device_tracker/openwrt.nix ./person/team.nix ]; + networking.firewall.allowedTCPPorts = [ 8123 ]; state = [ "/var/lib/hass/known_devices.yaml" ]; services.home-assistant = { enable = true; + package = (unstable.home-assistant.overrideAttrs (old: { + doInstallCheck = false; + })).override { + extraPackages = p: [ p.APScheduler ]; + }; autoExtraComponents = true; config = { config = {}; -- cgit v1.3.1 From ca13f21f885b608138779282013caf20ee92ddad Mon Sep 17 00:00:00 2001 From: makefu Date: Fri, 12 Mar 2021 20:26:27 +0100 Subject: ma etherpad: mv to bgt --- makefu/1systems/gum/config.nix | 2 +- makefu/2configs/bgt/etherpad.euer.krebsco.de.nix | 60 ++++++++++++++++++++++ .../deployment/docker/etherpad.euer.krebsco.de.nix | 60 ---------------------- 3 files changed, 61 insertions(+), 61 deletions(-) create mode 100644 makefu/2configs/bgt/etherpad.euer.krebsco.de.nix delete mode 100644 makefu/2configs/deployment/docker/etherpad.euer.krebsco.de.nix (limited to 'makefu/1systems') diff --git a/makefu/1systems/gum/config.nix b/makefu/1systems/gum/config.nix index d81aefb67..83fbd8f83 100644 --- a/makefu/1systems/gum/config.nix +++ b/makefu/1systems/gum/config.nix @@ -148,7 +148,7 @@ in { - + # diff --git a/makefu/2configs/bgt/etherpad.euer.krebsco.de.nix b/makefu/2configs/bgt/etherpad.euer.krebsco.de.nix new file mode 100644 index 000000000..48b947c58 --- /dev/null +++ b/makefu/2configs/bgt/etherpad.euer.krebsco.de.nix @@ -0,0 +1,60 @@ +{ lib, ... }: +let + port = 19201; +in { + #services.nginx.virtualHosts."euer.krebsco.de".serverAliases = [ "etherpad.euer.krebsco.de" ]; + services.nginx.virtualHosts."etherpad.euer.krebsco.de" = { + # useACMEHost = "euer.krebsco.de"; + extraConfig = '' + ssl_session_timeout 30m; + ''; + enableACME = true; + forceSSL = true; + locations."/".proxyPass = "http://localhost:${toString port}"; + # from https://github.com/ether/etherpad-lite/wiki/How-to-put-Etherpad-Lite-behind-a-reverse-Proxy + locations."/".extraConfig = '' + + proxy_buffering off; # be careful, this line doesn't override any proxy_buffering on set in a conf.d/file.conf + proxy_set_header Host $host; + proxy_pass_header Server; + + # Note you might want to pass these headers etc too. + proxy_set_header X-Real-IP $remote_addr; # https://nginx.org/en/docs/http/ngx_http_proxy_module.html + proxy_set_header X-Forwarded-For $remote_addr; # EP logs to show the actual remote IP + proxy_set_header X-Forwarded-Proto $scheme; # for EP to set secure cookie flag when https is used + proxy_http_version 1.1; # recommended with keepalive connections + + # WebSocket proxying - from https://nginx.org/en/docs/http/websocket.html + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + proxy_read_timeout 1799s; + ''; + }; + docker-containers."etherpad-lite" = { + image = "makefoo/bgt-etherpad:2020-05-02.6"; + ports = [ "127.0.0.1:${toString port}:9001" ]; + volumes = [ + "/var/src/secrets/etherpad/apikey:/opt/etherpad-lite/APIKEY.txt" + "etherpad_data:/opt/etherpad-lite/var" # persistent dirtydb + ]; + # for postgres + #DB_TYPE=postgres + #DB_HOST=db.local + #DB_PORT=4321 + #DB_NAME=etherpad + #DB_USER=dbusername + #DB_PASS=mypassword + environment = { + # ADMIN_PASSWORD = "auf jeden fall nicht das echte admin passwort"; + SUPPRESS_ERRORS_IN_PAD_TEXT = "true"; + TITLE = "Binärgewitter Etherpad"; + SKIN_NAME = "no-skin"; + DEFAULT_PAD_TEXT = builtins.replaceStrings ["\n"] ["\\n"] (builtins.readFile ./template.md); + PAD_OPTIONS_USE_MONOSPACE_FONT = "true"; + PAD_OPTIONS_USER_NAME = "true"; + PAD_OPTIONS_USER_COLOR = "true"; + PAD_OPTIONS_CHAT_AND_USERS = "true"; + PAD_OPTIONS_LANG = "en-US"; + }; + }; +} diff --git a/makefu/2configs/deployment/docker/etherpad.euer.krebsco.de.nix b/makefu/2configs/deployment/docker/etherpad.euer.krebsco.de.nix deleted file mode 100644 index 48b947c58..000000000 --- a/makefu/2configs/deployment/docker/etherpad.euer.krebsco.de.nix +++ /dev/null @@ -1,60 +0,0 @@ -{ lib, ... }: -let - port = 19201; -in { - #services.nginx.virtualHosts."euer.krebsco.de".serverAliases = [ "etherpad.euer.krebsco.de" ]; - services.nginx.virtualHosts."etherpad.euer.krebsco.de" = { - # useACMEHost = "euer.krebsco.de"; - extraConfig = '' - ssl_session_timeout 30m; - ''; - enableACME = true; - forceSSL = true; - locations."/".proxyPass = "http://localhost:${toString port}"; - # from https://github.com/ether/etherpad-lite/wiki/How-to-put-Etherpad-Lite-behind-a-reverse-Proxy - locations."/".extraConfig = '' - - proxy_buffering off; # be careful, this line doesn't override any proxy_buffering on set in a conf.d/file.conf - proxy_set_header Host $host; - proxy_pass_header Server; - - # Note you might want to pass these headers etc too. - proxy_set_header X-Real-IP $remote_addr; # https://nginx.org/en/docs/http/ngx_http_proxy_module.html - proxy_set_header X-Forwarded-For $remote_addr; # EP logs to show the actual remote IP - proxy_set_header X-Forwarded-Proto $scheme; # for EP to set secure cookie flag when https is used - proxy_http_version 1.1; # recommended with keepalive connections - - # WebSocket proxying - from https://nginx.org/en/docs/http/websocket.html - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection "upgrade"; - proxy_read_timeout 1799s; - ''; - }; - docker-containers."etherpad-lite" = { - image = "makefoo/bgt-etherpad:2020-05-02.6"; - ports = [ "127.0.0.1:${toString port}:9001" ]; - volumes = [ - "/var/src/secrets/etherpad/apikey:/opt/etherpad-lite/APIKEY.txt" - "etherpad_data:/opt/etherpad-lite/var" # persistent dirtydb - ]; - # for postgres - #DB_TYPE=postgres - #DB_HOST=db.local - #DB_PORT=4321 - #DB_NAME=etherpad - #DB_USER=dbusername - #DB_PASS=mypassword - environment = { - # ADMIN_PASSWORD = "auf jeden fall nicht das echte admin passwort"; - SUPPRESS_ERRORS_IN_PAD_TEXT = "true"; - TITLE = "Binärgewitter Etherpad"; - SKIN_NAME = "no-skin"; - DEFAULT_PAD_TEXT = builtins.replaceStrings ["\n"] ["\\n"] (builtins.readFile ./template.md); - PAD_OPTIONS_USE_MONOSPACE_FONT = "true"; - PAD_OPTIONS_USER_NAME = "true"; - PAD_OPTIONS_USER_COLOR = "true"; - PAD_OPTIONS_CHAT_AND_USERS = "true"; - PAD_OPTIONS_LANG = "en-US"; - }; - }; -} -- cgit v1.3.1