From 9c0f4a922a31c96b383c9050fe310ca422372ee1 Mon Sep 17 00:00:00 2001 From: Tim Van Baak Date: Sun, 28 Jul 2024 20:42:05 -0700 Subject: [PATCH] nix fmt --- closure.nix | 12 +++++------- flake.nix | 6 +----- lib.nix | 17 +++++++++-------- 3 files changed, 15 insertions(+), 20 deletions(-) diff --git a/closure.nix b/closure.nix index 7adf6cd..8d95a9e 100644 --- a/closure.nix +++ b/closure.nix @@ -7,11 +7,7 @@ { pkgs, ... }: let - inherit (builtins) - genericClosure - hasAttr - map - ; + inherit (builtins) genericClosure hasAttr map; inherit (pkgs.lib) concatLists concatMap @@ -22,12 +18,14 @@ let ; # Map a drv or list of drvs to a list of output drvs - drvOutputs = drv: + drvOutputs = + drv: if isList drv then concatMap drvOutputs drv else if hasAttr "outputs" drv then map (out: drv.${out}) drv.outputs - else [ drv ]; + else + [ drv ]; # Map a drv or list of drvs to the outputs of referenced derivations drvDeps = diff --git a/flake.nix b/flake.nix index 581b8ad..0c460df 100644 --- a/flake.nix +++ b/flake.nix @@ -5,11 +5,7 @@ system = "x86_64-linux"; pkgs = nixpkgs.legacyPackages.${system}; lib = import ./lib.nix { inherit pkgs; }; - inherit (lib) - allMaintainers - expandInput - noMaintainers - ; + inherit (lib) allMaintainers expandInput noMaintainers; in { bundlers."x86_64-linux" = rec { diff --git a/lib.nix b/lib.nix index 1cdcc03..560ac50 100644 --- a/lib.nix +++ b/lib.nix @@ -27,14 +27,15 @@ rec { drvMaintainers = drv: if maintainable drv then drv.meta.maintainers else [ ]; # Construct a link to a derivation's source in github:NixOS/nixpkgs - drvSource = drv: - let - parts = match "/nix/store/[^/]+/(.*):([0-9]*)" drv.meta.position; - in - if hasAttr "meta" drv && hasAttr "position" drv.meta then - "https://github.com/NixOS/nixpkgs/blob/master/${head parts}#L${head (tail parts)}" - else - ""; + drvSource = + drv: + let + parts = match "/nix/store/[^/]+/(.*):([0-9]*)" drv.meta.position; + in + if hasAttr "meta" drv && hasAttr "position" drv.meta then + "https://github.com/NixOS/nixpkgs/blob/master/${head parts}#L${head (tail parts)}" + else + ""; mainInfo = drv: { name = drv.name;