From 8e3a3aca2b796ca4ce0fb6aefd38c1ee0f222905 Mon Sep 17 00:00:00 2001 From: Amneesh Singh Date: Wed, 8 Mar 2023 11:17:33 +0530 Subject: [PATCH] lib: rename Signed-off-by: Amneesh Singh --- home/natto/dunst.nix | 4 ++-- home/natto/programs.nix | 4 ++-- home/natto/wayland.nix | 6 +++--- hosts/marisa/default.nix | 4 ++-- hosts/marisa/networking.nix | 6 +++--- hosts/remilia/default.nix | 4 ++-- hosts/remilia/mailserver.nix | 4 ++-- hosts/remilia/networking.nix | 6 +++--- hosts/remilia/services.nix | 6 +++--- hosts/satori/networking.nix | 6 +++--- hosts/satori/services.nix | 5 ++++- lib/default.nix | 6 ++++-- 12 files changed, 33 insertions(+), 28 deletions(-) diff --git a/home/natto/dunst.nix b/home/natto/dunst.nix index 6682613..75ea6b6 100644 --- a/home/natto/dunst.nix +++ b/home/natto/dunst.nix @@ -1,10 +1,10 @@ -{ config, colors, ... }: +{ config, lib', ... }: { services = { dunst = { enable = true; iconTheme = with config.gtk.iconTheme; { inherit name package; }; - settings = with colors.hex; { + settings = with lib'.colors.hex; { global = { mouse_left_click = "close_current"; mouse_right_click = "do_action"; diff --git a/home/natto/programs.nix b/home/natto/programs.nix index 435f8c8..047bd56 100644 --- a/home/natto/programs.nix +++ b/home/natto/programs.nix @@ -1,4 +1,4 @@ -{ pkgs, config, colors, ... }: +{ pkgs, config, lib', ... }: { programs = { firefox = { @@ -29,7 +29,7 @@ font-bold = "Fira Mono:style=Bold:pixelsize=18"; }; scrollback.lines = 4000; - colors = with colors.default; { + colors = with lib'.colors.default; { inherit foreground background; regular0 = surface1; regular1 = red; diff --git a/home/natto/wayland.nix b/home/natto/wayland.nix index f39ff8c..27cf2a3 100644 --- a/home/natto/wayland.nix +++ b/home/natto/wayland.nix @@ -1,4 +1,4 @@ -{ pkgs, config, colors, inputs, ... }: +{ pkgs, config, lib', inputs, ... }: { wayland = { windowManager = { @@ -16,7 +16,7 @@ + (with config.home.pointerCursor; '' exec-once=hyprctl setcursor ${name} ${toString size} '') - + (with colors.argb { a = "ee"; };'' + + (with lib'.colors.argb { a = "ee"; };'' general { col.active_border = 0x${mauve} 0x${flamingo} 135deg col.inactive_border = 0x${surface0} @@ -27,7 +27,7 @@ }; home.file.tofi = { - source = pkgs.writeText "tofi-config" (pkgs.lib.generators.toKeyValue { } (with colors.default; { + source = pkgs.writeText "tofi-config" (pkgs.lib.generators.toKeyValue { } (with lib'.colors.default; { # https://github.com/philj56/tofi/blob/master/themes/fullscreen width = "100%"; height = "100%"; diff --git a/hosts/marisa/default.nix b/hosts/marisa/default.nix index 5d40f5d..ca6f604 100644 --- a/hosts/marisa/default.nix +++ b/hosts/marisa/default.nix @@ -1,4 +1,4 @@ -{ config, pkgs, network, ... }: +{ config, pkgs, lib', ... }: { imports = [ ./networking.nix @@ -12,7 +12,7 @@ shell = pkgs.zsh; home = "/home/spark"; extraGroups = [ "wheel" ]; - openssh.authorizedKeys.keys = network.commonSSHKeys; + openssh.authorizedKeys.keys = lib'.network.commonSSHKeys; }; time.timeZone = "Asia/Kolkata"; diff --git a/hosts/marisa/networking.nix b/hosts/marisa/networking.nix index 4fa7993..ae0eb70 100644 --- a/hosts/marisa/networking.nix +++ b/hosts/marisa/networking.nix @@ -1,4 +1,4 @@ -{ config, pkgs, network, ... }: +{ config, pkgs, lib', ... }: { networking = { hostName = "marisa"; @@ -41,7 +41,7 @@ }]; }; }; - wireguard.interfaces.wg0 = with network.addresses.wireguard.ips; { + wireguard.interfaces.wg0 = with lib'.network.addresses.wireguard.ips; { ips = [ marisa ]; listenPort = 17840; privateKeyFile = "/var/secrets/wg.key"; @@ -50,7 +50,7 @@ #Oracle VM1 publicKey = "z0Y2VNEWcyVQVSqRHiwmiJ5/0MgSPM+HZfEcwIccSxM="; allowedIPs = [ remilia ]; - endpoint = "${network.addresses.domain.natto}:17840"; + endpoint = "${lib'.network.addresses.domain.natto}:17840"; persistentKeepalive = 25; } ]; diff --git a/hosts/remilia/default.nix b/hosts/remilia/default.nix index 097fad3..7cedc23 100644 --- a/hosts/remilia/default.nix +++ b/hosts/remilia/default.nix @@ -1,4 +1,4 @@ -{ config, pkgs, network, ... }: +{ config, pkgs, lib', ... }: { imports = [ ./networking.nix @@ -15,7 +15,7 @@ shell = pkgs.zsh; home = "/home/bat"; extraGroups = [ "wheel" ]; - openssh.authorizedKeys.keys = network.commonSSHKeys; + openssh.authorizedKeys.keys = lib'.network.commonSSHKeys; }; system.stateVersion = "21.11"; diff --git a/hosts/remilia/mailserver.nix b/hosts/remilia/mailserver.nix index e6f5d2b..43c62d0 100644 --- a/hosts/remilia/mailserver.nix +++ b/hosts/remilia/mailserver.nix @@ -1,7 +1,7 @@ -{ config, pkgs, lib, network, ... }: +{ config, pkgs, lib', network, ... }: { mailserver = - let domain = network.addresses.domain.natto; in + let domain = lib'.network.addresses.domain.natto; in rec { enable = true; fqdn = "mail.${domain}"; diff --git a/hosts/remilia/networking.nix b/hosts/remilia/networking.nix index 32931da..952946f 100644 --- a/hosts/remilia/networking.nix +++ b/hosts/remilia/networking.nix @@ -1,4 +1,4 @@ -{ lib, config, network, pkgs, ... }: +{ lib, config, lib', pkgs, ... }: { networking = { useDHCP = false; @@ -27,7 +27,7 @@ useDHCP = true; }; }; - nat = with network.addresses.wireguard.ips; { + nat = with lib'.network.addresses.wireguard.ips; { enable = true; externalInterface = "ens3"; internalInterfaces = [ "wg0" ]; @@ -46,7 +46,7 @@ } ]; }; - wireguard.interfaces = with network.addresses.wireguard; { + wireguard.interfaces = with lib'.network.addresses.wireguard; { wg0 = { ips = [ ips.remilia ]; listenPort = 17840; diff --git a/hosts/remilia/services.nix b/hosts/remilia/services.nix index 36a7ddb..a22de11 100644 --- a/hosts/remilia/services.nix +++ b/hosts/remilia/services.nix @@ -1,6 +1,6 @@ -{ config, pkgs, lib, network, ... }: +{ config, pkgs, lib, lib', ... }: let - domain = network.addresses.domain.natto; + domain = lib'.network.addresses.domain.natto; in { services = { @@ -40,7 +40,7 @@ in }; }; in - with network.addresses.wireguard.ips; { + with lib'.network.addresses.wireguard.ips; { "${domain}" = { addSSL = true; enableACME = true; diff --git a/hosts/satori/networking.nix b/hosts/satori/networking.nix index ecee7eb..5d95d9e 100644 --- a/hosts/satori/networking.nix +++ b/hosts/satori/networking.nix @@ -1,4 +1,4 @@ -{ config, pkgs, network, ... }: +{ config, pkgs, lib', ... }: { networking = { @@ -18,7 +18,7 @@ trustedInterfaces = [ "docker0" ]; }; - wireguard.interfaces.wg0 = with network.addresses.wireguard.ips; { + wireguard.interfaces.wg0 = with lib'.network.addresses.wireguard.ips; { ips = [ satori ]; listenPort = 17840; privateKeyFile = "/var/secrets/wg.key"; @@ -27,7 +27,7 @@ #Oracle VM1 publicKey = "z0Y2VNEWcyVQVSqRHiwmiJ5/0MgSPM+HZfEcwIccSxM="; allowedIPs = [ remilia ]; - endpoint = "${network.addresses.domain.natto}:17840"; + endpoint = "${lib'.network.addresses.domain.natto}:17840"; persistentKeepalive = 25; } ]; diff --git a/hosts/satori/services.nix b/hosts/satori/services.nix index c7ead8a..da33981 100644 --- a/hosts/satori/services.nix +++ b/hosts/satori/services.nix @@ -3,7 +3,10 @@ { services = { tor.enable = true; - openssh.enable = true; + openssh = { + enable = true; + settings.permitRootLogin = "yes"; + }; ratbagd.enable = true; btrfs.autoScrub.enable = true; zfs.autoScrub.enable = true; diff --git a/lib/default.nix b/lib/default.nix index 4022d53..6f46472 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -6,8 +6,10 @@ _module.args = { inherit inputs self; flake = self; - colors = import ./colors.nix; - network = import ./network.nix; + lib' = { + colors = import ./colors.nix; + network = import ./network.nix; + }; }; }; }