Commit Graph

19865 Commits

Author SHA1 Message Date
ajs124
47a2176ec8
Merge pull request #156998 from mweinelt/smartctl-exporter-fixups
prometheus.exporters.smartctl: fixes
2022-01-27 18:49:49 +01:00
Bernardo Meurer
5f9b470ff0
Merge pull request #154809 from helsinki-systems/feat/stc-proper-unit-file-parser
nixos/switch-to-configuration: Proper unit file parser and clean/fix lower part of the script
2022-01-27 09:35:34 -08:00
Martin Weinelt
12c26aca1f
prometheus.exporters.smartctl: Fix autodiscovery
When no devices are given the exporter tries to autodiscover available
disks. The previous DevicePolicy was however preventing the exporter
from accessing any device at all, since only explicitly mentioned ones
were allowed.

This commit adds an allow rule for several device classes that I could
find on my machines, that gets set when no devices are explicitly
configured.

There is an existing problem with nvme devices, that expose a character
device at `/dev/nvme0`, and a (namespaced) block device at
`/dev/nvme0n1`. The character device does not come with permissions that
we could give to the exporter without further impacting the hardening.

  crw------- 1 root root 247, 0 27. Jan 03:10 /dev/nvme0
  brw-rw---- 1 root disk 259, 0 27. Jan 03:10 /dev/nvme0n1

The autodiscovery only finds the character device, which the exporter
unfortunately does not have access to.

However a simple udev rule can be used to resolve this:

  services.udev.extraRules = ''
    SUBSYSTEM=="nvme", KERNEL=="nvme[0-9]*", GROUP="disk"
  '';

Unfortunately I'm not fully aware of the security implications this
change carries and we should question upstream (systemd) why they did
not include such a rule.
The disk group has no members on any of my machines.

  ❯ getent group disk
  disk6:
2022-01-27 17:33:27 +01:00
Daniel Olsen
5288bcab0a nixos/mx-puppet-discord: Change systemd unit description to avoid newline 2022-01-27 16:49:40 +01:00
Robert Hensing
d0947df006
Merge pull request #156992 from hercules-ci/revert-153594-doc-optimization
Revert 153594 doc optimization
2022-01-27 15:46:36 +01:00
Martin Weinelt
f860b289d4
prometheus.exporters.smartctl: Allow RAWIO
This allows the exporter to perform SCSI commands and interact with hpsa
and cciss devices.
2022-01-27 13:49:25 +01:00
Janne Heß
1f3b1a9067
Merge pull request #139075 from polykernel/nix-structural-settings-patch-1
nixos/nix-daemon: use structural settings
2022-01-27 13:38:41 +01:00
Robert Hensing
6b9ef93b98 Revert "flake.nix: Set nixpkgs.config.path"
This reverts commit 0b222173db.
2022-01-27 12:53:29 +01:00
Robert Hensing
aa877346f8 Revert "nixos/documentation: avoid copying nixpkgs subpaths, iteration 2"
This reverts commit 15a00be189.
2022-01-27 12:35:16 +01:00
Robert Hensing
647b304306 Revert "nixos/documentation.nix: Only use store non-flake pkgs.path directly when already copied"
This reverts commit fecf325059.
2022-01-27 12:35:16 +01:00
Robert Hensing
a732a8de1c Revert "nixos/documentation.nix: Use builtins.storePath when appropriate"
This reverts commit 5d29853c38.
2022-01-27 12:33:10 +01:00
olegkapitonov
ae5361fa1b
fix MTP support on KDE Plasma and Dolphin (#155405)
* fix MTP support on KDE Plasma and Dolphin

* Update pkgs/applications/kde/kio-extras.nix

Co-authored-by: ElXreno <elxreno@gmail.com>

Co-authored-by: Peter Hoeg <peter@hoeg.com>
Co-authored-by: ElXreno <elxreno@gmail.com>
2022-01-27 11:29:32 +08:00
polykernel
4a9d9928dc nixos/nix-daemon: use structural settings
The `nix.*` options, apart from options for setting up the
daemon itself, currently provide a lot of setting mappings
for the Nix daemon configuration. The scope of the mapping yields
convience, but the line where an option is considered essential
is blurry. For instance, the `extra-sandbox-paths` mapping is
provided without its primary consumer, and the corresponding
`sandbox-paths` option is also not mapped.

The current system increases the maintenance burden as maintainers have to
closely follow upstream changes. In this case, there are two state versions
of Nix which have to be maintained collectively, with different options
avaliable.

This commit aims to following the standard outlined in RFC 42[1] to
implement a structural setting pattern. The Nix configuration is encoded
at its core as key-value pairs which maps nicely to attribute sets, making
it feasible to express in the Nix language itself. Some existing options are
kept such as `buildMachines` and `registry` which present a simplified interface
to managing the respective settings. The interface is exposed as `nix.settings`.

Legacy configurations are mapped to their corresponding options under `nix.settings`
for backwards compatibility.

Various options settings in other nixos modules and relevant tests have been
updated to use structural setting for consistency.

The generation and validation of the configration file has been modified to
use `writeTextFile` instead of `runCommand` for clarity. Note that validation
is now mandatory as strict checking of options has been pushed down to the
derivation level due to freeformType consuming unmatched options. Furthermore,
validation can not occur when cross-compiling due to current limitations.

A new option `publicHostKey` was added to the `buildMachines`
submodule corresponding to the base64 encoded public host key settings
exposed in the builder syntax. The build machine generation was subsequently
rewritten to use `concatStringsSep` for better performance by grouping
concatenations.

[1] - https://github.com/NixOS/rfcs/blob/master/rfcs/0042-config-option.md
2022-01-26 21:04:50 -05:00
Martin Weinelt
b3b17c3885
Merge pull request #156787 from helsinki-systems/drop/racoon 2022-01-26 23:30:20 +01:00
Jan Tojnar
d843a692ae
Merge pull request #148344 from pasqui23/portals
nixos/xdg-portals: add portals to systemPackages
2022-01-26 19:22:49 +01:00
Pasquale
e9c4910524
nixos/xdg-portals: add portals' desktop files to XDG_DATA_DIRS 2022-01-26 18:45:42 +01:00
Sandro
89de95e632
Merge pull request #138439 from kjeremy/tmux-plugins-master 2022-01-26 17:17:19 +01:00
Martin Puppe
6a96992fe0 Fix invalid regular expression #156861
Empty parantheses are not supported in regular expressions on
Darwin/macOS. The old regular expression produces an error during
evaluation. This commit fixes that.

Nix‘s `builtins.match` works with extend POSIX regular expressions. The
specification for these regular expression states[^1] that the result
for a left paranthesis immediately followed by a right paranthesis
outside of a bracket expression is undefined.

[^1]: https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap09.html#tag_09_04_03
2022-01-26 16:23:14 +01:00
ajs124
ef8280914f nixos/openvswitch: remove ipsec 2022-01-26 01:12:40 +01:00
ajs124
737de29e11 nixos/racoon: drop 2022-01-26 01:12:39 +01:00
Martin Weinelt
89e18a19cd
Merge pull request #156738 from mweinelt/hass-ping 2022-01-26 00:08:47 +01:00
Jeremy Kolb
7be304a543 nixos/programs/tmux: specify wanted plugins
Currently it's rather difficult to install tmux plugins. The process involves two steps:
  1. Specify the correct `pkg.tmuxPlugins` package in `environment.systemPackages`
  2. Adding to the configuration file to instantiate the plugin.

This commit allows the user to specify a list of plugins under `programs.tmux.plugins`.

Update nixos/modules/programs/tmux.nix

Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
2022-01-25 17:12:44 -05:00
Pascal Bach
ee59b97045
Merge pull request #155473 from yayayayaka/matrix-synapse-administration
nixos/matrix-synapse: Wrap register_new_matrix_user
2022-01-25 22:10:03 +01:00
Pascal Bach
c0ad24ee1d
Merge pull request #155703 from dali99/synapse-webclient
nixos/matrix-synapse: Remove webclient from default listener
2022-01-25 22:03:34 +01:00
Jonathan Ringer
e74ccf2d72
Merge pull request #154708 from NixOS/staging-next
Staging next 2022-01-12
2022-01-25 11:54:52 -08:00
Lara
04560b9163 nixos/gitlab: Add additional paths to systemd.tmpfiles.rules
This fixes the NixOS gitlab test failure since gitlab 14.7.0.
2022-01-25 19:05:49 +01:00
github-actions[bot]
bf793f213d
Merge master into staging-next 2022-01-25 18:01:20 +00:00
Martin Weinelt
d4061dcc6e
nixos/home-assistant: allow capset with components using ping command 2022-01-25 18:29:16 +01:00
Franz Pletz
5940ac847f
Merge pull request #156718 from B4dM4n/bird-pre-check-config 2022-01-25 16:43:44 +01:00
Martin Weinelt
48f17360d9 Merge remote-tracking branch 'origin/master' into staging-next 2022-01-25 15:53:19 +01:00
Luflosi
c6bd1eea71
nixos/tor: fix tor getting killed by systemd when shuttding down
Tor waits ShutdownWaitLength seconds (30s by default) before actually shutting down. Since the systemd timeout is also set to 30 seconds, this results in a race condition that ends up killing Tor most of the time on my machine during shutdown.
To fix this, add the ShutdownWaitLength setting and tell systemd to wait 30 seconds more than that.
Arch Linux also has `TimeoutSec` set to 60 seconds: 6df716fe19/trunk/tor.service.
2022-01-25 15:02:18 +01:00
Fabian Möller
ba27a0aaed
nixos/bird: add option to modify config check environment 2022-01-25 14:58:26 +01:00
Anderson Torres
48743a4f17
Merge pull request #156571 from AndersonTorres/new-misc
mpc: install Bash shell completion (and more)
2022-01-25 10:20:29 -03:00
Robert Hensing
8919495cac
Merge pull request #156503 from hercules-ci/nixos-add-system.build-options
nixos: Add `system.build.`{`toplevel`,`installBootLoader`}, improve error message
2022-01-25 14:13:24 +01:00
AndersonTorres
7fb017e379 nixos/modules/services/hardware/triggerhappy.nix: mpc_cli -> mpc-cli 2022-01-24 23:24:06 -03:00
github-actions[bot]
bbbd0a92af
Merge master into staging-next 2022-01-25 00:02:13 +00:00
Luflosi
1c58cdbeed
nixos/modprobe: add boot.initrd.extraModprobeConfig option
This option behaves exactly like `boot.extraModprobeConfig`, except that it also includes the generated modprobe.d file in the initrd.
Many years ago, someone tried to include the normal modprobe.d/nixos.conf file generated by `boot.extraModprobeConfig` in the initrd: 0aa2c1dc46. This file contains a reference to a directory with firmware files inside. Including firmware in the initrd made it too big, so the commit was reverted again in 4a4c051a95.
The `boot.extraModprobeConfig` option not changing the initrd caused me much confusion because I tried to set the maximum cache size for ZFS and it didn't work.
Closes https://github.com/NixOS/nixpkgs/issues/25456.
2022-01-24 22:56:14 +01:00
github-actions[bot]
a45818989a
Merge master into staging-next 2022-01-24 18:01:03 +00:00
Franz Pletz
6e71fca817
Merge pull request #156408 from dali99/nixos-nginx-defaultAddresses 2022-01-24 16:40:57 +01:00
Robert Hensing
4800f30841 nixos: Explain system.build.installBootLoader's odd default
I don't really approve of this solution, but documenting its
purpose was the least I could do for now.
2022-01-24 16:17:20 +01:00
Robert Hensing
511e89f5a6 nixos: Make system.build.installBootLoader a proper option
This improves the error message when the configuration contains
more than one boot loader.
2022-01-24 16:17:19 +01:00
Robert Hensing
2aa7c25808 nixos: Document system.build.toplevel 2022-01-24 16:16:46 +01:00
Renaud
454272e7ff
Merge pull request #155847 from onny/dokuwikicleanup
nixos/dokuwiki: Minor code cleanup
2022-01-24 13:42:57 +01:00
github-actions[bot]
b261cac75a
Merge master into staging-next 2022-01-24 06:01:18 +00:00
Bernardo Meurer
7e395a4f40
Merge pull request #154180 from lovesegfault/roon-server-firewall-fix
nixos/roon-server: open TCP ports 9330-9332 in firewall
2022-01-24 02:36:14 +00:00
Samuel Dionne-Riel
18ebd1c330
Merge pull request #153409 from tpwrules/fix-nonx86-iso-reproducibility
installer/cd-dvd/iso-image: avoid leaking build timestamps on non-x86
2022-01-23 21:15:26 -05:00
Daniel Olsen
ab7e6995ac nixos/nginx: Add defaultListenAddresses option
Lets you specify the default listen address if none are listed in the vhost configuration.

Useful for hosts with more than one ip
2022-01-24 02:20:30 +01:00
github-actions[bot]
11cced7438
Merge master into staging-next 2022-01-24 00:01:45 +00:00
Robert Hensing
ccb85a53b6 nixos: Make system.build a submodule with freeformType
This allows the values below it to be specified as options, while
remaining compatible with existing code.
2022-01-24 00:52:46 +01:00
Robert Hensing
3ac955acf4 nixos/system/build: Extract
Modules that do not depend on e.g. toplevel should not have to include it just to set
things in `system.build`. As a general rule, this keeps tests simple, usage flexible
and evaluation fast. While one module is insignificant, consistency and good practices
are.
2022-01-24 00:47:57 +01:00