summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorseth <[email protected]>2024-06-30 09:56:30 -0400
committerseth <[email protected]>2024-06-30 10:23:04 -0400
commit088facf700946cb8f2d96c6089185bdc2a67180a (patch)
treec5b4e4cffbb3ee4ad2498c2251892bd457e9d3c7 /lib
parent5d3045a0769af3a94fba7b5cf646e8498aaef595 (diff)
alejandra -> nixfmt-rfc-style
Diffstat (limited to 'lib')
-rw-r--r--lib/default.nix9
-rw-r--r--lib/lib.nix66
-rw-r--r--lib/nginx.nix5
3 files changed, 41 insertions, 39 deletions
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}");
}