Run nixpkgs-fmt .

https://github.com/nix-community/nixpkgs-fmt
This commit is contained in:
Dmitry Ivankov 2020-12-26 21:43:32 +01:00
parent 1b2d11e7d8
commit 1149a2189f
7 changed files with 12 additions and 23 deletions

19
ci.nix
View file

@ -9,12 +9,10 @@
# then your CI will be able to build and cache only those packages for # then your CI will be able to build and cache only those packages for
# which this is possible. # which this is possible.
{ pkgs ? import <nixpkgs> {} }: { pkgs ? import <nixpkgs> { } }:
with builtins; with builtins;
let let
isReserved = n: n == "lib" || n == "overlays" || n == "modules"; isReserved = n: n == "lib" || n == "overlays" || n == "modules";
isDerivation = p: isAttrs p && p ? type && p.type == "derivation"; isDerivation = p: isAttrs p && p ? type && p.type == "derivation";
isBuildable = p: !(p.meta.broken or false) && p.meta.license.free or true; isBuildable = p: !(p.meta.broken or false) && p.meta.license.free or true;
@ -29,10 +27,10 @@ let
let let
f = p: f = p:
if shouldRecurseForDerivations p then flattenPkgs p if shouldRecurseForDerivations p then flattenPkgs p
else if isDerivation p then [p] else if isDerivation p then [ p ]
else []; else [ ];
in in
concatMap f (attrValues s); concatMap f (attrValues s);
outputsOf = p: map (o: p.${o}) p.outputs; outputsOf = p: map (o: p.${o}) p.outputs;
@ -40,13 +38,12 @@ let
nurPkgs = nurPkgs =
flattenPkgs flattenPkgs
(listToAttrs (listToAttrs
(map (n: nameValuePair n nurAttrs.${n}) (map (n: nameValuePair n nurAttrs.${n})
(filter (n: !isReserved n) (filter (n: !isReserved n)
(attrNames nurAttrs)))); (attrNames nurAttrs))));
in in
rec { rec {
buildPkgs = filter isBuildable nurPkgs; buildPkgs = filter isBuildable nurPkgs;
cachePkgs = filter isCacheable buildPkgs; cachePkgs = filter isCacheable buildPkgs;

View file

@ -6,7 +6,7 @@
# commands such as: # commands such as:
# nix-build -A mypackage # nix-build -A mypackage
{ pkgs ? import <nixpkgs> {} }: { pkgs ? import <nixpkgs> { } }:
{ {
# The `lib`, `modules`, and `overlay` names are special # The `lib`, `modules`, and `overlay` names are special
@ -18,4 +18,3 @@
# some-qt5-package = pkgs.libsForQt5.callPackage ./pkgs/some-qt5-package { }; # some-qt5-package = pkgs.libsForQt5.callPackage ./pkgs/some-qt5-package { };
# ... # ...
} }

View file

@ -5,4 +5,3 @@ with pkgs.lib; {
# #
# hexint = x: hexvals.${toLower x}; # hexint = x: hexvals.${toLower x};
} }

View file

@ -3,4 +3,3 @@
# #
# my-module = ./my-module; # my-module = ./my-module;
} }

View file

@ -3,16 +3,13 @@
# configuration. # configuration.
self: super: self: super:
let let
isReserved = n: n == "lib" || n == "overlays" || n == "modules"; isReserved = n: n == "lib" || n == "overlays" || n == "modules";
nameValuePair = n: v: { name = n; value = v; }; nameValuePair = n: v: { name = n; value = v; };
nurAttrs = import ./default.nix { pkgs = super; }; nurAttrs = import ./default.nix { pkgs = super; };
in in
builtins.listToAttrs
builtins.listToAttrs
(map (n: nameValuePair n nurAttrs.${n}) (map (n: nameValuePair n nurAttrs.${n})
(builtins.filter (n: !isReserved n) (builtins.filter (n: !isReserved n)
(builtins.attrNames nurAttrs))) (builtins.attrNames nurAttrs)))

View file

@ -3,4 +3,3 @@
# #
# my-overlay = import ./my-overlay; # my-overlay = import ./my-overlay;
} }

View file

@ -7,4 +7,3 @@ stdenv.mkDerivation rec {
buildPhase = "echo echo Hello World > example"; buildPhase = "echo echo Hello World > example";
installPhase = "install -Dm755 example $out"; installPhase = "install -Dm755 example $out";
} }