From cfacd69575b5888bf3e054c9f8056a19c4b5903e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Tue, 16 Jan 2024 17:00:20 +0100 Subject: Rework --- nixos/modules/autounlock.nix | 4 ++-- nixos/modules/compile.nix | 5 +++-- nixos/modules/default.nix | 23 +++++++++-------------- nixos/modules/desktop.nix | 13 +++++++------ nixos/modules/develop.nix | 7 ++++--- nixos/modules/gaming.nix | 4 ++-- nixos/modules/generic.nix | 4 ++-- nixos/modules/home-assistant.nix | 4 ++-- nixos/modules/hosts.nix | 10 ++-------- nixos/modules/monitoring.nix | 4 ++-- nixos/modules/openvpn.nix | 4 ++-- nixos/modules/syncthing.nix | 5 ++--- nixos/modules/wifi-client.nix | 5 +++-- 13 files changed, 42 insertions(+), 50 deletions(-) (limited to 'nixos/modules') diff --git a/nixos/modules/autounlock.nix b/nixos/modules/autounlock.nix index 244dcb4..d7d6a7c 100644 --- a/nixos/modules/autounlock.nix +++ b/nixos/modules/autounlock.nix @@ -3,8 +3,8 @@ lib, pkgs, ... -}: -with lib; let +}: let + inherit (lib) mapAttrs mkOption mkIf types; cnf = config.cynerd.autounlock; in { options = { diff --git a/nixos/modules/compile.nix b/nixos/modules/compile.nix index 929b373..3c90345 100644 --- a/nixos/modules/compile.nix +++ b/nixos/modules/compile.nix @@ -3,8 +3,9 @@ lib, pkgs, ... -}: -with lib; { +}: let + inherit (lib) mkOption mkIf mkDefault types; +in { options = { cynerd.compile = mkOption { type = types.bool; diff --git a/nixos/modules/default.nix b/nixos/modules/default.nix index 72221d8..9d707e9 100644 --- a/nixos/modules/default.nix +++ b/nixos/modules/default.nix @@ -1,14 +1,9 @@ -{ - cynerd-autounlock = import ./autounlock.nix; - cynerd-compile = import ./compile.nix; - cynerd-desktop = import ./desktop.nix; - cynerd-develop = import ./develop.nix; - cynerd-gaming = import ./gaming.nix; - cynerd-generic = import ./generic.nix; - cynerd-home-assistant = import ./home-assistant.nix; - cynerd-hosts = import ./hosts.nix; - cynerd-monitoring = import ./monitoring.nix; - cynerd-openvpn = import ./openvpn.nix; - cynerd-syncthing = import ./syncthing.nix; - cynerd-wifi-client = import ./wifi-client.nix; -} +self: let + inherit (builtins) readDir; + inherit (self.inputs.nixpkgs.lib) filterAttrs nameValuePair mapAttrs' hasSuffix removeSuffix; +in + mapAttrs' + (n: v: nameValuePair "cynerd-${removeSuffix ".nix" n}" (import (./. + "/${n}"))) + (filterAttrs + (n: v: v == "regular" && hasSuffix ".nix" n && n != "default.nix") + (readDir ./.)) diff --git a/nixos/modules/desktop.nix b/nixos/modules/desktop.nix index 38758c7..7d110ae 100644 --- a/nixos/modules/desktop.nix +++ b/nixos/modules/desktop.nix @@ -3,8 +3,8 @@ lib, pkgs, ... -}: -with lib; let +}: let + inherit (lib) mkOption mkIf types optionals; cnf = config.cynerd.desktop; in { options = { @@ -60,9 +60,9 @@ in { notmuch astroid taskwarrior - vdirsyncer - khal - khard + #vdirsyncer + #khal + #khard gnupg pinentry-gnome pinentry-curses @@ -70,6 +70,7 @@ in { exts.pass-otp exts.pass-audit ])) + nextcloud-client chromium ferdium @@ -149,7 +150,7 @@ in { # Gnome utils gnome-firmware - gaphor + #gaphor # CAD freecad diff --git a/nixos/modules/develop.nix b/nixos/modules/develop.nix index 84358ab..1826e36 100644 --- a/nixos/modules/develop.nix +++ b/nixos/modules/develop.nix @@ -3,8 +3,9 @@ lib, pkgs, ... -}: -with lib; { +}: let + inherit (lib) mkOption mkIf types; +in { options = { cynerd.develop = mkOption { type = types.bool; @@ -109,7 +110,7 @@ with lib; { stdmanpages # SHV - #shvspy + shvspy flatline shvcli diff --git a/nixos/modules/gaming.nix b/nixos/modules/gaming.nix index 182fc36..cbf2d10 100644 --- a/nixos/modules/gaming.nix +++ b/nixos/modules/gaming.nix @@ -3,8 +3,8 @@ lib, pkgs, ... -}: -with lib; let +}: let + inherit (lib) mkOption mkIf types; cnf = config.cynerd.gaming; in { options = { diff --git a/nixos/modules/generic.nix b/nixos/modules/generic.nix index 9b64aa8..f2a0d3b 100644 --- a/nixos/modules/generic.nix +++ b/nixos/modules/generic.nix @@ -3,8 +3,8 @@ lib, pkgs, ... -}: -with lib; let +}: let + inherit (lib) mkOverride mkDefault mkIf optionals; isNative = config.nixpkgs.hostPlatform == config.nixpkgs.buildPlatform; in { config = { diff --git a/nixos/modules/home-assistant.nix b/nixos/modules/home-assistant.nix index 0567785..e55533e 100644 --- a/nixos/modules/home-assistant.nix +++ b/nixos/modules/home-assistant.nix @@ -3,8 +3,8 @@ lib, pkgs, ... -}: -with lib; let +}: let + inherit (lib) mkIf mkEnableOption; cnf = config.cynerd.home-assistant; in { options = { diff --git a/nixos/modules/hosts.nix b/nixos/modules/hosts.nix index 2746f93..76e884d 100644 --- a/nixos/modules/hosts.nix +++ b/nixos/modules/hosts.nix @@ -3,8 +3,8 @@ lib, pkgs, ... -}: -with lib; let +}: let + inherit (lib) mkOption types mkIf; cnf = config.cynerd.hosts; staticZoneOption = mkOption { @@ -33,7 +33,6 @@ in { # Portable "binky" = "10.8.0.2"; "albert" = "10.8.0.3"; - "susan" = "10.8.0.5"; "android" = "10.8.0.6"; # Endpoints "spt-omnia" = "10.8.0.50"; @@ -49,7 +48,6 @@ in { "errol" = "10.8.2.60"; # Portable "albert" = "10.8.2.61"; - "susan" = "10.8.2.62"; "binky" = "10.8.2.63"; }; adm = { @@ -62,7 +60,6 @@ in { "mpd" = "10.8.3.51"; # Portable "albert" = "10.8.3.61"; - "susan" = "10.8.3.62"; "binky" = "10.8.3.63"; }; }; @@ -73,7 +70,6 @@ in { "${cnf.vpn.android}" = ["android.vpn"]; "${cnf.vpn.albert}" = ["albert.vpn"]; "${cnf.vpn.dean}" = ["dean" "dean.vpn"]; - "${cnf.vpn.susan}" = ["susan.vpn"]; "${cnf.vpn.binky}" = ["binky.vpn"]; "${cnf.vpn.spt-omnia}" = ["spt.vpn"]; "${cnf.vpn.adm-omnia}" = ["adm.vpn"]; @@ -85,7 +81,6 @@ in { "${cnf.spt.mpd}" = ["mpd.spt"]; "${cnf.spt.errol}" = ["errol" "desktop.spt"]; "${cnf.spt.albert}" = ["albert.spt"]; - "${cnf.spt.susan}" = ["susan.spt"]; "${cnf.spt.binky}" = ["binky.spt"]; # Adm "${cnf.adm.omnia}" = ["omnia.adm"]; @@ -93,7 +88,6 @@ in { "${cnf.adm.omnia2}" = ["omnia2.adm"]; "${cnf.adm.ridcully}" = ["ridcully" "desktop.adm"]; "${cnf.adm.albert}" = ["albert.adm"]; - "${cnf.adm.susan}" = ["susan.adm"]; "${cnf.adm.binky}" = ["binky.adm"]; "${cnf.adm."3dprint"}" = ["3dprint"]; "${cnf.adm.mpd}" = ["mpd.adm"]; diff --git a/nixos/modules/monitoring.nix b/nixos/modules/monitoring.nix index 2fc6da5..44d0cbb 100644 --- a/nixos/modules/monitoring.nix +++ b/nixos/modules/monitoring.nix @@ -3,8 +3,8 @@ lib, pkgs, ... -}: -with lib; let +}: let + inherit (lib) mkOption types mkMerge mkIf optionalAttrs optionals; cnf = config.cynerd.monitoring; in { options.cynerd.monitoring = { diff --git a/nixos/modules/openvpn.nix b/nixos/modules/openvpn.nix index d2c7319..57d59ee 100644 --- a/nixos/modules/openvpn.nix +++ b/nixos/modules/openvpn.nix @@ -3,8 +3,8 @@ lib, pkgs, ... -}: -with lib; let +}: let + inherit (lib) mkOption types mkIf; cnf = config.cynerd.openvpn; in { options = { diff --git a/nixos/modules/syncthing.nix b/nixos/modules/syncthing.nix index 263acbe..af6d957 100644 --- a/nixos/modules/syncthing.nix +++ b/nixos/modules/syncthing.nix @@ -3,9 +3,8 @@ lib, pkgs, ... -}: -with builtins; -with lib; let +}: let + inherit (lib) filterAttrs mkOption types mkIf any mkDefault recursiveUpdate genAttrs; cnf = config.cynerd.syncthing; inherit (config.networking) hostName; allDevices = [ diff --git a/nixos/modules/wifi-client.nix b/nixos/modules/wifi-client.nix index 0d7fd48..8fc803d 100644 --- a/nixos/modules/wifi-client.nix +++ b/nixos/modules/wifi-client.nix @@ -3,8 +3,9 @@ lib, pkgs, ... -}: -with lib; { +}: let + inherit (lib) mkOption types mkIf; +in { options = { cynerd.wifiClient = mkOption { type = types.bool; -- cgit v1.2.3