treewide: format all inactive Nix files

After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.

Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.

A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.

This commit was automatically created and can be verified using

    nix-build https://github.com/infinisil/treewide-nixpkgs-reformat-script/archive/a08b3a4d199c6124ac5b36a889d9099b4383463f.tar.gz \
      --argstr baseRev b32a094368
    result/bin/apply-formatting $NIXPKGS_PATH
This commit is contained in:
Silvan Mosberger
2024-12-10 20:26:33 +01:00
parent b32a094368
commit 4f0dadbf38
21293 changed files with 701276 additions and 428232 deletions
+16 -4
View File
@@ -1,16 +1,25 @@
{ lib, stdenv, fetchurl, automake, autoconf }:
{
lib,
stdenv,
fetchurl,
automake,
autoconf,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "avr-libc";
version = "2.2.1";
tag_version = builtins.replaceStrings ["."] ["_"] finalAttrs.version;
tag_version = builtins.replaceStrings [ "." ] [ "_" ] finalAttrs.version;
src = fetchurl {
url = "https://github.com/avrdudes/avr-libc/releases/download/avr-libc-${finalAttrs.tag_version}-release/avr-libc-${finalAttrs.version}.tar.bz2";
hash = "sha256-AGpjBsu8k4w721g6xU+T/n18jPl/nN6R+RxvsCc6tGU=";
};
nativeBuildInputs = [ automake autoconf ];
nativeBuildInputs = [
automake
autoconf
];
# Make sure we don't strip the libraries in lib/gcc/avr.
stripDebugList = [ "bin" ];
@@ -28,6 +37,9 @@ stdenv.mkDerivation (finalAttrs: {
changelog = "https://github.com/avrdudes/avr-libc/blob/avr-libc-${finalAttrs.tag_version}-release/NEWS";
license = licenses.bsd3;
platforms = [ "avr-none" ];
maintainers = with maintainers; [ mguentner emilytrau ];
maintainers = with maintainers; [
mguentner
emilytrau
];
};
})
+12 -7
View File
@@ -1,12 +1,14 @@
{ lib
, stdenv
, cmake
, fetchFromGitHub
, withFilters ? false
{
lib,
stdenv,
cmake,
fetchFromGitHub,
withFilters ? false,
}:
let
generic = { version, hash }:
generic =
{ version, hash }:
stdenv.mkDerivation rec {
inherit version;
pname = "h3";
@@ -18,7 +20,10 @@ let
inherit hash;
};
outputs = [ "out" "dev" ];
outputs = [
"out"
"dev"
];
nativeBuildInputs = [ cmake ];
@@ -1,7 +1,21 @@
{ mkDerivation, base, bytestring, cabal-install-parsers
, Cabal-syntax, containers, directory, fetchFromGitea, filepath
, generic-lens-lite, lib, mtl, optparse-applicative, parsec, pretty
, regex-applicative, frontmatter
{
mkDerivation,
base,
bytestring,
cabal-install-parsers,
Cabal-syntax,
containers,
directory,
fetchFromGitea,
filepath,
generic-lens-lite,
lib,
mtl,
optparse-applicative,
parsec,
pretty,
regex-applicative,
frontmatter,
}:
mkDerivation rec {
pname = "changelog-d";
@@ -16,12 +30,26 @@ mkDerivation rec {
isLibrary = false;
isExecutable = true;
libraryHaskellDepends = [
base bytestring cabal-install-parsers Cabal-syntax containers
directory filepath generic-lens-lite mtl parsec pretty
regex-applicative frontmatter
base
bytestring
cabal-install-parsers
Cabal-syntax
containers
directory
filepath
generic-lens-lite
mtl
parsec
pretty
regex-applicative
frontmatter
];
executableHaskellDepends = [
base bytestring Cabal-syntax directory filepath
base
bytestring
Cabal-syntax
directory
filepath
optparse-applicative
];
doHaddock = false;
@@ -1,8 +1,18 @@
# This has been automatically generated by the script
# ./update.sh. This should not be changed by hand.
{ mkDerivation, aeson, aeson-casing, base, fetchgit, hashable
, hpack, lib, template-haskell, text, th-lift-instances
, unordered-containers
{
mkDerivation,
aeson,
aeson-casing,
base,
fetchgit,
hashable,
hpack,
lib,
template-haskell,
text,
th-lift-instances,
unordered-containers,
}:
mkDerivation {
pname = "ci-info";
@@ -14,8 +24,14 @@ mkDerivation {
fetchSubmodules = true;
};
libraryHaskellDepends = [
aeson aeson-casing base hashable template-haskell text
th-lift-instances unordered-containers
aeson
aeson-casing
base
hashable
template-haskell
text
th-lift-instances
unordered-containers
];
libraryToolDepends = [ hpack ];
prePatch = "hpack";
@@ -1,9 +1,26 @@
# This has been automatically generated by the script
# ./update.sh. This should not be changed by hand.
{ mkDerivation, async, atomic-primops, base, containers, criterion
, fetchgit, ghc-prim, hashable, hspec, hspec-smallcheck, HUnit
, inspection-testing, lib, markdown-unlit, primitive, QuickCheck
, smallcheck, text, unordered-containers
{
mkDerivation,
async,
atomic-primops,
base,
containers,
criterion,
fetchgit,
ghc-prim,
hashable,
hspec,
hspec-smallcheck,
HUnit,
inspection-testing,
lib,
markdown-unlit,
primitive,
QuickCheck,
smallcheck,
text,
unordered-containers,
}:
mkDerivation {
pname = "ekg-core";
@@ -15,16 +32,39 @@ mkDerivation {
fetchSubmodules = true;
};
libraryHaskellDepends = [
atomic-primops base containers ghc-prim hashable inspection-testing
primitive text unordered-containers
atomic-primops
base
containers
ghc-prim
hashable
inspection-testing
primitive
text
unordered-containers
];
testHaskellDepends = [
async atomic-primops base containers ghc-prim hashable hspec
hspec-smallcheck HUnit inspection-testing markdown-unlit primitive
QuickCheck smallcheck text unordered-containers
async
atomic-primops
base
containers
ghc-prim
hashable
hspec
hspec-smallcheck
HUnit
inspection-testing
markdown-unlit
primitive
QuickCheck
smallcheck
text
unordered-containers
];
testToolDepends = [ markdown-unlit ];
benchmarkHaskellDepends = [ base criterion ];
benchmarkHaskellDepends = [
base
criterion
];
doHaddock = false;
homepage = "https://github.com/tibbe/ekg-core";
description = "Tracking of system metrics";
@@ -1,7 +1,16 @@
# This has been automatically generated by the script
# ./update.sh. This should not be changed by hand.
{ mkDerivation, aeson, base, ekg-core, fetchgit, hspec, lib, text
, unordered-containers, vector
{
mkDerivation,
aeson,
base,
ekg-core,
fetchgit,
hspec,
lib,
text,
unordered-containers,
vector,
}:
mkDerivation {
pname = "ekg-json";
@@ -13,10 +22,20 @@ mkDerivation {
fetchSubmodules = true;
};
libraryHaskellDepends = [
aeson base ekg-core text unordered-containers vector
aeson
base
ekg-core
text
unordered-containers
vector
];
testHaskellDepends = [
aeson base ekg-core hspec text unordered-containers
aeson
base
ekg-core
hspec
text
unordered-containers
];
homepage = "https://github.com/tibbe/ekg-json";
description = "JSON encoding of ekg metrics";
@@ -1,36 +1,160 @@
# This has been automatically generated by the script
# ./update.sh. This should not be changed by hand.
{ mkDerivation, aeson, aeson-casing, aeson-qq, ansi-wl-pprint
, asn1-encoding, asn1-types, async, attoparsec, attoparsec-iso8601
, auto-update, base, base16-bytestring, base64-bytestring, binary
, byteorder, bytestring, case-insensitive, ci-info, conduit
, connection, containers, cron, cryptonite, data-default-class
, data-has, deepseq, dependent-map, dependent-sum, directory
, either, ekg-core, ekg-json, exceptions, fast-logger, fetchgit
, file-embed, filepath, ghc-heap-view, graphql-parser, hashable
, hashable-time, haskell-src-meta, hedgehog, hspec, hspec-core
, hspec-discover, hspec-expectations, hspec-expectations-lifted
, hspec-hedgehog, hspec-wai, hspec-wai-json, http-api-data
, http-client, http-client-tls, http-conduit, http-media
, http-types, immortal, insert-ordered-containers, jose
, kan-extensions, kriti-lang, lens, lens-aeson, lib, libyaml
, lifted-async, lifted-base, list-t, memory, mime-types, mmorph
, monad-control, monad-logger, monad-loops, monad-validate, mtl
, mustache, mysql, mysql-simple, natural-transformation, network
, network-uri, odbc, openapi3, optparse-applicative
, optparse-generic, parsec, pem, pg-client, postgresql-binary
, postgresql-libpq, postgresql-simple, pretty-simple, process
, profunctors, psqueues, QuickCheck, quickcheck-instances, random
, regex-tdfa, resource-pool, resourcet, retry, safe
, safe-exceptions, scientific, semialign, semigroups, semver
, shakespeare, some, split, Spock-core, stm, stm-containers, tagged
, template-haskell, text, text-builder, text-conversions, th-lift
, th-lift-instances, these, time, tls, tmp-postgres, transformers
, transformers-base, typed-process, unix, unliftio-core
, unordered-containers, uri-bytestring, uri-encode, url
, utf8-string, uuid, validation, vector, vector-instances, wai
, wai-extra, warp, websockets, witch, wreq, x509, x509-store
, x509-system, x509-validation, yaml, zlib
{
mkDerivation,
aeson,
aeson-casing,
aeson-qq,
ansi-wl-pprint,
asn1-encoding,
asn1-types,
async,
attoparsec,
attoparsec-iso8601,
auto-update,
base,
base16-bytestring,
base64-bytestring,
binary,
byteorder,
bytestring,
case-insensitive,
ci-info,
conduit,
connection,
containers,
cron,
cryptonite,
data-default-class,
data-has,
deepseq,
dependent-map,
dependent-sum,
directory,
either,
ekg-core,
ekg-json,
exceptions,
fast-logger,
fetchgit,
file-embed,
filepath,
ghc-heap-view,
graphql-parser,
hashable,
hashable-time,
haskell-src-meta,
hedgehog,
hspec,
hspec-core,
hspec-discover,
hspec-expectations,
hspec-expectations-lifted,
hspec-hedgehog,
hspec-wai,
hspec-wai-json,
http-api-data,
http-client,
http-client-tls,
http-conduit,
http-media,
http-types,
immortal,
insert-ordered-containers,
jose,
kan-extensions,
kriti-lang,
lens,
lens-aeson,
lib,
libyaml,
lifted-async,
lifted-base,
list-t,
memory,
mime-types,
mmorph,
monad-control,
monad-logger,
monad-loops,
monad-validate,
mtl,
mustache,
mysql,
mysql-simple,
natural-transformation,
network,
network-uri,
odbc,
openapi3,
optparse-applicative,
optparse-generic,
parsec,
pem,
pg-client,
postgresql-binary,
postgresql-libpq,
postgresql-simple,
pretty-simple,
process,
profunctors,
psqueues,
QuickCheck,
quickcheck-instances,
random,
regex-tdfa,
resource-pool,
resourcet,
retry,
safe,
safe-exceptions,
scientific,
semialign,
semigroups,
semver,
shakespeare,
some,
split,
Spock-core,
stm,
stm-containers,
tagged,
template-haskell,
text,
text-builder,
text-conversions,
th-lift,
th-lift-instances,
these,
time,
tls,
tmp-postgres,
transformers,
transformers-base,
typed-process,
unix,
unliftio-core,
unordered-containers,
uri-bytestring,
uri-encode,
url,
utf8-string,
uuid,
validation,
vector,
vector-instances,
wai,
wai-extra,
warp,
websockets,
witch,
wreq,
x509,
x509-store,
x509-system,
x509-validation,
yaml,
zlib,
}:
mkDerivation {
pname = "graphql-engine";
@@ -45,50 +169,228 @@ mkDerivation {
isLibrary = true;
isExecutable = true;
libraryHaskellDepends = [
aeson aeson-casing ansi-wl-pprint asn1-encoding asn1-types async
attoparsec attoparsec-iso8601 auto-update base base16-bytestring
base64-bytestring binary byteorder bytestring case-insensitive
ci-info connection containers cron cryptonite data-default-class
data-has deepseq dependent-map dependent-sum directory either
ekg-core ekg-json exceptions fast-logger file-embed filepath
ghc-heap-view graphql-parser hashable hashable-time http-api-data
http-client http-client-tls http-conduit http-media http-types
immortal insert-ordered-containers jose kan-extensions kriti-lang
lens lens-aeson lifted-async lifted-base list-t memory mime-types
mmorph monad-control monad-loops monad-validate mtl mustache mysql
mysql-simple network network-uri odbc openapi3 optparse-applicative
optparse-generic parsec pem pg-client postgresql-binary
postgresql-libpq pretty-simple process profunctors psqueues
QuickCheck quickcheck-instances random regex-tdfa resource-pool
retry safe-exceptions scientific semialign semigroups semver
shakespeare some split Spock-core stm stm-containers tagged
template-haskell text text-builder text-conversions these time tls
transformers transformers-base unix unordered-containers
uri-bytestring uri-encode url utf8-string uuid validation vector
vector-instances wai warp websockets witch wreq x509 x509-store
x509-system x509-validation yaml zlib
aeson
aeson-casing
ansi-wl-pprint
asn1-encoding
asn1-types
async
attoparsec
attoparsec-iso8601
auto-update
base
base16-bytestring
base64-bytestring
binary
byteorder
bytestring
case-insensitive
ci-info
connection
containers
cron
cryptonite
data-default-class
data-has
deepseq
dependent-map
dependent-sum
directory
either
ekg-core
ekg-json
exceptions
fast-logger
file-embed
filepath
ghc-heap-view
graphql-parser
hashable
hashable-time
http-api-data
http-client
http-client-tls
http-conduit
http-media
http-types
immortal
insert-ordered-containers
jose
kan-extensions
kriti-lang
lens
lens-aeson
lifted-async
lifted-base
list-t
memory
mime-types
mmorph
monad-control
monad-loops
monad-validate
mtl
mustache
mysql
mysql-simple
network
network-uri
odbc
openapi3
optparse-applicative
optparse-generic
parsec
pem
pg-client
postgresql-binary
postgresql-libpq
pretty-simple
process
profunctors
psqueues
QuickCheck
quickcheck-instances
random
regex-tdfa
resource-pool
retry
safe-exceptions
scientific
semialign
semigroups
semver
shakespeare
some
split
Spock-core
stm
stm-containers
tagged
template-haskell
text
text-builder
text-conversions
these
time
tls
transformers
transformers-base
unix
unordered-containers
uri-bytestring
uri-encode
url
utf8-string
uuid
validation
vector
vector-instances
wai
warp
websockets
witch
wreq
x509
x509-store
x509-system
x509-validation
yaml
zlib
];
executableHaskellDepends = [
base bytestring ekg-core kan-extensions pg-client text
text-conversions time unix
base
bytestring
ekg-core
kan-extensions
pg-client
text
text-conversions
time
unix
];
testHaskellDepends = [
aeson aeson-casing aeson-qq async base bytestring case-insensitive
conduit containers cron dependent-map dependent-sum ekg-core
exceptions graphql-parser haskell-src-meta hedgehog hspec
hspec-core hspec-discover hspec-expectations
hspec-expectations-lifted hspec-hedgehog hspec-wai hspec-wai-json
http-client http-client-tls http-conduit http-types
insert-ordered-containers jose kan-extensions lens lens-aeson
libyaml lifted-base mmorph monad-control monad-logger mtl mysql
mysql-simple natural-transformation network network-uri odbc
optparse-applicative parsec pg-client postgresql-libpq
postgresql-simple process QuickCheck resource-pool resourcet safe
safe-exceptions scientific shakespeare split Spock-core stm
template-haskell text text-conversions th-lift th-lift-instances
time tmp-postgres transformers transformers-base typed-process unix
unliftio-core unordered-containers utf8-string vector wai wai-extra
warp websockets yaml
aeson
aeson-casing
aeson-qq
async
base
bytestring
case-insensitive
conduit
containers
cron
dependent-map
dependent-sum
ekg-core
exceptions
graphql-parser
haskell-src-meta
hedgehog
hspec
hspec-core
hspec-discover
hspec-expectations
hspec-expectations-lifted
hspec-hedgehog
hspec-wai
hspec-wai-json
http-client
http-client-tls
http-conduit
http-types
insert-ordered-containers
jose
kan-extensions
lens
lens-aeson
libyaml
lifted-base
mmorph
monad-control
monad-logger
mtl
mysql
mysql-simple
natural-transformation
network
network-uri
odbc
optparse-applicative
parsec
pg-client
postgresql-libpq
postgresql-simple
process
QuickCheck
resource-pool
resourcet
safe
safe-exceptions
scientific
shakespeare
split
Spock-core
stm
template-haskell
text
text-conversions
th-lift
th-lift-instances
time
tmp-postgres
transformers
transformers-base
typed-process
unix
unliftio-core
unordered-containers
utf8-string
vector
wai
wai-extra
warp
websockets
yaml
];
testToolDepends = [ hspec-discover ];
doCheck = false;
@@ -1,9 +1,24 @@
# This has been automatically generated by the script
# ./update.sh. This should not be changed by hand.
{ mkDerivation, aeson, attoparsec, base, bytestring, deepseq
, fetchgit, hashable, hedgehog, lib, prettyprinter, scientific
, tasty-bench, template-haskell, text, text-builder
, th-lift-instances, unordered-containers
{
mkDerivation,
aeson,
attoparsec,
base,
bytestring,
deepseq,
fetchgit,
hashable,
hedgehog,
lib,
prettyprinter,
scientific,
tasty-bench,
template-haskell,
text,
text-builder,
th-lift-instances,
unordered-containers,
}:
mkDerivation {
pname = "graphql-parser";
@@ -15,15 +30,37 @@ mkDerivation {
fetchSubmodules = true;
};
libraryHaskellDepends = [
aeson attoparsec base bytestring deepseq hashable hedgehog
prettyprinter scientific template-haskell text text-builder
th-lift-instances unordered-containers
aeson
attoparsec
base
bytestring
deepseq
hashable
hedgehog
prettyprinter
scientific
template-haskell
text
text-builder
th-lift-instances
unordered-containers
];
testHaskellDepends = [
attoparsec base bytestring hedgehog prettyprinter text text-builder
attoparsec
base
bytestring
hedgehog
prettyprinter
text
text-builder
];
benchmarkHaskellDepends = [
base bytestring prettyprinter tasty-bench text text-builder
base
bytestring
prettyprinter
tasty-bench
text
text-builder
];
homepage = "https://github.com/hasura/graphql-parser-hs";
description = "Native Haskell GraphQL parser";
@@ -1,12 +1,41 @@
# This has been automatically generated by the script
# ./update.sh. This should not be changed by hand.
{ mkDerivation, aeson, aeson-pretty, alex, array, base, bytestring
, containers, directory, fetchgit, filepath, generic-arbitrary
, happy, hspec, hspec-core, hspec-golden, lens, lens-aeson, lib
, megaparsec, mtl, network-uri, optparse-applicative, parsec
, parser-combinators, pretty-simple, prettyprinter, QuickCheck
, raw-strings-qq, safe-exceptions, scientific, text
, unordered-containers, utf8-string, vector
{
mkDerivation,
aeson,
aeson-pretty,
alex,
array,
base,
bytestring,
containers,
directory,
fetchgit,
filepath,
generic-arbitrary,
happy,
hspec,
hspec-core,
hspec-golden,
lens,
lens-aeson,
lib,
megaparsec,
mtl,
network-uri,
optparse-applicative,
parsec,
parser-combinators,
pretty-simple,
prettyprinter,
QuickCheck,
raw-strings-qq,
safe-exceptions,
scientific,
text,
unordered-containers,
utf8-string,
vector,
}:
mkDerivation {
pname = "kriti-lang";
@@ -20,21 +49,66 @@ mkDerivation {
isLibrary = true;
isExecutable = true;
libraryHaskellDepends = [
aeson array base bytestring containers lens megaparsec mtl
network-uri optparse-applicative parser-combinators prettyprinter
scientific text unordered-containers utf8-string vector
aeson
array
base
bytestring
containers
lens
megaparsec
mtl
network-uri
optparse-applicative
parser-combinators
prettyprinter
scientific
text
unordered-containers
utf8-string
vector
];
libraryToolDepends = [
alex
happy
];
libraryToolDepends = [ alex happy ];
executableHaskellDepends = [
aeson base bytestring containers mtl optparse-applicative
prettyprinter text utf8-string
aeson
base
bytestring
containers
mtl
optparse-applicative
prettyprinter
text
utf8-string
];
testHaskellDepends = [
aeson aeson-pretty base bytestring containers directory filepath
generic-arbitrary hspec hspec-core hspec-golden lens lens-aeson mtl
optparse-applicative parsec pretty-simple prettyprinter QuickCheck
raw-strings-qq safe-exceptions scientific text unordered-containers
utf8-string vector
aeson
aeson-pretty
base
bytestring
containers
directory
filepath
generic-arbitrary
hspec
hspec-core
hspec-golden
lens
lens-aeson
mtl
optparse-applicative
parsec
pretty-simple
prettyprinter
QuickCheck
raw-strings-qq
safe-exceptions
scientific
text
unordered-containers
utf8-string
vector
];
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ lassulus ];
@@ -1,12 +1,40 @@
# This has been automatically generated by the script
# ./update.sh. This should not be changed by hand.
{ mkDerivation, aeson, aeson-casing, async, attoparsec, base
, bytestring, ekg-core, fetchgit, file-embed, hashable, hashtables
, hasql, hasql-pool, hasql-transaction, hspec, lib, mmorph
, monad-control, mtl, postgresql-binary, postgresql-libpq
, resource-pool, retry, safe-exceptions, scientific, tasty-bench
, template-haskell, text, text-builder, time, transformers-base
, uuid, vector
{
mkDerivation,
aeson,
aeson-casing,
async,
attoparsec,
base,
bytestring,
ekg-core,
fetchgit,
file-embed,
hashable,
hashtables,
hasql,
hasql-pool,
hasql-transaction,
hspec,
lib,
mmorph,
monad-control,
mtl,
postgresql-binary,
postgresql-libpq,
resource-pool,
retry,
safe-exceptions,
scientific,
tasty-bench,
template-haskell,
text,
text-builder,
time,
transformers-base,
uuid,
vector,
}:
mkDerivation {
pname = "pg-client";
@@ -18,18 +46,51 @@ mkDerivation {
fetchSubmodules = true;
};
libraryHaskellDepends = [
aeson aeson-casing async attoparsec base bytestring ekg-core
hashable hashtables mmorph monad-control mtl postgresql-binary
postgresql-libpq resource-pool retry safe-exceptions scientific
template-haskell text text-builder time transformers-base uuid
aeson
aeson-casing
async
attoparsec
base
bytestring
ekg-core
hashable
hashtables
mmorph
monad-control
mtl
postgresql-binary
postgresql-libpq
resource-pool
retry
safe-exceptions
scientific
template-haskell
text
text-builder
time
transformers-base
uuid
vector
];
testHaskellDepends = [
async base bytestring hspec mtl safe-exceptions time
async
base
bytestring
hspec
mtl
safe-exceptions
time
];
benchmarkHaskellDepends = [
base bytestring file-embed hasql hasql-pool hasql-transaction mtl
tasty-bench text
base
bytestring
file-embed
hasql
hasql-pool
hasql-transaction
mtl
tasty-bench
text
];
homepage = "https://github.com/hasura/platform";
license = lib.licenses.asl20;
+24 -4
View File
@@ -1,7 +1,18 @@
# This has been automatically generated by the script
# ./update.sh. This should not be changed by hand.
{ mkDerivation, base, fetchgit, hashable, hspec, lib, monad-control
, stm, time, transformers, transformers-base, vector
{
mkDerivation,
base,
fetchgit,
hashable,
hspec,
lib,
monad-control,
stm,
time,
transformers,
transformers-base,
vector,
}:
mkDerivation {
pname = "resource-pool";
@@ -13,10 +24,19 @@ mkDerivation {
fetchSubmodules = true;
};
libraryHaskellDepends = [
base hashable monad-control stm time transformers transformers-base
base
hashable
monad-control
stm
time
transformers
transformers-base
vector
];
testHaskellDepends = [ base hspec ];
testHaskellDepends = [
base
hspec
];
homepage = "https://github.com/bos/pool";
description = "High-performance striped resource pooling implementation";
license = lib.licenses.bsd3;
@@ -1,6 +1,15 @@
{ mkDerivation, base, fetchFromGitHub, lib, prettyprinter
, prettyprinter-ansi-terminal, process, QuickCheck, text
, transformers, transformers-compat
{
mkDerivation,
base,
fetchFromGitHub,
lib,
prettyprinter,
prettyprinter-ansi-terminal,
process,
QuickCheck,
text,
transformers,
transformers-compat,
}:
mkDerivation {
pname = "hercules-ci-optparse-applicative";
@@ -12,10 +21,18 @@ mkDerivation {
rev = "a123939663ba1cd0f1750343f1c6b9864ac21207";
};
libraryHaskellDepends = [
base prettyprinter prettyprinter-ansi-terminal process text
transformers transformers-compat
base
prettyprinter
prettyprinter-ansi-terminal
process
text
transformers
transformers-compat
];
testHaskellDepends = [
base
QuickCheck
];
testHaskellDepends = [ base QuickCheck ];
homepage = "https://github.com/hercules-ci/optparse-applicative";
description = "Utilities and combinators for parsing command line options (fork)";
license = lib.licenses.bsd3;
+7 -2
View File
@@ -1,8 +1,13 @@
{ lib, stdenvNoCC, fetchzip }:
{
lib,
stdenvNoCC,
fetchzip,
}:
let
mspgccVersion = "6_1_1_0";
in stdenvNoCC.mkDerivation rec {
in
stdenvNoCC.mkDerivation rec {
pname = "msp430-gcc-support-files";
version = "1.207";
src = fetchzip {
+24 -18
View File
@@ -1,13 +1,15 @@
{ lib, stdenv
, fetchFromGitHub
, autoPatchelfHook
, libusb-compat-0_1
, readline ? null
, enableReadline ? true
, hidapi ? null
, pkg-config ? null
, mspds ? null
, enableMspds ? false
{
lib,
stdenv,
fetchFromGitHub,
autoPatchelfHook,
libusb-compat-0_1,
readline ? null,
enableReadline ? true,
hidapi ? null,
pkg-config ? null,
mspds ? null,
enableMspds ? false,
}:
assert stdenv.hostPlatform.isDarwin -> hidapi != null && pkg-config != null;
@@ -25,11 +27,13 @@ stdenv.mkDerivation rec {
};
enableParallelBuilding = true;
nativeBuildInputs = lib.optional stdenv.hostPlatform.isDarwin pkg-config
++ lib.optional (enableMspds && stdenv.hostPlatform.isLinux) autoPatchelfHook;
buildInputs = [ libusb-compat-0_1 ]
++ lib.optional stdenv.hostPlatform.isDarwin hidapi
++ lib.optional enableReadline readline;
nativeBuildInputs =
lib.optional stdenv.hostPlatform.isDarwin pkg-config
++ lib.optional (enableMspds && stdenv.hostPlatform.isLinux) autoPatchelfHook;
buildInputs =
[ libusb-compat-0_1 ]
++ lib.optional stdenv.hostPlatform.isDarwin hidapi
++ lib.optional enableReadline readline;
postPatch = lib.optionalString stdenv.hostPlatform.isDarwin ''
# TODO: remove once a new 0.26+ release is made
@@ -48,9 +52,11 @@ stdenv.mkDerivation rec {
done
'';
installFlags = [ "PREFIX=$(out)" "INSTALL=install" ];
makeFlags = [ "UNAME_S=$(unameS)" ] ++
lib.optional (!enableReadline) "WITHOUT_READLINE=1";
installFlags = [
"PREFIX=$(out)"
"INSTALL=install"
];
makeFlags = [ "UNAME_S=$(unameS)" ] ++ lib.optional (!enableReadline) "WITHOUT_READLINE=1";
unameS = lib.optionalString stdenv.hostPlatform.isDarwin "Darwin";
meta = with lib; {
+17 -7
View File
@@ -1,8 +1,17 @@
{ stdenv, lib, fetchurl, unzip, autoPatchelfHook }:
{
stdenv,
lib,
fetchurl,
unzip,
autoPatchelfHook,
}:
let
archPostfix = lib.optionalString (stdenv.hostPlatform.is64bit && !stdenv.hostPlatform.isDarwin) "_64";
in stdenv.mkDerivation rec {
archPostfix = lib.optionalString (
stdenv.hostPlatform.is64bit && !stdenv.hostPlatform.isDarwin
) "_64";
in
stdenv.mkDerivation rec {
pname = "msp-debug-stack-bin";
version = "3.15.1.1";
src = fetchurl {
@@ -12,11 +21,12 @@ in stdenv.mkDerivation rec {
sourceRoot = ".";
libname =
if stdenv.hostPlatform.isWindows then "MSP430${archPostfix}.dll"
else "libmsp430${archPostfix}${stdenv.hostPlatform.extensions.sharedLibrary}";
if stdenv.hostPlatform.isWindows then
"MSP430${archPostfix}.dll"
else
"libmsp430${archPostfix}${stdenv.hostPlatform.extensions.sharedLibrary}";
nativeBuildInputs = [ unzip ]
++ lib.optional stdenv.hostPlatform.isLinux autoPatchelfHook;
nativeBuildInputs = [ unzip ] ++ lib.optional stdenv.hostPlatform.isLinux autoPatchelfHook;
buildInputs = [ stdenv.cc.cc ];
installPhase = ''
+32 -17
View File
@@ -1,9 +1,12 @@
{ stdenv
, lib
, fetchurl, unzip
, boost, pugixml
, hidapi
, libusb1 ? null
{
stdenv,
lib,
fetchurl,
unzip,
boost,
pugixml,
hidapi,
libusb1 ? null,
}:
assert stdenv.hostPlatform.isLinux -> libusb1 != null;
@@ -11,7 +14,8 @@ assert stdenv.hostPlatform.isLinux -> libusb1 != null;
let
hidapiDriver = lib.optionalString stdenv.hostPlatform.isLinux "-libusb";
in stdenv.mkDerivation {
in
stdenv.mkDerivation {
pname = "msp-debug-stack";
version = "3.15.1.1";
@@ -23,18 +27,26 @@ in stdenv.mkDerivation {
enableParallelBuilding = true;
libName = "libmsp430${stdenv.hostPlatform.extensions.sharedLibrary}";
makeFlags = [ "OUTPUT=$(libName)" "HIDOBJ=" ];
NIX_LDFLAGS = [ "-lpugixml" "-lhidapi${hidapiDriver}" ];
makeFlags = [
"OUTPUT=$(libName)"
"HIDOBJ="
];
NIX_LDFLAGS = [
"-lpugixml"
"-lhidapi${hidapiDriver}"
];
env.NIX_CFLAGS_COMPILE = toString [ "-I${hidapi}/include/hidapi" ];
patches = [ ./bsl430.patch ];
preBuild = ''
rm ThirdParty/src/pugixml.cpp
rm ThirdParty/include/pugi{config,xml}.hpp
'' + lib.optionalString stdenv.hostPlatform.isDarwin ''
makeFlagsArray+=(OUTNAME="-install_name ")
'';
preBuild =
''
rm ThirdParty/src/pugixml.cpp
rm ThirdParty/include/pugi{config,xml}.hpp
''
+ lib.optionalString stdenv.hostPlatform.isDarwin ''
makeFlagsArray+=(OUTNAME="-install_name ")
'';
installPhase = ''
install -Dm0755 -t $out/lib $libName
@@ -42,8 +54,11 @@ in stdenv.mkDerivation {
'';
nativeBuildInputs = [ unzip ];
buildInputs = [ boost hidapi pugixml ]
++ lib.optional stdenv.hostPlatform.isLinux libusb1;
buildInputs = [
boost
hidapi
pugixml
] ++ lib.optional stdenv.hostPlatform.isLinux libusb1;
meta = with lib; {
description = "TI MSP430 FET debug driver";
+6 -1
View File
@@ -1,4 +1,9 @@
{ stdenvNoCC, xorg, newlib, msp430GccSupport }:
{
stdenvNoCC,
xorg,
newlib,
msp430GccSupport,
}:
stdenvNoCC.mkDerivation {
name = "msp430-${newlib.name}";
+85 -66
View File
@@ -1,8 +1,14 @@
{ stdenv, fetchurl, buildPackages, lib, fetchpatch, texinfo
, # "newlib-nano" is what the official ARM embedded toolchain calls this build
{
stdenv,
fetchurl,
buildPackages,
lib,
fetchpatch,
texinfo,
# "newlib-nano" is what the official ARM embedded toolchain calls this build
# configuration that prioritizes low space usage. We include it as a preset
# for embedded projects striving for a similar configuration.
nanoizeNewlib ? false
nanoizeNewlib ? false,
}:
stdenv.mkDerivation (finalAttrs: {
@@ -29,81 +35,94 @@ stdenv.mkDerivation (finalAttrs: {
];
# newlib expects CC to build for build platform, not host platform
preConfigure = ''
export CC=cc
'' +
# newlib tries to disable itself when building for Linux *except*
# when native-compiling. Unfortunately the check for "is cross
# compiling" was written when newlib was part of GCC and newlib
# was built along with GCC (therefore newlib was built to execute
# on the targetPlatform, not the hostPlatform). Unfortunately
# when newlib was extracted from GCC, this "is cross compiling"
# logic was not fixed. So we must disable it.
''
substituteInPlace configure --replace 'noconfigdirs target-newlib target-libgloss' 'noconfigdirs'
substituteInPlace configure --replace 'cross_only="target-libgloss target-newlib' 'cross_only="'
'';
preConfigure =
''
export CC=cc
''
+
# newlib tries to disable itself when building for Linux *except*
# when native-compiling. Unfortunately the check for "is cross
# compiling" was written when newlib was part of GCC and newlib
# was built along with GCC (therefore newlib was built to execute
# on the targetPlatform, not the hostPlatform). Unfortunately
# when newlib was extracted from GCC, this "is cross compiling"
# logic was not fixed. So we must disable it.
''
substituteInPlace configure --replace 'noconfigdirs target-newlib target-libgloss' 'noconfigdirs'
substituteInPlace configure --replace 'cross_only="target-libgloss target-newlib' 'cross_only="'
'';
configurePlatforms = [ "build" "target" ];
configurePlatforms = [
"build"
"target"
];
# flags copied from https://community.arm.com/support-forums/f/compilers-and-libraries-forum/53310/gcc-arm-none-eabi-what-were-the-newlib-compilation-options
# sort alphabetically
configureFlags = [
"--with-newlib"
configureFlags =
[
"--with-newlib"
# The newlib configury uses `host` to refer to the platform
# which is being used to compile newlib. Ugh. It does this
# because of its history: newlib used to be distributed with and
# built as part of gcc.
#
# To prevent nixpkgs from going insane, this package presents the
# "normal" view to the outside world: the binaries in $out will
# execute on `stdenv.hostPlatform`. We then fool newlib's build
# process into doing the right thing.
"--host=${stdenv.targetPlatform.config}"
# The newlib configury uses `host` to refer to the platform
# which is being used to compile newlib. Ugh. It does this
# because of its history: newlib used to be distributed with and
# built as part of gcc.
#
# To prevent nixpkgs from going insane, this package presents the
# "normal" view to the outside world: the binaries in $out will
# execute on `stdenv.hostPlatform`. We then fool newlib's build
# process into doing the right thing.
"--host=${stdenv.targetPlatform.config}"
] ++ (if !nanoizeNewlib then [
"--disable-newlib-supplied-syscalls"
"--disable-nls"
"--enable-newlib-io-c99-formats"
"--enable-newlib-io-long-long"
"--enable-newlib-reent-check-verify"
"--enable-newlib-register-fini"
"--enable-newlib-retargetable-locking"
] else [
"--disable-newlib-fseek-optimization"
"--disable-newlib-fvwrite-in-streamio"
"--disable-newlib-supplied-syscalls"
"--disable-newlib-unbuf-stream-opt"
"--disable-newlib-wide-orient"
"--disable-nls"
"--enable-lite-exit"
"--enable-newlib-global-atexit"
"--enable-newlib-nano-formatted-io"
"--enable-newlib-nano-malloc"
"--enable-newlib-reent-check-verify"
"--enable-newlib-reent-small"
"--enable-newlib-retargetable-locking"
]);
]
++ (
if !nanoizeNewlib then
[
"--disable-newlib-supplied-syscalls"
"--disable-nls"
"--enable-newlib-io-c99-formats"
"--enable-newlib-io-long-long"
"--enable-newlib-reent-check-verify"
"--enable-newlib-register-fini"
"--enable-newlib-retargetable-locking"
]
else
[
"--disable-newlib-fseek-optimization"
"--disable-newlib-fvwrite-in-streamio"
"--disable-newlib-supplied-syscalls"
"--disable-newlib-unbuf-stream-opt"
"--disable-newlib-wide-orient"
"--disable-nls"
"--enable-lite-exit"
"--enable-newlib-global-atexit"
"--enable-newlib-nano-formatted-io"
"--enable-newlib-nano-malloc"
"--enable-newlib-reent-check-verify"
"--enable-newlib-reent-small"
"--enable-newlib-retargetable-locking"
]
);
enableParallelBuilding = true;
dontDisableStatic = true;
# apply necessary nano changes from https://developer.arm.com/-/media/Files/downloads/gnu/12.2.rel1/manifest/copy_nano_libraries.sh?rev=4c50be6ccb9c4205a5262a3925317073&hash=1375A7B0A1CD0DB9B9EB0D2B574ADF66
postInstall = lib.optionalString nanoizeNewlib ''
mkdir -p $out${finalAttrs.passthru.incdir}/newlib-nano
cp $out${finalAttrs.passthru.incdir}/newlib.h $out${finalAttrs.passthru.incdir}/newlib-nano/
postInstall =
lib.optionalString nanoizeNewlib ''
mkdir -p $out${finalAttrs.passthru.incdir}/newlib-nano
cp $out${finalAttrs.passthru.incdir}/newlib.h $out${finalAttrs.passthru.incdir}/newlib-nano/
(
cd $out${finalAttrs.passthru.libdir}
(
cd $out${finalAttrs.passthru.libdir}
for f in librdimon.a libc.a libg.a; do
# Some libraries are only available for specific architectures.
# For example, librdimon.a is only available on ARM.
[ -f "$f" ] && cp "$f" "''${f%%\.a}_nano.a"
done
)
'' + ''[ "$(find $out -type f | wc -l)" -gt 0 ] || (echo '$out is empty' 1>&2 && exit 1)'';
for f in librdimon.a libc.a libg.a; do
# Some libraries are only available for specific architectures.
# For example, librdimon.a is only available on ARM.
[ -f "$f" ] && cp "$f" "''${f%%\.a}_nano.a"
done
)
''
+ ''[ "$(find $out -type f | wc -l)" -gt 0 ] || (echo '$out is empty' 1>&2 && exit 1)'';
passthru = {
incdir = "/${stdenv.targetPlatform.config}/include";
+10 -2
View File
@@ -1,4 +1,9 @@
{ stdenv, fetchFromGitHub, stdenvNoLibc, buildPackages }:
{
stdenv,
fetchFromGitHub,
stdenvNoLibc,
buildPackages,
}:
stdenvNoLibc.mkDerivation {
name = "newlib";
@@ -16,7 +21,10 @@ stdenvNoLibc.mkDerivation {
export CC=cc
'';
configurePlatforms = [ "build" "target" ];
configurePlatforms = [
"build"
"target"
];
configureFlags = [
"--host=${stdenv.buildPlatform.config}"
+24 -15
View File
@@ -1,17 +1,24 @@
{ lib
, pkgsBuildHost
, ...
{
lib,
pkgsBuildHost,
...
}:
let
removeKnownVulnerabilities = pkg: pkg.overrideAttrs (old: {
meta = (old.meta or { }) // { knownVulnerabilities = [ ]; };
});
removeKnownVulnerabilities =
pkg:
pkg.overrideAttrs (old: {
meta = (old.meta or { }) // {
knownVulnerabilities = [ ];
};
});
# We are removing `meta.knownVulnerabilities` from `python27`,
# and setting it in `resholve` itself.
python27' = (removeKnownVulnerabilities pkgsBuildHost.python27).override {
self = python27';
pkgsBuildHost = pkgsBuildHost // { python27 = python27'; };
pkgsBuildHost = pkgsBuildHost // {
python27 = python27';
};
# strip down that python version as much as possible
openssl = null;
bzip2 = null;
@@ -35,14 +42,16 @@ rec {
# not exposed in all-packages
resholveBuildTimeOnly = removeKnownVulnerabilities resholve;
# resholve itself
resholve = (callPackage ./resholve.nix {
inherit (source) rSrc version;
inherit (deps.oil) oildev;
inherit (deps) configargparse;
inherit resholve-utils;
# used only in tests
resholve = resholveBuildTimeOnly;
});
resholve = (
callPackage ./resholve.nix {
inherit (source) rSrc version;
inherit (deps.oil) oildev;
inherit (deps) configargparse;
inherit resholve-utils;
# used only in tests
resholve = resholveBuildTimeOnly;
}
);
# funcs to validate and phrase invocations of resholve
# and use those invocations to build packages
resholve-utils = callPackage ./resholve-utils.nix {
+7 -6
View File
@@ -1,9 +1,10 @@
{ lib
, callPackage
, fetchFromGitHub
, python27
, fetchPypi
, ...
{
lib,
callPackage,
fetchFromGitHub,
python27,
fetchPypi,
...
}:
/*
+25 -15
View File
@@ -1,15 +1,16 @@
{ lib
, stdenv
, python27
, callPackage
, fetchFromGitHub
, makeWrapper
, re2c
, # oil deps
glibcLocales
, file
, six
, typing
{
lib,
stdenv,
python27,
callPackage,
fetchFromGitHub,
makeWrapper,
re2c,
# oil deps
glibcLocales,
file,
six,
typing,
}:
rec {
@@ -67,9 +68,16 @@ rec {
"--without-readline"
];
nativeBuildInputs = [ re2c file makeWrapper ];
nativeBuildInputs = [
re2c
file
makeWrapper
];
propagatedBuildInputs = [ six typing ];
propagatedBuildInputs = [
six
typing
];
doCheck = true;
@@ -85,7 +93,9 @@ rec {
'';
# See earlier note on glibcLocales TODO: verify needed?
LOCALE_ARCHIVE = lib.optionalString (stdenv.buildPlatform.libc == "glibc") "${glibcLocales}/lib/locale/locale-archive";
LOCALE_ARCHIVE = lib.optionalString (
stdenv.buildPlatform.libc == "glibc"
) "${glibcLocales}/lib/locale/locale-archive";
# not exhaustive; sample what resholve uses as a sanity check
pythonImportsCheck = [
+210 -133
View File
@@ -1,7 +1,14 @@
{ lib, stdenv, resholve, binlore, writeTextFile }:
{
lib,
stdenv,
resholve,
binlore,
writeTextFile,
}:
rec {
/* These functions break up the work of partially validating the
/*
These functions break up the work of partially validating the
'solutions' attrset and massaging it into env/cli args.
Note: some of the left-most args do not *have* to be passed as
@@ -13,84 +20,128 @@ rec {
colons = l: builtins.concatStringsSep ":" l;
semicolons = l: builtins.concatStringsSep ";" l;
/* Throw a fit with dotted attr path context */
nope = path: msg:
throw "${builtins.concatStringsSep "." path}: ${msg}";
# Throw a fit with dotted attr path context
nope = path: msg: throw "${builtins.concatStringsSep "." path}: ${msg}";
/* Special-case directive value representations by type */
phraseDirective = solution: env: name: val:
if builtins.isInt val then builtins.toString val
else if builtins.isString val then name
else if true == val then name
else if false == val then "" # omit!
else if null == val then "" # omit!
else if builtins.isList val then "${name}:${semicolons (map lib.escapeShellArg val)}"
else nope [ solution env name ] "unexpected type: ${builtins.typeOf val}";
# Special-case directive value representations by type
phraseDirective =
solution: env: name: val:
if builtins.isInt val then
builtins.toString val
else if builtins.isString val then
name
else if true == val then
name
else if false == val then
"" # omit!
else if null == val then
"" # omit!
else if builtins.isList val then
"${name}:${semicolons (map lib.escapeShellArg val)}"
else
nope [ solution env name ] "unexpected type: ${builtins.typeOf val}";
/* Build fake/fix/keep directives from Nix types */
phraseDirectives = solution: env: val:
# Build fake/fix/keep directives from Nix types
phraseDirectives =
solution: env: val:
lib.mapAttrsToList (phraseDirective solution env) val;
/* Custom ~search-path routine to handle relative path strings */
relSafeBinPath = input:
if lib.isDerivation input then ((lib.getOutput "bin" input) + "/bin")
else if builtins.isString input then input
else throw "unexpected type for input: ${builtins.typeOf input}";
# Custom ~search-path routine to handle relative path strings
relSafeBinPath =
input:
if lib.isDerivation input then
((lib.getOutput "bin" input) + "/bin")
else if builtins.isString input then
input
else
throw "unexpected type for input: ${builtins.typeOf input}";
/* Special-case value representation by type/name */
phraseEnvVal = solution: env: val:
if env == "inputs" then (colons (map relSafeBinPath val))
else if builtins.isString val then val
else if builtins.isList val then spaces val
else if builtins.isAttrs val then spaces (phraseDirectives solution env val)
else nope [ solution env ] "unexpected type: ${builtins.typeOf val}";
# Special-case value representation by type/name
phraseEnvVal =
solution: env: val:
if env == "inputs" then
(colons (map relSafeBinPath val))
else if builtins.isString val then
val
else if builtins.isList val then
spaces val
else if builtins.isAttrs val then
spaces (phraseDirectives solution env val)
else
nope [ solution env ] "unexpected type: ${builtins.typeOf val}";
/* Shell-format each env value */
shellEnv = solution: env: value:
# Shell-format each env value
shellEnv =
solution: env: value:
lib.escapeShellArg (phraseEnvVal solution env value);
/* Build a single ENV=val pair */
phraseEnv = solution: env: value:
# Build a single ENV=val pair
phraseEnv =
solution: env: value:
"RESHOLVE_${lib.toUpper env}=${shellEnv solution env value}";
/* Discard attrs:
- claimed by phraseArgs
- only needed for binlore.collect
/*
Discard attrs:
- claimed by phraseArgs
- only needed for binlore.collect
*/
removeUnneededArgs = value:
removeAttrs value [ "scripts" "flags" "unresholved" ];
removeUnneededArgs =
value:
removeAttrs value [
"scripts"
"flags"
"unresholved"
];
/* Verify required arguments are present */
validateSolution = { scripts, inputs, interpreter, ... }: true;
# Verify required arguments are present
validateSolution =
{
scripts,
inputs,
interpreter,
...
}:
true;
/* Pull out specific solution keys to build ENV=val pairs */
phraseEnvs = solution: value:
spaces (lib.mapAttrsToList (phraseEnv solution) (removeUnneededArgs value));
# Pull out specific solution keys to build ENV=val pairs
phraseEnvs =
solution: value: spaces (lib.mapAttrsToList (phraseEnv solution) (removeUnneededArgs value));
/* Pull out specific solution keys to build CLI argstring */
phraseArgs = { flags ? [ ], scripts, ... }:
# Pull out specific solution keys to build CLI argstring
phraseArgs =
{
flags ? [ ],
scripts,
...
}:
spaces (flags ++ scripts);
phraseBinloreArgs = value:
phraseBinloreArgs =
value:
let
hasUnresholved = builtins.hasAttr "unresholved" value;
in {
drvs = value.inputs ++
lib.optionals hasUnresholved [ value.unresholved ];
in
{
drvs = value.inputs ++ lib.optionals hasUnresholved [ value.unresholved ];
strip = if hasUnresholved then [ value.unresholved ] else [ ];
};
/* Build a single resholve invocation */
phraseInvocation = solution: value:
# Build a single resholve invocation
phraseInvocation =
solution: value:
if validateSolution value then
# we pass resholve a directory
"RESHOLVE_LORE=${binlore.collect (phraseBinloreArgs value) } ${phraseEnvs solution value} ${resholve}/bin/resholve --overwrite ${phraseArgs value}"
else throw "invalid solution"; # shouldn't trigger for now
# we pass resholve a directory
"RESHOLVE_LORE=${binlore.collect (phraseBinloreArgs value)} ${phraseEnvs solution value} ${resholve}/bin/resholve --overwrite ${phraseArgs value}"
else
throw "invalid solution"; # shouldn't trigger for now
injectUnresholved = solutions: unresholved: (builtins.mapAttrs (name: value: value // { inherit unresholved; } ) solutions);
injectUnresholved =
solutions: unresholved:
(builtins.mapAttrs (name: value: value // { inherit unresholved; }) solutions);
/* Build resholve invocation for each solution. */
phraseCommands = solutions: unresholved:
# Build resholve invocation for each solution.
phraseCommands =
solutions: unresholved:
builtins.concatStringsSep "\n" (
lib.mapAttrsToList phraseInvocation (injectUnresholved solutions unresholved)
);
@@ -100,112 +151,138 @@ rec {
and invocation. Extra context makes it clearer what the
Nix API is doing, makes nix-shell debugging easier, etc.
*/
phraseContext = { invokable, prep ? ''cd "$out"'' }: ''
(
${prep}
PS4=$'\x1f'"\033[33m[resholve context]\033[0m "
set -x
: invoking resholve with PWD=$PWD
${invokable}
)
'';
phraseContextForPWD = invokable: phraseContext { inherit invokable; prep = ""; };
phraseContext =
{
invokable,
prep ? ''cd "$out"'',
}:
''
(
${prep}
PS4=$'\x1f'"\033[33m[resholve context]\033[0m "
set -x
: invoking resholve with PWD=$PWD
${invokable}
)
'';
phraseContextForPWD =
invokable:
phraseContext {
inherit invokable;
prep = "";
};
phraseContextForOut = invokable: phraseContext { inherit invokable; };
phraseSolution = name: solution: (phraseContextForOut (phraseInvocation name solution));
phraseSolutions = solutions: unresholved:
phraseContextForOut (phraseCommands solutions unresholved);
phraseSolutions =
solutions: unresholved: phraseContextForOut (phraseCommands solutions unresholved);
writeScript = name: partialSolution: text:
writeScript =
name: partialSolution: text:
writeTextFile {
inherit name text;
executable = true;
checkPhase = ''
${(phraseContextForPWD (
phraseInvocation name (
partialSolution // {
scripts = [ "${placeholder "out"}" ];
}
)
)
)}
'' + lib.optionalString (partialSolution.interpreter != "none") ''
${partialSolution.interpreter} -n $out
'';
checkPhase =
''
${
(phraseContextForPWD (
phraseInvocation name (
partialSolution
// {
scripts = [ "${placeholder "out"}" ];
}
)
))
}
''
+ lib.optionalString (partialSolution.interpreter != "none") ''
${partialSolution.interpreter} -n $out
'';
};
writeScriptBin = name: partialSolution: text:
writeScriptBin =
name: partialSolution: text:
writeTextFile rec {
inherit name text;
executable = true;
destination = "/bin/${name}";
checkPhase = ''
${phraseContextForOut (
checkPhase =
''
${phraseContextForOut (
phraseInvocation name (
partialSolution // {
partialSolution
// {
scripts = [ "bin/${name}" ];
}
)
)
}
'' + lib.optionalString (partialSolution.interpreter != "none") ''
${partialSolution.interpreter} -n $out/bin/${name}
'';
)}
''
+ lib.optionalString (partialSolution.interpreter != "none") ''
${partialSolution.interpreter} -n $out/bin/${name}
'';
};
mkDerivation = { pname
, src
, version
, passthru ? { }
, solutions
, ...
mkDerivation =
{
pname,
src,
version,
passthru ? { },
solutions,
...
}@attrs:
let
inherit stdenv;
/*
Knock out our special solutions arg, but otherwise
just build what the caller is giving us. We'll
actually resholve it separately below (after we
generate binlore for it).
Knock out our special solutions arg, but otherwise
just build what the caller is giving us. We'll
actually resholve it separately below (after we
generate binlore for it).
*/
unresholved = (stdenv.mkDerivation ((removeAttrs attrs [ "solutions" ])
// {
inherit version src;
pname = "${pname}-unresholved";
}));
unresholved = (
stdenv.mkDerivation (
(removeAttrs attrs [ "solutions" ])
// {
inherit version src;
pname = "${pname}-unresholved";
}
)
);
in
/*
resholve in a separate derivation; some concerns:
- we aren't keeping many of the user's args, so they
can't readily set LOGLEVEL and such...
- not sure how this affects multiple outputs
resholve in a separate derivation; some concerns:
- we aren't keeping many of the user's args, so they
can't readily set LOGLEVEL and such...
- not sure how this affects multiple outputs
*/
lib.extendDerivation true passthru (stdenv.mkDerivation {
src = unresholved;
inherit version pname;
buildInputs = [ resholve ];
disallowedReferences = [ resholve ];
lib.extendDerivation true passthru (
stdenv.mkDerivation {
src = unresholved;
inherit version pname;
buildInputs = [ resholve ];
disallowedReferences = [ resholve ];
# retain a reference to the base
passthru = unresholved.passthru // {
unresholved = unresholved;
# fallback attr for update bot to query our src
originalSrc = unresholved.src;
};
# retain a reference to the base
passthru = unresholved.passthru // {
unresholved = unresholved;
# fallback attr for update bot to query our src
originalSrc = unresholved.src;
};
# do these imply that we should use NoCC or something?
dontConfigure = true;
dontBuild = true;
# do these imply that we should use NoCC or something?
dontConfigure = true;
dontBuild = true;
installPhase = ''
cp -R $src $out
'';
installPhase = ''
cp -R $src $out
'';
# enable below for verbose debug info if needed
# supports default python.logging levels
# LOGLEVEL="INFO";
preFixup = phraseSolutions solutions unresholved;
# enable below for verbose debug info if needed
# supports default python.logging levels
# LOGLEVEL="INFO";
preFixup = phraseSolutions solutions unresholved;
# don't break the metadata...
meta = unresholved.meta;
});
# don't break the metadata...
meta = unresholved.meta;
}
);
}
+37 -21
View File
@@ -1,16 +1,17 @@
{ lib
, callPackage
, python27
, fetchFromGitHub
, installShellFiles
, rSrc
, version
, oildev
, configargparse
, gawk
, binlore
, resholve
, resholve-utils
{
lib,
callPackage,
python27,
fetchFromGitHub,
installShellFiles,
rSrc,
version,
oildev,
configargparse,
gawk,
binlore,
resholve,
resholve-utils,
}:
let
@@ -25,7 +26,8 @@ let
};
};
in python27.pkgs.buildPythonApplication {
in
python27.pkgs.buildPythonApplication {
pname = "resholve";
inherit version;
src = rSrc;
@@ -59,8 +61,20 @@ in python27.pkgs.buildPythonApplication {
'';
passthru = {
inherit (resholve-utils) mkDerivation phraseSolution writeScript writeScriptBin;
tests = callPackage ./test.nix { inherit rSrc binlore python27 resholve; };
inherit (resholve-utils)
mkDerivation
phraseSolution
writeScript
writeScriptBin
;
tests = callPackage ./test.nix {
inherit
rSrc
binlore
python27
resholve
;
};
};
meta = with lib; {
@@ -70,10 +84,12 @@ in python27.pkgs.buildPythonApplication {
license = with licenses; [ mit ];
maintainers = with maintainers; [ abathur ];
platforms = platforms.all;
knownVulnerabilities = [ ''
resholve depends on python27 (EOL). While it's safe to
run on trusted input in the build sandbox, you should
avoid running it on untrusted input.
'' ];
knownVulnerabilities = [
''
resholve depends on python27 (EOL). While it's safe to
run on trusted input in the build sandbox, you should
avoid running it on untrusted input.
''
];
};
}
+3 -2
View File
@@ -1,5 +1,6 @@
{ fetchFromGitHub
, ...
{
fetchFromGitHub,
...
}:
rec {
+213 -150
View File
@@ -1,67 +1,83 @@
{ lib
, stdenv
, callPackage
, resholve
, shunit2
, coreutils
, gnused
, gnugrep
, findutils
, jq
, bash
, bats
, libressl
, openssl
, python27
, file
, gettext
, rSrc
, runDemo ? false
, binlore
, sqlite
, unixtools
, gawk
, rlwrap
, gnutar
, bc
# override testing
, esh
, getconf
, libarchive
, locale
, mount
, ncurses
, nixos-install-tools
, nixos-rebuild
, procps
, ps
# known consumers
, aaxtomp3
, arch-install-scripts
, bashup-events32
, dgoss
, git-ftp
, ix
, lesspipe
, locate-dominating-file
, mons
, msmtp
, nix-direnv
, pdf2odt
, pdfmm
, rancid
, s0ix-selftest-tool
, unix-privesc-check
, wgnord
, wsl-vpnkit
, xdg-utils
, yadm
, zxfer
{
lib,
stdenv,
callPackage,
resholve,
shunit2,
coreutils,
gnused,
gnugrep,
findutils,
jq,
bash,
bats,
libressl,
openssl,
python27,
file,
gettext,
rSrc,
runDemo ? false,
binlore,
sqlite,
unixtools,
gawk,
rlwrap,
gnutar,
bc,
# override testing
esh,
getconf,
libarchive,
locale,
mount,
ncurses,
nixos-install-tools,
nixos-rebuild,
procps,
ps,
# known consumers
aaxtomp3,
arch-install-scripts,
bashup-events32,
dgoss,
git-ftp,
ix,
lesspipe,
locate-dominating-file,
mons,
msmtp,
nix-direnv,
pdf2odt,
pdfmm,
rancid,
s0ix-selftest-tool,
unix-privesc-check,
wgnord,
wsl-vpnkit,
xdg-utils,
yadm,
zxfer,
}:
let
default_packages = [ bash file findutils gettext ];
parsed_packages = [ coreutils sqlite unixtools.script gnused gawk findutils rlwrap gnutar bc ];
default_packages = [
bash
file
findutils
gettext
];
parsed_packages = [
coreutils
sqlite
unixtools.script
gnused
gawk
findutils
rlwrap
gnutar
bc
];
in
rec {
module1 = resholve.mkDerivation {
@@ -80,9 +96,16 @@ rec {
solutions = {
libressl = {
# submodule to demonstrate
scripts = [ "bin/libressl.sh" "submodule/helper.sh" ];
scripts = [
"bin/libressl.sh"
"submodule/helper.sh"
];
interpreter = "none";
inputs = [ jq module2 libressl.bin ];
inputs = [
jq
module2
libressl.bin
];
};
};
@@ -107,9 +130,17 @@ rec {
fix = {
aliases = true;
};
scripts = [ "bin/openssl.sh" "libexec/invokeme" ];
scripts = [
"bin/openssl.sh"
"libexec/invokeme"
];
interpreter = "none";
inputs = [ shunit2 openssl.bin "libexec" "libexec/invokeme" ];
inputs = [
shunit2
openssl.bin
"libexec"
"libexec/invokeme"
];
execer = [
/*
This is the same verdict binlore will
@@ -144,7 +175,10 @@ rec {
interpreter = "${bash}/bin/bash";
inputs = [ module1 ];
fake = {
external = [ "jq" "openssl" ];
external = [
"jq"
"openssl"
];
};
}}
'';
@@ -163,7 +197,10 @@ rec {
doCheck = true;
buildInputs = [ resholve ];
nativeCheckInputs = [ coreutils bats ];
nativeCheckInputs = [
coreutils
bats
];
# LOGLEVEL="DEBUG";
# default path
@@ -173,95 +210,116 @@ rec {
PKG_FINDUTILS = "${lib.makeBinPath [ findutils ]}";
PKG_GETTEXT = "${lib.makeBinPath [ gettext ]}";
PKG_COREUTILS = "${lib.makeBinPath [ coreutils ]}";
RESHOLVE_LORE = "${binlore.collect { drvs = default_packages ++ [ coreutils ] ++ parsed_packages; } }";
RESHOLVE_LORE = "${binlore.collect {
drvs = default_packages ++ [ coreutils ] ++ parsed_packages;
}}";
PKG_PARSED = "${lib.makeBinPath parsed_packages}";
# explicit interpreter for demo suite; maybe some better way...
INTERP = "${bash}/bin/bash";
checkPhase = ''
patchShebangs .
mkdir empty_lore
touch empty_lore/{execers,wrappers}
export EMPTY_LORE=$PWD/empty_lore
printf "\033[33m============================= resholve test suite ===================================\033[0m\n" > test.ansi
if ./test.sh &>> test.ansi; then
cat test.ansi
else
cat test.ansi && exit 1
fi
'' + lib.optionalString runDemo ''
printf "\033[33m============================= resholve demo ===================================\033[0m\n" > demo.ansi
if ./demo &>> demo.ansi; then
cat demo.ansi
else
cat demo.ansi && exit 1
fi
'';
checkPhase =
''
patchShebangs .
mkdir empty_lore
touch empty_lore/{execers,wrappers}
export EMPTY_LORE=$PWD/empty_lore
printf "\033[33m============================= resholve test suite ===================================\033[0m\n" > test.ansi
if ./test.sh &>> test.ansi; then
cat test.ansi
else
cat test.ansi && exit 1
fi
''
+ lib.optionalString runDemo ''
printf "\033[33m============================= resholve demo ===================================\033[0m\n" > demo.ansi
if ./demo &>> demo.ansi; then
cat demo.ansi
else
cat demo.ansi && exit 1
fi
'';
};
# Caution: ci.nix asserts the equality of both of these w/ diff
resholvedScript = resholve.writeScript "resholved-script" {
inputs = [ file ];
interpreter = "${bash}/bin/bash";
} ''
echo "Hello"
file .
'';
resholvedScriptBin = resholve.writeScriptBin "resholved-script-bin" {
inputs = [ file ];
interpreter = "${bash}/bin/bash";
} ''
echo "Hello"
file .
'';
resholvedScriptBinNone = resholve.writeScriptBin "resholved-script-bin" {
inputs = [ file ];
interpreter = "none";
} ''
echo "Hello"
file .
'';
resholvedScript =
resholve.writeScript "resholved-script"
{
inputs = [ file ];
interpreter = "${bash}/bin/bash";
}
''
echo "Hello"
file .
'';
resholvedScriptBin =
resholve.writeScriptBin "resholved-script-bin"
{
inputs = [ file ];
interpreter = "${bash}/bin/bash";
}
''
echo "Hello"
file .
'';
resholvedScriptBinNone =
resholve.writeScriptBin "resholved-script-bin"
{
inputs = [ file ];
interpreter = "none";
}
''
echo "Hello"
file .
'';
# spot-check lore overrides
loreOverrides = resholve.writeScriptBin "verify-overrides" {
inputs = [
coreutils
esh
getconf
libarchive
locale
mount
ncurses
procps
ps
] ++ lib.optionals stdenv.hostPlatform.isLinux [
nixos-install-tools
nixos-rebuild
];
interpreter = "none";
execer = [
"cannot:${esh}/bin/esh"
];
fix = {
mount = true;
};
} (''
env b2sum fake args
b2sum fake args
esh fake args
getconf fake args
bsdtar fake args
locale fake args
mount fake args
reset fake args
tput fake args
tset fake args
ps fake args
top fake args
'' + lib.optionalString stdenv.hostPlatform.isLinux ''
nixos-generate-config fake args
nixos-rebuild fake args
'');
loreOverrides =
resholve.writeScriptBin "verify-overrides"
{
inputs =
[
coreutils
esh
getconf
libarchive
locale
mount
ncurses
procps
ps
]
++ lib.optionals stdenv.hostPlatform.isLinux [
nixos-install-tools
nixos-rebuild
];
interpreter = "none";
execer = [
"cannot:${esh}/bin/esh"
];
fix = {
mount = true;
};
}
(
''
env b2sum fake args
b2sum fake args
esh fake args
getconf fake args
bsdtar fake args
locale fake args
mount fake args
reset fake args
tput fake args
tset fake args
ps fake args
top fake args
''
+ lib.optionalString stdenv.hostPlatform.isLinux ''
nixos-generate-config fake args
nixos-rebuild fake args
''
);
# ensure known consumers in nixpkgs keep working
inherit aaxtomp3;
@@ -279,7 +337,8 @@ rec {
inherit shunit2;
inherit xdg-utils;
inherit yadm;
} // lib.optionalAttrs stdenv.hostPlatform.isLinux {
}
// lib.optionalAttrs stdenv.hostPlatform.isLinux {
inherit arch-install-scripts;
inherit dgoss;
inherit rancid;
@@ -287,6 +346,10 @@ rec {
inherit wgnord;
inherit wsl-vpnkit;
inherit zxfer;
} // lib.optionalAttrs (stdenv.hostPlatform.isLinux && (stdenv.hostPlatform.isi686 || stdenv.hostPlatform.isx86_64)) {
inherit s0ix-selftest-tool;
}
//
lib.optionalAttrs
(stdenv.hostPlatform.isLinux && (stdenv.hostPlatform.isi686 || stdenv.hostPlatform.isx86_64))
{
inherit s0ix-selftest-tool;
}
+14 -2
View File
@@ -1,4 +1,12 @@
{ stdenv, texinfo, flex, bison, fetchFromGitHub, stdenvNoLibc, buildPackages }:
{
stdenv,
texinfo,
flex,
bison,
fetchFromGitHub,
stdenvNoLibc,
buildPackages,
}:
stdenvNoLibc.mkDerivation {
name = "newlib";
@@ -12,7 +20,11 @@ stdenvNoLibc.mkDerivation {
configurePlatforms = [ "target" ];
enableParallelBuilding = true;
nativeBuildInputs = [ texinfo flex bison ];
nativeBuildInputs = [
texinfo
flex
bison
];
depsBuildBuild = [ buildPackages.stdenv.cc ];
# newlib expects CC to build for build platform, not host platform
preConfigure = ''