Commit graph

1379 commits

Author SHA1 Message Date
Daniel Nagy 8e760f4858
nixos/matrix-synapse: set port type to types.port 2021-05-30 14:38:19 +02:00
pmenke 9e0ed182aa
sdrplay: init at 3.07.1
this adds support for software defined radio (SDR) devices by SDRplay.
SDRplay provides an unfree binary library and api-service as well
as a MIT licensed adapter library for SoapySDR for integration
with many popular SDR applications.
2021-05-28 15:40:04 +02:00
regnat 113823669b Revert "nixos/nix-daemon: fix sandbox-paths option"
This reverts commit aeeee447bc.
2021-05-24 10:51:02 +02:00
Maximilian Bosch 278bcdce1f
Merge pull request #123941 from mweinelt/matrix-synapse
nixos/matrix-synapse: protect created files
2021-05-22 22:20:16 +02:00
Martin Weinelt 79e675444c
nixos/matrix-synapse: protect created files
Enforce UMask on the systemd unit to restrict the permissions of files
created. Especially the homeserver signing key should not be world
readable, and media is served through synapse itself, so no other user
needs access to these files.

Use a prestart chmod to fixup the permissions on the signing key.
2021-05-22 20:30:49 +02:00
Vika aeeee447bc
nixos/nix-daemon: fix sandbox-paths option
In newer versions of Nix (at least on 2.4pre20201102_550e11f) the
`extra-` prefix for config options received a special meaning and the
option `extra-sandbox-paths` isn't recognized anymore. This commit fixes
it.

It doesn't cause a behavior change when using older versions of Nix but
does cause an extra newline to appear in the config, thus changing the
hash.
2021-05-22 05:14:56 +00:00
Martin Weinelt 446c97f96f
Merge pull request #123355 from Ma27/bump-matrix-synapse 2021-05-19 18:12:14 +02:00
talyz 7842e89bfc
nixos/gitlab: Use replace-secret to avoid leaking secrets
Using `replace-literal` to insert secrets leaks the secrets through
the `replace-literal` process' `/proc/<pid>/cmdline`
file. `replace-secret` solves this by reading the secret straight from
the file instead, which also simplifies the code a bit.
2021-05-19 09:32:12 +02:00
Maximilian Bosch 2addab5fd6
nixos/matrix-synapse: room_invite_state_types was deprecated and room_prejoin_state is used now
See https://github.com/matrix-org/synapse/blob/release-v1.34.0/UPGRADE.rst#upgrading-to-v1340
2021-05-17 13:45:28 +02:00
Jörg Thalheim b900661f6e
Merge pull request #122825 from Izorkin/update-duplicates-systemcallfilters
treewide: remove duplicates SystemCallFilters
2021-05-17 12:06:06 +01:00
Sandro 700942d2a5
Merge pull request #121119 from SuperSandro2000/remove-gnidorah
treewide: remove gnidorah
2021-05-17 02:42:24 +02:00
Izorkin feebe402f5
treewide: remove duplicates SystemCallFilters 2021-05-13 15:44:56 +03:00
Robert Schütz 7217b2d85e
Merge pull request #121785 from dotlambda/dendrite-rename
matrix-dendrite: rename to dendrite
2021-05-10 23:30:12 +02:00
Joe DeVivo bf92d0ec37 nixos/ssm-agent: conf files written to /etc
ssm-agent expects files in /etc/amazon/ssm. The pkg substitutes a location in
the nix store for those default files, but if we ever want to adjust this
configuration on NixOS, we'd need the ability to modify that file.

This change to the nixos module writes copies of the default files from the nix
store to /etc/amazon/ssm. Future versions can add config, but right now this
would allow users to at least write out a text value to
environment.etc."amazon/ssm/amazon-ssm-agent.json".text to provide
their own config.
2021-05-10 13:16:41 -07:00
Sander van der Burg 77295e7e6b nixos/disnix: configure the remote client by default, if multi-user mode has been enabled 2021-05-06 19:33:02 +02:00
Martin Weinelt 24adc01e2e
nixos/home-assistant: allow netlink sockets and /proc/net inspection
Since v2021.5.0 home-assistant uses the ifaddr library in the zeroconf
component to enumerate network interfaces via netlink. Since discovery
is all over the place lets allow AF_NETLINK unconditionally.

It also relies on pyroute2 now, which additionally tries to access files
in /proc/net, so we relax ProtectProc a bit by default as well.

This leaves us with these options unsecured:

✗ PrivateNetwork=                                             Service has access to the host's network                                                                 0.5
✗ RestrictAddressFamilies=~AF_(INET|INET6)                    Service may allocate Internet sockets                                                                    0.3
✗ DeviceAllow=                                                Service has a device ACL with some special devices                                                       0.1
✗ IPAddressDeny=                                              Service does not define an IP address allow list                                                         0.2
✗ PrivateDevices=                                             Service potentially has access to hardware devices                                                       0.2
✗ PrivateUsers=                                               Service has access to other users                                                                        0.2
✗ SystemCallFilter=~@resources                                System call allow list defined for service, and @resources is included (e.g. ioprio_set is allowed)      0.2
✗ RestrictAddressFamilies=~AF_NETLINK                         Service may allocate netlink sockets                                                                     0.1
✗ RootDirectory=/RootImage=                                   Service runs within the host's root directory                                                            0.1
✗ SupplementaryGroups=                                        Service runs with supplementary groups                                                                   0.1
✗ RestrictAddressFamilies=~AF_UNIX                            Service may allocate local sockets                                                                       0.1
✗ ProcSubset=                                                 Service has full access to non-process /proc files (/proc subset=)                                       0.1

→ Overall exposure level for home-assistant.service: 1.6 OK 🙂
2021-05-06 16:55:53 +02:00
Robert Schütz f82c6fdfd5 nixos/matrix-dendrite: rename to dendrite 2021-05-05 12:38:02 +02:00
Robert Schütz 007cab9644 matrix-dendrite: rename to dendrite
No other distro calls it matrix-dendrite:
https://repology.org/project/matrix-dendrite
2021-05-05 12:37:04 +02:00
Robert Hensing ce93c98ce2
Merge pull request #99132 from Infinisil/recursive-type-deprecation
Recursive type deprecation
2021-05-05 11:13:37 +02:00
Silvan Mosberger 0a377f11a5 nixos/treewide: Remove usages of deprecated types.string 2021-05-05 03:31:41 +02:00
Luke Granger-Brown 62f675eff6
Merge pull request #121558 from sumnerevans/fix-airsonic-service
airsonic: force use of jre8
2021-05-03 20:43:00 +01:00
Silvan Mosberger 0111666954
Merge pull request #109561 from mjlbach/init_matrix_dendrite
matrix-dendrite: init at 0.3.11
2021-05-03 20:16:27 +02:00
Michael Lingelbach ff43bbe53e matrix-dendrite: add nixos module 2021-05-03 10:12:24 -07:00
Martin Weinelt d23610ae65
Merge pull request #121209 from mweinelt/pinnwand 2021-05-03 18:24:45 +02:00
Sumner Evans 6dde6bf3bf
airsonic: force use of jre8 2021-05-03 09:41:04 -06:00
Martin Weinelt fda2ff4edc
nixos/pinnwand: add reaper systemd unit/timer
The reap function culls expired pastes outside of the process serving
the pastes. Previously the database could accumulate a large number of
pastes and while they were expired they would not be deleted unless
accessed from the frontend.
2021-05-03 16:52:05 +02:00
Martin Weinelt ac4b47f823
nixos/pinnwand: improve settings behaviour
Individual settings would previously overwrite the whole config, but
now individual values can be overwritten.

Fix missing slash to make the database path an absolute path per
https://docs.sqlalchemy.org/en/14/core/engines.html#sqlite.

Drop preferred_lexers, it's not set to anything meaningful anyway.
2021-05-03 15:18:12 +02:00
Martin Weinelt f41349d30d
nixos/home-assistant: Restart systemd unit on restart service
Home-assistant through its `--runner` commandline flag supports sending
exit code 100 when the `homeassistant.restart` service is called.

With `RestartForceExitStatus` we can listen for that specific exit code
and restart the whole systemd unit, providing an actual clean restart
with fresh processes. Additional treat exit code 100 as a successful
termination.
2021-05-03 00:21:25 +02:00
Martin Weinelt 7d09d7f571
nixos/home-assistant: harden systemd service
This is what is still exposed, and it should still allow things to work
as usual.

✗ PrivateNetwork=                    Service has access to the host's …      0.5
✗ RestrictAddressFamilies=~AF_(INET… Service may allocate Internet soc…      0.3
✗ DeviceAllow=                       Service has a device ACL with som…      0.1
✗ IPAddressDeny=                     Service does not define an IP add…      0.2
✗ PrivateDevices=                    Service potentially has access to…      0.2
✗ PrivateUsers=                      Service has access to other users       0.2
✗ SystemCallFilter=~@resources       System call allow list defined fo…      0.2
✗ RootDirectory=/RootImage=          Service runs within the host's ro…      0.1
✗ SupplementaryGroups=               Service runs with supplementary g…      0.1
✗ RestrictAddressFamilies=~AF_UNIX   Service may allocate local sockets      0.1

→ Overall exposure level for home-assistant.service: 1.6 OK :-)

This can grow to as much as ~1.9 if you use one of the bluetooth or nmap
trackers or the emulated_hue component, all of which required elevated
permisssions.
2021-05-03 00:21:24 +02:00
Maximilian Bosch 040f0acccd
Merge pull request #121299 from Ma27/gitea-umask
nixos/gitea: set umask for secret creation
2021-05-02 00:06:20 +02:00
Maximilian Bosch 02c3bd2187
nixos/gitea: set umask for secret creation
This ensures that newly created secrets will have the permissions
`0640`. With this change it's ensured that no sensitive information will
be word-readable at any time.

Related to #121293.

Strictly speaking this is a breaking change since each new directory
(including data-files) aren't world-readable anymore, but actually these
shouldn't be, unless there's a good reason for it.
2021-04-30 21:39:11 +02:00
Martin Weinelt 62de527dc3
nixos/zigbee2mqtt: start maintaing the module 2021-04-30 20:40:04 +02:00
Martin Weinelt 2b61d9ea01
nixos/zigbee2mqtt: create migration path from config to settings 2021-04-30 20:39:21 +02:00
Martin Weinelt a691549f7e
nixos/zigbee2mqtt: harden systemd unit
This is what is still exposed, and it allows me to control my lamps from
within home-assistant.

✗ PrivateNetwork=                                             Service has access to the host's network                                            0.5
✗ RestrictAddressFamilies=~AF_(INET|INET6)                    Service may allocate Internet sockets                                               0.3
✗ DeviceAllow=                                                Service has a device ACL with some special devices                                  0.1
✗ IPAddressDeny=                                              Service does not define an IP address allow list                                    0.2
✗ PrivateDevices=                                             Service potentially has access to hardware devices                                  0.2
✗ RootDirectory=/RootImage=                                   Service runs within the host's root directory                                       0.1
✗ SupplementaryGroups=                                        Service runs with supplementary groups                                              0.1
✗ MemoryDenyWriteExecute=                                     Service may create writable executable memory mappings                              0.1

→ Overall exposure level for zigbee2mqtt.service: 1.3 OK 🙂
2021-04-30 19:42:26 +02:00
Martin Weinelt e0f1e1f7bf
nixos/zigbee2mqtt: convert to rfc42 style settings 2021-04-30 19:42:26 +02:00
Kim Lindberger fdd6ca8fce
Merge pull request #118898 from talyz/gitlab-memory-bloat
nixos/gitlab: Add options to tame GitLab's memory usage somewhat
2021-04-30 16:58:30 +02:00
Sandro a73342b7ce
Merge pull request #120637 from andreisergiu98/ombi-update 2021-04-30 12:57:15 +02:00
Sandro Jäckel ae02415ee8
treewide: remove gnidorah
due to github account removal/deletion and not other mean of contact.
2021-04-30 01:48:19 +02:00
Andrei Pampu e88bf5f13b
nixos/ombi: set ombi as system user 2021-04-29 10:52:02 +03:00
Aaron Andersen 45eb9c21ee
Merge pull request #119672 from chessai/init-duckling-service
init duckling service
2021-04-27 20:58:28 -04:00
chessai e47e2a1b9f init duckling service 2021-04-27 10:41:07 -07:00
talyz 7a67a2d1a8
gitlab: Add patch for db_key_base length bug, fix descriptions
The upstream recommended minimum length for db_key_base is 30 bytes,
which our option descriptions repeated. Recently, however, upstream
has, in many places, moved to using aes-256-gcm, which requires a key
of exactly 32 bytes. To allow for shorter keys, the upstream code pads
the key in some places. However, in many others, it just truncates the
key if it's too long, leaving it too short if it was to begin
with. This adds a patch that fixes this and updates the descriptions
to recommend a key of at least 32 characters.

See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/53602
2021-04-27 17:49:43 +02:00
Robert Schütz e22d76fe34
Merge pull request #120520 from minijackson/jellyfin-remove-10.5
jellyfin_10_5: remove unmaintained version
2021-04-26 17:16:43 +02:00
Minijackson 2ad8aa72ae
jellyfin_10_5: remove unmaintained version
This version contains a vulnerability[1], and isn't maintained. The
original reason to have two jellyfin versions was to allow end-users to
backup the database before the layout was upgraded, but these backups
should be done periodically.

[1]: <https://nvd.nist.gov/vuln/detail/CVE-2021-21402>
2021-04-26 14:11:29 +02:00
Luke Granger-Brown ed83f6455c
Merge pull request #119443 from ambroisie/add-podgrab
Add podgrab package and module
2021-04-25 14:12:40 +01:00
Joe Hermaszewski 03ea3ba1ed
modules.matrix-appservice-irc: allow connecting to unix sockets
In order to connect to postgres sockets.

This took a while to track down :/
2021-04-20 15:48:50 +08:00
Martin Weinelt e5cc06a1e8
Merge pull request #119191 from NixOS/revert-118719-home-assistant-tests 2021-04-17 02:35:05 +02:00
Robert Schütz 1d9f619311
nixos/home-assistant: warn about overridePythonAttrs in package option 2021-04-17 02:20:07 +02:00
sternenseemann ecfd3d4c53 nixos/services/matrix-synapse: fix eval errors in manual example 2021-04-16 18:13:42 +02:00
Felix Tenley c25e8e8c96 nixos/etebase-server: do not prompt for input during automatic upgrade 2021-04-16 13:08:42 +02:00
Bruno BELANYI f1b36d19fd nixos/podgrab: add module
Closes #117284.
2021-04-15 20:57:21 +00:00
Felix Tenley 004e80f8ae nixos/etebase-server: set users.users.etebase-server.isSystemUser
- setting users.users.name.{isSystemUser,isNormalUser} is required since
  #115332
2021-04-15 21:49:50 +02:00
Symphorien Gibol 7a87973b4c nixos/users: require one of users.users.name.{isSystemUser,isNormalUser}
As the only consequence of isSystemUser is that if the uid is null then
it's allocated below 500, if a user has uid = something below 500 then
we don't require isSystemUser to be set.

Motivation: https://github.com/NixOS/nixpkgs/issues/112647
2021-04-14 20:40:00 +02:00
Martin Weinelt 485034873f Revert "nixos/home-assistant: use overridePythonAttrs"
This reverts commit f9bd8b1b7b.
2021-04-13 22:46:36 +02:00
Martin Weinelt 3cb83409d2
Revert "nixos/home-assistant: use override before overridePythonAttrs" 2021-04-12 00:00:57 +02:00
Aaron Andersen e0fd737309
Merge pull request #107969 from corngood/jellyfin
jellyfin: add openFirewall option
2021-04-10 18:02:05 -04:00
talyz 6389170b39
nixos/gitlab: Set MALLOC_ARENA_MAX to "2"
This should reduce memory fragmentation drastically and is recommended
by both the Puma and the Sidekiq author. It's also the default value
for Ruby deployments on Heroku.
2021-04-10 10:49:31 +02:00
talyz 306fc0648b
nixos/gitlab: Add Sidekiq MemoryKiller support
Restart sidekiq automatically when it consumes too much memory. See
https://docs.gitlab.com/ee/administration/operations/sidekiq_memory_killer.html
for details.
2021-04-10 10:49:24 +02:00
talyz 6230936be2
nixos/gitlab: Add options to control puma worker and threads numbers 2021-04-10 10:49:18 +02:00
Robert Schütz 5522a67fa5
Merge pull request #118719 from dotlambda/home-assistant-tests
nixos/home-assistant: use override before overridePythonAttrs
2021-04-08 18:19:34 +02:00
Robert Schütz 5e0defcb25 nixos/home-assistant: use override before overridePythonAttrs 2021-04-08 12:30:59 +02:00
Martin Weinelt c11a3f5fd4
Merge pull request #118633 from mweinelt/home-assistant-team 2021-04-08 01:55:27 +02:00
Milan Pässler e0d8f6b183
nixos/gitlab: do not set backup.upload by default 2021-04-07 09:21:18 +02:00
Martin Weinelt dc84583452
home-assistant: Move maintainership to home-assistant team 2021-04-07 02:33:24 +02:00
Peter Hoeg aa22be179a nixos/packagekit: RFC42 support and drop pointless setting 2021-04-06 11:41:37 +08:00
Martin Weinelt b0cf9f6775
Merge pull request #118503 from dotlambda/home-assistant-dont-maintain
home-assistant: remove dotlambda from maintainers
2021-04-06 01:09:31 +02:00
Robert Schütz d01376d81d home-assistant: remove dotlambda from maintainers
I'm currently not using it.
2021-04-04 22:15:13 +02:00
Sandro Jäckel 9378fdf87e
iproute: deprecate alias 2021-04-04 01:43:46 +02:00
Robert Schütz f9bd8b1b7b nixos/home-assistant: use overridePythonAttrs 2021-04-03 12:43:10 +02:00
Sandro ca6a01c9a1
Merge pull request #117946 from andreisergiu98/ombi-init 2021-04-01 12:01:10 +02:00
Andrei Pampu a364121ef9
nixos/ombi: create ombi service 2021-04-01 10:34:40 +03:00
Martin Weinelt b2ebc881cf
Merge pull request #113988 from piegamesde/matrix-appservice-irc 2021-04-01 01:39:24 +02:00
Jamie McClymont fe228cb25b nixos/matrix-appservice-irc: init
Co-authored-by: Brian McKenna <brian@brianmckenna.org>
Co-authored-by: piegames <git@piegames.de>
2021-04-01 01:16:23 +02:00
Felix Tenley 410d181739 nixos/etebase-server: add missing static directory setup 2021-03-30 23:32:26 +02:00
Felix Tenley dccd915adf nixos/etebase-server: replace customIni with more flexible settings option
Fixes #112834 where incorrect documentation of options was reported.

customIni used to replace the entire default configuration while the
new settings option is merged in with the default configuration
and still allows overriding options when needed.
2021-03-30 23:32:26 +02:00
talyz abba76a3b9
nixos/gitlab: Document automatic backups 2021-03-30 19:15:33 +02:00
talyz 7b5cbde81f
nixos/gitlab: Gitlab -> GitLab 2021-03-30 19:13:43 +02:00
talyz 3fb04ca505
nixos/gitlab: Introduce automatic backup support
Add support for automatically backing up GitLab state, both locally
and to remote locations.
2021-03-30 19:13:31 +02:00
Sander van der Burg 13b367df5f nixos/dysnomia: configure systemd unit path 2021-03-28 21:39:23 +02:00
Sander van der Burg 4ae1fa61ad Revert "nixos/dysnomia nixos/disnix: Drop modules"
This reverts commit a3f4db8679.
2021-03-28 21:37:43 +02:00
Milan 58804b24bc
nixos/gitlab: add option for tls wrapper-mode smtp (#116801) 2021-03-20 15:05:29 +01:00
Jan Tojnar 01a4d350c7
Merge branch 'master' into staging-next
Reverted https://github.com/NixOS/nixpkgs/pull/115228 for kodi to avoid conflict.

It does not look like unzip would be used but not investigating now to speed up merge conflict resolution.
2021-03-13 19:16:43 +01:00
Milan 24133ead28
nixos/mautrix-telegram: substitute secrets in config file at runtime (#112966)
In the latest release of mautrix-telegram not all secrets can be set
using environment variables (see https://github.com/tulir/mautrix-telegram/issues/584).
This change allows these secret values to be set without ending up in
the Nix store.
2021-03-13 13:56:17 +01:00
github-actions[bot] 0a8ec23e51
Merge master into staging-next 2021-03-11 00:39:21 +00:00
Sarah Brofeldt fd02940262 nixos/apache-kafka: Use version-matched jre 2021-03-10 08:10:30 +01:00
Sarah Brofeldt 08ef827056 nixos/apache-kafka: Drop default jvmOptions 2021-03-10 08:09:34 +01:00
Jan Tojnar 1465e8e397
Merge branch 'staging-next' into staging 2021-03-06 19:56:45 +01:00
John Ericson f5a7d8bb41
Merge pull request #115228 from siraben/unzip-buildInputs
treewide: unzip buildInputs to nativeBuildInputs (2)
2021-03-06 13:30:43 -05:00
Ben Siraphob 4f0cdb68d7 treewide: unzip buldInputs to nativeBuildInputs (2) 2021-03-06 15:18:05 +07:00
Martin Weinelt 1050f1487b
nixos/home-assistant: disable tests on the package by default
We are running over 6000 tests by now and they take around 5 minutes
on faster machines and tests alot of components that endusers will not
actually be using. It is sufficient if we run them on package upgrades
and in the passthrough test.
2021-03-06 03:02:06 +01:00
davidak 00b47419c6
Merge pull request #103705 from freezeboy/add-plik
plik: init at 1.3.1
2021-03-04 20:28:34 +01:00
Cole Helbling c89117997d nixos/lifecycled: init 2021-03-03 11:15:35 -08:00
Kim Lindberger e72375464b
Merge pull request #113635 from talyz/gitlab-improvements
nixos/gitlab: Clean config dir, switch to puma, split PreStart script and more
2021-03-01 13:37:53 +01:00
Milan Svoboda df3d560999 nixos/nix-gc: add persistent and randomizeDelaySec options 2021-02-28 04:21:21 -05:00
Michael Weiss 18df480d9b gollum: Transfer maintainership to erictapen
I'm not using Gollum anymore while Justin still uses it and has also
written the NixOS module. So it makes perfect sense to pass it on :)
2021-02-27 21:39:16 +01:00
talyz ca725e7fcd
nixos/gitlab: Add gitlab.target
To make it easier to start and stop all GitLab services, introduce
`gitlab.target` which wants all services (meaning they will start with
it) and which all services are part of (meaning they will stop with
it).
2021-02-26 19:54:23 +01:00
talyz 9d4e76dd46
nixos/gitlab: Make gitlab.service's PreStart into two new services
Make the config initialization script run in gitlab.service's PreStart
section into two new services, `gitlab-config.service` and
`gitlab-db-config.service`. Other services can then depend on the
config scripts they need instead of unnecessarily depending on
`gitlab.service`. This makes the reason for the configured service
dependencies much clearer and should also reduce the restart time of
the `gitlab` service quite a lot, when triggered manually.

Also, set up stricter service dependencies, using `bindsTo`, to ensure
that if a service fails or is stopped, its dependants are also
stopped. For example, if we're using the `postgresql` service and it's
stopped, `gitlab.service` and `gitlab-sidekiq.service`, which depend on
it to function, should also be stopped.
2021-02-26 19:54:05 +01:00
talyz 53d9ec83ff
nixos/gitlab: postgresql: Make PSQL a function, run as superUser
A function is more appropriate for this use. See
http://mywiki.wooledge.org/BashFAQ/050 for reference.

Also, we don't need to run the service as root: since we essentially
run all commands as `services.postgresql.superUser` anyway, the whole
service can just run as that user instead.
2021-02-24 18:32:31 +01:00
talyz 2b3800b9c7
nixos/gitlab: Change default SMTP port, enable postfix only if used
Change the default SMTP port to `25`, to better match the default
address `localhost`. This gets rid of some error outputs in the test,
where it fails to connect to localhost:465.

Also, don't enable postfix by default unless it's actually useful to
us.
2021-02-24 18:32:24 +01:00
talyz f8ab43ef7b
nixos/gitlab: Switch from unicorn to puma
Puma is the new upstream default server since GitLab 13.
2021-02-24 18:31:30 +01:00