Commit Graph

126 Commits

Author SHA1 Message Date
Robert Schütz
34ab5d3a78 formats.yaml_1_1: use remarshal v2 2026-07-30 09:55:06 -07:00
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
figsoda
331c7d8e30 pkgs-lib/formats: revert to remarshal for toml 2026-05-04 12:13:42 -04:00
isabel
1cdfe0bd00 tests.writers: fix toml test
seems to have been forgotten in
https://github.com/NixOS/nixpkgs/pull/512319
2026-05-02 19:03:31 +01:00
Johannes Kirschbauer
df4aa1444e lib: add type signature to some of the functions and normalize existing ones (#495873) 2026-03-04 15:23:55 +00: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
dish
5e25771b0a tests.writers: replace semver with katex in writeJS* tests
Part of #489959
2026-03-01 13:11:06 -05:00
Antoine du Hamel
9e77da8bdc treewide: use nodejs-slim when accessing only node 2026-02-06 20:51:34 +01:00
Dyego Aurélio
28096cc5e3 treewide: apply nixfmt 1.2.0 2026-01-22 18:37:56 -03:00
Aliaksandr
01ab58d05d writers: remove very old aliases 2025-11-30 02:23:26 +02:00
Lukas Wurzinger
1f4c50ab81 lib/cli: deprecate toGNUCommandLine 2025-10-21 21:01:38 +02:00
Wolfgang Walther
91a8fee3aa treewide: remove redundant parentheses
Auto-fixed by nixf-diagnose.
2025-10-05 10:52:03 +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
jopejoe1
33964ab8ba tests: recurse into more attrs
This makes it so that our ci evals more tests and that hydra builds them, making it possible to catch more regressions.
2025-05-13 20:35:53 +02: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
Silvan Mosberger
4f0dadbf38 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 a08b3a4d19.tar.gz \
      --argstr baseRev b32a094368
    result/bin/apply-formatting $NIXPKGS_PATH
2024-12-10 20:26:33 +01: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
lassulus
a6521dc687 writers: disable broken test (fsharp) (#343507) 2024-10-04 21:40:32 +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
José Luis Lafuente
e852c13342 writers: disable broken test (fsharp) 2024-09-21 15:59:22 +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
Philip Taron
661aa513a1 writers: remove with statements from aliases 2024-08-18 06:31:14 -07: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