246 Commits
Author SHA1 Message Date
talyz dfe85974ca nixos/logrotate: Fix the config file check phase regex for create/createolddir
The check phase for the config file has to replace any instances of
user and group with the current ones, since logrotate checks whether
they actually exist. However, the create/createolddir substitution
expressions didn't take all different parameter formats into
account. Mainly, if the mode was specified, but not user and group,
the result would be something like

  create 0644nixbld nixbld

since it relies on matching a space at the end of the mode
specification.

To fix this, always append a space before the substituted user and
group.

Also, simplify the formatting by using extended regex and check for
word boundaries after create/createolddir to exclude any incorrect or
unsupported suffixes.
2026-05-29 16:26:07 +02:00
emilylange 5e0917082b nixos/promtail,promtail: remove because promtail is EOL
Promtail reached its end of life on 2026-03-02. Its code has been
removed by upstream with the release of grafana-loki 3.7.x.
2026-03-30 19:57:07 +02:00
h7x4 c6708d9bda various: replace systemd.services.<name>.{script,preStart} with ExecStart{,Pre}
This is a partial revert of 39e9380
2026-01-19 14:45:11 +09:00
NAHO a2ed7e8d88 nixos: 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 \
      --exclude doc/manual/release-notes \
      --type file \
      . \
      nixos \
      --exec-batch sed --in-place --regexp-extended "
        s/\<builtins\.($(
          printf '%s\n' "${builtins[@]}" |
            paste --delimiter '|' --serial -
        ))\>/\1/g
      "

    nix fmt
2026-01-15 16:07:55 +01:00
h7x4andGitHub 39e93806aa Revert "various: replace systemd.services.<name>.{script,preStart} with ExecStart{,Pre}" 2025-10-31 11:03:32 +01:00
h7x4 74605cd611 nixos/syslog-ng: replace preStart with ExecStartPre 2025-10-27 18:52:23 +09:00
h7x4 872a7e9876 nixos/promtail: replace preStart with ExecStartPre 2025-10-27 18:52:23 +09:00
h7x4 f167ee7597 nixos/heartbeat: replace preStart with ExecStartPre 2025-10-27 18:52:22 +09:00
h7x4 9a4f125b88 nixos/journalbeat: replace preStart with ExecStartPre 2025-10-27 18:52:17 +09:00
h7x4 6de18eedae nixos/journaldriver: replace systemd script with ExecStart 2025-10-27 18:52:06 +09:00
Wolfgang Walther 91a8fee3aa treewide: remove redundant parentheses
Auto-fixed by nixf-diagnose.
2025-10-05 10:52:03 +02:00
Wolfgang Walther c283f32d29 treewide: remove unused with
Auto-fixed by nixf-diagnose.
2025-10-05 10:50:41 +02:00
h7x4 34fe1083bd nixos/journalwatch: use more accurate int types 2025-09-22 15:34:41 +02:00
Wolfgang Walther 5a0711127c treewide: run nixfmt 1.0.0 2025-07-24 13:55:40 +02:00
weriomat 6b4ce1ee23 nixos/vector: add option to disable the configuration validation
Currently, during built time the configuration gets checked by vector.
This can be a problem if [environment
variables](https://vector.dev/docs/reference/environment_variables/) are
interpolated into the configuration. In this case the validation can be
disabled. This came up in trying to find a solution for
[#377889](https://github.com/NixOS/nixpkgs/issues/377889).
2025-07-14 16:38:04 +02:00
Nick Ionata 25a40ead28 nixos/vector: add graceful shutdown limit option
This adds a NixOS module option to configure the Vector cli option
`--graceful-shutdown-limit-secs`,
https://vector.dev/docs/reference/cli/#vector_graceful_shutdown_limit_secs.
2025-06-05 14:38:48 -07: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 KellerandGitHub d7a2a10a40 graylog-5_1: remove (#358780) 2025-03-16 15:45:23 +01:00
jopejoe1andGitHub dca7e827b3 nixos: Replace custom cfg format handling with pkgs.formats (#314933) 2025-03-14 21:08:14 +01:00
Izorkin 01e8036a98 logrotate: allow access to unix socket 2025-03-06 10:41:49 +03:00
Peder Bergebakken Sundt 953f72e76e nixos/*: tag manpage references 2025-01-27 02:47:01 +01:00
Benno Bielmeier 36c0d740c6 nixos/graylog: change default package version to 6.0 2025-01-15 12:53:34 +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
nicoo 94b7b469aa nixos/promtail: Replace custom jq-based runCommand with pkgs.formats 2024-12-04 20:50:45 +00:00
Izorkin a7c8d553ae nixos/logrotate: allow change mode of a file 2024-11-26 18:55:41 +03:00
YtandGitHub c0c77416ac vector: fix service using pkgs.vector regardless package option (#354316) 2024-11-11 19:09:22 -05:00
JennyandGitHub 8db885974b nixos/promtail: configFile for passing path as config (#322426) 2024-11-08 08:58:33 +01:00
KX 518bc9c5b3 nixos/promtail: configFile for passing path as config 2024-11-07 22:53:22 +01:00
jonboh f81a2c1514 fix: use selected package instead of pkgs.vector 2024-11-07 21:24:21 +01:00
Martin Weinelt 4ca03e3a11 nixos/logrotate: allow sending signal to arbitrary processes
Various postrotate scripts send e.g. SIGHUP to processes, to have them
reload their config or reopen their logfile.
2024-09-30 13:30:38 +02:00
Martin Weinelt 2dabc4fce1 nixos/logrotate: reorder setuid syscall group
Relevant parts of @setuid are in @privileged, so we need to flip the
order around, to grant @setuid in spite of denying @privileged.
2024-09-30 13:26:14 +02:00
Martin Weinelt d3e0a89ca6 nixos/logrotate: relax hardening
The previous hardening change restricted the unit too much, breaking
legitimate functionality of logrotate.

Unfortunately this was not covered by our NixOS test.
2024-09-29 12:29:19 +02: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
Martin Weinelt 01d0b0b683 nixos/logrotate: harden systemd unit
Logrotate is a service that runs as root and moves logfiles around while
keeping ownership of these files intact. This means we can and should
severely limit the scope of what can be done during its runtime.
2024-09-09 02:53:36 +02:00
Felix Buehler 28072b63dd nixos/services.vector: remove with lib; 2024-08-30 00:30:58 +02:00
Felix Buehler 640892113a nixos/services.ulogd: remove with lib; 2024-08-30 00:30:58 +02:00
Felix Buehler 12cf354b83 nixos/services.syslogd: remove with lib; 2024-08-30 00:30:57 +02:00
Felix Buehler b14d3ec28f nixos/services.syslog-ng: remove with lib; 2024-08-30 00:30:57 +02:00
Felix Buehler bb1483bbc6 nixos/services.rsyslogd: remove with lib; 2024-08-30 00:30:57 +02:00
Felix Buehler 5b61b70082 nixos/services.logstash: remove with lib; 2024-08-30 00:30:57 +02:00
Felix Buehler 5ba36926e6 nixos/services.logrotate: remove with lib; 2024-08-30 00:30:57 +02:00
Felix Buehler e3a59fb4ac nixos/services.logcheck: remove with lib; 2024-08-30 00:30:56 +02:00
Felix Buehler 5bc3fb4949 nixos/services.journalwatch: remove with lib; 2024-08-30 00:30:56 +02:00
Felix Buehler 0470d7f52f nixos/services.journalbeat: remove with lib; 2024-08-30 00:30:56 +02:00
Felix Buehler d0885b12f2 nixos/services.heartbeat: remove with lib; 2024-08-30 00:30:56 +02:00
Felix Buehler 83ed6b4d3b nixos/services.graylog: remove with lib; 2024-08-30 00:30:56 +02:00
Felix Buehler 4e0ba37569 nixos/services.fluentd: remove with lib; 2024-08-30 00:30:55 +02:00
Felix Buehler e2a2735d4d nixos/services.awstats: remove with lib; 2024-08-30 00:30:55 +02:00
Felix Buehler d9a644373a nixos/services.SystemdJournal2Gelf: remove with lib; 2024-08-30 00:30:55 +02:00
Benno Bielmeier ed904c256f nixos/graylog: add option dataDir
in order to use this nixos module with Graylog 6.0, in which

> the default value for the data_dir configuration option has been
> removed and must be specified in graylog.conf [1].
> -- https://go2docs.graylog.org/current/upgrading_graylog/upgrading_to_graylog_6.0.x.htm

The value set by default is the same as before introducing this option.
See also [1,2]

[1]: https://go2docs.graylog.org/current/setting_up_graylog/server.conf.html
[2]: https://go2docs.graylog.org/5-2/setting_up_graylog/server.conf.html
2024-07-05 01:49:12 +02:00