summary refs log tree commit diff
path: root/lib
Commit message (Collapse)AuthorAge
...
| * | | | | lib.meta: introduce `availableOn`oxalica2021-04-02
| | | | | |
* | | | | | Merge pull request #119406 from sternenseemann/toDerivation-listSilvan Mosberger2021-05-07
|\ \ \ \ \ \ | | | | | | | | | | | | | | lib/attrsets: make toDerivation x always work when isStorePath x
| * | | | | | lib/strings: forbid lists in isStorePathsternenseemann2021-05-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a list is passed to isStorePath this is most likely a mistake and it is therefore better to just return false. There is one case where this theoretically makes sense (if a list contains a single element for which isStorePath elem), but since that case is also probably seldomly intentional, it may save someone from debbuging unclear evaluation errors.
| * | | | | | lib/strings: fix example for isStorePathsternenseemann2021-05-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since it checks if dirOf x is the nix store dir, a trailing slash will break this check and make it return false.
* | | | | | | Merge pull request #121870 from Pacman99/pass-specialargsRobert Hensing2021-05-07
|\ \ \ \ \ \ \ | |/ / / / / / |/| | | | | | lib/modules: pass specialArgs to modules
| * | | | | | lib/modules: pass specialArgs as a module argumentPacman992021-05-06
| | | | | | |
* | | | | | | treewide: Do a number of no-op cleanups for cross and darwinJohn Ericson2021-05-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I am taking the non-invasive parts of #110914 to hopefully help out with #111988. In particular: - Use `lib.makeScopeWithSplicing` to make the `darwin` package set have a proper `callPackage`. - Adjust Darwin `stdenv`'s overlays keeping things from the previous stage to not stick around too much. - Expose `binutilsNoLibc` / `darwin.binutilsNoLibc` to hopefully get us closer to a unified LLVM and GCC bootstrap.
* | | | | | | lib/modules: Small optimizationSilvan Mosberger2021-05-06
| | | | | | |
* | | | | | | Merge pull request #114955 from berbiche/fix/modules-imports-listSilvan Mosberger2021-05-05
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | lib/modules: provide a better error message when "imports" contains a list
| * | | | | | | lib/modules: provide error message when imports contains a listNicolas Berbiche2021-05-05
| | | | | | | |
* | | | | | | | Revert "lib/modules: Issue type deprecation warnings recursively"Robert Hensing2021-05-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 4b54aedee5e05aaf2838f6d951508b83e33d2baa.
* | | | | | | | Revert "lib/tests: Add type deprecation tests"Robert Hensing2021-05-05
|/ / / / / / / | | | | | | | | | | | | | | | | | | | | | This reverts commit 8b957e3b301d748e6fbbed806d82bd9d4b9d4ac4.
* | | | | | | lib/tests: Add type deprecation testsSilvan Mosberger2021-05-03
| | | | | | |
* | | | | | | lib/modules: Issue type deprecation warnings recursivelySilvan Mosberger2021-05-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, an option of type attrsOf string wouldn't throw a deprecation warning, even though the string type is deprecated. This was because the deprecation warning trigger only looked at the type of the option itself, not any of its subtypes. This commit fixes this, causing each of the types deprecationMessages to trigger for the option. This relies on the subtypes mkOptionType attribute introduced in 26607a5a2e06653fec453c83d063cdfc4b59185f
* | | | | | | lib/tests: Make sure the submodule type description can be evaluatedSilvan Mosberger2021-05-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In 2d45a62899d47c109a0b8ce4ca9d33265b8a1a37, the submodule type description was amended with the freeformType description. This causes all the modules passed to the submodule to be evaluated once on their own, without any extra definitions from the config section. This means that the specified modules need to be valid on their own, without any undeclared options. This commit adds a test that evaluates a submodules option description, which would trigger the above problem for one of the tests, if it were not fixed by this commit as well. This is done because the next commit makes option evaluation a bit more strict, which would also trigger this test failure, even though it's not related to the change at all.
* | | | | | | lib/types: Introduce mkOptionType occurringTypes argumentSilvan Mosberger2021-05-03
|/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This will be used to issue deprecation warnings recursively in the next commit In addition, this allows easily getting nested types of other options, which is useful when you want to create an option that aliases a part of another one.
* | | | | | Merge pull request #120774 from sternenseemann/shellpackage-fix-checkSilvan Mosberger2021-05-03
|\ \ \ \ \ \ | | | | | | | | | | | | | | lib/types: only accept derivations for shellPackage
| * | | | | | lib/types: only accept derivations for shellPackagesternenseemann2021-04-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since shellPackage actually requires the value to be an attribute set (i. e. an derivation in this case), we cannot re-use the package.check type checker since it also allows strings or things that are coercible to strings as long as they look like store paths.
* | | | | | | lib: fix documented type of fixedWidthString (#121396)Lennart Spitzner2021-05-01
| | | | | | |
* | | | | | | treewide: use lib.warnIf where appropriateAlyssa Ross2021-04-28
| | | | | | |
* | | | | | | lib.trivial.warnIf: initAlyssa Ross2021-04-28
|/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's a common pattern in Nixpkgs to want to emit a warning in certain cases, but not actually change behaviours. This is often expressed as either if cond then lib.warn "Don't do that thing" x else x Or (if cond then lib.warn "Don't do that thing" else lib.id) x Neither of which really expresses the intent here, because it looks like 'x' is being chosen conditionally. To make this clearer, I introduce a "warnIf" function, which makes it clear that the only thing being affected by the condition is whether the warning is generated, not the value being returned.
* | | | | | Merge branch 'master' into staging-nextJan Tojnar2021-04-25
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | Choose binwalk 2.3.1, 27 is legacy version for Python 2.
| * | | | | | lib.systems.doubles.netbsd: expandAlyssa Ross2021-04-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These are all the architectures supported by Nixpkgs on other platforms, that are also supported by NetBSD. (So I haven't added any architectures that are new to Nixpkgs here, even though NetBSD supports some that we don't have.)
* | | | | | | Merge master into staging-nextgithub-actions[bot]2021-04-24
|\| | | | | |
| * | | | | | lib.systems.doubles.all: reorganizeAlyssa Ross2021-04-23
| | |_|/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The previous mess was partially grouped by OS, and partially grouped by architecture, which made it very difficult to know where to add new entries. I've chosen to group by OS entirely, because OSes are likely to maintain exhaustive lists of supported architectures, but it's far less likely we'd be able to find exhaustive lists of supported OSes for every architecture.
* | | | | | Merge master into staging-nextgithub-actions[bot]2021-04-15
|\| | | | |
| * | | | | lib.systems.examples.amd64-netbsd: add warningAlyssa Ross2021-04-15
| | | | | | | | | | | | | | | | | | | | | | | | Otherwise, nobody will know it's deprecated!
* | | | | | Merge master into staging-nextgithub-actions[bot]2021-04-15
|\| | | | |
| * | | | | lib: Adjust NetBSD example systemsJohn Ericson2021-04-15
| | | | | | | | | | | | | | | | | | | | | | | | Deprecate the odd one so no breaking change.
* | | | | | Merge remote-tracking branch 'upstream/staging-next' into down-integrate-stagingLuke Granger-Brown2021-04-12
|\| | | | |
| * | | | | Merge pull request #116495 from r-burns/ppc64Sandro2021-04-12
| |\ \ \ \ \ | | | | | | | | | | | | | | lib/systems: remove powerpc64 elfv1 support
| | * | | | | lib/systems: remove powerpc64 elfv1 supportRyan Burns2021-03-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I was specifying the ELF ABI using -elfv1 and -elfv2 target config suffixes, which are nonstandard and no longer work with gnu-config.
| * | | | | | systems: add appropriate rustc.config for androidMilan Pässler2021-04-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Rust doesn't like the `-unknown` vendor component in the target triple.
* | | | | | | Merge pull request #111988 from thefloweringash/darwin-platform-versionsJohn Ericson2021-04-12
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Darwin platform versions
| * | | | | | | lib.systems: add darwinPlatform where necessaryAndrew Childs2021-04-11
| | | | | | | |
| * | | | | | | bintools-wrapper, cc-wrapper: parameterize darwin min version variableAndrew Childs2021-04-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These variables are the ones that the standard toolchain uses, so we should use those and not always use MACOSX_DEPLOYMENT_TARGET. See https://github.com/tpoechtrager/cctools-port/blob/236a426c1205a3bfcf0dbb2e2faf2296f0a100e5/cctools/ld64/src/ld/PlatformSupport.cpp#L54-L55
| * | | | | | | darwin: move deployment target and sdk version to platform configAndrew Childs2021-03-26
| | | | | | | |
* | | | | | | | lib.licenses: add bsdOriginalUC (BSD 4-Clause University of California-Specific)ajs1242021-04-09
| |/ / / / / / |/| | | | | |
* | | | | | | lib.trivial: fix typo "nixpks" -> "nixpkgs"Alyssa Ross2021-04-05
| |_|/ / / / |/| | | | |
* | | | | | lib/generators: add toDhallEmery Hemingway2021-04-01
| |_|/ / / |/| | | |
* | | | | lib: fix commitIdFromGitRepo (#117752)Léo Gaspard2021-03-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When in the presence of worktrees, it happens that /commondir has a trailing slash. In these circumstances, it can lead to `lib.pathType` being passed paths like `/foo/bar/.git/`, which in turn lead to `error: attribute '.git' missing`. With this change, we now make sure send properly-formatted paths to all other functions. This, in particular, fixes running NixOS tests on worktrees created by libgit2 on my machine. (Worktrees created by git itself appear to not hit the issue.)
* | | | | Merge pull request #115919 from Ma27/module-error-improvementSilvan Mosberger2021-03-26
|\ \ \ \ \ | |/ / / / |/| | | | lib/modules: better error message if an attr-set of options is expected
| * | | | lib/modules: better error message if an attr-set of options is expectedMaximilian Bosch2021-03-11
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I recently wrote some Nix code where I wrongly set a value to an option which wasn't an actual option, but an attr-set of options. The mistake I made can be demonstrated with an expression like this: { foo = { lib, pkgs, config, ... }: with lib; { options.foo.bar.baz = mkOption { type = types.str; }; config.foo.bar = 23; }; } While it wasn't too hard to find the cause of the mistake for me, it was necessary to have some practice in reading stack traces from the module system since the eval-error I got was not very helpful: error: --- TypeError --------------------------------------------------------- nix-build at: (323:25) in file: /nix/store/3nm31brdz95pj8gch5gms6xwqh0xx55c-source/lib/modules.nix 322| foldl' (acc: module: 323| acc // (mapAttrs (n: v: | ^ 324| (acc.${n} or []) ++ f module v value is an integer while a set was expected (use '--show-trace' to show detailed location information) I figured that such an error can be fairly confusing for someone who's new to NixOS, so I decided to catch this case in th `byName` function in `lib/modules.nix` by checking if the value to map through is an actual attr-set. If not, a different error will be thrown.
* | | | Merge pull request #113212 from lopsided98/kernel-arm-fixJohn Ericson2021-03-21
|\ \ \ \ | | | | | | | | | | lib/systems/platforms: remove TI_CPTS override
| * | | | lib/systems/platforms: remove TI_CPTS overrideBen Wolsieffer2021-02-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Forcing the module to be builtin breaks 5.10, which wants to compile it as a module (probably due to dependencies). There doesn't seem to be a need to have it builtin anymore, so we can just remove the override.
| * | | | lib/systems/platforms: note that RPi 3 fixes aren't needed for kernel >=4.17Ben Wolsieffer2021-02-15
| | | | |
* | | | | Merge branch 'master' into staging-nextJan Tojnar2021-03-18
|\ \ \ \ \
| * | | | | licenses.odbl: init at 1.0Aaron Andersen2021-03-17
| | |/ / / | |/| | |
* / | | | lib/systems: add `darwinArch`Andrew Childs2021-03-02
|/ / / /
* / / / lib/licenses: fix regression removing shortName for some licensessternenseemann2021-02-25
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Usually we ensure using the mapAttrs call wrapping the license set that every license has an associated shortName. A change related to legacy aliases most likely introduced the removal of the shortName attribute for all the legacy license names by splitting the set into two sets connected by a record update operator -- leading to mapAttrs only affecting the first set. Since it used to be a valid assumption to have that every license had a shortName attribute, we reintroduce this attribute for the legacy aliases as well.