1
0
Fork 0
mirror of https://github.com/NixOS/nix-pills synced 2024-09-19 04:00:13 -04:00

Merge pull request #232 from dasJ/fix/formatting

treewide: Format all Nix code according to RFC-166
This commit is contained in:
John Ericson 2024-03-31 00:27:40 -04:00 committed by GitHub
commit 2355217790
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
24 changed files with 212 additions and 111 deletions

View file

@ -1,7 +1,7 @@
let let
pkgs = import <nixpkgs> {}; pkgs = import <nixpkgs> { };
in in
pkgs.stdenv.mkDerivation { pkgs.stdenv.mkDerivation {
name = "simple"; name = "simple";
builder = "${pkgs.bash}/bin/bash"; builder = "${pkgs.bash}/bin/bash";
args = [ ./simple_builder.sh ]; args = [ ./simple_builder.sh ];

View file

@ -1,7 +1,7 @@
let let
pkgs = import <nixpkgs> {}; pkgs = import <nixpkgs> { };
in in
pkgs.stdenv.mkDerivation { pkgs.stdenv.mkDerivation {
name = "simple"; name = "simple";
builder = "${pkgs.bash}/bin/bash"; builder = "${pkgs.bash}/bin/bash";
args = [ ./simple_builder.sh ]; args = [ ./simple_builder.sh ];

View file

@ -1,10 +1,21 @@
pkgs: attrs: pkgs: attrs:
let defaultAttrs = { let
defaultAttrs = {
builder = "${pkgs.bash}/bin/bash"; builder = "${pkgs.bash}/bin/bash";
args = [ ./builder.sh ]; args = [ ./builder.sh ];
baseInputs = with pkgs; [ gnutar gzip gnumake gcc coreutils gawk gnused gnugrep binutils.bintools ]; baseInputs = with pkgs; [
buildInputs = []; gnutar
gzip
gnumake
gcc
coreutils
gawk
gnused
gnugrep
binutils.bintools
];
buildInputs = [ ];
system = builtins.currentSystem; system = builtins.currentSystem;
}; };
in in
derivation (defaultAttrs // attrs) derivation (defaultAttrs // attrs)

View file

@ -1,13 +1,21 @@
let let
pkgs = import <nixpkgs> {}; pkgs = import <nixpkgs> { };
in in
derivation { derivation {
name = "hello"; name = "hello";
builder = "${pkgs.bash}/bin/bash"; builder = "${pkgs.bash}/bin/bash";
args = [ ./hello_builder.sh ]; args = [ ./hello_builder.sh ];
inherit (pkgs) gnutar gzip gnumake coreutils gawk gnused gnugrep; inherit (pkgs)
gnutar
gzip
gnumake
coreutils
gawk
gnused
gnugrep
;
gcc = pkgs.clang; gcc = pkgs.clang;
bintools = pkgs.clang.bintools.bintools_bin; bintools = pkgs.clang.bintools.bintools_bin;
src = ./hello-2.12.1.tar.gz; src = ./hello-2.12.1.tar.gz;
system = builtins.currentSystem; system = builtins.currentSystem;
} }

View file

@ -1,11 +1,21 @@
let let
pkgs = import <nixpkgs> {}; pkgs = import <nixpkgs> { };
in in
derivation { derivation {
name = "hello"; name = "hello";
builder = "${pkgs.bash}/bin/bash"; builder = "${pkgs.bash}/bin/bash";
args = [ ./builder.sh ]; args = [ ./builder.sh ];
buildInputs = with pkgs; [ gnutar gzip gnumake gcc coreutils gawk gnused gnugrep binutils.bintools ]; buildInputs = with pkgs; [
gnutar
gzip
gnumake
gcc
coreutils
gawk
gnused
gnugrep
binutils.bintools
];
src = ./hello-2.12.1.tar.gz; src = ./hello-2.12.1.tar.gz;
system = builtins.currentSystem; system = builtins.currentSystem;
} }

View file

@ -1,8 +1,8 @@
let let
pkgs = import <nixpkgs> {}; pkgs = import <nixpkgs> { };
mkDerivation = import ./autotools.nix pkgs; mkDerivation = import ./autotools.nix pkgs;
in in
mkDerivation { mkDerivation {
name = "hello"; name = "hello";
src = ./hello-2.12.1.tar.gz; src = ./hello-2.12.1.tar.gz;
} }

View file

@ -1,12 +1,21 @@
let let
pkgs = import <nixpkgs> {}; pkgs = import <nixpkgs> { };
in in
derivation { derivation {
name = "hello"; name = "hello";
builder = "${pkgs.bash}/bin/bash"; builder = "${pkgs.bash}/bin/bash";
args = [ ./hello_builder.sh ]; args = [ ./hello_builder.sh ];
inherit (pkgs) gnutar gzip gnumake gcc coreutils gawk gnused gnugrep; inherit (pkgs)
gnutar
gzip
gnumake
gcc
coreutils
gawk
gnused
gnugrep
;
bintools = pkgs.binutils.bintools; bintools = pkgs.binutils.bintools;
src = ./hello-2.12.1.tar.gz; src = ./hello-2.12.1.tar.gz;
system = builtins.currentSystem; system = builtins.currentSystem;
} }

View file

@ -1,12 +1,24 @@
pkgs: attrs: pkgs: attrs:
let defaultAttrs = { let
defaultAttrs = {
builder = "${pkgs.bash}/bin/bash"; builder = "${pkgs.bash}/bin/bash";
args = [ ./builder.sh ]; args = [ ./builder.sh ];
setup = ./setup.sh; setup = ./setup.sh;
baseInputs = with pkgs; [ gnutar gzip gnumake gcc coreutils gawk gnused gnugrep binutils.bintools patchelf findutils ]; baseInputs = with pkgs; [
buildInputs = []; gnutar
gzip
gnumake
gcc
coreutils
gawk
gnused
gnugrep
binutils.bintools
patchelf
findutils
];
buildInputs = [ ];
system = builtins.currentSystem; system = builtins.currentSystem;
}; };
in in
derivation (defaultAttrs // attrs) derivation (defaultAttrs // attrs)

View file

@ -1,7 +1,8 @@
let let
pkgs = import <nixpkgs> {}; pkgs = import <nixpkgs> { };
mkDerivation = import ./autotools.nix pkgs; mkDerivation = import ./autotools.nix pkgs;
in mkDerivation { in
mkDerivation {
name = "hello"; name = "hello";
src = ./hello-2.12.1.tar.gz; src = ./hello-2.12.1.tar.gz;
} }

View file

@ -1,7 +1,8 @@
let let
pkgs = import <nixpkgs> {}; pkgs = import <nixpkgs> { };
mkDerivation = import ./autotools.nix pkgs; mkDerivation = import ./autotools.nix pkgs;
in mkDerivation { in
mkDerivation {
name = "graphviz"; name = "graphviz";
src = ./graphviz-2.49.3.tar.gz; src = ./graphviz-2.49.3.tar.gz;
} }

View file

@ -1,7 +1,8 @@
let let
pkgs = import <nixpkgs> {}; pkgs = import <nixpkgs> { };
mkDerivation = import ./autotools.nix pkgs; mkDerivation = import ./autotools.nix pkgs;
in mkDerivation { in
mkDerivation {
name = "graphviz"; name = "graphviz";
src = ./graphviz-2.49.3.tar.gz; src = ./graphviz-2.49.3.tar.gz;
buildInputs = with pkgs; [ buildInputs = with pkgs; [

View file

@ -1,11 +1,25 @@
let let
pkgs = import <nixpkgs> {}; pkgs = import <nixpkgs> { };
mkDerivation = import ./autotools.nix pkgs; mkDerivation = import ./autotools.nix pkgs;
in with pkgs; { in
with pkgs;
{
hello = import ./hello.nix { inherit mkDerivation; }; hello = import ./hello.nix { inherit mkDerivation; };
graphviz = import ./graphviz.nix { inherit mkDerivation lib gd pkg-config; }; graphviz = import ./graphviz.nix {
inherit
mkDerivation
lib
gd
pkg-config
;
};
graphvizCore = import ./graphviz.nix { graphvizCore = import ./graphviz.nix {
inherit mkDerivation lib gd pkg-config; inherit
mkDerivation
lib
gd
pkg-config
;
gdSupport = false; gdSupport = false;
}; };
} }

View file

@ -1,13 +1,17 @@
let let
nixpkgs = import <nixpkgs> {}; nixpkgs = import <nixpkgs> { };
allPkgs = nixpkgs // pkgs; allPkgs = nixpkgs // pkgs;
callPackage = path: overrides: callPackage =
let f = import path; path: overrides:
in f ((builtins.intersectAttrs (builtins.functionArgs f) allPkgs) // overrides); let
f = import path;
in
f ((builtins.intersectAttrs (builtins.functionArgs f) allPkgs) // overrides);
pkgs = with nixpkgs; { pkgs = with nixpkgs; {
mkDerivation = import ./autotools.nix nixpkgs; mkDerivation = import ./autotools.nix nixpkgs;
hello = callPackage ./hello.nix { }; hello = callPackage ./hello.nix { };
graphviz = callPackage ./graphviz.nix { }; graphviz = callPackage ./graphviz.nix { };
graphvizCore = callPackage ./graphviz.nix { gdSupport = false; }; graphvizCore = callPackage ./graphviz.nix { gdSupport = false; };
}; };
in pkgs in
pkgs

View file

@ -1,4 +1,4 @@
rec { rec {
lib1 = import package1.nix { inherit input1 input2 ...; }; lib1 = import package1.nix { inherit input1 input2; };
program2 = import package2.nix { inherit inputX inputY lib1 ...; }; program2 = import package2.nix { inherit inputX inputY lib1; };
} }

View file

@ -1,5 +1,6 @@
{ {
makeOverridable = f: origArgs: makeOverridable =
f: origArgs:
let let
origRes = f origArgs; origRes = f origArgs;
in in

View file

@ -1,4 +1,11 @@
mygraphviz = import ./graphviz.nix { {
inherit mkDerivation fontconfig libjpeg bzip2; mygraphviz = import ./graphviz.nix {
inherit
mkDerivation
fontconfig
libjpeg
bzip2
;
gd = customgd; gd = customgd;
}; };
}

View file

@ -1,5 +1,6 @@
rec { rec {
makeOverridable = f: origArgs: makeOverridable =
f: origArgs:
let let
origRes = f origArgs; origRes = f origArgs;
in in

View file

@ -1,5 +1,8 @@
{ {
packageOverrides = pkgs: { packageOverrides = pkgs: {
graphviz = pkgs.graphviz.override { withXorg = false; }; graphviz = pkgs.graphviz.override {
# disable xorg support
withXorg = false;
};
}; };
} }

View file

@ -1,2 +1,9 @@
# Take a function and evaluate it with its own returned value. {
fix = f: let result = f result; in result; # Take a function and evaluate it with its own returned value.
fix =
f:
let
result = f result;
in
result;
}

View file

@ -1,4 +1,4 @@
with import <nixpkgs> {}; with import <nixpkgs> { };
stdenv.mkDerivation { stdenv.mkDerivation {
name = "hello"; name = "hello";
src = ./hello-2.10.tar.gz; src = ./hello-2.10.tar.gz;

View file

@ -1,7 +1,11 @@
{ {
... # ...
builder = attrs.realBuilder or shell; builder = attrs.realBuilder or shell;
args = attrs.args or ["-e" (attrs.builder or ./default-builder.sh)]; args =
attrs.args or [
"-e"
(attrs.builder or ./default-builder.sh)
];
stdenv = result; stdenv = result;
... # ...
} }

View file

@ -1,6 +1,6 @@
let let
nixpkgs = import <nixpkgs> {}; nixpkgs = import <nixpkgs> { };
inherit (nixpkgs) stdenv fetchurl which; inherit (nixpkgs) stdenv fetchurl which;
@ -8,7 +8,7 @@ let
name = "hello-2.3"; name = "hello-2.3";
src = fetchurl { src = fetchurl {
url = mirror://gnu/hello/hello-2.3.tar.bz2; url = "mirror://gnu/hello/hello-2.3.tar.bz2";
sha256 = "0c7vijq8y68bpr7g6dh1gny0bff8qq81vnp4ch8pjzvg56wb3js1"; sha256 = "0c7vijq8y68bpr7g6dh1gny0bff8qq81vnp4ch8pjzvg56wb3js1";
}; };
}; };
@ -28,7 +28,10 @@ let
wrappedHello = stdenv.mkDerivation { wrappedHello = stdenv.mkDerivation {
name = "hello-wrapper"; name = "hello-wrapper";
buildInputs = [ intermediary which ]; buildInputs = [
intermediary
which
];
unpackPhase = "true"; unpackPhase = "true";
@ -39,5 +42,5 @@ let
chmod 0755 "$out/bin/hello" chmod 0755 "$out/bin/hello"
''; '';
}; };
in
in wrappedHello wrappedHello

View file

@ -1,6 +1,6 @@
let let
nixpkgs = import <nixpkgs> {}; nixpkgs = import <nixpkgs> { };
inherit (nixpkgs) stdenv fetchurl which; inherit (nixpkgs) stdenv fetchurl which;
@ -8,7 +8,7 @@ let
name = "hello-2.3"; name = "hello-2.3";
src = fetchurl { src = fetchurl {
url = mirror://gnu/hello/hello-2.3.tar.bz2; url = "mirror://gnu/hello/hello-2.3.tar.bz2";
sha256 = "0c7vijq8y68bpr7g6dh1gny0bff8qq81vnp4ch8pjzvg56wb3js1"; sha256 = "0c7vijq8y68bpr7g6dh1gny0bff8qq81vnp4ch8pjzvg56wb3js1";
}; };
}; };
@ -16,7 +16,10 @@ let
wrappedHello = stdenv.mkDerivation { wrappedHello = stdenv.mkDerivation {
name = "hello-wrapper"; name = "hello-wrapper";
buildInputs = [ actualHello which ]; buildInputs = [
actualHello
which
];
unpackPhase = "true"; unpackPhase = "true";
@ -27,5 +30,6 @@ let
chmod 0755 "$out/bin/hello" chmod 0755 "$out/bin/hello"
''; '';
}; };
in
wrappedHello
in wrappedHello