nixfmt slightly insane formatting

This commit is contained in:
Gerg-L 2023-11-01 21:51:47 -04:00
parent 4196aac49c
commit 90c4599b1b
Signed by: gerg-l
SSH key fingerprint: SHA256:FPYDHIkvMocr4wdmZXpgpJjsb2Tw6rASs2ISPbOb0KI

View file

@ -10,28 +10,24 @@ in
# Only good use case for rec # Only good use case for rec
rec { rec {
constructInputs' = needsSystem =
system: inputs: output:
lib.pipe inputs [ builtins.elem output [
(lib.filterAttrs (_: lib.isType "flake"))
(lib.mapAttrs (
_:
lib.mapAttrs (
name: value:
if
builtins.elem name [
"defaultPackage" "defaultPackage"
"devShell" "devShell"
"devShells" "devShells"
"formatter" "formatter"
"legacyPackages" "legacyPackages"
"packages" "packages"
] ];
then
value.${system} constructInputs' =
else system: inputs:
value lib.pipe inputs [
) (lib.filterAttrs (_: lib.isType "flake"))
(lib.mapAttrs (
_:
lib.mapAttrs (name: value: if needsSystem name then value.${system} else value)
)) ))
]; ];
@ -71,22 +67,7 @@ rec {
import unstable { inherit system config; }; import unstable { inherit system config; };
in in
lib.mapAttrs lib.mapAttrs
( (name: value: if needsSystem name then { ${system} = value pkgs; } else value)
name: value:
if
builtins.elem name [
"defaultPackage"
"devShell"
"devShells"
"formatter"
"legacyPackages"
"packages"
]
then
{ ${system} = value pkgs; }
else
value
)
outputs outputs
) )
[ "x86_64-linux" ] [ "x86_64-linux" ]