From 6d64096cd99db27357bf2d038bdfdfc2d3a3aeae Mon Sep 17 00:00:00 2001 From: tv Date: Fri, 9 Dec 2022 01:31:56 +0100 Subject: tv: normalize lib imports --- tv/3modules/Xresources.nix | 2 +- tv/3modules/charybdis/config.nix | 2 +- tv/3modules/charybdis/default.nix | 3 ++- tv/3modules/charybdis/lib | 1 + tv/3modules/dnsmasq.nix | 2 +- tv/3modules/ejabberd/default.nix | 4 ++-- tv/3modules/ejabberd/lib | 1 + tv/3modules/focus.nix | 2 +- tv/3modules/hosts.nix | 7 ++----- tv/3modules/hw.nix | 2 +- tv/3modules/im.nix | 2 +- tv/3modules/iptables.nix | 6 ++---- tv/3modules/lib | 1 + tv/3modules/org.freedesktop.machine1.host-shell.nix | 3 ++- tv/3modules/slock.nix | 2 +- tv/3modules/x0vncserver.nix | 4 +--- 16 files changed, 21 insertions(+), 23 deletions(-) create mode 120000 tv/3modules/charybdis/lib create mode 120000 tv/3modules/ejabberd/lib create mode 120000 tv/3modules/lib (limited to 'tv/3modules') diff --git a/tv/3modules/Xresources.nix b/tv/3modules/Xresources.nix index ab233dd6..266531de 100644 --- a/tv/3modules/Xresources.nix +++ b/tv/3modules/Xresources.nix @@ -1,4 +1,4 @@ -with import ; +with import ./lib; { config, pkgs, ... }: let cfg = { enable = config.services.xserver.enable && config.tv.Xresources != {}; diff --git a/tv/3modules/charybdis/config.nix b/tv/3modules/charybdis/config.nix index dccbfde6..4669345e 100644 --- a/tv/3modules/charybdis/config.nix +++ b/tv/3modules/charybdis/config.nix @@ -1,4 +1,4 @@ -{ config, ... }: with import ; let +{ config, ... }: with import ./lib; let cfg = config.tv.charybdis; in toFile "charybdis.conf" '' /* doc/example.conf - brief example configuration file diff --git a/tv/3modules/charybdis/default.nix b/tv/3modules/charybdis/default.nix index 96aae702..4a0f9950 100644 --- a/tv/3modules/charybdis/default.nix +++ b/tv/3modules/charybdis/default.nix @@ -1,4 +1,5 @@ -{ config, lib, pkgs, ... }@args: with import ; let +with import ./lib; +{ config, pkgs, ... }@args: let cfg = config.tv.charybdis; in { options.tv.charybdis = { diff --git a/tv/3modules/charybdis/lib b/tv/3modules/charybdis/lib new file mode 120000 index 00000000..dc598c56 --- /dev/null +++ b/tv/3modules/charybdis/lib @@ -0,0 +1 @@ +../lib \ No newline at end of file diff --git a/tv/3modules/dnsmasq.nix b/tv/3modules/dnsmasq.nix index ab24ac08..e1dfdea3 100644 --- a/tv/3modules/dnsmasq.nix +++ b/tv/3modules/dnsmasq.nix @@ -1,4 +1,4 @@ -with import ; +with import ./lib; { config, ... }: let cfg = config.tv.dnsmasq; in { diff --git a/tv/3modules/ejabberd/default.nix b/tv/3modules/ejabberd/default.nix index edc5296b..e3a41a57 100644 --- a/tv/3modules/ejabberd/default.nix +++ b/tv/3modules/ejabberd/default.nix @@ -1,5 +1,5 @@ -{ config, lib, pkgs, ... }@args: with import ; let - +with import ./lib; +{ config, pkgs, ... }: let cfg = config.tv.ejabberd; gen-dhparam = pkgs.writeDash "gen-dhparam" '' diff --git a/tv/3modules/ejabberd/lib b/tv/3modules/ejabberd/lib new file mode 120000 index 00000000..dc598c56 --- /dev/null +++ b/tv/3modules/ejabberd/lib @@ -0,0 +1 @@ +../lib \ No newline at end of file diff --git a/tv/3modules/focus.nix b/tv/3modules/focus.nix index b1a7b2e5..c16d4424 100644 --- a/tv/3modules/focus.nix +++ b/tv/3modules/focus.nix @@ -1,4 +1,4 @@ -with import ; +with import ./lib; { options.tv.focus.enable = mkEnableOption "tv.focus"; } diff --git a/tv/3modules/hosts.nix b/tv/3modules/hosts.nix index 11874051..2d382e26 100644 --- a/tv/3modules/hosts.nix +++ b/tv/3modules/hosts.nix @@ -1,8 +1,5 @@ -{ config, ... }: - -with import ; - -{ +with import ./lib; +{ config, ... }: { options.tv.hosts = mkOption { type = types.attrsOf types.host; default = diff --git a/tv/3modules/hw.nix b/tv/3modules/hw.nix index 6eb722d2..db1a77c8 100644 --- a/tv/3modules/hw.nix +++ b/tv/3modules/hw.nix @@ -1,5 +1,5 @@ +with import ./lib; let - lib = import ; local.types.screen = lib.types.submodule { options.width = lib.mkOption { type = lib.types.uint; diff --git a/tv/3modules/im.nix b/tv/3modules/im.nix index e98a5732..76a61b19 100644 --- a/tv/3modules/im.nix +++ b/tv/3modules/im.nix @@ -1,6 +1,6 @@ +with import ./lib; { config, pkgs, ... }: let im = config.tv.im; - lib = import ; in { options = { tv.im.client.enable = lib.mkEnableOption "tv.im.client" // { diff --git a/tv/3modules/iptables.nix b/tv/3modules/iptables.nix index 9cf0bd5a..c4bf4644 100644 --- a/tv/3modules/iptables.nix +++ b/tv/3modules/iptables.nix @@ -1,7 +1,5 @@ -{ config, lib, pkgs, ... }: - -with import ; -let { +with import ./lib; +{ config, pkgs, ... }: let { cfg = config.tv.iptables; body = { diff --git a/tv/3modules/lib b/tv/3modules/lib new file mode 120000 index 00000000..dc598c56 --- /dev/null +++ b/tv/3modules/lib @@ -0,0 +1 @@ +../lib \ No newline at end of file diff --git a/tv/3modules/org.freedesktop.machine1.host-shell.nix b/tv/3modules/org.freedesktop.machine1.host-shell.nix index e1a5323d..7d31edf9 100644 --- a/tv/3modules/org.freedesktop.machine1.host-shell.nix +++ b/tv/3modules/org.freedesktop.machine1.host-shell.nix @@ -1,4 +1,5 @@ -{ config, ... }: let lib = import ../../lib; in { +with import ./lib; +{ config, ... }: { options.org.freedesktop.machine1.host-shell.access = lib.mkOption { default = {}; type = diff --git a/tv/3modules/slock.nix b/tv/3modules/slock.nix index 926adc8e..a0830321 100644 --- a/tv/3modules/slock.nix +++ b/tv/3modules/slock.nix @@ -1,4 +1,4 @@ -with import ; +with import ./lib; { config, pkgs, ... }: let cfg = config.tv.slock; in { diff --git a/tv/3modules/x0vncserver.nix b/tv/3modules/x0vncserver.nix index 4dbb34df..f19bfebc 100644 --- a/tv/3modules/x0vncserver.nix +++ b/tv/3modules/x0vncserver.nix @@ -1,8 +1,6 @@ -with import ; +with import ./lib; { config, pkgs, ... }: let - cfg = config.tv.x0vncserver; - in { options.tv.x0vncserver = { display = mkOption { -- cgit v1.2.3