summary refs log tree commit diff
path: root/lib
Commit message (Collapse)AuthorAge
* lib/systems: Fix eval for iphone32* examplesJohn Ericson2018-05-01
| | | | Whoops messed up 9a845de873dfcc31f360a08f1b1f786c6f649c7d slightly.
* lib/systems: Update iOS examplesJohn Ericson2018-05-01
| | | | | | The commented-out configs are @shlevy's old known-good ones. I changed them as needed to play nice with lib.systems.parse but did not test so leaving them as comments for now.
* Merge pull request #39788 from obsidiansystems/aarch32-for-masterJohn Ericson2018-04-30
|\ | | | | lib: Improve deprecation message for `isArm`
| * Merge remote-tracking branch 'upstream/master' into aarch32John Ericson2018-04-30
| |\
| * | treewide: isArm -> isAarch32John Ericson2018-04-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Following legacy packing conventions, `isArm` was defined just for 32-bit ARM instruction set. This is confusing to non packagers though, because Aarch64 is an ARM instruction set. The official ARM overview for ARMv8[1] is surprisingly not confusing, given the overall state of affairs for ARM naming conventions, and offers us a solution. It divides the nomenclature into three levels: ``` ISA: ARMv8 {-A, -R, -M} / \ Mode: Aarch32 Aarch64 | / \ Encoding: A64 A32 T32 ``` At the top is the overall v8 instruction set archicture. Second are the two modes, defined by bitwidth but differing in other semantics too, and buttom are the encodings, (hopefully?) isomorphic if they encode the same mode. The 32 bit encodings are mostly backwards compatible with previous non-Thumb and Thumb encodings, and if so we can pun the mode names to instead mean "sets of compatable or isomorphic encodings", and then voilà we have nice names for 32-bit and 64-bit arm instruction sets which do not use the word ARM so as to not confused either laymen or experienced ARM packages. [1]: https://developer.arm.com/products/architecture/a-profile (cherry picked from commit ba52ae50488de85a9cf60a3a04f1c9ca7122ec74)
| * | lib: Make platform predicates greppableJohn Ericson2018-03-20
| | | | | | | | | | | | | | | | | | | | | Should have commited on here and on merged master to begin with, but I didn't, so instead I cherry-pick. (cherry picked from commit 88c04a8b6b6714a61c8a28ec8bbd5ecf580ed2c7)
* | | treewide: rename version attributesMaximilian Bosch2018-04-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As suggested in https://github.com/NixOS/nixpkgs/pull/39416#discussion_r183845745 the versioning attributes in `lib` should be consistent to `nixos/version` which implicates the following changes: * `lib.trivial.version` -> `lib.trivial.release` * `lib.trivial.suffix` -> `lib.trivial.versionSuffix` * `lib.nixpkgsVersion` -> `lib.version` As `lib.nixpkgsVersion` is referenced several times in `NixOS/nixpkgs`, `NixOS/nix` and probably several user's setups. As the rename will cause a notable impact it's better to keep `lib.nixpkgsVersion` as alias with a warning yielded by `builtins.trace`.
* | | lib: deduplicate version/suffix referencesMaximilian Bosch2018-04-28
| | | | | | | | | | | | | | | | | | The logic regarding the generated `.version-suffix` file is already defined in `lib/trivial.nix` and shouldn't be duplicated in `nixos/version`.
* | | lib/debug: add replacement instructions & release notesProfpatsch2018-04-27
| | | | | | | | | | | | for every deprecated function.
* | | lib/debug: document module & functions, prune importsProfpatsch2018-04-27
| | |
* | | lib/debug: deprecate `traceCallXml`Profpatsch2018-04-27
| | | | | | | | | | | | Incompletely documented, and a FIXME/bug that has been there for years.
* | | lib/debug: deprecate `addErrorContextToAttrs`Profpatsch2018-04-27
| | | | | | | | | | | | | | | | | | The function isn’t used anywhere and `addErrorContext` is an undocumented builtin. The builtin is explicitely qualified at its two uses in the module system.
* | | lib/debug: deprecate `traceValIfNot`Profpatsch2018-04-27
| | | | | | | | | | | | | | | The function is only used in exactly one module and overly specific (`c` must be a true predicate for `x`, if not, a specific trace is called).
* | | lib/debug: deprecate attrNamesToStr, traceXMLVal(Marked)Profpatsch2018-04-27
| | | | | | | | | | | | | | | | | | | | | `attrNamesToStr` is very specific (and pretty trivial), so it doesn’t make sense to have it in the library. `traceXMLVal(Marked)` are just a builtin and `trace` and not very useful in general (trace output should not be parsed anyway).
* | | lib/debug: deprecate & modernize showValProfpatsch2018-04-27
| | | | | | | | | | | | | | | The code is re-implemented in terms of `generators.toPretty`, but is strictly less general than `traceValSeqN`, so we deprecate it.
* | | lib/debug: remove the deprecated strict functionProfpatsch2018-04-27
| | | | | | | | | | | | The grace period was long enough.
* | | lib/debug: add traceValFn, traceValSeqFn, traceValSeqNFnProfpatsch2018-04-27
| |/ |/| | | | | | | Being able to modify the value on-the-fly before printing is very useful in practice.
* | treewide: isArm -> isAarch32John Ericson2018-04-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Following legacy packing conventions, `isArm` was defined just for 32-bit ARM instruction set. This is confusing to non packagers though, because Aarch64 is an ARM instruction set. The official ARM overview for ARMv8[1] is surprisingly not confusing, given the overall state of affairs for ARM naming conventions, and offers us a solution. It divides the nomenclature into three levels: ``` ISA: ARMv8 {-A, -R, -M} / \ Mode: Aarch32 Aarch64 | / \ Encoding: A64 A32 T32 ``` At the top is the overall v8 instruction set archicture. Second are the two modes, defined by bitwidth but differing in other semantics too, and buttom are the encodings, (hopefully?) isomorphic if they encode the same mode. The 32 bit encodings are mostly backwards compatible with previous non-Thumb and Thumb encodings, and if so we can pun the mode names to instead mean "sets of compatable or isomorphic encodings", and then voilà we have nice names for 32-bit and 64-bit arm instruction sets which do not use the word ARM so as to not confused either laymen or experienced ARM packages. [1]: https://developer.arm.com/products/architecture/a-profile
* | lib/generators: print paths without quotes & move function downProfpatsch2018-04-25
| |
* | Merge pull request #39172 from obsidiansystems/ios-crossJohn Ericson2018-04-19
|\ \ | | | | | | ios-sdk-pkgs: Init from iOS SDK from XCode
| * | ios-sdk-pkgs: Init from iOS SDK from XCodeKen Micklas2018-04-19
| | |
* | | Merge pull request #38485 from obsidiansystems/nixos-nixpkgs-optionsJohn Ericson2018-04-19
|\ \ \ | |/ / |/| | nixpkgs module: Clean up platform options
| * | nixpkgs module: Clean up platform optionsJohn Ericson2018-04-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - `localSystem` is added, it strictly supercedes system - `crossSystem`'s description mentions `localSystem` (and vice versa). - No more weird special casing I don't even understand TEMP
* | | Fix a typo: types.openSignifiantByte -> types.openSignificantByteJohn Wiegley2018-04-13
| | |
* | | Merge pull request #38611 from volth/nat-sortJörg Thalheim2018-04-08
|\ \ \ | | | | | | | | lib: add naturalSort
| * | | lib: add naturalSort (move the example IPs to private space)volth2018-04-08
| | | |
| * | | lib: add naturalSortvolth2018-04-08
| | | |
* | | | lib: make extensibleSilvan Mosberger2018-04-07
| |/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows the lib fixed point to be extended with myLib = lib.extend (self: super: { foo = "foo"; }) With this it's possible to have the new modified lib attrset available to all modules when using evalModules myLib.evalModules { modules = [ ({ lib, ... }: { options.bar = lib.mkOption { default = lib.foo; }; }) ]; } => { config = { bar = "foo"; ... }; options = ...; }
* | | lib/generators: introduce a sane default for `mkValueString`Profpatsch2018-03-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | So far, `mkValueString` defaulted to `toString`, which is a bad match for most configuration file formats, especially because how booleans are formatted. This also improves error messages for unsupported types. Add a test to codify the formatting.
* | | lib/generators: improve documentation a bitProfpatsch2018-03-29
| | |
* | | lib/generators: improve toPrettyProfpatsch2018-03-29
| | | | | | | | | | | | | | | | | | * properly escape strings * remove one check for booleans * improve error message
* | | lib/modules: fix typoFranz Pletz2018-03-28
| | |
* | | libseccomp: Disable only on RISC-V if Linux.Shea Levy2018-03-27
| | | | | | | | | | | | | | | | | | The isSeccomputable flag treated Linux without seccomp as just a normal variant, when it really should be treated as a special case incurring complexity debt to support.
* | | kexectools: Disable only on RISC-V if Linux.Shea Levy2018-03-27
| | | | | | | | | | | | | | | | | | The isKexecable flag treated Linux without kexec as just a normal variant, when it really should be treated as a special case incurring complexity debt to support.
* | | Merge pull request #37752 from ryantm/fix-urlsMatthew Justin Bauer2018-03-25
|\ \ \ | | | | | | | | treewide: use more HTTPS URLs
| * | | treewide: use more HTTPS URLsRyan Mulligan2018-03-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Uses the HTTPS url for cases where the existing URL has a permanent redirect. For each domain, at least one fixed derivation URL was downloaded to test the domain is properly serving downloads. Also fixes jbake source URL, which was broken.
* | | | riscv-pk: Set platforms properlyShea Levy2018-03-24
|/ / /
* | | Remove obsolete /nix/var/nix/{manifests,channel-cache}Eelco Dolstra2018-03-20
| | |
* | | lib: Add `lib.platforms.windows`John Ericson2018-03-20
| | |
* | | lib: Make `platforms.all` actually match all platformsJohn Ericson2018-03-20
|/ / | | | | | | | | | | Otherwise obscure cross-compilations are hampered. `all` breaks all but the initial derivation (which we can't even write yet) in an open world setting however, so we really shouldn't have it.
* | lib: Make platform predicates greppableJohn Ericson2018-03-19
| |
* | Merge pull request #37395 from obsidiansystems/lib-meta-platformJohn Ericson2018-03-19
|\| | | | | lib: Factor in tiny bit of `meta.platform` checking
| * lib: Factor in tiny bit of `meta.platform` checkingJohn Ericson2018-03-19
| | | | | | | | I need it in stdenv and release-lib, so that seems motivation enough.
* | Merge pull request #37359 from obsidiansystems/lib-darwin-reorgJohn Ericson2018-03-19
|\ \ | | | | | | lib: Split Darwin into macOS and iOS
| * | lib: Split Darwin into macOS and iOSJohn Ericson2018-03-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I noticed LLVM accepts `ios` as its own OS in platform triples; a recent change as far as I know. I see it also accepts `macos*` for macOS (formerly OS X). If it's now customary to distinguish iOS like so (rather than guessing from the aarch, lets add both so our OSes are still disjoint, and make Darwin a family instead. But changing the config everywhere would probably be a mass rebuild, and I'm not sure how well other software supports OSes besides "darwin", so I'm keeping that the default name for macOS for now.
* | | add the CPAL-1.0 licenseMoritz Küttel2018-03-18
|/ / | | | | | | | | The 'Common Public Attribution License 1.0' is used for projectlibre and required for packaging it into nixpkgs.
* | Merge pull request #34444 from obsidiansystems/meta-checkJohn Ericson2018-03-18
|\| | | | | lib: Fix #30902
| * lib, stdenv: Check `meta.platforms` against host platform and be open worldJohn Ericson2018-03-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | First, we need check against the host platform, not the build platform. That's simple enough. Second, we move away from exahustive finite case analysis (i.e. exhaustively listing all platforms the package builds on). That only work in a closed-world setting, where we know all platforms we might build one. But with cross compilation, we may be building for arbitrary platforms, So we need fancier filters. This is the closed world to open world change. The solution is instead of having a list of systems (strings in the form "foo-bar"), we have a list of of systems or "patterns", i.e. attributes that partially match the output of the parsers in `lib.systems.parse`. The "check meta" logic treats the systems strings as an exact whitelist just as before, but treats the patterns as a fuzzy whitelist, intersecting the actual `hostPlatform` with the pattern and then checking for equality. (This is done using `matchAttrs`). The default convenience lists for `meta.platforms` are now changed to be lists of patterns (usually a single pattern) in `lib/systems/for-meta.nix` for maximum flexibility under this new system. Fixes #30902
* | Merge pull request #36985 from obsidiansystems/no-allButJohn Ericson2018-03-14
|\| | | | | treewide: get rid of platforms.allBut
| * treewide: get rid of platforms.allButJohn Ericson2018-03-14
| | | | | | | | | | | | | | Negative reasoning like `allBut` is a bad idea with an open world of platforms. Concretely, if we add a new, quite different sort of platform, existing packages with `allBut` will claim they work on it even though they probably won't.