79 Commits

Author SHA1 Message Date
Eman Resu e21c64b291 build-support/dart: remove assertMsg usage 2026-05-26 14:14:40 -04:00
Eman Resu 40f65ad564 build-support/build-dart-application: remove assertMsg usage 2026-05-26 14:14:28 -04:00
Sigmanificient 0bbc8dffae treewide: set meta.license on hooks 2026-05-25 13:48:20 +02:00
hacker1024 4a7fb2c8ea Revert "flutterPackages: refactor"
This reverts commit fe90d5a666.
2026-04-12 20:41:26 +10:00
kyehn fe90d5a666 flutterPackages: refactor 2026-04-03 08:09:50 +00:00
kyehn 42c0f81a19 flutter.buildFlutterApplication: add support for finalAttrs 2026-02-28 10:01:14 +08:00
Luminar Leaf f761faf26d pub2nix.generatePackageGraph: use workspace package config 2026-02-03 11:46:38 +05:30
qzylinra a8e88a1be4 buildDartApplication: add workspace-package-config.py 2025-10-22 08:41:27 +08: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
qzylinra f0680ae0e2 pub2nix.generatePackageGraph: init 2025-08-26 11:57:30 +08:00
Wolfgang Walther 5a0711127c treewide: run nixfmt 1.0.0 2025-07-24 13:55:40 +02:00
emaryn cf57cdeb3b pub2nix.generators.linkPackageConfig: set languageVersion for root package 2025-07-08 01:44:15 +08:00
Silvan Mosberger 374e6bcc40 treewide: Format all Nix files
Format all Nix files using the officially approved formatter,
making the CI check introduced in the previous commit succeed:

  nix-build ci -A fmt.check

This is the next step of the of the [implementation](https://github.com/NixOS/nixfmt/issues/153)
of the accepted [RFC 166](https://github.com/NixOS/rfcs/pull/166).

This commit will lead to merge conflicts for a number of PRs,
up to an estimated ~1100 (~33%) among the PRs with activity in the past 2
months, but that should be lower than what it would be without the previous
[partial treewide format](https://github.com/NixOS/nixpkgs/pull/322537).

Merge conflicts caused by this commit can now automatically be resolved while rebasing using the
[auto-rebase script](https://github.com/NixOS/nixpkgs/tree/8616af08d915377bd930395f3b700a0e93d08728/maintainers/scripts/auto-rebase).

If you run into any problems regarding any of this, please reach out to the
[formatting team](https://nixos.org/community/teams/formatting/) by
pinging @NixOS/nix-formatting.
2025-04-01 20:10:43 +02:00
Arne Keller 75caf18b04 pub2nix.generatePackageConfig: Use logical paths for pubspec.yaml (#310059) 2024-12-13 10:33:43 +01: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 https://github.com/infinisil/treewide-nixpkgs-reformat-script/archive/a08b3a4d199c6124ac5b36a889d9099b4383463f.tar.gz \
      --argstr baseRev b32a094368
    result/bin/apply-formatting $NIXPKGS_PATH
2024-12-10 20:26:33 +01:00
Tristan Ross 299a94a7ed buildDartApplication: include dart SDK builder by default (#343337) 2024-10-11 20:56:17 -04: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
lelgenio 77292c4f5b buildDartApplication: include dart SDK builder by default 2024-09-20 17:04:09 -03:00
hacker1024 d67c1a4c6b pub2nix.generatePackageConfig: Use logical paths for pubspec.yaml 2024-05-08 19:24:51 +10:00
hacker1024 e3b2edadef dartHooks.dartInstallHook: Add trailing newline 2024-01-18 12:17:43 +11:00
hacker1024 b43ee05f4e dartHooks.dartInstallHook: Allow disabling cache installation independently 2024-01-18 10:15:35 +11:00
hacker1024 196a0a5b2d buildDartApplication: Add custom outputs to the end of the list 2024-01-18 10:13:57 +11:00
hacker1024 ee18b58cf4 pub2nix: Fix language version regex on Darwin 2024-01-14 17:21:51 +11:00
hacker1024 778cefd464 buildDartApplication: Allow reading pubspec.lock with IFD 2024-01-10 20:29:53 +11:00
FlafyDev 5a5db92870 buildDartApplication: remove customSourceBuilders from baseDerivation 2023-12-26 21:57:46 +02:00
FlafyDev 65b0c270c2 pub2nix: Add disclaimer why not to use fetchTarball 2023-12-26 21:54:30 +02:00
FlafyDev b0a2d432da buildDartApplication: fix note about fixed-output derivation 2023-12-26 21:50:50 +02:00
FlafyDev e827619c11 buildDartApplication: remove unused pubGetScript and generatePubspecLock 2023-12-26 21:49:22 +02:00
hacker1024 81a99463d8 buildDartApplication: Pass customSourceBuilders through to pub2nix 2023-12-26 18:48:12 +02:00
hacker1024 23952fb641 buildDartApplication: Remove depsListFile
We get a dependency list with pub2nix now. We can no longer easily distinguish between development dependency dependencies and regular dependency dependencies, but we weren't doing this anyway.
2023-12-26 18:48:12 +02:00
hacker1024 2bd3e5d779 buildDartApplication: Use package source builders and setup hooks instead of package overrides 2023-12-26 18:48:08 +02:00
hacker1024 cf55bc7300 buildDartApplication: Generate LD_LIBRARY_PATH at build time
This allows setup hooks to add runtime dependencies.
2023-12-26 17:08:51 +02:00
hacker1024 1ae96d0704 buildDartApplication: Move package sources to nativeBuildInputs
They are only needed at build time, after all.
2023-12-26 17:08:51 +02:00
hacker1024 48bf6da955 buildDartApplication: Declare dependency sources as build inputs 2023-12-26 17:08:51 +02:00
hacker1024 18d9cd0c50 pub2nix.readPubspecLock: Add package versions to passthru 2023-12-26 17:08:51 +02:00
hacker1024 4e4c4c2ad0 buildDartApplication: Use overrides for dev dependencies as well 2023-12-26 17:08:51 +02:00
hacker1024 65d2cc04a3 dartHooks.dartConfigHook: Simplify packageRun function 2023-12-26 17:08:51 +02:00
hacker1024 d41348a68a dartHooks.dartConfigHook: Add packageRun utility 2023-12-26 17:08:51 +02:00
hacker1024 bea71b1fe3 pub2nix.readPubspecLock: Add packagePath convenience attribute 2023-12-26 17:08:50 +02:00
hacker1024 7e043f5f28 buildDartApplication: Accept additional package_config.json setup commands 2023-12-26 17:06:18 +02:00
hacker1024 4eb35ef711 buildDartApplication: Link the package_config.json in a separate derivation 2023-12-26 17:06:18 +02:00
hacker1024 4f623fa0a1 buildDartApplication: Refactor autoDepsList logic 2023-12-26 17:06:18 +02:00
hacker1024 34ce9c64c9 pub2nix.readPubspecLock: Include entire source in package derivations
This allows references to paths above the package being built, e.g.  https://github.com/ExpidusOS/libtokyo/blob/bc5d988f32b67a9f91ff34248f69c45cfb4efcca/packages/libtokyo_flutter/pubspec.yaml#L42
2023-12-26 17:05:28 +02:00
hacker1024 3081228cc4 dart: Use Nix instead of Pub 2023-12-26 17:05:20 +02:00
linsui 676ef2b4b2 dart: fix fetchDartDeps 2023-12-25 14:58:02 +08:00
hacker1024 145c291ca6 fetchDartDeps: Use add milliseconds to date in package_config.json
This in compliance with the format specification.
https://github.com/dart-lang/language/blob/main/accepted/2.8/language-versioning/package-config-file-v2.md
2023-12-21 11:46:18 +01:00
hacker1024 0d82a3864a fetchDartDeps: Add a package_config.json derivation 2023-12-21 11:46:13 +01:00
hacker1024 e99f59010c fetchDartDeps: Pass through the dependency cache 2023-12-21 11:46:12 +01:00
hacker1024 623ac19416 fetchDartDeps: Generalise dependency derivation logic 2023-12-21 11:46:12 +01:00
hacker1024 75b809c7c6 buildDartApplication: Add entire Dart derivation to nativeBuildInputs 2023-12-21 11:46:11 +01:00