summaryrefslogtreecommitdiff
path: root/lib/lib.nix
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/lib.nix
parent5d3045a0769af3a94fba7b5cf646e8498aaef595 (diff)
alejandra -> nixfmt-rfc-style
Diffstat (limited to 'lib/lib.nix')
-rw-r--r--lib/lib.nix66
1 files changed, 37 insertions, 29 deletions
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;