1
0
Fork 0
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:
Janne Heß 2024-03-30 10:54:12 +01:00
parent 102ef96805
commit 14736fe159
No known key found for this signature in database
24 changed files with 212 additions and 111 deletions

View file

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

View file

@ -5,7 +5,15 @@ in
name = "hello";
builder = "${pkgs.bash}/bin/bash";
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;
bintools = pkgs.clang.bintools.bintools_bin;
src = ./hello-2.12.1.tar.gz;

View file

@ -5,7 +5,17 @@ in
name = "hello";
builder = "${pkgs.bash}/bin/bash";
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;
system = builtins.currentSystem;
}

View file

@ -5,7 +5,16 @@ in
name = "hello";
builder = "${pkgs.bash}/bin/bash";
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;
src = ./hello-2.12.1.tar.gz;
system = builtins.currentSystem;

View file

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

View file

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

View file

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

View file

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

View file

@ -1,11 +1,25 @@
let
pkgs = import <nixpkgs> { };
mkDerivation = import ./autotools.nix pkgs;
in with pkgs; {
in
with pkgs;
{
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 {
inherit mkDerivation lib gd pkg-config;
inherit
mkDerivation
lib
gd
pkg-config
;
gdSupport = false;
};
}

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,5 +1,8 @@
{
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;
fix =
f:
let
result = f result;
in
result;
}

View file

@ -1,7 +1,11 @@
{
...
# ...
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;
...
# ...
}

View file

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

View file

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