Skip to content

Commit 435192e

Browse files
authored
Merge pull request #36 from divanorama/nixpkgs_fmt
[RFC] Run nixpkgs-fmt .
2 parents fb02840 + 1149a21 commit 435192e

File tree

7 files changed

+12
-23
lines changed

7 files changed

+12
-23
lines changed

ci.nix

+8-11
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,10 @@
99
# then your CI will be able to build and cache only those packages for
1010
# which this is possible.
1111

12-
{ pkgs ? import <nixpkgs> {} }:
12+
{ pkgs ? import <nixpkgs> { } }:
1313

1414
with builtins;
15-
1615
let
17-
1816
isReserved = n: n == "lib" || n == "overlays" || n == "modules";
1917
isDerivation = p: isAttrs p && p ? type && p.type == "derivation";
2018
isBuildable = p: !(p.meta.broken or false) && p.meta.license.free or true;
@@ -29,24 +27,23 @@ let
2927
let
3028
f = p:
3129
if shouldRecurseForDerivations p then flattenPkgs p
32-
else if isDerivation p then [p]
33-
else [];
30+
else if isDerivation p then [ p ]
31+
else [ ];
3432
in
35-
concatMap f (attrValues s);
33+
concatMap f (attrValues s);
3634

3735
outputsOf = p: map (o: p.${o}) p.outputs;
3836

3937
nurAttrs = import ./default.nix { inherit pkgs; };
4038

4139
nurPkgs =
4240
flattenPkgs
43-
(listToAttrs
44-
(map (n: nameValuePair n nurAttrs.${n})
45-
(filter (n: !isReserved n)
46-
(attrNames nurAttrs))));
41+
(listToAttrs
42+
(map (n: nameValuePair n nurAttrs.${n})
43+
(filter (n: !isReserved n)
44+
(attrNames nurAttrs))));
4745

4846
in
49-
5047
rec {
5148
buildPkgs = filter isBuildable nurPkgs;
5249
cachePkgs = filter isCacheable buildPkgs;

default.nix

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# commands such as:
77
# nix-build -A mypackage
88

9-
{ pkgs ? import <nixpkgs> {} }:
9+
{ pkgs ? import <nixpkgs> { } }:
1010

1111
{
1212
# The `lib`, `modules`, and `overlay` names are special
@@ -18,4 +18,3 @@
1818
# some-qt5-package = pkgs.libsForQt5.callPackage ./pkgs/some-qt5-package { };
1919
# ...
2020
}
21-

lib/default.nix

-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,3 @@ with pkgs.lib; {
55
#
66
# hexint = x: hexvals.${toLower x};
77
}
8-

modules/default.nix

-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,3 @@
33
#
44
# my-module = ./my-module;
55
}
6-

overlay.nix

+3-6
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,13 @@
33
# configuration.
44

55
self: super:
6-
76
let
8-
97
isReserved = n: n == "lib" || n == "overlays" || n == "modules";
108
nameValuePair = n: v: { name = n; value = v; };
119
nurAttrs = import ./default.nix { pkgs = super; };
1210

1311
in
14-
15-
builtins.listToAttrs
12+
builtins.listToAttrs
1613
(map (n: nameValuePair n nurAttrs.${n})
17-
(builtins.filter (n: !isReserved n)
18-
(builtins.attrNames nurAttrs)))
14+
(builtins.filter (n: !isReserved n)
15+
(builtins.attrNames nurAttrs)))

overlays/default.nix

-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,3 @@
33
#
44
# my-overlay = import ./my-overlay;
55
}
6-

pkgs/example-package/default.nix

-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,3 @@ stdenv.mkDerivation rec {
77
buildPhase = "echo echo Hello World > example";
88
installPhase = "install -Dm755 example $out";
99
}
10-

0 commit comments

Comments
 (0)