Commit Graph

98 Commits

Author SHA1 Message Date
K900
784330e275 treewide: nuke remaining mdDoc leftovers
bors when
2024-04-15 20:12:24 +03: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
Sandro Jäckel
8c972ce2c0
nixos/grafana: fix deprecation warning by using grafana server instead of grafana-server
Deprecation warning: The standalone 'grafana-server' program is deprecated and will be removed in the future. Please update all uses of 'grafana-server' to 'grafana server'
2023-12-06 23:40:30 +01:00
Sandro Jäckel
cff247a127
nixos/grafana: create plugins directory in provisioning
The error message was:
msg="Failed to read plugin provisioning files from directory" path=/nix/store/gs2cy8n6ndsa1f7msf7ndl8f85xl1pzg-grafana-provisioning/plugins
 error="open /nix/store/gs2cy8n6ndsa1f7msf7ndl8f85xl1pzg-grafana-provisioning/plugins: no such file or directory"
2023-12-06 23:40:29 +01: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
Jonathan Davies
58cbf94b38 nixos/grafana: Set systemd unit to restart on failure 2023-11-15 23:20:59 +00:00
Anthony Roussel
e30f48be94
treewide: fix redirected and broken URLs
Using the script in maintainers/scripts/update-redirected-urls.sh
2023-11-11 10:49:01 +01:00
Maximilian Bosch
698c640e77
nixos/grafana: remove hacky deprecation helper from dashbaords & datasources
The problem we had back then was that `mkRenamedOptionModule` doesn't
work if an option will be moved a level depper, i.e.

    services.grafana.provision.dashboards

became

    services.grafana.provision.dashboards.settings.provider

I actually planned to remove this before 23.05 (since the change was
already released in 22.11), but as you can see that didn't happen ;-)

I think the grace-period was quite long already. And if someone is
migrating from <22.11 to a current NixOS now, there are very precise
instructions on how to upgrade in the 22.11 release notes.
2023-09-14 22:12:53 +02:00
Sandro
0a5cb5c47e
nixos/grafana: disable updater by default (#240323) 2023-06-28 14:09:55 +02:00
Franz Pletz
48d0d69869
Merge pull request #239348 from Ma27/bump-grafana 2023-06-23 23:15:43 +02:00
Maximilian Bosch
6e6c2e6530
nixos/grafana: clarify that there's still a bit of time until notifiers are removed
See https://github.com/grafana/grafana/pull/66269
2023-06-23 13:45:56 +02:00
Joscha
daa75a4093 nixos/grafana: Fix and adjust config options 2023-06-20 23:19:45 +02:00
Joscha
5e4ec14596 nixos/grafana: update and add settings
I went through all categories that were already present in the grafana
module and added most options from the official docs at
https://grafana.com/docs/grafana/v9.5/setup-grafana/configure-grafana/

I also modified the descriptions of some existing options to match the
official docs more closely.
2023-06-18 22:23:48 +02:00
Joscha
2f68d8cb10 nixos/grafana: reformat 2023-06-18 22:23:39 +02:00
Jacob Moody
39f220b6df
nixos/grafana: add jsonData datasource option (#234364) 2023-06-07 00:11:10 +02:00
KFears
51fdf00ecb nixos/grafana: fix assertions leaking into YAML
This commit deletes the assertions that were added in 4ec456b. Those
assertions weren't even working to begin with, and they also cause
assertions leak into the generated YAML.
2023-04-06 02:35:23 +04:00
Artturin
cab4a24c34 treewide: fix lints
Arg to lib.optional is a list

build time tool in buildInputs
2023-03-11 00:55:17 +02:00
Ross Gardiner
b199b821c2 nixos/grafana: fix spelling 2023-01-09 13:02:36 +01:00
Sandro Jäckel
7e0588b2fb
nixos/grafana: listen on localhost by default (again) 2022-12-29 03:00:14 +01:00
Maximilian Bosch
f37f1de422
Merge pull request #204537 from squalus/grafana-role
nixos/grafana: add Admin to valid auto_assign_org_role values
2022-12-20 21:14:47 +01:00
D Anzorge
9be81d0acf nixos/grafana: allow @chown syscalls when using unix sockets
Grafana will unconditionally call chown on the socket after creating it,
even if the configuration does not ask for a different socket gid.
2022-12-13 02:47:50 +01:00
squalus
ef90ce7093 nixos/grafana: add Admin to valid auto_assign_org_role values 2022-12-04 13:10:19 -08:00
Maximilian Bosch
98cadbcf70
nixos/grafana: review fixes 2022-11-20 19:54:44 +01:00
Maximilian Bosch
6ee5ae3e48
nixos/grafana: make warning more clear 2022-11-20 18:21:41 +01:00
Maximilian Bosch
9d7e9c5965
nixos/grafana: allow using both directories or single YAML files for non-Nix provisioning 2022-11-20 18:21:41 +01:00
Maximilian Bosch
2f1dfb0db3
nixos/grafana: fix w/o datasources or dashboard provisioning 2022-11-20 18:21:41 +01:00
Maximilian Bosch
4ec456b725
nixos/grafana: fix secret-related warnings
Closes #198646

* The options `password`/`basicAuthPassword` were removed for
  datasources in Grafana 9. The only option to declare them now is to use
  `secureJsonData`.
* Fix description for contactPoints provisioning: when using file/env
  providers, nothing will be leaked into the store.
* Fix regex in file-provider usage check: it's also possible to either
  use `$__env{FOO}` or `$FOO` to fetch secrets from the environment.
* Fix warning for datasources: `password`/`basicAuthPassword` was
  removed, also check for each setting in `secureJsonData` if
  env/file-provider was used (then no warning is needed!).
2022-11-20 18:21:40 +01:00
Maximilian Bosch
45e1ce7e3a
nixos/grafana: get rid of unnecessary flatten for warnings 2022-11-20 18:21:39 +01:00
Maximilian Bosch
25b5824696
nixos/grafana: mark services.grafana.extraOptions as removed 2022-11-20 18:21:38 +01:00
Maximilian Bosch
957e368f3d
nixos/grafana: provision.{datasources,dashboards} can't be a list anymore
The hack with `either` had the side-effect that the sub-options of the
submodule didn't appear in the manual. I decided to remove this because
the "migration" isn't that hard, you just need to fix some module
declarations.

However, `mkRenamedOptionModule` wouldn't work here because it'd create
a "virtual" option for the deprecated path (i.e.
`services.grafana.provision.{datasources,dashboards}`), but that's the
already a new option, i.e. the submodule for the new stuff.

To make sure that you still get errors, I implemented a small hack using
`coercedTo` which throws an error if a list is specified (as it would be
done on 22.05) which explains what to do instead to make the migration
easier.

Also, I linkified the options in the manual now to make it easier to
navigate between those.
2022-11-20 18:21:35 +01:00
Sandro Jäckel
95a7b35b1c
nixos/grafana: add default value back to settings.server.socket 2022-10-27 00:53:46 +02:00
KFears
f2e74bdf57 nixos/grafana: fix secrets-related warnings 2022-10-26 21:03:57 +04:00
KFears
f3cb29a5b8 nixos/grafana: fix issues with rfc42 refactoring 2022-10-24 19:31:50 +04:00
KFears
9f963f36e5 nixos/grafana: refactor settings for RFC42 2022-10-22 23:56:14 +04:00
KFears
c7cd659710 nixos/grafana: fix markdown docs 2022-10-22 23:54:32 +04:00
KFears
7908ef062f nixos/grafana: add alerting 2022-10-22 23:54:32 +04:00
KFears
34c2ea6750 nixos/grafana: deprecate notifiers 2022-10-22 23:54:31 +04:00
KFears
0852dc859e nixos/grafana: refactor datasources for RFC42
This commit refactors `services.grafana.provision.datasources` towards
the RFC42 style. To preserve backwards compatibility, we have to jump
through a ton of hoops, introducing esoteric type signatures and bizarre
structs. The Grafana module definition should hopefully become a lot
cleaner after a release cycle or two once the old configuration style is
completely deprecated.
2022-10-22 23:53:24 +04:00
KFears
89e30315e0 nixos/grafana: refactor dashboards for RFC42
This commit refactors `services.grafana.provision.dashboards` towards
the RFC42 style. To preserve backwards compatibility, we have to jump
through a ton of hoops, introducing esoteric type signatures and bizarre
structs. The Grafana module definition should hopefully become a lot
cleaner after a release cycle or two once the old configuration style is
completely deprecated.
2022-10-21 16:42:30 +04:00
Maximilian Bosch
0df6c52026
nixos/grafana: ensure that declarative prometheus data-sources don't use direct access
Support for that was permanently dropped in Grafana 9.2.0, see also
f30795b088
2022-10-13 10:28:29 +02:00
Erik Skytthe
3c1c405e72 nixos/grafana: fix description text error
Description text has been placed incorrectly for allowedDomains and allowedGroups
2022-09-09 15:55:15 +02:00
Pierre Bourdon
bfe73f9543
nixos/grafana: loosen systemd syscall sandboxing
Allow @resources syscalls in the grafana.service unit. While Grafana
itself does not need them, some plugins (incl. first party) crash if
they fail to setrlimit. This was first seen with the official grafana
Clickhouse datasource plugin.

The @resources syscalls set is fairly harmess anyway.
2022-09-06 02:10:47 +02:00
pennae
ef176dcf7e nixos/*: automatically convert option descriptions
conversions were done using https://github.com/pennae/nix-doc-munge
using (probably) rev f34e145 running

    nix-doc-munge nixos/**/*.nix
    nix-doc-munge --import nixos/**/*.nix

the tool ensures that only changes that could affect the generated
manual *but don't* are committed, other changes require manual review
and are discarded.
2022-08-31 16:32:53 +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
Maximilian Bosch
7f9a78e197
Merge pull request #175330 from jtojnar/grafana-uid
nixos/grafana: Allow setting UID for datasource
2022-06-13 07:01:19 +02:00
Jan Tojnar
81291cc793 nixos/grafana: Allow setting UID for datasource 2022-05-29 19:22:02 +02:00
Kristoffer Føllesdal
298e2ce302 nixos/grafana: add disableLoginForm option 2022-05-18 16:09:04 +02:00
Kristoffer Føllesdal
ea8f7e7bbd nixos/grafana: add serveFromSubPath option 2022-05-18 16:08:15 +02:00
Kristoffer Føllesdal
e13ec87217 nixos/grafana: add Azure AD OAuth options 2022-05-16 16:37:02 +02:00
Moritz
9f715a3d31
nixos/grafana: Add foldersFromFilesStructure option for dashboard provisioning (#132348) 2022-03-29 10:53:39 +02:00