mirror of
https://github.com/NixOS/nix-pills
synced 2024-09-19 04:00:13 -04:00
treewide: Format all Nix code according to RFC-166
This commit is contained in:
parent
102ef96805
commit
14736fe159
|
@ -1,12 +1,12 @@
|
||||||
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 ];
|
||||||
gcc = pkgs.gcc;
|
gcc = pkgs.gcc;
|
||||||
coreutils = pkgs.coreutils;
|
coreutils = pkgs.coreutils;
|
||||||
src = ./simple.c;
|
src = ./simple.c;
|
||||||
system = builtins.currentSystem;
|
system = builtins.currentSystem;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
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 ];
|
||||||
inherit (pkgs) gcc coreutils;
|
inherit (pkgs) gcc coreutils;
|
||||||
src = ./simple.c;
|
src = ./simple.c;
|
||||||
system = builtins.currentSystem;
|
system = builtins.currentSystem;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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)
|
||||||
|
|
|
@ -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)
|
||||||
gcc = pkgs.clang;
|
gnutar
|
||||||
bintools = pkgs.clang.bintools.bintools_bin;
|
gzip
|
||||||
src = ./hello-2.12.1.tar.gz;
|
gnumake
|
||||||
system = builtins.currentSystem;
|
coreutils
|
||||||
}
|
gawk
|
||||||
|
gnused
|
||||||
|
gnugrep
|
||||||
|
;
|
||||||
|
gcc = pkgs.clang;
|
||||||
|
bintools = pkgs.clang.bintools.bintools_bin;
|
||||||
|
src = ./hello-2.12.1.tar.gz;
|
||||||
|
system = builtins.currentSystem;
|
||||||
|
}
|
||||||
|
|
|
@ -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; [
|
||||||
src = ./hello-2.12.1.tar.gz;
|
gnutar
|
||||||
system = builtins.currentSystem;
|
gzip
|
||||||
}
|
gnumake
|
||||||
|
gcc
|
||||||
|
coreutils
|
||||||
|
gawk
|
||||||
|
gnused
|
||||||
|
gnugrep
|
||||||
|
binutils.bintools
|
||||||
|
];
|
||||||
|
src = ./hello-2.12.1.tar.gz;
|
||||||
|
system = builtins.currentSystem;
|
||||||
|
}
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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)
|
||||||
bintools = pkgs.binutils.bintools;
|
gnutar
|
||||||
src = ./hello-2.12.1.tar.gz;
|
gzip
|
||||||
system = builtins.currentSystem;
|
gnumake
|
||||||
}
|
gcc
|
||||||
|
coreutils
|
||||||
|
gawk
|
||||||
|
gnused
|
||||||
|
gnugrep
|
||||||
|
;
|
||||||
|
bintools = pkgs.binutils.bintools;
|
||||||
|
src = ./hello-2.12.1.tar.gz;
|
||||||
|
system = builtins.currentSystem;
|
||||||
|
}
|
||||||
|
|
|
@ -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)
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
name = "hello";
|
mkDerivation {
|
||||||
src = ./hello-2.12.1.tar.gz;
|
name = "hello";
|
||||||
}
|
src = ./hello-2.12.1.tar.gz;
|
||||||
|
}
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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; [
|
||||||
|
|
|
@ -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;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{
|
{
|
||||||
hello = import ./hello.nix;
|
hello = import ./hello.nix;
|
||||||
graphviz = import ./graphviz.nix;
|
graphviz = import ./graphviz.nix;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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; };
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
{
|
{
|
||||||
makeOverridable = f: origArgs:
|
makeOverridable =
|
||||||
|
f: origArgs:
|
||||||
let
|
let
|
||||||
origRes = f origArgs;
|
origRes = f origArgs;
|
||||||
in
|
in
|
||||||
origRes // { override = newArgs: f (origArgs // newArgs); };
|
origRes // { override = newArgs: f (origArgs // newArgs); };
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,11 @@
|
||||||
mygraphviz = import ./graphviz.nix {
|
{
|
||||||
inherit mkDerivation fontconfig libjpeg bzip2;
|
mygraphviz = import ./graphviz.nix {
|
||||||
gd = customgd;
|
inherit
|
||||||
};
|
mkDerivation
|
||||||
|
fontconfig
|
||||||
|
libjpeg
|
||||||
|
bzip2
|
||||||
|
;
|
||||||
|
gd = customgd;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
rec {
|
rec {
|
||||||
makeOverridable = f: origArgs:
|
makeOverridable =
|
||||||
|
f: origArgs:
|
||||||
let
|
let
|
||||||
origRes = f origArgs;
|
origRes = f origArgs;
|
||||||
in
|
in
|
||||||
origRes // { override = newArgs: makeOverridable f (origArgs // newArgs); };
|
origRes // { override = newArgs: makeOverridable f (origArgs // newArgs); };
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
{
|
{
|
||||||
packageOverrides = pkgs: {
|
packageOverrides = pkgs: {
|
||||||
graphviz = pkgs.graphviz.override { withXorg = false; };
|
graphviz = pkgs.graphviz.override {
|
||||||
|
# disable xorg support
|
||||||
|
withXorg = false;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
||||||
|
}
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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;
|
||||||
...
|
# ...
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
|
||||||
|
|
Loading…
Reference in a new issue