Commit Graph

5434 Commits

Author SHA1 Message Date
Jules Aguillon
f2a91a6679 Fix string context lost in linkFarm
```nix
let pkgs = import ./. {}; in
pkgs.linkFarm "test" [
  { name = "foo"; path = ./README.md; }
]
```

The nix code above generates this result: (`nix build -f test.nix`)

```
lrwxrwxrwx 1 root root 31 Jan  1  1970 /nix/store/98mdz626n99w0467q4r203q154bnnli9-test/foo -> /home/juloo/w/nixpkgs/README.md
```

With this patch, the target file is naturally copied into the store:

```
lrwxrwxrwx 1 root root 53 Jan  1  1970 /nix/store/ndvffnardifqwzbp07g15llav55r5k1m-test/foo -> /nix/store/9rqwjskbbgbflrpyhzi6rak2j7jspr5f-README.md
```
2022-05-14 19:23:15 +02:00
adisbladis
fb222e0086
Merge pull request #172820 from alyssais/compressed-firmware
Compressed firmware
2022-05-14 02:38:48 +08:00
Alyssa Ross
8aa8e0ce7f
nixos/udev: compress all firmware if supported
This should be a significant disk space saving for most NixOS
installations.  This method is a bit more complicated than doing it in
the postInstall for the firmware derivations, but this way it's
automatic, so each firmware package doesn't have to separately
implement its compression.

Currently, only xz compression is supported, but it's likely that
future versions of Linux will additionally support zstd, so I've
written the code in such a way that it would be very easy to implement
zstd compression for those kernels when they arrive, falling back to
xz for older (current) kernels.

I chose the highest possible level of compression (xz -9) because even
at this level, decompression time is negligible.  Here's how long it took
to decompress every firmware file my laptop uses:

	i915/kbl_dmc_ver1_04.bin                  	2ms
	regulatory.db                             	4ms
	regulatory.db.p7s                         	3ms
	iwlwifi-7265D-29.ucode                    	62ms
	9d71-GOOGLE-EVEMAX-0-tplg.bin             	22ms
	intel/dsp_fw_kbl.bin                      	65ms
	dsp_lib_dsm_core_spt_release.bin          	6ms
	intel/ibt-hw-37.8.10-fw-22.50.19.14.f.bseq	7ms

And since booting NixOS is a parallel process, it's unlikely (but
difficult to measure) that the time to user interaction was held up at
all by most of these.

Fixes (partially?) #148197
2022-05-13 14:36:34 +00:00
Vincent Laporte
1f11888116 Revert "coqPackages: etc"
This reverts commit 7e589a45ef.
2022-05-13 06:47:14 +02:00
sternenseemann
357da6c296 buildRustPackage: make cargoDeps logic easier to follow
The old logic flow had the structure

  if ( … ) {
    if ( … ) {
      …
    } else {
      …
    }
  } else {
    …
  }

which is quite hard to follow in Nix. Instead we ensure that no if
expression is inside a then branch.

This change is zero rebuild, as no logic was changed.
2022-05-13 08:18:39 +10:00
Cyril Cohen
7e589a45ef coqPackages: etc
- use propagatedBuildInputs to make sure ocaml plugin stuff is in path
- updated coqPackage.heq (broken url)
- fixed use of `DESTDIR` and `COQMF_COQLIB` in mkCoqDerivation
- adding `COQCORELIB` environement variable to put ocaml plugin files in the right place
- make metaFetch available from `coqPackages`
2022-05-12 06:11:43 +02:00
Alyssa Ross
6592d3fbc7
skawarePackages.buildPackage: fix typo in comment 2022-05-09 15:52:56 +00:00
Robert Hensing
c3bbe1d9c7 testers.nixosTest: Remove redundant system.stateVersion = lib.trivial.release;
Already present in nixos/modules/testing/test-instrumentation.nix,
which is imported by the test framework.
2022-05-09 14:33:49 +02:00
Robert Hensing
ebf0465d09 Merge remote-tracking branch 'upstream/master' into testers 2022-05-09 14:27:13 +02:00
Robert Hensing
93abb7bef7 tests.testers.nixosTest-example: move from tests.nixos-functions.nixosTest-test
And improve the test a bit, to assert correct wiring of `pkgs`.
2022-05-09 14:21:56 +02:00
Robert Hensing
ae172a2bb4 treewide: nixosTest -> testers.nixosTest 2022-05-09 14:16:06 +02:00
Naïm Favier
d4aa650608
makeBinaryWrapper: really unset NIX_CFLAGS
f8cc8ff575
fails to unset the variables in the environment due to a Bash quirk,
so set them to the empty string instead.
2022-05-06 17:03:52 +02:00
Naïm Favier
42a4c05dd0
makeBinaryWrapper: add -Wno-overlength-strings
The generated C code contains large string literals that are longer than
the maximum length specified by the standard.

However, GCC has no trouble dealing with those strings, so we can just
add -Wno-overlength-strings.

https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Woverlength-strings
2022-05-06 16:12:57 +02:00
github-actions[bot]
b962dee3e7
Merge master into staging-next 2022-05-06 00:02:16 +00:00
ilkecan
d6bd313f07 buildRustCrate: set meta.mainProgram to crateName 2022-05-05 14:25:27 +00:00
Robert Hensing
7edb414660 testers.nixosTest: Move from top-level and improve docs 2022-05-05 12:48:47 +02:00
Robert Hensing
c071530ca5 testers.invalidateFetcherByDrvHash: Move from top-level 2022-05-05 12:08:50 +02:00
github-actions[bot]
00dc0eecc7
Merge staging-next into staging 2022-05-03 12:01:45 +00:00
Janne Heß
2edce50847
Merge pull request #171134 from helsinki-systems/feat/make-initrd-ng-strip
makeInitrdNG: Strip more and remove output
2022-05-03 09:41:22 +02:00
Vladimír Čunát
9478ec747c
Merge branch 'staging-next-2022-04-23'
Close #169965: the PR and real 'staging-next' branch contained
extra systemd rebuild that I wanted to avoid in this iteration.
(to save Hydra's work)
2022-05-02 09:12:51 +02:00
github-actions[bot]
677697c12f
Merge staging-next into staging 2022-05-01 18:01:35 +00:00
github-actions[bot]
da9b549e31
Merge master into staging-next 2022-05-01 18:01:03 +00:00
David Scherer
13a9006ec3 Fix determinism by defaulting codegenUnits to 1, not NIX_BUILD_CORES 2022-05-01 11:48:32 -04:00
Mateusz Kowalczyk
f6897d23f4 buildRustCrate: make codegen-units configurable
This parameter is being set to `$NIX_BUILD_CORES` by default. This is a
standard practice but there's a suspicion that this can produce broken
builds. For some details see
https://github.com/cargo2nix/cargo2nix/issues/184 . As a
work-around/test, it'd be good if codegen-units can be set to something
constant, such as `1`. This PR allows it.

Note that the default of `$NIX_BUILD_CORES` is preserved so this MR
causes no change in default behaviour and no rebuilds.
2022-05-01 11:48:32 -04:00
Janne Heß
e5995b2235
makeInitrdNG: Strip more and remove output
This strips all elf files as far as possible and removes a lot of
unnecessary output. Also wrap in the binaries instead of relying on
$PATH.
2022-05-01 17:06:14 +02:00
Vladimír Čunát
cec6e7362c
Merge branch 'master' into staging-next-2022-04-23 2022-05-01 14:26:52 +02:00
github-actions[bot]
676b5fba35
Merge staging-next into staging 2022-05-01 06:01:47 +00:00
github-actions[bot]
dc0ace8d6e
Merge master into staging-next 2022-05-01 06:01:14 +00:00
Ivar Scholten
e3c19ba57e nuget-to-nix: include required dependencies 2022-04-30 18:24:48 -07:00
=
f0af1ef49c buildDotnetModule: properly inherit arguments from drv
Previously buildDotnetModule did not properly inherit some arguments from
derivations, take for example this expression:

dotnetFlags = [
    "--runtime linux-x64"
];

It would error out as follows: "MSBUILD : error MSB1001: Unknown switch.".
Setting the same flag from bash would work fine. This fixes that, all
arguments should now be properly interpreted :)
2022-04-30 18:24:48 -07:00
=
f69de108fb buildDotnetModule: nuget source cleanup
There used to be a few issues with the way we generate the nuget source:

* The derivation generated for the deps would have "nuget-deps" in them twice:
  /nix/store/...-foo-1.0-nuget-deps-nuget-deps

* We always tried to generate the dependencies for "projectReferences"
  even when it wasn't set, causing a warning.

This fixes those issues :)
2022-04-30 18:24:48 -07:00
=
38419c65ce mkNugetSource: fix bug in metadata generation
This improves the metadata generation, previously it would take any
"license" entry from the nuspec, and tried to match it to an spdx ID from
"lib.licenses".

Sometimes however licenses are provided in plain-text, which we
obviously cannot cleanly resolve. This resulted in in useless information
("LICENSE.txt") being written to "meta.license".
2022-04-30 18:24:48 -07:00
Vladimír Čunát
c480cc2895
Merge branch 'master' into staging-next-2022-04-23 2022-04-30 23:02:28 +02:00
github-actions[bot]
03ecebd53a
Merge staging-next into staging 2022-04-29 00:03:11 +00:00
github-actions[bot]
619828db66
Merge master into staging-next 2022-04-29 00:02:35 +00:00
Yusuf Bera Ertan
e2a3a3c690
default-crate-overrides: only add Security to propagatedBuildInputs on darwin for security-framework-sys 2022-04-28 21:24:46 +03:00
Doron Behar
40d287cfd7
Merge pull request #164163 from ncfavier/gapps-binary-wrapper 2022-04-27 23:30:37 +03:00
Naïm Favier
f8cc8ff575
makeBinaryWrapper: unset NIX_CFLAGS
Prevent the wrapper from being affected by the derivation's CFLAGS,
which may not even apply to GCC.
2022-04-26 12:14:39 +02:00
Naïm Favier
532ebf6b57
wrapGAppsHook: use makeBinaryWrapper
Reduces the likelihood of having apps wrapped twice by a shell script,
which causes problems with argv0.
2022-04-26 12:14:39 +02:00
github-actions[bot]
f8c265f433
Merge master into staging-next 2022-04-26 06:01:08 +00:00
Anders Kaseorg
6920d8ca42 treewide: Simplify negated uses of versionAtLeast, versionOlder
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2022-04-25 13:35:24 -07:00
Vladimír Čunát
82ec893b68
Merge branch 'staging' into staging-next 2022-04-23 18:10:57 +02:00
Artturi
62866bc352
Merge pull request #169449 from Artturin/movetesting1
testers.testVersion: move from trivial-builders.nix
2022-04-23 06:06:16 +03:00
github-actions[bot]
05f9abf294
Merge staging-next into staging 2022-04-22 18:01:54 +00:00
Artturi
785373a76f
Merge pull request #166605 from siraben/remove-redundant-stdenv 2022-04-22 20:25:38 +03:00
Artturin
41808d42d2 doc: move testers to their own chapter 2022-04-22 16:24:29 +03:00
Artturin
3cc2e86bab testers: convert to a format that is kind of compatible with nixdoc
Examples: support has to be added to https://github.com/nix-community/nixdoc

'nixdoc --category testers --description "nixpkgs testers" --file ./pkgs/build-support/testers/default.nix'
2022-04-22 16:24:29 +03:00
Artturin
250ef1ff39 testers.testVersion: move from trivial-builders.nix
we will have more testers in the future so they should have their own
location

putting 'testers' in args will also make it simpler to use multiple testers
2022-04-22 16:22:40 +03:00
Lassulus
1468e8f52d
Merge pull request #165111 from toonn/darwin-bundle-outputBin
make-darwin-bundle: Use output bin
2022-04-22 12:04:09 +01:00
Mario Rodas
f73ff5c229 emacsWrapper: add missing variable substitutions to Darwin app 2022-04-22 04:20:00 +00:00