From 088facf700946cb8f2d96c6089185bdc2a67180a Mon Sep 17 00:00:00 2001 From: seth Date: Sun, 30 Jun 2024 09:56:30 -0400 Subject: alejandra -> nixfmt-rfc-style --- lib/default.nix | 9 +++----- lib/lib.nix | 66 ++++++++++++++++++++++++++++++++------------------------- lib/nginx.nix | 5 +---- 3 files changed, 41 insertions(+), 39 deletions(-) (limited to 'lib') diff --git a/lib/default.nix b/lib/default.nix index 6e4bec7..27e4a15 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -1,7 +1,4 @@ -{lib, ...} @ args: { - flake.lib = - (lib.extend (final: _: { - my = import ./lib.nix (args // {lib = final;}); - })) - .my; +{ lib, ... }@args: +{ + flake.lib = (lib.extend (final: _: { my = import ./lib.nix (args // { lib = final; }); })).my; } diff --git a/lib/lib.nix b/lib/lib.nix index aedb67a..e0e14e4 100644 --- a/lib/lib.nix +++ b/lib/lib.nix @@ -3,28 +3,34 @@ self, inputs, ... -}: let +}: +let # function -> function -> { } -> { } # wrap the `args` applied to `builder` with the result of `apply` # applied to those `args` - wrapBuilderWith = apply: builder: args: builder (apply args); + wrapBuilderWith = + apply: builder: args: + builder (apply args); # string -> function -> { } -> { } # wrap the `args` for `builder` of type `type` with nice defaults - wrapBuilder = type: - wrapBuilderWith ({ - modules ? [], - specialArgs ? {}, + wrapBuilder = + type: + wrapBuilderWith ( + { + modules ? [ ], + specialArgs ? { }, ... - } @ args: - args - // { - modules = - modules - ++ lib.attrValues (self."${type}Modules" or {}); + }@args: + args + // { + modules = modules ++ lib.attrValues (self."${type}Modules" or { }); - specialArgs = specialArgs // {inherit inputs;}; - }); + specialArgs = specialArgs // { + inherit inputs; + }; + } + ); # function -> { } -> { } # wrap the `args` to the nixos `builder` function with nice defaults @@ -35,23 +41,25 @@ # function -> { } -> { } # wrap the `args` to the homeManager `builder` function with nice defaults - wrapUser = builder: args: - wrapBuilderWith ({ - modules ? [], - extraSpecialArgs ? {}, + wrapUser = + builder: args: + wrapBuilderWith ( + { + modules ? [ ], + extraSpecialArgs ? { }, ... - } @ args: - args - // { - modules = - modules - ++ lib.attrValues (self.homeManagerModules or {}); + }@args: + args + // { + modules = modules ++ lib.attrValues (self.homeManagerModules or { }); - extraSpecialArgs = extraSpecialArgs // {inherit inputs;}; - }) - builder - args; -in { + extraSpecialArgs = extraSpecialArgs // { + inherit inputs; + }; + } + ) builder args; +in +{ # { } -> { } # apply nice defaults to the `args` of `nixosSystem` nixosSystem = wrapNixOS inputs.nixpkgs.lib.nixosSystem; diff --git a/lib/nginx.nix b/lib/nginx.nix index 0564dba..e7c22c3 100644 --- a/lib/nginx.nix +++ b/lib/nginx.nix @@ -12,8 +12,5 @@ lib: { # string -> { } -> { } # transform the names of an attribute set of nginx virtualHosts # into a full subdomain - toVHosts = domain: - lib.mapAttrs' ( - name: lib.nameValuePair "${name}.${domain}" - ); + toVHosts = domain: lib.mapAttrs' (name: lib.nameValuePair "${name}.${domain}"); } -- cgit v1.2.3