471 Commits

Author SHA1 Message Date
Aliaksandr 80f12557f5 treewide: replace "yes" else "no" usages to lib.boolToYesNo 2025-10-21 16:04:34 +03:00
jopejoe1 7d30c40939 treewide: migrate packages to pkgs/by-name, again 2025-03-25 17:00:45 +01:00
maralorn 92a0f1c301 nix-output-monitor: 2.1.4 -> 2.1.5 2025-02-28 20:16:04 +01:00
Ethan Carter Edwards 752cc5c3de nixci: move nixci to by-name and modernize
Signed-off-by: Ethan Carter Edwards <ethan@ethancedwards.com>
2025-01-31 20:47:49 -05:00
Thiago Kenji Okada 9875c5795a nixos-option: move to pkgs/by-name 2025-01-01 13:18:03 +00:00
Thiago Kenji Okada f6c458dfc1 nixos-option: add warn when Flake is used 2025-01-01 13:18:02 +00:00
aleksana 2ceb1dbe60 nixos-option: update manpage 2025-01-01 13:18:02 +00:00
FireFly 7c8e422689 nixos-option: rewrite as a nix script
This ports the functionality of the C++ nixos-option to a nix script
(with a tiny shellscript for argument processing and invoking the nix
script). Benefits compared to the native binary include no longer being
tied to a specific nix version, generally improved maintainability and
improved stability.

The main tradeoff is that the C++ version would have better access to
introspecting and reporting errors nicely, but that doesn't seem to have
been the case in practice anyway.  The other tradeoff is that we
generate all the output at the end instead of streaming it as we
traverse the option tree.

Co-authored-by: Zhong Jianxin <azuwis@gmail.com>
Co-authored-by: aleksana <me@aleksana.moe>
Co-authored-by: eclairevoyant <contactmeongithubinstead@proton.me>
2025-01-01 13:18:02 +00:00
Jörg Thalheim 2bd5a84b9c nixos-option: link to nixos test (#363967) 2024-12-11 07:55:58 +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
Jörg Thalheim e4206aafdd nixos-option: link to nixos test 2024-12-10 17:02:18 +01:00
K900 ba8c043270 Revert "nixos-option: cleanup and linting" 2024-12-10 16:30:05 +03:00
Jörg Thalheim b7ea84f900 nixos-options: don't use references for string_views 2024-11-18 17:29:10 +01:00
Jörg Thalheim cf11719258 nixos-option: disable modernize-use-trailing-return-type 2024-11-18 17:23:06 +01:00
Jörg Thalheim 7a8407e477 nixos-option: fix potential memory leak in mapOptions 2024-11-18 17:23:06 +01:00
Jörg Thalheim 6fe4fb2b95 nixos-option: enable cppcoreguidelines lints 2024-11-18 17:23:06 +01:00
Jörg Thalheim e7367a6eab nixos-option: enable misc lints 2024-11-18 17:06:35 +01:00
Jörg Thalheim 1e59fb41f0 nixos-option: enable more lints 2024-11-18 17:06:35 +01:00
Jörg Thalheim e5705ba07b nixos-option: enable readability lint 2024-11-18 17:06:35 +01:00
Jörg Thalheim 9c4e940564 nixos-option: enable modernize-* checks in clang-tidy 2024-11-18 17:06:34 +01:00
Jörg Thalheim c3e48526e0 nixos-option: enable performance lint 2024-11-13 23:12:32 +01:00
Jörg Thalheim 01580b19ae nixos-option: enable bugprone lints 2024-11-13 23:12:30 +01:00
Jörg Thalheim 2cfcb6f442 nixos-option: don't throw errors in main
https://clang.llvm.org/extra/clang-tidy/checks/bugprone/exception-escape.html
2024-11-13 23:12:28 +01:00
Jörg Thalheim e8d76d62a2 nixos-option: explicitly cast to int from size_t
to make the linter happy.
2024-11-13 23:12:26 +01:00
Jörg Thalheim 553461adc7 nixos-option: use c++20 starts_with 2024-11-13 23:12:19 +01:00
Jörg Thalheim 226981490b nixos-option: clean up includes based on clang-tidy suggestions
Before the code was using include-what-you-means, but it's a bit tricky
to integrate this in nix. I had some trouble with nix-eval-jobs when using include-what-you-means.
clang-tidy on the other hand proved more robust to me and is useful for linting in general,
so less tooling overall for this little project.
2024-11-13 23:11:42 +01:00
Jörg Thalheim 7e9e33e79c nixos-option: add devShell 2024-11-13 23:10:25 +01:00
Jörg Thalheim 00c3a3defe nixos-option: add clang-tidy 2024-11-13 23:10:23 +01:00
Jörg Thalheim 5f9d2d9572 nixos-option: fix build against nix 2.24 2024-11-13 22:57:08 +01:00
Valentin Gagarin 50ff833cd8 devmode: move to pkgs/by-name
now one can use `devmode` from anywhere Nixpkgs is available:

    devmode = pkgs.devmode.override {
      buildArgs = toString ./.;
      open = "/index.html";
    };
2024-11-12 10:16:58 +01:00
Valentin Gagarin b94f54b7a0 devmode: make reusable
the `devmode` helper made for the Nixpkgs/NixOS manual was exposed wrapped
in `mkShell`, which made it impossible to reuse.

this change strips that wrapper and reproduces it at the call site.

now one can use `devmode` from anywhere Nixpkgs is available:

    devmode = pkgs.callPackage "${pkgs.path}/pkgs/tools/nix/web-devmode.nix" {
      buildArgs = toString ./.;
      open = "/index.html";
    };
2024-11-12 10:16:58 +01:00
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00
maralorn 56d03d86ed nix-output-monitor: 2.1.3 -> 2.1.4
Changelog:

* bash: Add shell completion for `nom` command (thanks to @tomberek and @pdietl).
* zsh: Add shell completion for `nom` and `nom-shell` command (additionally to the existing completion for `nom-build`).
* Fix typo in README (thanks to @techie2000)
2024-10-17 01:23:57 +02:00
R. Ryantm 69bc7c632f fh: 0.1.17 -> 0.1.18 2024-10-09 12:58:51 +00: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
Jörg Thalheim fd81e768a7 nixos-install-tools: make nixos-install/enter overridable 2024-09-20 11:19:01 +02:00
h7x4 9a6c76c4af treewide: remove unused inputs (#342672) 2024-09-19 20:36:18 +02:00
R. Ryantm cbda7ae070 fh: 0.1.16 -> 0.1.17 2024-09-18 03:09:05 +00:00
Peder Bergebakken Sundt 8c8c27bb19 treewide: remove unused inputs 2024-09-18 01:00:07 +02:00
figsoda 4e56dc29b5 nix-melt: 0.1.2 -> 0.1.3
Diff: https://github.com/nix-community/nix-melt/compare/v0.1.2...v0.1.3

Changelog: https://github.com/nix-community/nix-melt/blob/v0.1.3/CHANGELOG.md
2024-09-16 11:33:54 -04:00
Silvan Mosberger e67ca390a3 nixdoc: 3.0.7 -> 3.0.8 (#339883) 2024-09-13 00:17:30 +02:00
Francesco Gazzetta e84fdec7f0 nixdoc: 3.0.7 -> 3.0.8
Diff: https://github.com/nix-community/nixdoc/compare/v3.0.7...v3.0.8
2024-09-05 21:54:58 +02:00
Sandro Jäckel ab8bf8c35b lib/modules: improve error message when option is being accessed that isn't defined 2024-09-01 23:29:21 +02:00
Silvan Mosberger 65e7143039 nix-info: Format files with nixfmt
This is a rare case of a Nix file actually ending up in the build result.
We reformat this now, causing a rebuild, so that we won't cause a rebuild
in the treewide reformatting PR.
2024-08-25 04:59:04 +02:00
Bryan Lai 0d077cbecb nix-melt: bump deps harder to fix rust 1.80 build
With: cargo update time --recursive

It turns out that in this case a simple `cargo update time` is
not enough to fix the build; one also needs to add the `--recursive`
flag.
2024-08-24 17:49:34 +02:00
ghpzin 7f907528a8 fh: 0.1.10 -> 0.1.16, fix build 2024-08-19 08:11:23 +02:00
K900 11ce9983ff nix-init: 0.3.1 -> 0.3.2 2024-08-16 09:18:01 +03:00
Sandro 6c6d28888b Merge pull request #334556 from bryango/nix-melt-rust-1.80-fix-build 2024-08-14 11:05:11 +02:00
Bryan Lai 1d28ed3c3a nix-melt: fix build for rust 1.80 2024-08-14 15:51:28 +08:00
R. Ryantm e1822b634c nix-init: 0.3.0 -> 0.3.1 2024-08-14 05:16:12 +00:00