Commit graph

14 commits

Author SHA1 Message Date
Arne Keller 138ac300df
nixos/v2ray: change the type of config field (#163810) 2024-12-11 10:30:02 +01:00
stuebinm 6afb255d97 nixos: remove all uses of lib.mdDoc
these changes were generated with nixq 0.0.2, by running

  nixq ">> lib.mdDoc[remove] Argument[keep]" --batchmode nixos/**.nix
  nixq ">> mdDoc[remove] Argument[keep]" --batchmode nixos/**.nix
  nixq ">> Inherit >> mdDoc[remove]" --batchmode nixos/**.nix

two mentions of the mdDoc function remain in nixos/, both of which
are inside of comments.

Since lib.mdDoc is already defined as just id, this commit is a no-op as
far as Nix (and the built manual) is concerned.
2024-04-13 10:07:35 -07:00
h7x4 0a37316d6c
treewide: use mkPackageOption
This commit replaces a lot of usages of `mkOption` with the package
type, to be `mkPackageOption`, in order to reduce the amount of code.
2023-11-27 01:28:36 +01:00
oxalica 07a9b7b1d8 nixos/{test/,}v2ray: fix for new CLI and use upstream systemd units 2022-09-21 15:59:29 +08:00
pennae 6039648c50 nixos/*: automatically convert option docs 2022-08-19 22:40:58 +02:00
pennae 72b507d5a2 nixos/*: convert some markdown in docbook to tags
a lot of markdown syntax has already snuck into option docs, many of it
predating the intent to migrate to markdown. we don't convert all of it
here, just that which is accompanied by docbook tags as well. the rest
can be converted by simply adding the mdDoc marker.
2022-08-19 22:40:58 +02:00
pennae 2e751c0772 treewide: automatically md-convert option descriptions
the conversion procedure is simple:

 - find all things that look like options, ie calls to either `mkOption`
   or `lib.mkOption` that take an attrset. remember the attrset as the
   option
 - for all options, find a `description` attribute who's value is not a
   call to `mdDoc` or `lib.mdDoc`
 - textually convert the entire value of the attribute to MD with a few
   simple regexes (the set from mdize-module.sh)
 - if the change produced a change in the manual output, discard
 - if the change kept the manual unchanged, add some text to the
   description to make sure we've actually found an option. if the
   manual changes this time, keep the converted description

this procedure converts 80% of nixos options to markdown. around 2000
options remain to be inspected, but most of those fail the "does not
change the manual output check": currently the MD conversion process
does not faithfully convert docbook tags like <code> and <package>, so
any option using such tags will not be converted at all.
2022-07-30 15:16:34 +02:00
c4710n fc4e95e2e0 nixos/v2ray: change the type of config field
Currently, the type of `config` is `types.attrsOf types.unspecified`. It results
that the merging of list doesn't perform as expected.

For example, I declare two part of config in two files:

`a.nix`:
```
config = {
  routing = {
    rules = [
      {
        type = "field";
        outboundTag = "direct";
        domain = [ "geosite:cn" ];
      }
    ];
  };
};
```

`b.nix`:
```
config = {
  routing = {
    rules = [
      {
        type = "field";
        outboundTag = "direct";
        ip = [
          "geoip:cn"
          "geoip:private"
        ];
      }
    ];
  };
};
```

After merging, only the content of `b.nix` left, the content of `a.nix` is
removed.

This commit give the right type of config, which makes the merging of config
acts as expected.
2022-03-12 18:08:32 +08:00
Bobby Rong 6a1c868a9d
Merge pull request #133700 from poscat0x04/v2ray-add-package-option
nixos/v2ray: add an option for specifying v2ray package used in the systemd service
2021-10-08 12:38:15 +08:00
Poscat e4dd32f67e
nixos/v2ray: add an option for specifying v2ray package used in the systemd service 2021-10-08 12:02:10 +08:00
Kid 3b27d83fa5
nixos/v2ray: update reference links 2021-08-19 19:53:45 +08:00
Serval 75afd2fc34
nixos/v2ray: check v2ray config during the build time 2020-03-25 01:51:56 +08:00
Serval 899d38170c
v2ray: fixups and change to buildGoModule 2019-11-28 02:10:37 +08:00
Serval 740e85f847
v2ray: add v2ray service 2019-11-21 21:51:10 +08:00