From bc56014b83a1abe507c7b437da33685d88bc337a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Sun, 14 Apr 2024 13:44:00 +0200 Subject: [PATCH] Cleanup --- flake.nix | 5 ++--- nix/lib/default.nix | 6 +++--- nix/lib/dns.nix | 5 +---- nix/nixos-module/default.nix | 4 ++-- 4 files changed, 8 insertions(+), 12 deletions(-) diff --git a/flake.nix b/flake.nix index 5ff3710..9295028 100644 --- a/flake.nix +++ b/flake.nix @@ -33,9 +33,8 @@ # Config, and utilities lib = nixpkgs.lib.extend (_final: _prev: import ./nix/lib { - inherit self; - inherit openwrt; - pkgs = nixpkgs.legacyPackages.x86_64-linux; + inherit self openwrt; + inherit (nixpkgs.legacyPackages.x86_64-linux) lib pkgs; }); # Everything that can be built locally outside of NixOS diff --git a/nix/lib/default.nix b/nix/lib/default.nix index c7e1691..c4c77e3 100644 --- a/nix/lib/default.nix +++ b/nix/lib/default.nix @@ -1,13 +1,13 @@ -{ self, pkgs, openwrt }: +{ self, lib, openwrt, pkgs }: rec { - config = (import ./config { inherit self pkgs; }).config; + inherit (import ./config { inherit self pkgs; }) config; netmasks = import ./netmasks.nix; subnet = import ./subnet { inherit pkgs; }; - dns = import ./dns.nix { inherit pkgs config; }; + dns = import ./dns.nix { inherit config lib; }; openwrtModels = import ./openwrt-models.nix { inherit self openwrt; }; diff --git a/nix/lib/dns.nix b/nix/lib/dns.nix index 7ad409e..475ed83 100644 --- a/nix/lib/dns.nix +++ b/nix/lib/dns.nix @@ -1,8 +1,5 @@ -{ pkgs, config }: +{ config, lib }: -let - lib = pkgs.lib; -in rec { ns = "dns.serv.zentralwerk.org"; internalNS = [ ns ]; diff --git a/nix/nixos-module/default.nix b/nix/nixos-module/default.nix index 4d286b5..01affd2 100644 --- a/nix/nixos-module/default.nix +++ b/nix/nixos-module/default.nix @@ -1,13 +1,13 @@ # Pulls together NixOS configuration modules according to the # name/role of the host to be built. -{ hostName, config, lib, ... }: +{ hostName, lib, ... }: let inherit (lib) optionals; hostConfig = lib.config.site.hosts.${hostName}; in { - site = lib.config.site; + inherit (lib.config) site; imports = [ ../lib/config/options.nix