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,12 +1,12 @@
let
pkgs = import <nixpkgs> {};
pkgs = import <nixpkgs> { };
in
pkgs.stdenv.mkDerivation {
name = "simple";
builder = "${pkgs.bash}/bin/bash";
args = [ ./simple_builder.sh ];
gcc = pkgs.gcc;
coreutils = pkgs.coreutils;
src = ./simple.c;
system = builtins.currentSystem;
}
pkgs.stdenv.mkDerivation {
name = "simple";
builder = "${pkgs.bash}/bin/bash";
args = [ ./simple_builder.sh ];
gcc = pkgs.gcc;
coreutils = pkgs.coreutils;
src = ./simple.c;
system = builtins.currentSystem;
}

View file

@ -1,11 +1,11 @@
let
pkgs = import <nixpkgs> {};
pkgs = import <nixpkgs> { };
in
pkgs.stdenv.mkDerivation {
name = "simple";
builder = "${pkgs.bash}/bin/bash";
args = [ ./simple_builder.sh ];
inherit (pkgs) gcc coreutils;
src = ./simple.c;
system = builtins.currentSystem;
}
pkgs.stdenv.mkDerivation {
name = "simple";
builder = "${pkgs.bash}/bin/bash";
args = [ ./simple_builder.sh ];
inherit (pkgs) gcc coreutils;
src = ./simple.c;
system = builtins.currentSystem;
}

View file

@ -1,10 +1,21 @@
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 ];
buildInputs = [];
baseInputs = with pkgs; [
gnutar
gzip
gnumake
gcc
coreutils
gawk
gnused
gnugrep
binutils.bintools
];
buildInputs = [ ];
system = builtins.currentSystem;
};
in
derivation (defaultAttrs // attrs)
in
derivation (defaultAttrs // attrs)

View file

@ -1,13 +1,21 @@
let
pkgs = import <nixpkgs> {};
pkgs = import <nixpkgs> { };
in
derivation {
name = "hello";
builder = "${pkgs.bash}/bin/bash";
args = [ ./hello_builder.sh ];
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;
system = builtins.currentSystem;
}
derivation {
name = "hello";
builder = "${pkgs.bash}/bin/bash";
args = [ ./hello_builder.sh ];
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;
system = builtins.currentSystem;
}

View file

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

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

View file

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

View file

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

View file

@ -1,7 +1,8 @@
let
pkgs = import <nixpkgs> {};
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> {};
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> {};
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,4 +1,4 @@
{
hello = import ./hello.nix;
hello = import ./hello.nix;
graphviz = import ./graphviz.nix;
}

View file

@ -1,13 +1,17 @@
let
nixpkgs = import <nixpkgs> {};
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,7 +1,8 @@
{
makeOverridable = f: origArgs:
makeOverridable =
f: origArgs:
let
origRes = f origArgs;
in
origRes // { override = newArgs: f (origArgs // newArgs); };
origRes // { override = newArgs: f (origArgs // newArgs); };
}

View file

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

View file

@ -1,7 +1,8 @@
rec {
makeOverridable = f: origArgs:
makeOverridable =
f: origArgs:
let
origRes = f origArgs;
in
origRes // { override = newArgs: makeOverridable f (origArgs // newArgs); };
origRes // { override = newArgs: makeOverridable f (origArgs // newArgs); };
}

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;
{
# 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 {
name = "hello";
src = ./hello-2.10.tar.gz;

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

@ -1,6 +1,6 @@
let
nixpkgs = import <nixpkgs> {};
nixpkgs = import <nixpkgs> { };
inherit (nixpkgs) stdenv fetchurl which;
@ -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

@ -1,6 +1,6 @@
let
nixpkgs = import <nixpkgs> {};
nixpkgs = import <nixpkgs> { };
inherit (nixpkgs) stdenv fetchurl which;
@ -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