From 48e71f75f8ca80e57dd8aa7b98258045071a6fab Mon Sep 17 00:00:00 2001 From: Jakob Lechner Date: Wed, 9 Apr 2025 22:44:36 +0200 Subject: [PATCH] Remove unused code --- custom-utils/default.nix | 2 +- custom-utils/ports.nix | 2 +- flake.nix | 4 +-- hosts/aluminium/configuration.nix | 2 +- hosts/aluminium/hardware-configuration.nix | 2 +- hosts/aluminium/ports.nix | 2 +- hosts/aluminium/services/asterisk/default.nix | 2 +- .../asterisk/voicemail-sounds/default.nix | 2 +- hosts/aluminium/services/dnsmasq.nix | 5 +--- hosts/aluminium/services/doorbell.nix | 2 +- hosts/aluminium/services/esphome/default.nix | 7 +---- hosts/aluminium/services/home-assistant.nix | 2 +- hosts/aluminium/services/nginx.nix | 2 +- hosts/aluminium/services/ntp.nix | 1 - hosts/aluminium/services/unifi-controller.nix | 2 +- hosts/cadmium/configuration.nix | 2 +- hosts/copper/services/ntfy.nix | 1 - hosts/iron/configuration.nix | 24 +++++++--------- hosts/iron/ports.nix | 2 +- hosts/iron/services/avahi.nix | 1 - hosts/iron/services/calibre.nix | 2 +- hosts/iron/services/dnsmasq.nix | 3 +- hosts/iron/services/esphome/default.nix | 7 +---- hosts/iron/services/home-assistant.nix | 2 +- hosts/iron/services/jellyfin.nix | 2 +- hosts/iron/services/mail.nix | 2 +- hosts/iron/services/matrix.nix | 2 +- hosts/iron/services/navidrome.nix | 2 +- hosts/iron/services/nginx.nix | 2 +- hosts/iron/services/ntp.nix | 1 - hosts/iron/services/public-ip-tunnel.nix | 2 +- hosts/iron/services/radicale.nix | 2 +- hosts/iron/services/remarkable.nix | 2 +- hosts/iron/services/snapcast/ledfx.nix | 2 +- hosts/iron/services/snapcast/mopidy.nix | 2 +- hosts/iron/services/snapcast/snapclient.nix | 15 +--------- hosts/iron/services/snapcast/snapserver.nix | 2 +- hosts/iron/services/sturzbach.nix | 2 +- hosts/iron/services/unifi-controller.nix | 2 +- hosts/iron/services/whatsapp.nix | 2 +- hosts/magnesium/configuration.nix | 3 +- hosts/magnesium/ports.nix | 28 +++++++++---------- hosts/magnesium/services/coturn.nix | 14 ++++------ hosts/magnesium/services/forgejo.nix | 4 +-- hosts/magnesium/services/gitlab-runner.nix | 2 +- hosts/magnesium/services/hedgedoc.nix | 4 +-- hosts/magnesium/services/ntfy.nix | 4 +-- hosts/magnesium/services/public-ip-tunnel.nix | 4 +-- hosts/magnesium/services/trilium.nix | 4 +-- hosts/magnesium/services/webserver.nix | 4 +-- .../hardware-configuration.nix | 2 +- hosts/weinturm-pretix-prod/ports.nix | 2 +- .../weinturm-pretix-prod/services/pretix.nix | 2 +- modules/adb.nix | 2 +- modules/aws.nix | 2 +- modules/bootloader/grub2.nix | 2 +- modules/gnome.nix | 2 +- modules/journald.nix | 2 -- modules/kdeconnect.nix | 2 +- modules/localization.nix | 2 +- modules/luksusb.nix | 6 ++-- modules/mailserver/default.nix | 2 +- modules/matrix/default.nix | 4 +-- modules/matrix/mautrix-signal.nix | 2 +- modules/matrix/mautrix-whatsapp.nix | 2 +- modules/matrix/synapse.nix | 5 ++-- modules/networking/default.nix | 1 + modules/networking/ports.nix | 20 +++++++++++++ modules/nix.nix | 2 +- modules/printers/p-touch_p700.nix | 2 -- modules/qbittorrent/default.nix | 2 +- modules/sudo.nix | 1 - modules/udmx.nix | 2 -- pkgs/asterisk-sounds-de/default.nix | 3 +- pkgs/contact-page/default.nix | 2 +- pkgs/default.nix | 4 +-- .../docker-machine-driver-hetzner/default.nix | 8 +++--- pkgs/fpvout/default.nix | 3 +- .../guntamatic.nix | 3 +- pkgs/illuminanced/default.nix | 1 - pkgs/modules.nix | 2 -- pkgs/myintercom-doorbell/default.nix | 6 ++-- pkgs/pretix-banktool/module.nix | 11 -------- users/jalr/default.nix | 2 +- users/jalr/modules/aws.nix | 2 +- users/jalr/modules/cli/default.nix | 2 +- users/jalr/modules/communication/default.nix | 2 -- users/jalr/modules/dynamic-colors.nix | 2 +- users/jalr/modules/git.nix | 2 +- users/jalr/modules/graphics/default.nix | 2 -- users/jalr/modules/mycli/default.nix | 4 +-- users/jalr/modules/neo.nix | 1 - users/jalr/modules/ots.nix | 5 +--- users/jalr/modules/pomodoro.nix | 2 +- users/jalr/modules/remarkable/restream.nix | 2 +- users/jalr/modules/remarkable/rmview.nix | 4 +-- users/jalr/modules/solarized.nix | 2 +- users/jalr/modules/sound/default.nix | 2 -- users/jalr/modules/sway/default.nix | 2 +- .../modules/sway/move-to-output/default.nix | 4 +-- users/jalr/modules/sway/wofi.nix | 2 +- .../modules/sway/yubikey-touch-detector.nix | 2 +- users/jalr/modules/tmux.nix | 1 - users/jalr/modules/vdirsyncer.nix | 21 -------------- 104 files changed, 151 insertions(+), 229 deletions(-) create mode 100644 modules/networking/ports.nix diff --git a/custom-utils/default.nix b/custom-utils/default.nix index 5db6ecb..101f08c 100644 --- a/custom-utils/default.nix +++ b/custom-utils/default.nix @@ -4,7 +4,7 @@ let filterPort = pm: port: ( lib.attrsets.catAttrs port ( lib.attrsets.attrValues ( - lib.attrsets.filterAttrs (n: v: v ? "${port}") pm + lib.attrsets.filterAttrs (_: v: v ? "${port}") pm ) ) ); diff --git a/custom-utils/ports.nix b/custom-utils/ports.nix index 5db6ecb..101f08c 100644 --- a/custom-utils/ports.nix +++ b/custom-utils/ports.nix @@ -4,7 +4,7 @@ let filterPort = pm: port: ( lib.attrsets.catAttrs port ( lib.attrsets.attrValues ( - lib.attrsets.filterAttrs (n: v: v ? "${port}") pm + lib.attrsets.filterAttrs (_: v: v ? "${port}") pm ) ) ); diff --git a/flake.nix b/flake.nix index c05fa48..74808d5 100644 --- a/flake.nix +++ b/flake.nix @@ -56,13 +56,11 @@ outputs = { self , flake-utils - , gomod2nix , home-manager , krops , nix-pre-commit-hooks , nixpkgs , nur - , poetry2nix , ... }@inputs: flake-utils.lib.eachSystem [ "x86_64-linux" @@ -104,7 +102,7 @@ }; apps = lib.mapAttrs - (name: program: { type = "app"; program = toString program; }) + (_: program: { type = "app"; program = toString program; }) (flake-utils.lib.flattenTree { deploy = lib.recurseIntoAttrs (lib.mapAttrs (hostname: machine: diff --git a/hosts/aluminium/configuration.nix b/hosts/aluminium/configuration.nix index 6b89247..43c1b5d 100644 --- a/hosts/aluminium/configuration.nix +++ b/hosts/aluminium/configuration.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, ... }: +{ config, ... }: { imports = [ diff --git a/hosts/aluminium/hardware-configuration.nix b/hosts/aluminium/hardware-configuration.nix index f146835..6b60bb6 100644 --- a/hosts/aluminium/hardware-configuration.nix +++ b/hosts/aluminium/hardware-configuration.nix @@ -1,7 +1,7 @@ # Do not modify this file! It was generated by ‘nixos-generate-config’ # and may be overwritten by future invocations. Please make changes # to /etc/nixos/configuration.nix instead. -{ config, lib, pkgs, modulesPath, ... }: +{ config, lib, modulesPath, ... }: { imports = diff --git a/hosts/aluminium/ports.nix b/hosts/aluminium/ports.nix index 34bfdaf..f07e09d 100644 --- a/hosts/aluminium/ports.nix +++ b/hosts/aluminium/ports.nix @@ -1,4 +1,4 @@ -{ lib, custom-utils, ... }: +{ custom-utils, ... }: custom-utils.validatePortAttrset { asterisk-rtp = { udp.range = [ 10000 10200 ]; }; diff --git a/hosts/aluminium/services/asterisk/default.nix b/hosts/aluminium/services/asterisk/default.nix index 92f945d..1fe50cb 100644 --- a/hosts/aluminium/services/asterisk/default.nix +++ b/hosts/aluminium/services/asterisk/default.nix @@ -1,4 +1,4 @@ -args@{ config, lib, pkgs, custom-utils, ... }: +args@{ config, lib, pkgs, ... }: let ports = import ../../ports.nix args; diff --git a/hosts/aluminium/services/asterisk/voicemail-sounds/default.nix b/hosts/aluminium/services/asterisk/voicemail-sounds/default.nix index a4a810c..06451f1 100644 --- a/hosts/aluminium/services/asterisk/voicemail-sounds/default.nix +++ b/hosts/aluminium/services/asterisk/voicemail-sounds/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenvNoCC }: +{ stdenvNoCC }: stdenvNoCC.mkDerivation { name = "voicemail-sounds"; diff --git a/hosts/aluminium/services/dnsmasq.nix b/hosts/aluminium/services/dnsmasq.nix index ff4549a..c6ada0d 100644 --- a/hosts/aluminium/services/dnsmasq.nix +++ b/hosts/aluminium/services/dnsmasq.nix @@ -1,8 +1,5 @@ { lib, pkgs, ... }: -let - stateDir = "/var/lib/dnsmasq"; -in { services.dnsmasq = { enable = true; @@ -54,7 +51,7 @@ in "voice" ] ( - interface: { + _: { allowedUDPPorts = [ 53 67 ]; allowedTCPPorts = [ 53 ]; } diff --git a/hosts/aluminium/services/doorbell.nix b/hosts/aluminium/services/doorbell.nix index e2b7229..7d2f45d 100644 --- a/hosts/aluminium/services/doorbell.nix +++ b/hosts/aluminium/services/doorbell.nix @@ -1,4 +1,4 @@ -args@{ config, lib, pkgs, custom-utils, ... }: +args@{ config, ... }: let ports = import ../ports.nix args; diff --git a/hosts/aluminium/services/esphome/default.nix b/hosts/aluminium/services/esphome/default.nix index b64c343..bf8f9bc 100644 --- a/hosts/aluminium/services/esphome/default.nix +++ b/hosts/aluminium/services/esphome/default.nix @@ -1,7 +1,6 @@ -args@{ lib, pkgs, config, custom-utils, ... }: +args@{ lib, pkgs, config, ... }: let ports = import ../../ports.nix args; - cfg = config.services.esphome; cfgdir = pkgs.stdenvNoCC.mkDerivation { name = "esphome-config"; src = ./devices; @@ -11,10 +10,6 @@ let cp -r * $out ''; }; - esphomeParams = - if cfg.enableUnixSocket - then "--socket /run/esphome/esphome.sock" - else "--address ${cfg.address} --port ${toString cfg.port}"; in { sops.secrets.esphome = { diff --git a/hosts/aluminium/services/home-assistant.nix b/hosts/aluminium/services/home-assistant.nix index aed7b78..bab9944 100644 --- a/hosts/aluminium/services/home-assistant.nix +++ b/hosts/aluminium/services/home-assistant.nix @@ -1,4 +1,4 @@ -args@{ lib, pkgs, config, custom-utils, ... }: +args@{ pkgs, config, ... }: let ports = import ../ports.nix args; in diff --git a/hosts/aluminium/services/nginx.nix b/hosts/aluminium/services/nginx.nix index 71bdff2..b2e020e 100644 --- a/hosts/aluminium/services/nginx.nix +++ b/hosts/aluminium/services/nginx.nix @@ -1,4 +1,4 @@ -args@{ pkgs, custom-utils, ... }: +args: let ports = import ../ports.nix args; diff --git a/hosts/aluminium/services/ntp.nix b/hosts/aluminium/services/ntp.nix index aed11f4..45917cf 100644 --- a/hosts/aluminium/services/ntp.nix +++ b/hosts/aluminium/services/ntp.nix @@ -1,4 +1,3 @@ -{ lib, pkgs, ... }: { services.chrony = { enable = true; diff --git a/hosts/aluminium/services/unifi-controller.nix b/hosts/aluminium/services/unifi-controller.nix index 4801621..deeae22 100644 --- a/hosts/aluminium/services/unifi-controller.nix +++ b/hosts/aluminium/services/unifi-controller.nix @@ -1,4 +1,4 @@ -args@{ pkgs, custom-utils, ... }: +args@{ pkgs, ... }: let ports = import ../ports.nix args; diff --git a/hosts/cadmium/configuration.nix b/hosts/cadmium/configuration.nix index 55d51ab..1bb11aa 100644 --- a/hosts/cadmium/configuration.nix +++ b/hosts/cadmium/configuration.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: +{ pkgs, ... }: { imports = [ diff --git a/hosts/copper/services/ntfy.nix b/hosts/copper/services/ntfy.nix index d252d96..7f910c5 100644 --- a/hosts/copper/services/ntfy.nix +++ b/hosts/copper/services/ntfy.nix @@ -1,4 +1,3 @@ -{ pkgs, lib, ... }: { sops.secrets.ntfy_shiftphone = { sopsFile = ../secrets.yaml; diff --git a/hosts/iron/configuration.nix b/hosts/iron/configuration.nix index ac8ee66..789aca1 100644 --- a/hosts/iron/configuration.nix +++ b/hosts/iron/configuration.nix @@ -1,4 +1,4 @@ -{ inputs, config, pkgs, lib, ... }: +{ config, pkgs, lib, ... }: let interfaces = import ./interfaces.nix; disks = { @@ -119,13 +119,11 @@ with lib; { jalr.luksUsbUnlock = { enable = true; devices = builtins.mapAttrs - (name: dev: - { - keyPath = "iron.key"; - usbDevice = "by-label/RAM_USB"; - waitForDevice = 10; - } - ) + (_: _: { + keyPath = "iron.key"; + usbDevice = "by-label/RAM_USB"; + waitForDevice = 10; + }) disks; }; @@ -144,12 +142,10 @@ with lib; { ]; systemd.enable = true; luks.devices = builtins.mapAttrs - (name: dev: - { - device = "${devNodes}${dev}${partitionScheme.luksDev}"; - allowDiscards = true; - } - ) + (_: dev: { + device = "${devNodes}${dev}${partitionScheme.luksDev}"; + allowDiscards = true; + }) disks; }; supportedFilesystems = [ "zfs" ]; diff --git a/hosts/iron/ports.nix b/hosts/iron/ports.nix index 0d753b8..9c3a7fc 100644 --- a/hosts/iron/ports.nix +++ b/hosts/iron/ports.nix @@ -1,4 +1,4 @@ -{ lib, custom-utils, ... }: +{ custom-utils, ... }: custom-utils.validatePortAttrset { calibre-server.tcp = 8081; diff --git a/hosts/iron/services/avahi.nix b/hosts/iron/services/avahi.nix index 6c14bcd..f15827b 100644 --- a/hosts/iron/services/avahi.nix +++ b/hosts/iron/services/avahi.nix @@ -1,4 +1,3 @@ -args@{ lib, pkgs, config, custom-utils, ... }: let interfaces = import ../interfaces.nix; in diff --git a/hosts/iron/services/calibre.nix b/hosts/iron/services/calibre.nix index 0f30021..831cbce 100644 --- a/hosts/iron/services/calibre.nix +++ b/hosts/iron/services/calibre.nix @@ -1,4 +1,4 @@ -args@{ lib, config, pkgs, custom-utils, ... }: +args@{ lib, config, ... }: let ports = import ../ports.nix args; in diff --git a/hosts/iron/services/dnsmasq.nix b/hosts/iron/services/dnsmasq.nix index b277cf4..ea0f6b2 100644 --- a/hosts/iron/services/dnsmasq.nix +++ b/hosts/iron/services/dnsmasq.nix @@ -2,7 +2,6 @@ let interfaces = import ../interfaces.nix; - stateDir = "/var/lib/dnsmasq"; in { services.dnsmasq = { @@ -47,7 +46,7 @@ in "iot" ] ( - interface: { + _: { allowedUDPPorts = [ 53 67 ]; allowedTCPPorts = [ 53 ]; } diff --git a/hosts/iron/services/esphome/default.nix b/hosts/iron/services/esphome/default.nix index 0e81496..b49ec96 100644 --- a/hosts/iron/services/esphome/default.nix +++ b/hosts/iron/services/esphome/default.nix @@ -1,7 +1,6 @@ -args@{ lib, pkgs, config, custom-utils, ... }: +args@{ lib, pkgs, config, ... }: let ports = import ../../ports.nix args; - cfg = config.services.esphome; cfgdir = pkgs.stdenvNoCC.mkDerivation { name = "esphome-config"; src = ./devices; @@ -11,10 +10,6 @@ let cp -r * $out ''; }; - esphomeParams = - if cfg.enableUnixSocket - then "--socket /run/esphome/esphome.sock" - else "--address ${cfg.address} --port ${toString cfg.port}"; in { sops.secrets.esphome = { diff --git a/hosts/iron/services/home-assistant.nix b/hosts/iron/services/home-assistant.nix index 1bf6d3e..8901256 100644 --- a/hosts/iron/services/home-assistant.nix +++ b/hosts/iron/services/home-assistant.nix @@ -1,4 +1,4 @@ -args@{ lib, pkgs, config, custom-utils, ... }: +args@{ lib, pkgs, config, ... }: let ports = import ../ports.nix args; interfaces = import ../interfaces.nix; diff --git a/hosts/iron/services/jellyfin.nix b/hosts/iron/services/jellyfin.nix index 01aff39..2f0230f 100644 --- a/hosts/iron/services/jellyfin.nix +++ b/hosts/iron/services/jellyfin.nix @@ -1,4 +1,4 @@ -args@{ lib, pkgs, custom-utils, ... }: +args@{ lib, ... }: let ports = import ../ports.nix args; in diff --git a/hosts/iron/services/mail.nix b/hosts/iron/services/mail.nix index 98b4364..db2c2d2 100644 --- a/hosts/iron/services/mail.nix +++ b/hosts/iron/services/mail.nix @@ -1,4 +1,4 @@ -args@{ config, pkgs, custom-utils, ... }: +args: let ports = import ../ports.nix args; diff --git a/hosts/iron/services/matrix.nix b/hosts/iron/services/matrix.nix index 8cf62b5..4f7dd3d 100644 --- a/hosts/iron/services/matrix.nix +++ b/hosts/iron/services/matrix.nix @@ -1,4 +1,4 @@ -args@{ config, pkgs, custom-utils, ... }: +args@{ config, pkgs, ... }: let ports = import ../ports.nix args; diff --git a/hosts/iron/services/navidrome.nix b/hosts/iron/services/navidrome.nix index f6b87e4..054f38f 100644 --- a/hosts/iron/services/navidrome.nix +++ b/hosts/iron/services/navidrome.nix @@ -1,4 +1,4 @@ -args@{ config, lib, pkgs, utils, custom-utils, ... }: +args@{ config, lib, pkgs, ... }: let ports = import ../ports.nix args; diff --git a/hosts/iron/services/nginx.nix b/hosts/iron/services/nginx.nix index 71bdff2..b2e020e 100644 --- a/hosts/iron/services/nginx.nix +++ b/hosts/iron/services/nginx.nix @@ -1,4 +1,4 @@ -args@{ pkgs, custom-utils, ... }: +args: let ports = import ../ports.nix args; diff --git a/hosts/iron/services/ntp.nix b/hosts/iron/services/ntp.nix index edf7dbf..b10a245 100644 --- a/hosts/iron/services/ntp.nix +++ b/hosts/iron/services/ntp.nix @@ -1,4 +1,3 @@ -{ lib, pkgs, ... }: { services.chrony = { enable = true; diff --git a/hosts/iron/services/public-ip-tunnel.nix b/hosts/iron/services/public-ip-tunnel.nix index 612b041..67ee737 100644 --- a/hosts/iron/services/public-ip-tunnel.nix +++ b/hosts/iron/services/public-ip-tunnel.nix @@ -1,4 +1,4 @@ -args@{ config, lib, pkgs, custom-utils, ... }: +args@{ config, lib, pkgs, ... }: let ports = import ../ports.nix args; diff --git a/hosts/iron/services/radicale.nix b/hosts/iron/services/radicale.nix index b41a67d..7f327b6 100644 --- a/hosts/iron/services/radicale.nix +++ b/hosts/iron/services/radicale.nix @@ -1,4 +1,4 @@ -args@{ config, lib, pkgs, custom-utils, ... }: +args@{ config, ... }: let ports = import ../ports.nix args; diff --git a/hosts/iron/services/remarkable.nix b/hosts/iron/services/remarkable.nix index b8729ac..b3d6938 100644 --- a/hosts/iron/services/remarkable.nix +++ b/hosts/iron/services/remarkable.nix @@ -1,4 +1,4 @@ -args@{ lib, config, pkgs, custom-utils, ... }: +args@{ lib, config, pkgs, ... }: let ports = import ../ports.nix args; domain = "rmfakecloud.jalr.de"; diff --git a/hosts/iron/services/snapcast/ledfx.nix b/hosts/iron/services/snapcast/ledfx.nix index 9f78c71..4a4a3d6 100644 --- a/hosts/iron/services/snapcast/ledfx.nix +++ b/hosts/iron/services/snapcast/ledfx.nix @@ -1,4 +1,4 @@ -args@{ lib, pkgs, config, custom-utils, ... }: +{ pkgs, ... }: let interfaces = import ../../interfaces.nix; in diff --git a/hosts/iron/services/snapcast/mopidy.nix b/hosts/iron/services/snapcast/mopidy.nix index 5b66864..18be1a5 100644 --- a/hosts/iron/services/snapcast/mopidy.nix +++ b/hosts/iron/services/snapcast/mopidy.nix @@ -1,4 +1,4 @@ -args@{ lib, pkgs, config, custom-utils, ... }: +{ lib, pkgs, config, ... }: let interfaces = import ../../interfaces.nix; mopidyConfig = { diff --git a/hosts/iron/services/snapcast/snapclient.nix b/hosts/iron/services/snapcast/snapclient.nix index 8093022..27bb202 100644 --- a/hosts/iron/services/snapcast/snapclient.nix +++ b/hosts/iron/services/snapcast/snapclient.nix @@ -1,19 +1,6 @@ -{ lib, pkgs, ... }: +{ pkgs, ... }: -let hostId = "Wohnzimmer"; -in { - #services.pipewire = { - # enable = true; - # pulse.enable = true; - # alsa.enable = true; - #}; - - #environment.systemPackages = with pkgs; [ - # pulseaudio # pacmd and pactl - # pulsemixer - #]; - systemd.services.snapclient = { enable = true; description = "Snapcast client"; diff --git a/hosts/iron/services/snapcast/snapserver.nix b/hosts/iron/services/snapcast/snapserver.nix index f1807aa..3aa31ff 100644 --- a/hosts/iron/services/snapcast/snapserver.nix +++ b/hosts/iron/services/snapcast/snapserver.nix @@ -1,4 +1,4 @@ -args@{ lib, pkgs, config, custom-utils, ... }: +args@{ lib, pkgs, config, ... }: let ports = import ../../ports.nix args; interfaces = import ../../interfaces.nix; diff --git a/hosts/iron/services/sturzbach.nix b/hosts/iron/services/sturzbach.nix index ea0430a..ce7cbe6 100644 --- a/hosts/iron/services/sturzbach.nix +++ b/hosts/iron/services/sturzbach.nix @@ -1,4 +1,4 @@ -args@{ config, lib, custom-utils, ... }: +args: let ports = import ../ports.nix args; diff --git a/hosts/iron/services/unifi-controller.nix b/hosts/iron/services/unifi-controller.nix index bbd67a8..841fdba 100644 --- a/hosts/iron/services/unifi-controller.nix +++ b/hosts/iron/services/unifi-controller.nix @@ -1,4 +1,4 @@ -args@{ pkgs, custom-utils, ... }: +args@{ pkgs, ... }: let ports = import ../ports.nix args; diff --git a/hosts/iron/services/whatsapp.nix b/hosts/iron/services/whatsapp.nix index 9021758..6ef117c 100644 --- a/hosts/iron/services/whatsapp.nix +++ b/hosts/iron/services/whatsapp.nix @@ -1,4 +1,4 @@ -args@{ config, pkgs, custom-utils, ... }: +args@{ pkgs, ... }: let ports = import ../ports.nix args; diff --git a/hosts/magnesium/configuration.nix b/hosts/magnesium/configuration.nix index 855b1d1..1903e48 100644 --- a/hosts/magnesium/configuration.nix +++ b/hosts/magnesium/configuration.nix @@ -1,4 +1,4 @@ -{ config, lib, ... }: +{ lib, ... }: { imports = [ @@ -6,6 +6,7 @@ ./services ../../users/jalr ./persistence.nix + ./ports.nix ]; networking.hostName = "magnesium"; diff --git a/hosts/magnesium/ports.nix b/hosts/magnesium/ports.nix index 8956bca..79e6a0b 100644 --- a/hosts/magnesium/ports.nix +++ b/hosts/magnesium/ports.nix @@ -1,15 +1,15 @@ -{ custom-utils, ... }: - -custom-utils.validatePortAttrset { - coturn-cli.tcp = 5766; - coturn-plain = { tcp = [ 3478 3479 ]; udp = [ 3478 3479 ]; }; - coturn-relay.udp.range = [ 49160 49200 ]; - coturn-tls = { tcp = [ 5349 5350 ]; udp = [ 5349 5350 ]; }; - forgejo-ssh.tcp = 2022; - hedgedoc.tcp = 3000; - nginx-http.tcp = 80; - nginx-https.tcp = 443; - ntfy.tcp = 12474; - trilium.tcp = 12783; - wireguard-public-ip-tunnel.udp = 51000; +{ + config.networking.ports = { + coturn-cli.tcp = 5766; + coturn-plain = { tcp = [ 3478 3479 ]; udp = [ 3478 3479 ]; }; + coturn-relay.udp = { from = 49160; to = 49200; }; + coturn-tls = { tcp = [ 5349 5350 ]; udp = [ 5349 5350 ]; }; + forgejo-ssh.tcp = 2022; + hedgedoc.tcp = 3000; + nginx-http.tcp = 80; + nginx-https.tcp = 443; + ntfy.tcp = 12474; + trilium.tcp = 12783; + wireguard-public-ip-tunnel.udp = 51000; + }; } diff --git a/hosts/magnesium/services/coturn.nix b/hosts/magnesium/services/coturn.nix index a6d3dd6..e48af8b 100644 --- a/hosts/magnesium/services/coturn.nix +++ b/hosts/magnesium/services/coturn.nix @@ -1,9 +1,9 @@ -args@{ config, lib, pkgs, custom-utils, ... }: +{ config, lib, pkgs, ... }: let - ports = import ../ports.nix args; cfg = config.services.coturn; fqdn = "turn.jalr.de"; + ports = config.networking.ports; in { sops.secrets.turn-static-auth-secret = { @@ -22,8 +22,8 @@ in tls-listening-port = builtins.elemAt ports.coturn-tls.tcp 0; alt-tls-listening-port = builtins.elemAt ports.coturn-tls.tcp 1; cli-port = ports.coturn-cli.tcp; - min-port = builtins.elemAt ports.coturn-relay.udp.range 0; - max-port = builtins.elemAt ports.coturn-relay.udp.range 1; + min-port = ports.coturn-relay.udp.from; + max-port = ports.coturn-relay.udp.to; } ) // { enable = true; @@ -108,10 +108,6 @@ in networking.firewall = { allowedTCPPorts = with cfg; [ listening-port alt-listening-port tls-listening-port alt-tls-listening-port ]; allowedUDPPorts = with cfg; [ listening-port alt-listening-port tls-listening-port alt-tls-listening-port ]; - - allowedUDPPortRanges = lib.singleton { - from = builtins.elemAt ports.coturn-relay.udp.range 0; - to = builtins.elemAt ports.coturn-relay.udp.range 1; - }; + allowedUDPPortRanges = lib.singleton ports.coturn-relay.udp; }; } diff --git a/hosts/magnesium/services/forgejo.nix b/hosts/magnesium/services/forgejo.nix index 90d7fb4..459e6e4 100644 --- a/hosts/magnesium/services/forgejo.nix +++ b/hosts/magnesium/services/forgejo.nix @@ -1,8 +1,8 @@ -args@{ config, custom-utils, ... }: +{ config, ... }: let domain = "git.jalr.de"; cfg = config.services.forgejo; - ports = import ../ports.nix args; + ports = config.networking.ports; in { sops.secrets.forgejo-mail = { diff --git a/hosts/magnesium/services/gitlab-runner.nix b/hosts/magnesium/services/gitlab-runner.nix index bc28c9f..24f6c68 100644 --- a/hosts/magnesium/services/gitlab-runner.nix +++ b/hosts/magnesium/services/gitlab-runner.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, ... }: +{ config, pkgs, ... }: { sops.secrets.gitlab-runner_fablab-nea-hcloud-labsync = { diff --git a/hosts/magnesium/services/hedgedoc.nix b/hosts/magnesium/services/hedgedoc.nix index 633fbdc..aa9f1f8 100644 --- a/hosts/magnesium/services/hedgedoc.nix +++ b/hosts/magnesium/services/hedgedoc.nix @@ -1,9 +1,9 @@ -args@{ config, custom-utils, ... }: +{ config, ... }: let domain = "pad.jalr.de"; - ports = import ../ports.nix args; cfg = config.services.hedgedoc; + ports = config.networking.ports; in { sops.secrets.hedgedoc-session-secret = { diff --git a/hosts/magnesium/services/ntfy.nix b/hosts/magnesium/services/ntfy.nix index 4533c26..17848fa 100644 --- a/hosts/magnesium/services/ntfy.nix +++ b/hosts/magnesium/services/ntfy.nix @@ -1,9 +1,9 @@ -args@{ lib, pkgs, config, custom-utils, ... }: +{ config, ... }: let cfg = config.services.ntfy-sh; - ports = import ../ports.nix args; domain = "ntfy.jalr.de"; datadir = "/var/lib/ntfy-sh"; + ports = config.networking.ports; in { # ntfy access --auth-file /var/lib/private/ntfy-sh/user.db '*' 'up*' write-only diff --git a/hosts/magnesium/services/public-ip-tunnel.nix b/hosts/magnesium/services/public-ip-tunnel.nix index 28d917d..80a9800 100644 --- a/hosts/magnesium/services/public-ip-tunnel.nix +++ b/hosts/magnesium/services/public-ip-tunnel.nix @@ -1,9 +1,9 @@ -args@{ config, lib, pkgs, custom-utils, ... }: +{ config, lib, ... }: let - ports = import ../ports.nix args; listenPort = ports.wireguard-public-ip-tunnel.udp; publicKey = "GCmQs7upvDYFueEfqD2yJkkOZg3K7YaGluWWzdjsyTo="; + ports = config.networking.ports; in { sops.secrets = lib.listToAttrs (map diff --git a/hosts/magnesium/services/trilium.nix b/hosts/magnesium/services/trilium.nix index 0546897..964db27 100644 --- a/hosts/magnesium/services/trilium.nix +++ b/hosts/magnesium/services/trilium.nix @@ -1,8 +1,8 @@ -args@{ config, lib, pkgs, custom-utils, ... }: +{ config, pkgs, ... }: let - ports = import ../ports.nix args; domain = "notes.jalr.de"; + ports = config.networking.ports; in { services.trilium-server = { diff --git a/hosts/magnesium/services/webserver.nix b/hosts/magnesium/services/webserver.nix index 8ab2c50..c0aa71f 100644 --- a/hosts/magnesium/services/webserver.nix +++ b/hosts/magnesium/services/webserver.nix @@ -1,9 +1,9 @@ -args@{ config, lib, pkgs, custom-utils, ... }: +{ config, lib, pkgs, ... }: let - ports = import ../ports.nix args; domain = "jalr.de"; matrixDomain = "matrix.jalr.de"; + ports = config.networking.ports; in { networking.firewall.allowedTCPPorts = [ ports.nginx-http.tcp ports.nginx-https.tcp ]; diff --git a/hosts/weinturm-pretix-prod/hardware-configuration.nix b/hosts/weinturm-pretix-prod/hardware-configuration.nix index a0ae780..178664e 100644 --- a/hosts/weinturm-pretix-prod/hardware-configuration.nix +++ b/hosts/weinturm-pretix-prod/hardware-configuration.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, modulesPath, ... }: +{ lib, modulesPath, ... }: { imports = [ (modulesPath + "/profiles/qemu-guest.nix") ]; diff --git a/hosts/weinturm-pretix-prod/ports.nix b/hosts/weinturm-pretix-prod/ports.nix index 5de5641..cabfead 100644 --- a/hosts/weinturm-pretix-prod/ports.nix +++ b/hosts/weinturm-pretix-prod/ports.nix @@ -1,4 +1,4 @@ -{ lib, custom-utils, ... }: +{ custom-utils, ... }: custom-utils.validatePortAttrset { nginx-http.tcp = 80; diff --git a/hosts/weinturm-pretix-prod/services/pretix.nix b/hosts/weinturm-pretix-prod/services/pretix.nix index 7fe04d7..174c68d 100644 --- a/hosts/weinturm-pretix-prod/services/pretix.nix +++ b/hosts/weinturm-pretix-prod/services/pretix.nix @@ -1,4 +1,4 @@ -args@{ config, lib, pkgs, custom-utils, ... }: +args@{ config, lib, ... }: let cfg = config.services.pretix; diff --git a/modules/adb.nix b/modules/adb.nix index 1aae96c..47198c1 100644 --- a/modules/adb.nix +++ b/modules/adb.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, ... }: +{ config, lib, ... }: lib.mkIf config.jalr.gui.enable { programs.adb.enable = true; diff --git a/modules/aws.nix b/modules/aws.nix index f94580a..2b6eddb 100644 --- a/modules/aws.nix +++ b/modules/aws.nix @@ -4,7 +4,7 @@ options.jalr.aws = { enable = lib.mkEnableOption "Enable AWS CLI"; accounts = with lib; mkOption { - type = with types; attrsOf (submodule ({ config, name, ... }: { + type = with types; attrsOf (submodule (_: { options = { sso_account_id = mkOption { type = int; diff --git a/modules/bootloader/grub2.nix b/modules/bootloader/grub2.nix index a2ec2ee..2037be7 100644 --- a/modules/bootloader/grub2.nix +++ b/modules/bootloader/grub2.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, ... }: +{ config, lib, ... }: lib.mkIf (config.jalr.bootloader == "grub2") { boot.loader.grub = { diff --git a/modules/gnome.nix b/modules/gnome.nix index 1bd91bb..528934b 100644 --- a/modules/gnome.nix +++ b/modules/gnome.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, ... }: +{ config, lib, ... }: lib.mkIf (config.jalr.gui.enable && config.jalr.gui.desktop == "gnome") { services.xserver = { diff --git a/modules/journald.nix b/modules/journald.nix index c6f1271..e527dc6 100644 --- a/modules/journald.nix +++ b/modules/journald.nix @@ -1,5 +1,3 @@ -{ lib, ... }: - { services.journald.extraConfig = '' MaxRetentionSec=90day diff --git a/modules/kdeconnect.nix b/modules/kdeconnect.nix index 87cbf5d..96b3016 100644 --- a/modules/kdeconnect.nix +++ b/modules/kdeconnect.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, ... }: +{ config, lib, ... }: let portRange = { diff --git a/modules/localization.nix b/modules/localization.nix index b1a7ea0..0034c23 100644 --- a/modules/localization.nix +++ b/modules/localization.nix @@ -1,4 +1,4 @@ -{ lib, config, pkgs, ... }: +{ config, ... }: { i18n = { defaultLocale = "en_GB.UTF-8"; diff --git a/modules/luksusb.nix b/modules/luksusb.nix index 2015955..315c6a0 100644 --- a/modules/luksusb.nix +++ b/modules/luksusb.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, ... }: +{ config, lib, ... }: let cfg = config.jalr.luksUsbUnlock; in @@ -59,7 +59,7 @@ in kernelModules = [ "uas" "usbcore" "usb_storage" "vfat" "nls_cp437" "nls_iso8859_1" ]; systemd.services = let - makeService = name: { keyPath, usbDevice, waitForDevice }: + makeService = name: { usbDevice, waitForDevice, ... }: let usbDevPath = makeUsbDevPath usbDevice; usbMountPath = makeMountPath usbDevice; @@ -106,7 +106,7 @@ in cfg.devices; luks.devices = builtins.mapAttrs - (name: { keyPath, usbDevice, ... }: + (_: { keyPath, usbDevice, ... }: let usbMountPath = makeMountPath usbDevice; in diff --git a/modules/mailserver/default.nix b/modules/mailserver/default.nix index 93abbbf..59a8e2c 100644 --- a/modules/mailserver/default.nix +++ b/modules/mailserver/default.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, ... }: +{ config, lib, ... }: let cfg = config.jalr.mailserver; in diff --git a/modules/matrix/default.nix b/modules/matrix/default.nix index bbdce2d..4f3c745 100644 --- a/modules/matrix/default.nix +++ b/modules/matrix/default.nix @@ -1,7 +1,5 @@ { config, lib, pkgs, ... }: -let - cfg = config.jalr.matrix; -in + { options.jalr.matrix = with lib; with lib.types; { enable = mkEnableOption "simple matrix server"; diff --git a/modules/matrix/mautrix-signal.nix b/modules/matrix/mautrix-signal.nix index 09c932e..e00ec3a 100644 --- a/modules/matrix/mautrix-signal.nix +++ b/modules/matrix/mautrix-signal.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, ... }: +{ config, lib, ... }: let cfg = config.jalr.matrix; diff --git a/modules/matrix/mautrix-whatsapp.nix b/modules/matrix/mautrix-whatsapp.nix index f365efc..d4438fe 100644 --- a/modules/matrix/mautrix-whatsapp.nix +++ b/modules/matrix/mautrix-whatsapp.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, ... }: +{ config, lib, ... }: let cfg = config.jalr.matrix; diff --git a/modules/matrix/synapse.nix b/modules/matrix/synapse.nix index c590b42..f97ddd6 100644 --- a/modules/matrix/synapse.nix +++ b/modules/matrix/synapse.nix @@ -79,7 +79,7 @@ lib.mkIf cfg.enable { matrix-synapse.settings.app_service_config_files = lib.attrsets.mapAttrsToList ( - name: value: + name: _: "/run/matrix-synapse/app_service_config/${name}.yaml" ) cfg.synapse.app_service_config; @@ -108,8 +108,7 @@ lib.mkIf cfg.enable { systemd.services.matrix-synapse = { restartTriggers = lib.attrsets.mapAttrsToList ( - name: value: - "${value}" + _: value: "${value}" ) cfg.synapse.app_service_config; serviceConfig = { diff --git a/modules/networking/default.nix b/modules/networking/default.nix index 065c24b..80cdff2 100644 --- a/modules/networking/default.nix +++ b/modules/networking/default.nix @@ -5,6 +5,7 @@ { imports = [ ./network-manager.nix + ./ports.nix ]; networking.firewall.logRefusedConnections = lib.mkDefault false; diff --git a/modules/networking/ports.nix b/modules/networking/ports.nix new file mode 100644 index 0000000..74293ac --- /dev/null +++ b/modules/networking/ports.nix @@ -0,0 +1,20 @@ +{lib, ...}: + +{ + options.networking.ports = with lib; with lib.types; mkOption { + type = attrsOf (types.submodule { + options = { + tcp = mkOption { + type = oneOf [ port (listOf port) (attrsOf port) (listOf (attrsOf lib.types.port)) ]; + description = "TCP ports"; + default = [ ]; + }; + udp = mkOption { + type = oneOf [ port (listOf port) (attrsOf port) (listOf (attrsOf lib.types.port)) ]; + description = "UDP ports"; + default = [ ]; + }; + }; + }); + }; +} diff --git a/modules/nix.nix b/modules/nix.nix index 689184e..0be49a4 100644 --- a/modules/nix.nix +++ b/modules/nix.nix @@ -42,7 +42,7 @@ nixpkgs.overlays = [ inputs.self.overlays.default - (final: prev: { + (_: prev: { master = import inputs.nixpkgsMaster { inherit system; inherit (prev) config; diff --git a/modules/printers/p-touch_p700.nix b/modules/printers/p-touch_p700.nix index 627ad56..07076b1 100644 --- a/modules/printers/p-touch_p700.nix +++ b/modules/printers/p-touch_p700.nix @@ -1,5 +1,3 @@ -{ config, lib, ... }: - { services.udev.extraRules = '' SUBSYSTEM=="usb", ACTION=="add", ATTR{idVendor}=="04f9", ATTR{idProduct}=="2061", OWNER="root", GROUP="users", MODE="660" diff --git a/modules/qbittorrent/default.nix b/modules/qbittorrent/default.nix index 12771a4..9165d4d 100644 --- a/modules/qbittorrent/default.nix +++ b/modules/qbittorrent/default.nix @@ -1,4 +1,4 @@ -{ config, inputs, lib, pkgs, ... }: +{ config, lib, pkgs, ... }: let cfg = config.jalr.qbittorrent; in diff --git a/modules/sudo.nix b/modules/sudo.nix index d47d889..da6577a 100644 --- a/modules/sudo.nix +++ b/modules/sudo.nix @@ -1,4 +1,3 @@ -{ pkgs, inputs, ... }: let commandsWithoutPassword = [ "/run/current-system/sw/bin/systemctl restart tor.service" diff --git a/modules/udmx.nix b/modules/udmx.nix index da8df93..3d7befe 100644 --- a/modules/udmx.nix +++ b/modules/udmx.nix @@ -1,5 +1,3 @@ -{ config, lib, pkgs, ... }: - { services.udev.extraRules = '' # uDMX diff --git a/pkgs/asterisk-sounds-de/default.nix b/pkgs/asterisk-sounds-de/default.nix index ba9a9b0..ca5cad5 100644 --- a/pkgs/asterisk-sounds-de/default.nix +++ b/pkgs/asterisk-sounds-de/default.nix @@ -1,5 +1,4 @@ -{ lib -, stdenvNoCC +{ stdenvNoCC , fetchurl , unzip }: diff --git a/pkgs/contact-page/default.nix b/pkgs/contact-page/default.nix index 1a487ca..170b787 100644 --- a/pkgs/contact-page/default.nix +++ b/pkgs/contact-page/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenvNoCC }: +{ stdenvNoCC }: stdenvNoCC.mkDerivation { name = "jalr-contact"; diff --git a/pkgs/default.nix b/pkgs/default.nix index 2671fe0..2eb4b51 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -1,8 +1,8 @@ inputs: -final: prev: +_: prev: let - inherit (prev) callPackage system pkgsCross darwin; + inherit (prev) callPackage system pkgsCross; poetry2nix = callPackage inputs.poetry2nix { }; in { diff --git a/pkgs/docker-machine-driver-hetzner/default.nix b/pkgs/docker-machine-driver-hetzner/default.nix index 83cfd12..aa0efa1 100644 --- a/pkgs/docker-machine-driver-hetzner/default.nix +++ b/pkgs/docker-machine-driver-hetzner/default.nix @@ -1,12 +1,12 @@ -{ lib, stdenv, buildGoApplication, fetchFromGitHub }: +{ buildGoApplication, fetchFromGitHub }: buildGoApplication rec { pname = "docker-machine-driver-hetzner"; version = "5.0.1"; src = fetchFromGitHub { - rev = "${version}"; - owner = "JonasProgrammer"; - repo = "docker-machine-driver-hetzner"; + rev = "${version}"; + owner = "JonasProgrammer"; + repo = "docker-machine-driver-hetzner"; sha256 = "sha256-JREn6AzayaHkyhdOTJ8P2H/s/5RaKLe+Qb8GV5dI2pA="; }; modules = ./gomod2nix.toml; diff --git a/pkgs/fpvout/default.nix b/pkgs/fpvout/default.nix index f4090d7..7664f9c 100644 --- a/pkgs/fpvout/default.nix +++ b/pkgs/fpvout/default.nix @@ -1,5 +1,4 @@ -{ lib -, stdenv +{ stdenv , fetchFromGitHub , pkgs }: diff --git a/pkgs/home-assistant-custom-components/guntamatic.nix b/pkgs/home-assistant-custom-components/guntamatic.nix index b7f86bb..8ddb7cd 100644 --- a/pkgs/home-assistant-custom-components/guntamatic.nix +++ b/pkgs/home-assistant-custom-components/guntamatic.nix @@ -1,5 +1,4 @@ -{ lib -, fetchFromGitHub +{ fetchFromGitHub , buildHomeAssistantComponent }: diff --git a/pkgs/illuminanced/default.nix b/pkgs/illuminanced/default.nix index cf27e6f..2683fdc 100644 --- a/pkgs/illuminanced/default.nix +++ b/pkgs/illuminanced/default.nix @@ -1,6 +1,5 @@ { rustPlatform , fetchFromGitHub -, pkgs }: rustPlatform.buildRustPackage { diff --git a/pkgs/modules.nix b/pkgs/modules.nix index 25865fa..8a82e06 100644 --- a/pkgs/modules.nix +++ b/pkgs/modules.nix @@ -1,5 +1,3 @@ -{ pkgs, ... }: - { imports = [ ./asterisk-sounds-de/module.nix diff --git a/pkgs/myintercom-doorbell/default.nix b/pkgs/myintercom-doorbell/default.nix index 9d7fd58..23a4101 100644 --- a/pkgs/myintercom-doorbell/default.nix +++ b/pkgs/myintercom-doorbell/default.nix @@ -1,10 +1,10 @@ -{ lib, python3, poetry2nix }: +{ poetry2nix }: -poetry2nix.mkPoetryApplication rec { +poetry2nix.mkPoetryApplication { pname = "myintercom-audiosocket"; version = "0.0.1"; projectDir = ./.; - overrides = poetry2nix.overrides.withDefaults (final: prev: { + overrides = poetry2nix.overrides.withDefaults (_: prev: { urllib3 = prev.urllib3.override { preferWheel = true; }; diff --git a/pkgs/pretix-banktool/module.nix b/pkgs/pretix-banktool/module.nix index 253a519..9c58157 100644 --- a/pkgs/pretix-banktool/module.nix +++ b/pkgs/pretix-banktool/module.nix @@ -2,17 +2,6 @@ let cfg = config.services.pretix-banktool; - mkTimer = { description, unit, onCalendar }: { - inherit description; - requires = [ "pretix-migrate.service" ]; - after = [ "network.target" ]; - wantedBy = [ "timers.target" ]; - timerConfig = { - Persistent = true; - OnCalendar = onCalendar; - Unit = unit; - }; - }; in { options.services.pretix-banktool = with lib; with lib.types; { diff --git a/users/jalr/default.nix b/users/jalr/default.nix index 93e99b1..d08ba2e 100644 --- a/users/jalr/default.nix +++ b/users/jalr/default.nix @@ -32,7 +32,7 @@ in useUserPackages = true; useGlobalPkgs = true; backupFileExtension = "hm.bak"; - users.jalr = { lib, pkgs, ... }: { + users.jalr = { pkgs, ... }: { imports = [ ./modules ]; config = { home.stateVersion = config.system.stateVersion; diff --git a/users/jalr/modules/aws.nix b/users/jalr/modules/aws.nix index c37e6d5..2e85f92 100644 --- a/users/jalr/modules/aws.nix +++ b/users/jalr/modules/aws.nix @@ -1,4 +1,4 @@ -{ nixosConfig, lib, pkgs, config, ... }: +{ nixosConfig, lib, config, ... }: let inherit (config) xdg; diff --git a/users/jalr/modules/cli/default.nix b/users/jalr/modules/cli/default.nix index 978c846..a0d6ca9 100644 --- a/users/jalr/modules/cli/default.nix +++ b/users/jalr/modules/cli/default.nix @@ -1,4 +1,4 @@ -{ nixosConfig, lib, pkgs, ... }: +{ nixosConfig, pkgs, ... }: { imports = [ ./htop.nix diff --git a/users/jalr/modules/communication/default.nix b/users/jalr/modules/communication/default.nix index 5dc2faf..f461097 100644 --- a/users/jalr/modules/communication/default.nix +++ b/users/jalr/modules/communication/default.nix @@ -1,5 +1,3 @@ -{ nixosConfig, ... }: - { imports = [ ./ferdium.nix diff --git a/users/jalr/modules/dynamic-colors.nix b/users/jalr/modules/dynamic-colors.nix index cb318e0..31e1893 100644 --- a/users/jalr/modules/dynamic-colors.nix +++ b/users/jalr/modules/dynamic-colors.nix @@ -1,4 +1,4 @@ -{ nixosConfig, lib, config, pkgs, ... }: +{ nixosConfig, lib, pkgs, ... }: let loadSwayTheme = pkgs.writeShellScript "load-sway-theme" '' diff --git a/users/jalr/modules/git.nix b/users/jalr/modules/git.nix index da57290..93e9d9f 100644 --- a/users/jalr/modules/git.nix +++ b/users/jalr/modules/git.nix @@ -1,4 +1,4 @@ -{ nixosConfig, pkgs, ... }: +{ pkgs, ... }: let identity.DigitalerDienst = { name = "Jakob Lechner"; diff --git a/users/jalr/modules/graphics/default.nix b/users/jalr/modules/graphics/default.nix index 802e665..3af9b75 100644 --- a/users/jalr/modules/graphics/default.nix +++ b/users/jalr/modules/graphics/default.nix @@ -1,5 +1,3 @@ -{ nixosConfig, ... }: - { imports = [ ./gimp.nix diff --git a/users/jalr/modules/mycli/default.nix b/users/jalr/modules/mycli/default.nix index 758eb36..4f90e9e 100644 --- a/users/jalr/modules/mycli/default.nix +++ b/users/jalr/modules/mycli/default.nix @@ -1,8 +1,8 @@ { lib, pkgs, ... }: let quoteValues = ini: lib.mapAttrs - (section: attrs: - lib.mapAttrs (key: value: if builtins.isString value then ''"${value}"'' else value) attrs + (_: attrs: + lib.mapAttrs (_: value: if builtins.isString value then ''"${value}"'' else value) attrs ) ini; diff --git a/users/jalr/modules/neo.nix b/users/jalr/modules/neo.nix index 48bbb3b..9acef59 100644 --- a/users/jalr/modules/neo.nix +++ b/users/jalr/modules/neo.nix @@ -1,4 +1,3 @@ -{ config, pkgs, ... }: { home.sessionVariables = { XKB_DEFAULT_LAYOUT = "de,de"; diff --git a/users/jalr/modules/ots.nix b/users/jalr/modules/ots.nix index 68369e2..4f3e85c 100644 --- a/users/jalr/modules/ots.nix +++ b/users/jalr/modules/ots.nix @@ -1,8 +1,5 @@ -{ lib, pkgs, ... }: +{ pkgs, ... }: -let - configFile = "ots/ots.json"; -in { home.packages = [ ( diff --git a/users/jalr/modules/pomodoro.nix b/users/jalr/modules/pomodoro.nix index 85e1b78..6df182a 100644 --- a/users/jalr/modules/pomodoro.nix +++ b/users/jalr/modules/pomodoro.nix @@ -1,4 +1,4 @@ -{ nixosConfig, lib, pkgs, config, ... }: +{ nixosConfig, lib, pkgs, ... }: let tomlFormat = pkgs.formats.toml { }; diff --git a/users/jalr/modules/remarkable/restream.nix b/users/jalr/modules/remarkable/restream.nix index f2725f8..6dcbec5 100644 --- a/users/jalr/modules/remarkable/restream.nix +++ b/users/jalr/modules/remarkable/restream.nix @@ -1,4 +1,4 @@ -{ nixosConfig, lib, pkgs, ... }: +{ pkgs, ... }: { home.packages = with pkgs; [ diff --git a/users/jalr/modules/remarkable/rmview.nix b/users/jalr/modules/remarkable/rmview.nix index e87366b..0bf96ed 100644 --- a/users/jalr/modules/remarkable/rmview.nix +++ b/users/jalr/modules/remarkable/rmview.nix @@ -1,4 +1,4 @@ -{ nixosConfig, lib, pkgs, ... }: +{ lib, pkgs, ... }: let config = { @@ -16,7 +16,7 @@ in { home.packages = with pkgs; [ ( - pkgs.writeShellScriptBin "rmview" '' + writeShellScriptBin "rmview" '' export QT_QPA_PLATFORM=xcb exec ${pkgs.rmview}/bin/rmview "$@" '' diff --git a/users/jalr/modules/solarized.nix b/users/jalr/modules/solarized.nix index c814420..5390a31 100644 --- a/users/jalr/modules/solarized.nix +++ b/users/jalr/modules/solarized.nix @@ -1,5 +1,5 @@ builtins.mapAttrs - (name: hex: { + (_: hex: { inherit hex; rgb = builtins.concatStringsSep "," (map (f: toString (builtins.fromTOML "i = 0x${f hex}").i) (map (pos: builtins.substring pos 2) [ 1 3 5 ])); }) diff --git a/users/jalr/modules/sound/default.nix b/users/jalr/modules/sound/default.nix index 37008dd..79ed3c4 100644 --- a/users/jalr/modules/sound/default.nix +++ b/users/jalr/modules/sound/default.nix @@ -1,5 +1,3 @@ -{ nixosConfig, pkgs, ... }: - { imports = [ ./audacity.nix diff --git a/users/jalr/modules/sway/default.nix b/users/jalr/modules/sway/default.nix index 5139fc9..2d1a004 100644 --- a/users/jalr/modules/sway/default.nix +++ b/users/jalr/modules/sway/default.nix @@ -1,4 +1,4 @@ -{ nixosConfig, config, lib, pkgs, stdenv, ... }: +{ nixosConfig, config, lib, pkgs, ... }: let solarized = import ../solarized.nix; diff --git a/users/jalr/modules/sway/move-to-output/default.nix b/users/jalr/modules/sway/move-to-output/default.nix index 4c3fa5e..0daabfe 100644 --- a/users/jalr/modules/sway/move-to-output/default.nix +++ b/users/jalr/modules/sway/move-to-output/default.nix @@ -1,5 +1,5 @@ -{ lib, stdenv, pkgs, writeShellScript, ... }: -stdenv.mkDerivation rec { +{ stdenv, pkgs, ... }: +stdenv.mkDerivation { name = "sway-move-to-output"; phases = "installPhase"; installPhase = '' diff --git a/users/jalr/modules/sway/wofi.nix b/users/jalr/modules/sway/wofi.nix index 9180509..ca8eb9a 100644 --- a/users/jalr/modules/sway/wofi.nix +++ b/users/jalr/modules/sway/wofi.nix @@ -1,4 +1,4 @@ -{ nixosConfig, config, lib, pkgs, ... }: +{ lib, ... }: let solarized = import ../solarized.nix; diff --git a/users/jalr/modules/sway/yubikey-touch-detector.nix b/users/jalr/modules/sway/yubikey-touch-detector.nix index 658f653..0d01b60 100644 --- a/users/jalr/modules/sway/yubikey-touch-detector.nix +++ b/users/jalr/modules/sway/yubikey-touch-detector.nix @@ -1,4 +1,4 @@ -{ nixosConfig, config, lib, pkgs, ... }: +{ pkgs, ... }: { systemd.user.services.yubikey-touch-detector = { diff --git a/users/jalr/modules/tmux.nix b/users/jalr/modules/tmux.nix index a0781e4..c8d4c10 100644 --- a/users/jalr/modules/tmux.nix +++ b/users/jalr/modules/tmux.nix @@ -1,4 +1,3 @@ -{ config, pkgs, ... }: { programs.tmux = { enable = true; diff --git a/users/jalr/modules/vdirsyncer.nix b/users/jalr/modules/vdirsyncer.nix index c8c828d..c853db1 100644 --- a/users/jalr/modules/vdirsyncer.nix +++ b/users/jalr/modules/vdirsyncer.nix @@ -45,27 +45,6 @@ let }; }; - mkWebcalSection = { name, url ? null, urlCommand ? null }: assert url == null -> urlCommand != null; { - "pair calendar_${name}" = { - a = "calendar_${name}_local"; - b = "calendar_${name}_remote"; - collections = null; - }; - - "storage calendar_${name}_local" = { - type = "filesystem"; - path = "${calendarBasePath}/${name}/"; - fileext = ".ics"; - }; - - "storage calendar_${name}_remote" = { - type = "http"; - } // (if urlCommand != null then { - "url.fetch" = fetchCommand urlCommand; - } else { - inherit url; - }); - }; in { home.packages = with pkgs; [