Commit graph

371 commits

Author SHA1 Message Date
Wolfgang Walther 9992c0fd4d
doc/option-types: fix attrTag example
Further down, `ssh = { drop = {}; };` is used.
2025-03-27 14:22:53 +01:00
maryjane a6f14a6036 nixos/doc: Fix outdated references in the NixOS manual 2025-03-25 19:51:54 +00:00
Matt Sturgeon 2611d5bd70
formats.lua: init
Add a lua format, based on `lib.generators.toLua`.
2025-03-19 21:18:49 +00:00
Matt Sturgeon c347d605c9
lib.types: add luaInline
Represents inline lua as expected by `lib.generators.toLua`, for
embedding raw lua expressions within structurally generated lua.
2025-03-15 10:29:28 +00:00
Peder Bergebakken Sundt d525eb5838 treewide: fix typos
done with `fd \\\.md$ . --type f -x typos --write-changes`
2025-02-22 02:02:07 +01:00
Jeremy Fleischman 6d7f6a92cc
lib/types: add types.pathWith
This gives people some flexibility when they need a path type, and
prevents a "combinatorial explosion" of various path stops.

I've re-implemented our existing `path` and `pathInStore` types using
`pathWith`. Our existing `package` type is potentially a candidate for
similar treatment, but it's a little quirkier (there's some stuff with
`builtins.hasContext` and `toDerivation` that I don't completely
understand), and I didn't want to muddy this PR with that.

As a happy side effect of this work, we get a new feature: the ability
to create a type for paths *not* in the store. This is useful for when a
module needs a path to a file, and wants to protect people from
accidentally leaking that file into the nix store.
2025-02-15 16:14:06 +07:00
Silvan Mosberger 4fbf6bf123
pkgs-lib.formats.xml: init (#342633) 2025-01-13 22:11:17 +01:00
Felix Buehler a468405d67 pkgs-lib.formats.xml: init 2025-01-13 21:56:22 +01:00
Gavin John ce02ad25ed doc/manual: replace bad advice about package options and overlays 2025-01-08 12:49:40 -08:00
uku ccfeb0ac5b
pkgs.formats: add documentation entry for CDN 2025-01-08 14:02:24 +01:00
Robert Hensing 04a5fd4b4f
nixos/eval-config: Deprecate NIXOS_EXTRA_MODULE_PATH (#349549) 2025-01-05 20:51:20 +01:00
Will Fancher 15be453e9a
switch-to-configuration: Better handling of socket-activated units (#359724) 2025-01-04 11:51:21 -05:00
misuzu bec0f1da1b
nixos/manual: add hint to interactive testing about Internet access (#338639) 2024-12-14 13:21:43 +02:00
Johannes Kirschbauer d504a1e680
lib.types.attrsWith: add placeholder parameter 2024-12-09 15:25:18 +01:00
Andreas Fuchs d95a8f5a13 Document the logic around X-NotSocketActivated in the manual 2024-12-09 08:57:47 -05:00
Johannes Kirschbauer f2d4dc7a32
doc: lib.types.attrsWith init documentation 2024-12-03 08:37:33 +01:00
Johannes Kirschbauer 6b53949b0c
formats.ini: expose INI atom from all ini formats 2024-11-18 16:07:22 +01:00
Will Fancher 37ee6ba681 Revert "NixOS apply script"
Reverts #344407

This has broken nixos-rebuild switch so that it no longer updates the profile, which has bad consequences including not updating the systemd-boot menu with new generations.
2024-11-01 20:18:09 -04:00
Aleksana 11874eccfa
nixos/doc: Split mkdir mode into chmod command for clarity (#236740) 2024-11-01 11:09:52 +08:00
Robert Hensing 7902cea1de nixos: Update documentation to refer to bin/apply 2024-10-30 00:21:21 +01:00
Jacek Galowicz d2e4b94d8a nixos documentation: Suggest pkgs.testers.runNixOSTest
`pkgs.testers.runNixOSTest` is the latest and best way to run NixOS Tests
outside of nixpkgs as it also improves evaluation performance by
injecting the host pkgs into all the guests.
It seems no one uses it because it is not mentioned at the right places.
2024-10-28 09:36:39 +01:00
Robert Hensing 5f197bf5d0 nixos/eval-config: Deprecate NIXOS_EXTRA_MODULE_PATH
This gets rid of a potentially confusing behavior that doesn't need to
be in NixOS, and nobody ever bothered to add a test for it.
Let's keep things simple!
The suggested snippet is better than this feature ever was, and will be
in the user's face, where it belongs, kindly.

Tested with

    nix-instantiate nixos/lib/eval-config.nix --arg modules '[{fileSystems."/".device="x";boot.loader.grub.enable=false;}]' -A config.system.build.toplevel
    NIXOS_EXTRA_MODULE_PATH=$HOME/whatever.nix nix-instantiate nixos/lib/eval-config.nix --arg modules '[{fileSystems."/".device="x";boot.loader.grub.enable=false;}]' -A config.system.build.toplevel
2024-10-18 17:04:35 +02:00
K900 1f9fc918ce treewide: use pkgs.nixos-enter instead of config.system.build.nixos-enter 2024-09-21 16:13:36 +03:00
Artturin 7a199f5dd6
nixos/doc: add documentation for formats.hocon and formats.libconfig (#320339) 2024-09-10 18:26:10 +03:00
Felix Stupp 61fd315b42
nixos/manual: add hint to interactive testing about Internet access
verified with following minimal test, embedded in a flake for ease of
execution:
```nix
{
  inputs.nixpkgs.url = "github:NixOS/nixpkgs/master";
  outputs = { nixpkgs, ... }:
    let
      pkgs = import nixpkgs { system = "x86_64-linux"; };
    in
    {
      nixosTests.x86_64-linux.internet = pkgs.nixosTest {
        name = "internet";
        nodes.machine = { };
        # only succeeds in interactive mode
        testScript = ''
          machine.wait_for_unit("default.target")
          print(machine.succeed("curl -4 https://nixos.org"))
        '';
      };
    };
}
```

Launch this test interactively as described in the manual & run
`test_script()` to verify that the VM has Internet access.
2024-08-31 14:40:14 +00:00
Peder Bergebakken Sundt 99dec1f6b0 treewide: fix doc typos
Done with `fd \\\.md$ . --type f -x typos --write-changes`
2024-07-26 00:55:13 +02:00
h7x4 bf2adb82b7
nixos/doc: move implementation notes for formats.libconfig to docs 2024-06-16 20:58:50 +02:00
h7x4 a891526b22
nixos/doc: add documentation for formats.libconfig 2024-06-16 20:58:49 +02:00
h7x4 141a8a6c86
nixos/doc: move implementation notes for formats.hocon to docs 2024-06-16 20:58:48 +02:00
h7x4 89aaab565e
nixos/doc: add documentation for formats.hocon 2024-06-16 20:58:47 +02:00
Pedro O. A. Regis 015e29a742 doc: removes extra backtick 2024-06-07 15:21:57 -03:00
Sizhe Zhao 5209c84957
nixos/activation/bootspec: fix style 2024-06-05 11:14:36 +08:00
Sizhe Zhao 4f05b8e213
nixos/activation/bootspec: rephrase 2024-06-05 11:13:43 +08:00
Sizhe Zhao 3a4753867d
nixos/activation/bootspec: no longer experimental 2024-06-05 11:09:55 +08:00
Sizhe Zhao 0aaccaa596
nixos/activation/bootspec: now enabled by default 2024-06-05 11:06:03 +08:00
crayor1 970f689a49
nixos/doc: fix a typo in option-declarations.section.md (#304733)
Fix a typo
2024-05-18 13:06:50 +08:00
nhnn 083f211783
pkgs: add PHP to formats.nix 2024-05-16 13:07:34 +03:00
Silvan Mosberger 4f1d724b82
Merge pull request #284551 from hercules-ci/types-attrTag
Add `types.attrTag`
2024-04-09 20:48:44 +02:00
Robert Hensing f354686536 doc/option-types: Update sum types 2024-04-04 12:00:54 +02:00
Robert Hensing fa8b46adf4 doc/option-types: Make attrTag example self-contained
... well, except for the ellipses, which hide unnecessary descriptions,
which you should write!
2024-04-04 11:54:46 +02:00
Robert Hensing c0f54d3dea doc/option-types: Add attrTag example 2024-04-04 11:54:46 +02:00
Philip Taron ebde306504
nixos/lib, doc: remove references to mdDoc (#300738)
* doc: remove references to mdDoc in nixos/doc/manual/development/option-declarations.section.md

* nixos/lib: remove mdDoc in nixos/lib/make-options-doc/default.nix

* nixos/lib: remove mdDoc in nixos/lib/systemd-types.nix

* nixos/lib: remove mdDoc in nixos/lib/systemd-unit-options.nix

* nixos/lib: remove mdDoc in nixos/lib/testing/driver.nix

* nixos/lib: remove mdDoc in nixos/lib/testing/interactive.nix

* nixos/lib: remove mdDoc in nixos/lib/testing/meta.nix

* nixos/lib: remove mdDoc in nixos/lib/testing/name.nix

* nixos/lib: remove mdDoc in nixos/lib/testing/network.nix

* nixos/lib: remove mdDoc in nixos/lib/testing/nodes.nix

* nixos/lib: remove mdDoc in nixos/lib/testing/run.nix

* nixos/lib: remove mdDoc in nixos/lib/testing/testScript.nix
2024-04-01 16:58:23 -07:00
Janne Heß fcc95ff817 treewide: Fix all Nix ASTs in all markdown files
This allows for correct highlighting and maybe future automatic
formatting. The AST was verified to work with nixfmt only.
2024-03-28 09:28:12 +01:00
Anton Dyudin 811ec16c8a
doc: Fix test in writing-nixos-tests.section.md (#294902)
* Fix test in writing-nixos-tests.section.md

That paren couldn't possibly have been in the right place.

(I do not have nix set up to generate `writing-nixos-tests.section.xml` or verify the test or anything, please do whatever is appropriate with this trivial change)

* doc: fix numpy example test value

Making the test test the right thing made it fail

see PR discussion
2024-03-12 19:19:54 -07:00
Philip Taron 86ae7a6243
Remove top level with lib; in docs (#293829) 2024-03-06 22:35:43 +01:00
Robert Hensing eb787006d7 nixos/doc/running-nixos-tests: Describe system requirements 2024-03-05 20:51:10 +01:00
benaryorg 8b2d86b982
pkgs.formats: toINIWithGlobalSection wrapper
The new format is based on the existing wrapper and generates an INI file with an unnamed global section at the top as is used by *stunnel* for instance.
Technically the INI format is a subset of this however testing, type checking, and API guarantees profit from two separate generators.

Co-authored-by: tim-tx <tim-tx@users.noreply.github.com>
Signed-off-by: benaryorg <binary@benary.org>
2024-02-12 17:58:48 +00:00
Robert Hensing 6949bc21ce doc/option-types: Move nullOr to Union types 2024-02-11 18:45:16 +01:00
Robert Hensing 1ad30772ea doc/option-types: Move attrTag to Sum types, remove redundant paragraph 2024-02-11 18:45:15 +01:00
Robert Hensing 2ceb5558f9 doc/option-types: Move either and oneOf to Union types 2024-02-11 18:45:15 +01:00