Commit Graph

51 Commits

Author SHA1 Message Date
Eman Resu
f9feb60dba makePythonWriter: remove a useless (and incorrect) check (#521741) 2026-07-15 14:05:19 +00:00
eveeifyeve
81daafea8c nim: remove 1_0, 2_0 and 2_2 versions and aliases; nim: 2.2.4 -> 2.2.10
writers/writeNim: migrate package to nim
nim: remove nativeStacktraces and gnuReadline args
nim: use pname instead

It's time that we remove nim1, nim1 has been a package for a while and
nim has moved on during that time to the v2 versions.
It's also time that nim had some attention in nixpkgs and upgrade the
nim 2 versions.

Also fixes an issue with nim-unwrapped missing the pname and version.
See #485742 for more info.

Co-authored-by: éclairevoyant
<848000+eclairevoyant@users.noreply.github.com>
2026-07-02 13:36:59 +10:00
Jack Wilsdon
d72cff76c8 writers.writeNginxConfig: fix cross compilation 2026-06-17 00:35:41 +01:00
SandaruKasa
14403d5630 makePythonWriter: remove a useless pypy check 2026-06-10 00:20:29 +03:00
Stefan Frijters
a95a506991 nixos/nginx: use structuredAttrs instead of passAsFile in writeNginxConfig 2026-05-30 14:52:53 +02:00
Martin Weinelt
8fc3c8c37d Revert "Revert "nixos/nginx: return nginx config formatter"" 2026-05-29 00:58:43 +02:00
Martin Weinelt
dfc06b1699 Revert "nixos/nginx: return nginx config formatter" 2026-05-29 00:25:14 +02:00
Izorkin
a5b9d2cc50 nixos/nginx: return nginx config formatter 2026-05-26 20:18:31 +03:00
Lin Jian
7a72b3ecb5 writeHaskell: allow providing function for libraries
This is much safer at avoiding version mismatches.
2026-05-06 01:47:30 +08:00
İlkecan Bozdoğan
e394a579b0 lib: update type signatures
- concrete types start with uppercase: Int, String, Bool, Derivation,
  etc.
- type variables start with lowercase: a, b, etc.
- list:
  - use `[x]` for homogeneous lists instead of `List x` or `[ x ]`
  - use `List` for heterogeneous lists (not that common in `lib`)
- attr:
  - use `AttrSet` for a generic attribute set type
  - use `{ key1 :: Type1; key2 :: Type2; ... }` for adding signatures
    for known attribute names and types
  - use `{ key1 = value1; key2 = value2; ... }` for adding attributes
    with known literals
  - end with an ellipsis (`...`) if the set can contain unknown
    attributes
  - use `{ [String] :: x }` if all the attributes has the same type `x`
- prefer `Any` over `a` if the latter is not reused
2026-03-04 00:10:00 +03:00
Antoine du Hamel
9e77da8bdc treewide: use nodejs-slim when accessing only node 2026-02-06 20:51:34 +01:00
Lukas Wurzinger
1f4c50ab81 lib/cli: deprecate toGNUCommandLine 2025-10-21 21:01:38 +02:00
NAHO
c8d4dabc43 pkgs: remove optional builtins prefixes from prelude functions
Remove optional builtins prefixes from prelude functions by running:

    builtins=(
      abort
      baseNameOf
      break
      derivation
      derivationStrict
      dirOf
      false
      fetchGit
      fetchMercurial
      fetchTarball
      fetchTree
      fromTOML
      import
      isNull
      map
      null
      placeholder
      removeAttrs
      scopedImport
      throw
      toString
      true
    )

    fd \
      --type file \
      . \
      pkgs \
      --exec-batch sed --in-place --regexp-extended "
        s/\<builtins\.($(
          printf '%s\n' "${builtins[@]}" |
            paste --delimiter '|' --serial -
        ))\>/\1/g
      "

    nix fmt
2025-10-04 19:02:37 +02:00
Katalin Rebhan
f98fe9dd4d writers.writeBash(Bin): use bashNonInteractive as interpreter
Fixup of e3491c9e40, making non-interactive bash once again the
interpreter for this derivation constructor.
2025-09-10 00:02:12 +02:00
lassulus
6730f8c4b0 makePythonWriter: allow providing function for libraries (#305163) 2025-06-25 00:46:25 +02:00
Josh Hoffer
03959029e6 Use direct function application syntax
Co-authored-by: Wolfgang Walther <walther@technowledgy.de>
2025-05-21 14:13:18 -07:00
Arnout Engelen
317689eefb nginx: output config on failed gixy check
Sometimes the gixy output can be hard to trace back to the module
configurations that were merged into that config. Also provide a
hint that this can happen due to merging incompatible services on
the same hostname.
2025-03-13 17:42:19 +01:00
rczb
239a22c971 writers: add writeGuile[Bin] 2024-12-12 21:12:16 +08:00
David McFarland
b0d941edb4 dotnet: november 2024 upgrades and infrastructure changes (#355753) 2024-11-18 20:20:45 -04:00
David McFarland
bfaca46529 dotnet-sdk/runtime/aspnetcore: 6.0 -> 8.0 2024-11-17 18:35:19 -04:00
sg-qwt
4cadc5e868 writers: fix babashka docs format 2024-11-17 14:12:47 +08:00
無名氏
5647f0905b writers: make babashka interpreter and check configurable 2024-11-11 19:49:17 +08:00
euxane
ca23669cf8 writers: add writeNim and writeNimBin
This adds convenience writers for self-contained Nim programs.
Those are compiled into very small binaries.

Test with: `nix build .#pkgs.tests.writers.{bin,simple,wrapping}.nim`
2024-10-05 21:33:26 +02:00
lassulus
d263cdfff4 writers: add babashka (#343510) 2024-10-04 21:40:48 +01:00
Artturin
e0464e4788 treewide: replace stdenv.is with stdenv.hostPlatform.is
In preparation for the deprecation of `stdenv.isX`.

These shorthands are not conducive to cross-compilation because they
hide the platforms.

Darwin might get cross-compilation for which the continued usage of `stdenv.isDarwin` will get in the way

One example of why this is bad and especially affects compiler packages
https://www.github.com/NixOS/nixpkgs/pull/343059

There are too many files to go through manually but a treewide should
get users thinking when they see a `hostPlatform.isX` in a place where it
doesn't make sense.

```
fd --type f "\.nix" | xargs sd --fixed-strings "stdenv.is" "stdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "stdenv'.is" "stdenv'.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "clangStdenv.is" "clangStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "gccStdenv.is" "gccStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "stdenvNoCC.is" "stdenvNoCC.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "inherit (stdenv) is" "inherit (stdenv.hostPlatform) is"
fd --type f "\.nix" | xargs sd --fixed-strings "buildStdenv.is" "buildStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "effectiveStdenv.is" "effectiveStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "originalStdenv.is" "originalStdenv.hostPlatform.is"
```
2024-09-25 00:04:37 +03:00
José Luis Lafuente
55903a2f8e writers: add babashka 2024-09-21 16:30:50 +02:00
Josh Hoffer
718d2287b0 makePythonWriter: allow providing function for libraries 2024-09-19 09:58:48 -07:00
Johannes Kirschbauer
e78c3b6d6e Format: pkgs.writers 2024-09-14 19:23:41 +02:00
Johannes Kirschbauer
9d9decda25 Doc: {pkgs.writers.*} migrate doc-comments 2024-09-14 19:20:17 +02:00
Alexander Sieg
3b0ba6a6e1 writers.*: use lib.makeBinPath in documentation
This also fixes a syntax error with `,` being used as a array element
separator.
2024-08-26 12:19:19 +02:00
Sigmanificient
f03b7856a6 makePythonWriter: add doCheck toggle 2024-08-21 19:17:36 +02:00
lassulus
4b3c31b884 Merge pull request #334776 from aos/aos/update-writepy3-example
fix: Update writePython3Bin docs
2024-08-15 07:42:45 +02:00
Aos Dabbagh
55e4114fb3 fix: Update writePython3Bin docs
Was trying out the recommended example for `writePython3Bin` and it
failed with:
```
Traceback (most recent call last):
  File "/nix/store/gcmhfm7mslpndjasfhvs66f1ca24vxim-test_py3/bin/test_py3", line 4, in <module>
    y = yaml.load("""
TypeError: load() missing 1 required positional argument: 'Loader'
```

Looks like `yaml.load(input)` was deprecated in 5.1: https://msg.pyyaml.org/load

`nixos-24.05` uses `6.0.1` so we're in the clear.
2024-08-15 00:57:39 -04:00
Philip Taron
989f10d419 pkgs.writers: improve documentation on {makeScriptWriter,makeScriptWriterBin} 2024-08-12 08:42:11 -07:00
Johannes Kirschbauer
85a8d22290 Pkgs.writers: document {makeScriptWriter,makeScriptWriterBin} 2024-08-09 14:13:02 +02:00
Sandro Jäckel
2040dfa812 uglify-js: remove remaining aliases, entry from nodePackages 2024-07-03 21:25:54 +02:00
Alexis Hildebrandt
755b915a15 treewide: Remove indefinite article from meta.description
nix run nixpkgs#silver-searcher -- -G '\.nix$' -0l 'description.*"[Aa]n?' pkgs \
  | xargs -0 nix run nixpkgs#gnused -- -i '' -Ee 's/(description.*")[Aa]n? (.)/\1\U\2/'
2024-06-09 23:07:45 +02:00
annalee
636ed70ab3 Merge remote-tracking branch 'upstream/staging-next' into staging 2024-03-16 00:07:22 +00:00
Philip Taron
dc59ca2bd9 Avoid lib.or in pkgs/build-support/writers/ 2024-03-14 14:11:11 -07:00
DavHau
9a5b86c189 writers: add support for wrapping
Add a makeWrapperArgs argument to all script writers under pkgs.writers.

This can be used to set, prefix, or suffix the PATH or other environment variables which improves the ability to generate scripts with reproducible behavior.

Some of the writers (writeBash, writeDash, writeFish, writeNu) previously did not support passing an argument set, for example
```
writeBash "example" "echo hello"

```

In order to add the new capability to these writers as well, their call signature is now overloaded in order to allow the following:
(The old call style from the example above remains intact)
```
writeBash "example"
  { makeWrapperArgs = [ "--prefix" "PATH" ":" "${pkgs.hello}/bin" ]; }
  ''
    hello
  ''
```

Done as well:
- add tests
- add more docs
- fix some misleading docs
- extend existing docs with more examples
2024-03-05 14:25:42 +07:00
Vladimír Čunát
ea4b95755d Revert "writers: add support for wrapping" 2024-03-04 07:05:23 +01:00
DavHau
3e3ae4ecf5 writers: add support for wrapping
Add a makeWrapperArgs argument to all script writers under pkgs.writers.

This can be used to set, prefix, or suffix the PATH or other environment variables which improves the ability to generate scripts with reproducible behavior.

Some of the writers (writeBash, writeDash, writeFish, writeNu) previously did not support passing an argument set, for example
```
writeBash "example" "echo hello"

```

In order to add the new capability to these writers as well, their call signature is now overloaded in order to allow the following:
(The old call style from the example above remains intact)
```
writeBash "example"
  { makeWrapperArgs = [ "--prefix" "PATH" ":" "${pkgs.hello}/bin" ]; }
  ''
    hello
  ''
```

Done as well:
- add tests
- add more docs
- fix some misleading docs
- extend existing docs with more examples
2024-02-29 17:31:58 +07:00
Tulili
1e7dc0e1b8 pkgs.writers: fix type in description for writeHaskellBin 2024-01-30 06:48:51 +01:00
Tulili
703a085c0a pkgs.writers: tests for lua ruby, and remove failed tests because of external package errors 2024-01-30 06:48:43 +01:00
Tulili
f6e0ee5545 pkgs.writers: remove tests that dont work anymore and add comments tracking issues 2024-01-30 06:48:35 +01:00
Tulili
05ad04bdd3 pkgs.writers add snu, lua and ruby 2024-01-30 06:48:15 +01:00
Vladimír Čunát
d5732d9669 Merge branch 'staging-next' into staging 2023-08-05 07:45:29 +02:00
Simon Žlender
8e912feb29 codesign_allocate: reference cctools 2023-08-01 21:27:09 +02:00
Robert Hensing
0ed9e35a22 writers: Set mainProgram
Part of https://github.com/NixOS/nixpkgs/pull/246386
2023-08-01 12:21:06 +02:00
Ben Wolsieffer
09dd973987 writers: use callPackages to import sub-groups of writers
Use callPackages instead of plain import to get proper splicing. Without this,
writeNginxConfig fails when cross-compiling.
2023-07-27 22:54:41 -04:00