From 1149a2189f51eed6c7fd8243b250cafd053acd32 Mon Sep 17 00:00:00 2001 From: Dmitry Ivankov Date: Sat, 26 Dec 2020 21:43:32 +0100 Subject: [PATCH] Run nixpkgs-fmt . https://github.com/nix-community/nixpkgs-fmt --- ci.nix | 19 ++++++++----------- default.nix | 3 +-- lib/default.nix | 1 - modules/default.nix | 1 - overlay.nix | 9 +++------ overlays/default.nix | 1 - pkgs/example-package/default.nix | 1 - 7 files changed, 12 insertions(+), 23 deletions(-) diff --git a/ci.nix b/ci.nix index 47d2236..1d08a33 100644 --- a/ci.nix +++ b/ci.nix @@ -9,12 +9,10 @@ # then your CI will be able to build and cache only those packages for # which this is possible. -{ pkgs ? import {} }: +{ pkgs ? import { } }: with builtins; - let - isReserved = n: n == "lib" || n == "overlays" || n == "modules"; isDerivation = p: isAttrs p && p ? type && p.type == "derivation"; isBuildable = p: !(p.meta.broken or false) && p.meta.license.free or true; @@ -29,10 +27,10 @@ let let f = p: if shouldRecurseForDerivations p then flattenPkgs p - else if isDerivation p then [p] - else []; + else if isDerivation p then [ p ] + else [ ]; in - concatMap f (attrValues s); + concatMap f (attrValues s); outputsOf = p: map (o: p.${o}) p.outputs; @@ -40,13 +38,12 @@ let nurPkgs = flattenPkgs - (listToAttrs - (map (n: nameValuePair n nurAttrs.${n}) - (filter (n: !isReserved n) - (attrNames nurAttrs)))); + (listToAttrs + (map (n: nameValuePair n nurAttrs.${n}) + (filter (n: !isReserved n) + (attrNames nurAttrs)))); in - rec { buildPkgs = filter isBuildable nurPkgs; cachePkgs = filter isCacheable buildPkgs; diff --git a/default.nix b/default.nix index 46c4090..d6497c9 100644 --- a/default.nix +++ b/default.nix @@ -6,7 +6,7 @@ # commands such as: # nix-build -A mypackage -{ pkgs ? import {} }: +{ pkgs ? import { } }: { # The `lib`, `modules`, and `overlay` names are special @@ -18,4 +18,3 @@ # some-qt5-package = pkgs.libsForQt5.callPackage ./pkgs/some-qt5-package { }; # ... } - diff --git a/lib/default.nix b/lib/default.nix index 53d6abe..a7fab1d 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -5,4 +5,3 @@ with pkgs.lib; { # # hexint = x: hexvals.${toLower x}; } - diff --git a/modules/default.nix b/modules/default.nix index 84ccb1a..ff6c7c0 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -3,4 +3,3 @@ # # my-module = ./my-module; } - diff --git a/overlay.nix b/overlay.nix index 122729d..bff7396 100644 --- a/overlay.nix +++ b/overlay.nix @@ -3,16 +3,13 @@ # configuration. self: super: - let - isReserved = n: n == "lib" || n == "overlays" || n == "modules"; nameValuePair = n: v: { name = n; value = v; }; nurAttrs = import ./default.nix { pkgs = super; }; in - - builtins.listToAttrs +builtins.listToAttrs (map (n: nameValuePair n nurAttrs.${n}) - (builtins.filter (n: !isReserved n) - (builtins.attrNames nurAttrs))) + (builtins.filter (n: !isReserved n) + (builtins.attrNames nurAttrs))) diff --git a/overlays/default.nix b/overlays/default.nix index 642fefa..0c2d870 100644 --- a/overlays/default.nix +++ b/overlays/default.nix @@ -3,4 +3,3 @@ # # my-overlay = import ./my-overlay; } - diff --git a/pkgs/example-package/default.nix b/pkgs/example-package/default.nix index 2533adf..41e22df 100644 --- a/pkgs/example-package/default.nix +++ b/pkgs/example-package/default.nix @@ -7,4 +7,3 @@ stdenv.mkDerivation rec { buildPhase = "echo echo Hello World > example"; installPhase = "install -Dm755 example $out"; } -