Commit Graph

468 Commits

Author SHA1 Message Date
0x4A6F
a0db07dad5
Merge pull request #256295 from Janik-Haag/usbguard
nixos/usbguard: restore ruleFile option
2023-09-25 22:05:36 +02:00
Janik H.
3b673297e7
nixos/usbguard: restore ruleFile option 2023-09-20 13:55:55 +02:00
Niklas Hambüchen
c460434104 nixos/vaultwarden: Fix doubly-nested config value. Fixes evaluation 2023-09-19 16:46:08 +00:00
Sagi Sarussi
f3cf8b679b nixos/kanidm: fix broken doc links 2023-08-31 14:03:30 +03:00
Ilan Joselevich
fb1f530bc6
Merge pull request #249521 from Kranzes/oauth2-proxy
nixos/oauth2_proxy: service after network.target -> network-online.target
2023-08-17 03:16:10 +03:00
Ilan Joselevich
0a732d2adf
nixos/oauth2_proxy: service after network.target -> network-online.target 2023-08-16 14:40:33 +03:00
h7x4
655a04a8fa
nixos/kanidm: add package option
Signed-off-by: h7x4 <h7x4@nani.wtf>
2023-08-15 10:05:44 +02:00
Jonas Heinrich
c5f4a46036 nixos/opensnitch: Add support for EPBF process monitor
Co-authored-by: Slime90
2023-08-13 22:19:48 +08:00
Martin Weinelt
184d15cc06
kanidm: 1.1.0-alpha.12 -> 1.1.0-beta.13
https://github.com/kanidm/kanidm/releases/tag/v1.1.0-beta.13

The kanidmd process now creates a unix socket, over which admin tasks
can be done, without having to shut kanidm down first.

The kanidm_unixd process now wants access to /etc/shadow and /etc/group,
so it can rule out collisions with the host system.
2023-08-01 17:13:58 +02:00
Tim
28a081c736
also inherit bantime 2023-07-21 18:48:20 +02:00
André Schröder
9858973dad nixos/vaultwarden: Fix Markdown syntax of link
The typo was introduced in 1d41cff3dc
2023-07-17 23:41:44 +02:00
Oliver Richter
9d6cd34766 esdm: init at 0.6.0
Signed-off-by: Oliver Richter <richter-oliver@gmx.net>
2023-07-13 16:08:12 +02:00
Lassulus
0e1fc501c6
Merge pull request #241927 from ether42/usbguard
nixos/usbguard: rename services.usbguard.implictPolicyTarget to services.usbguard.implicitPolicyTarget
2023-07-12 18:58:30 +02:00
Felix Buehler
bec27fabee treewide: use lib.optional instead of 'then []' 2023-07-12 09:36:28 +01:00
Kevin Boulain
680ee304ca nixos/usbguard: rename services.usbguard.implictPolicyTarget to services.usbguard.implicitPolicyTarget 2023-07-06 15:34:40 +02:00
Lassulus
f751061a08
Merge pull request #237477 from accelbread/usbguard-dbus-support
nixos/usbguard: add USBGuard dbus daemon option
2023-07-05 23:13:10 +02:00
Ryan Lahfa
7672c1e9ae
Merge pull request #201907 from Tom-Hubrecht/fail2ban 2023-07-02 13:57:47 +02:00
Niklas Hambüchen
080757c6c5 nixos/vaultwarden: Bind to localhost by default. See #100192 2023-07-01 15:35:28 +02:00
Tom Hubrecht
208ee8b2e2 nixos/fail2ban: use attrsets for settings instead of strings 2023-06-30 22:27:40 +02:00
Felix Buehler
933a41a73f treewide: use optional instead of 'then []' 2023-06-25 09:11:40 -03:00
Jelle Besseling
53a3ddfab8
vault: set coredump ulimit to 0 2023-06-22 16:44:30 +02:00
Archit Gupta
cbb69aa1c1 nixos/usbguard: add USBGuard dbus daemon option
The usbguard package includes the dbus daemon, but the NixOS config
option does not provide a service file or its necessary polkit rules.

Enabling the dbus daemon allows use of Gnome's USBGuard support.
2023-06-12 21:38:07 -07:00
Max
847a7f1102 nixos/kanidm: auto-restart kanidm-unixd-tasks 2023-06-11 17:17:42 +02:00
pennae
727086540f
Merge pull request #233238 from emilylange/username-change
maintainers: rename indeednotjames to emilylange
2023-05-21 17:07:05 +02:00
emilylange
b0e7f7f5db
maintainers: rename indeednotjames to emilylange 2023-05-21 16:01:35 +02:00
figsoda
701bcdbead nixos: fix typos 2023-05-19 22:31:04 -04:00
Izorkin
edb40b3e4f nixos/fail2ban: others small update 2023-05-03 08:45:26 +02:00
Izorkin
544ebba973 nixos/fail2ban: update bantime options 2023-05-03 08:45:26 +02:00
Thomas
4e8bde773f
nixos/{consul-template,vault-agent}: init 2023-04-24 06:55:57 +02:00
Tom Hubrecht
e41c569429 nixos/authelia: Allow using Unix sockets 2023-04-20 23:53:16 +02:00
datafoo
066166cf49 nixos/fail2ban: add extraSettings option 2023-04-20 16:57:24 +02:00
Artturi
b83db86a9e
Merge pull request #222080 from Stunkymonkey/nixos-optionalString 2023-04-20 16:07:30 +03:00
Flakebi
603e89eef9 kanidm: BindMount certificate paths
Bind mount the base dirs of the tls key and chain into the service.

Make sure to bind every directory just once. The test failed on ofborg
when /nix/store and the certificate path in /nix/store/<some path> were
bound.
2023-04-20 02:32:37 +02:00
datafoo
3403ee0602 nixos/fail2ban: add bantime option 2023-04-19 19:18:31 +02:00
Felix Buehler
327b0cff7a treewide: use more lib.optionalString 2023-04-07 13:38:33 +02:00
06kellyjac
9b60eef4bd authelia: move module under security and minor fixes
Fixed test access to lib
Added nixos test to passthru
2023-03-27 12:00:07 +01:00
Flakebi
12db8314d7
fail2ban: 0.11.2 -> 1.0.2
Update to 1.0.2: https://github.com/fail2ban/fail2ban/blob/1.0.2/ChangeLog#ver-102-20221109---finally-war-game-test-tape-not-a-nuclear-alarm
1.0.1 contained a few breaking changes, but I think they have little
impact.

I changed the module to use the systemd service shipping with fail2ban
(now added to the package).
2023-02-15 10:11:38 +01:00
Marin
785cd824a3 nixos/yubikey-agent: Add dependency to pcsd.service
Issue: after installing, running `yubikey-agent -setup` produces the
following error:
```
nixOS: Failed to connect to the YubiKey: connecting to pscs: the Smart
card resource manager is not running
```

More on this issue: https://github.com/FiloSottile/yubikey-agent/issues/137
2023-02-11 09:32:24 -05:00
pennae
bf4c0c1900 nixos/*: remove trailing period in mkEnableOptions
those are added by mkEnableOption, and .. is replaced to … by markdown
processing.
2023-02-08 15:23:34 +01:00
Maximilian Bosch
918c22bd5f
privacyidea: fix build
The previous changes for the 3.8 update are ready, but staging got
merged into master, so there are a few more challenges to tackle:

* Use python 3.10 now since it's actually supported and less effort to
  build (3.9 isn't recursed into anymore).
* sphinx doesn't build with these overrides, so patch it out entirely
  (i.e. drop `sphinxHook` where it's causing problems).
* backport a few jinja2 fixes for python 3.10 that were fixed in later
  versions, but break because this env is stuck to 2.11.
2023-02-06 20:28:26 +01:00
Maximilian Bosch
f6c8d04d11
nixos/privacyidea: fix db uri
Fixes db migration on 3.8. See also https://github.com/privacyidea/privacyidea/issues/3447
2023-02-06 17:29:47 +01:00
Naïm Favier
3aa1337a71
nixos: remove stray spaces 2023-01-21 21:46:53 +01:00
Matthieu Coudron
cf10d7aef8
services.openssh: support freeform settings (#193757)
* services.openssh: support freeform settings

Keep "extraConfig" but introduces "settings".

Also renames several options

(mkRenamedOptionModule [ "services" "openssh" "kbdInteractiveAuthentication" ] [  "services" "openssh" "settings" "KbdInteractiveAuthentication" ])
(mkRenamedOptionModule [ "services" "openssh" "passwordAuthentication" ] [  "services" "openssh" "settings" "PasswordAuthentication" ])
(mkRenamedOptionModule [ "services" "openssh" "useDns" ] [  "services" "openssh" "settings" "UseDns" ])
(mkRenamedOptionModule [ "services" "openssh" "permitRootLogin" ] [  "services" "openssh" "settings" "PermitRootLogin" ])

* updated doc
* regen doc
2023-01-15 16:32:46 +01:00
Naïm Favier
88a7218236
nixos/fail2ban: support nftables with default configuration 2023-01-07 11:26:40 +01:00
Sandro
c8c8ac5cc6
Merge pull request #203449 from yaxitech/azure-quote-provider 2022-12-24 16:19:39 +01:00
figsoda
6bb0dbf91f nixos: fix typos 2022-12-17 19:31:14 -05:00
Martin Weinelt
0497d5b99f
vaultwarden: Add update script to keep web vault in sync
- Adds an update script to fetch the compatible web vault version
- Removes `vaultwarden-vault` from top-level to prevent independent
  updates through e.g. r-ryantm. Istead the vault is now accessible
  at `vaultwarden.webvault`.
- The name webvault was chosen because it is the title of the projects
  README and it makes it clearer, that this is the web UI.
2022-12-14 15:00:20 +01:00
Naïm Favier
0ff3b35356 nixos/doc: fix some options 2022-12-08 17:52:52 +01:00
Vincent Haupert
dbff3c22c1 nixos/aesmd: add option environment 2022-12-04 20:12:50 +01:00
Andreas Stührk
da0dc8339c nixos/aesmd: add option to configure quote provider library
Changes sgx-psw to append `aesm` to `LD_LIBRARY_PATH`:
- Append instead of prepend to allow for overriding in service config
- As we already add a wrapper to add `aesm` to `LD_LIBRARY_PATH` it is
  not necessary to also set in `LD_LIBRARY_PATH` of the systemd service.

Co-authored-by: Vincent Haupert <mail@vincent-haupert.de>
2022-12-04 20:12:50 +01:00
Ryan Lahfa
39f399f6ff
Merge pull request #199395 from owm111/physlock-m
nixos/physlock: add muteKernelMessages option
2022-12-01 14:51:50 +01:00
Jonas Heinrich
3aff916914 nixos/opensnitch: Add option to configure rules 2022-11-28 14:19:16 -05:00
Flakebi
887020f39c nixos/kanidm: Add tls options
Since 1.1.0-alpha.10 kanidm requires TLS to be set up or it won't start.
2022-11-26 21:42:35 +01:00
figsoda
d1dd00b618 nixos/vaultwarden: use lib.concatMapAttrs 2022-11-17 12:54:28 -05:00
Owen McGrath
ee090cd808 nixos/physlock: add muteKernelMessages options
Add an option for physlock's -m flag, which mutes kernel messages on the
console. This ensures that the password prompt is the only thing on the
screen and isn't lost in a flood of kernel messages.
2022-11-03 15:22:09 -05:00
Sandro
a01b2b807e
Merge pull request #197221 from azahi/endlessh-module 2022-11-01 23:44:25 +01:00
MidAutumnMoon
7415970a3e nixos/endlessh-go: set proper SystemCallFilter 2022-10-24 22:21:02 +10:00
Azat Bahawi
76ccbea152
nixos/endlessh: init module 2022-10-22 16:07:52 +03:00
Artturin
7e49471316 treewide: optional -> optionals where the argument is a list
the argument to optional should not be list
2022-10-10 15:40:21 +03:00
Sandro
f5802f496d
Merge pull request #187026 from azahi/endlessh-go 2022-10-09 16:50:02 +02:00
Maximilian Bosch
15914eba85
nixos/privacyidea: fix manual build 2022-10-06 13:50:31 +02:00
Maximilian Bosch
ecaf6aed02
nixos/privacyidea: add proper support for privacyidea-token-janitor
`privacyidea-token-janitor`[1] is a tool which helps to automate
maintenance of tokens. This is helpful to identify e.g. orphaned tokens,
i.e. tokens of users that were removed or tokens that were unused for a
longer period of time and apply actions to them (e.g. `disable` or
`delete`).

This patch adds two new things:

* A wrapper for `privacyidea-token-janitor` to make sure it's executable
  from CLI. To achieve this, it does a `sudo(8)` into the
  `privacyidea`-user and sets up the environment to make sure the
  configuration file can be found. With that, administrators can
  directly invoke it from the CLI without additional steps.

* An optional service is added which performs automatic cleanups of
  orphaned and/or unassigned tokens. Yes, the tool can do way more
  stuff, but I figured it's reasonable to have an automatic way to clean
  up tokens of users who were removed from the PI instance. Additional
  automation steps should probably be implemented in additional
  services (and are perhaps too custom to add them to this module).

[1] https://privacyidea.readthedocs.io/en/v3.7/workflows_and_tools/tools/index.html
2022-10-06 11:43:20 +02:00
Solene Rapenne
605a588ea6 nixos/fail2ban: improve module documentation 2022-10-02 12:59:54 +02:00
Azat Bahawi
99dc9b9c16
nixos/endlessh-go: init module 2022-09-23 23:55:54 +03:00
Kerstin
1637945189
Merge pull request #189975 from Tasqa/kanidm-cacerts-fix
nixos/kanidm: Add cacerts path to unixd service
2022-09-15 16:28:21 +02:00
Guillaume Girol
a47cfca9af
Merge pull request #189744 from symphorien/vaultwarden-service
nixos/vaultwarden: misc fixes
2022-09-12 19:26:39 +00:00
Tako Marks
3df41451e3 nixos/kanidm: Bind mount cacert path in unixd service
In order to be able to use the unixd service with the `verify_ca` and
`verify_hostnames` set to `true` it needs to be able to read the
certificate store. This change bind mounts the cacert paths for the
unixd service.
2022-09-06 15:01:37 +02:00
Guillaume Girol
70b8ef1df6 nixos/vaultwarden: fix typo in timer alias 2022-09-04 12:00:00 +00:00
Guillaume Girol
7160e94e27 nixos/vaultwarden: fix race with backup
when vaultwarden starts while backup-vaultwarden.service is running, it
fails because the sqlite database is locked
2022-09-04 12:00:00 +00:00
Guillaume Girol
7d009061c9 nixos/vaultwarden: Restart=always
there is no reason vaultwarden should remain not started
2022-09-04 12:00:00 +00:00
pennae
3bddcf5f90
Merge branch 'master' into option-docs-md 2022-09-01 16:10:09 +02:00
pennae
1d41cff3dc nixos/*: convert straggler options to MD 2022-08-31 17:27:38 +02:00
pennae
f2ea09ecbe nixos/*: convert options with listings
minor rendering changes.
2022-08-31 17:27:36 +02:00
pennae
722b99bc0e nixos/*: convert options with admonitions to MD
rendering changes only slightly, most changes are in spacing.
2022-08-31 16:36:16 +02:00
pennae
bd56368848 nixos/*: md-convert hidden plaintext options
most of these are hidden because they're either part of a submodule that
doesn't have its type rendered (eg because the submodule type is used in
an either type) or because they are explicitly hidden. some of them are
merely hidden from nix-doc-munge by how their option is put together.
2022-08-31 16:32:54 +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
e4f876eb7e nixos/*: convert varlist-using options to MD
there are sufficiently few variable list around, and they are
sufficiently simple, that it doesn't seem helpful to add another
markdown extension for them. rendering differences are small, except in
the tor module: admonitions inside other blocks cannot be made to work
well with mistune (and likely most other markdown processors), so those
had to be shuffled a bit. we also lose paragraph breaks in the list
items due to how we have to render from markdown to docbook, but once we
remove docbook from the pipeline those paragraph breaks will be restored.
2022-08-31 16:32:53 +02:00
pennae
7d102d113a nixos/*: convert multiline inline code to listings
presumably it was not intended to have these blocks rendered inline, and
markdown conversion would be messy as well.
2022-08-31 16:27:25 +02:00
pennae
5841c386a0 nixos/*: remove indentation from long enable options
the way these are written they introduce lots of whitespace in each
line, which will cause those lines to render as code when converted to
markdown. override the whole description instead.
2022-08-31 16:21:14 +02:00
K900
a7bfb90ea8 nixos/vaultwarden: protect the default data directory more
Fixes #179415
2022-08-29 09:26:31 +03:00
pennae
e607b30abe nixos/tor: convert option descriptions to MD
no change in rendered output. the html manual could render <screen>
blocks differently, but so far it hasn't (and if we need to make a
distinction we can use a special info string).
2022-08-27 19:18:29 +02:00
pennae
6039648c50 nixos/*: automatically convert option docs 2022-08-19 22:40:58 +02:00
pennae
7e7d68a250 nixos/*: mark pre-existing markdown descriptions as mdDoc 2022-08-19 22:40:58 +02:00
pennae
b51f8036c2 nixos/*: use properly indented strings for option docs
using regular strings works well for docbook because docbook is not as
whitespace-sensitive as markdown. markdown would render all of these as
code blocks when given the chance.
2022-08-19 22:40:58 +02:00
pennae
8f8e101527 nixos/*: normalize <package> to <literal>
this renders the same in the manpage and a little more clearly in the
html manual. in the manpage there continues to be no distinction from
regular text, the html manual gets code-type markup (which was probably
the intention for most of these uses anyway).
2022-08-19 22:40:58 +02:00
Jörg Thalheim
7a8a3dfd8b
Merge pull request #181939 from Mic92/vault-2
vault: fix assertions when raft backend is used
2022-08-16 05:24:01 +01:00
pennae
087472b1e5 nixos/*: automatically convert option docs 2022-08-06 20:39:12 +02:00
pennae
423545fe48 nixos/*: normalize manpage references to single-line form
now nix-doc-munge will not introduce whitespace changes when it replaces
manpage references with the MD equivalent.

no change to the manpage, changes to the HTML manual are whitespace only.
2022-08-05 18:34:50 +02:00
pennae
61e93df189 nixos/*: automatically convert option docs to MD
once again using nix-doc-munge (69d080323a)
2022-08-03 22:46:41 +02:00
pennae
3aebb4a2be nixos/*: normalize link format
make (almost) all links appear on only a single line, with no
unnecessary whitespace, using double quotes for attributes. this lets us
automatically convert them to markdown easily.

the few remaining links are extremely long link in a gnome module, we'll
come back to those at a later date.
2022-08-03 21:57:46 +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
81add6600c
nixos/privacyidea-ldap-proxy: umask to avoid accidental world-readability 2022-07-20 20:29:38 +02:00
Maximilian Bosch
8b72dae17b
Merge pull request #181528 from Ma27/privacyidea-ldap-proxy-secrets
nixos/privacyidea: better secret-handling ldap-proxy & RFC42-style settings for ldap-proxy
2022-07-18 14:19:47 +02:00
Maximilian Bosch
949c334ea9
nixos/privacyidea-ldap-proxy: use list for EnvironmentFile for mergeability 2022-07-18 13:58:08 +02:00
Jörg Thalheim
2856eb2046 vault: fix assertions when raft backend is used 2022-07-18 13:12:26 +02:00
Maximilian Bosch
4adf26f018
nixos/privacyidea-ldap-proxy: always run envsubst
Otherwise the file doesn't exist at the expected location.
2022-07-16 14:00:46 +02:00
Maximilian Bosch
bccaac9535
nixos/privacyidea: better secret-handling ldap-proxy & RFC42-style settings for ldap-proxy
Instead of hard-coding a single `configFile` for
`privacyidea-ldap-proxy.service` which is pretty unmergable with other
declarations it now uses a RFC42-like approach. Also to make sure that
secrets can be handled properly without ending up in the Nix store, it's
possible to inject secrets via envsubst

    {
      services.privacyidea.ldap-proxy = {
        enable = true;
        environmentFile = "/run/secrets/ldap-pw";
        settings = {
          privacyidea.instance = "privacyidea.example.org";
          service-account = {
            dn = "uid=readonly,ou=serviceaccounts,dc=example,dc=org";
            password = "$LDAP_PW";
          };
        };
      };
    }

and the following secret file (at `/run/secrets`):

    LDAP_PW=<super-secret ldap pw>

For backwards-compat the old `configFile`-option is kept, but it throws
a deprecation warning and is mutually exclusive with the
`settings`-attrset. Also, it doesn't support secrets injection with
`envsubst` & `environmentFile`.
2022-07-14 23:51:17 +02:00
Aidan Gauland
d9119dbbdf
pass-secret-service: unstable-2020-04-12 -> unstable-2022-03-21
* Update to the latest upstream version of pass-secret-service that includes
  systemd service files.
* Add patch to fix use of a function that has been removed from the Python
  Cryptography library in NixOS 22.05
* Install systemd service files in the Nix package.
* Add NixOS test to ensure the D-Bus API activates the service unit.
* Add myself as a maintainer to the package and NixOS test.
* Use checkTarget instead of equivalent custom checkPhase.
2022-07-12 07:33:26 +12:00
Maximilian Bosch
000d72eb7f
nixos/privacyidea: pin python to 3.9
Otherwise `pi-manage` doesn't work inside the Python env (which is 3.10
whereas privacyidea requires 3.9).

Failing Hydra build: https://hydra.nixos.org/build/182734928
2022-07-05 19:38:54 +02:00
Jörg Thalheim
826c20dcae
nixos/vault: add option to start in dev mode. (#180114)
* nixos/vault: add option to start in dev mode.

This is not only useful for nixos tests i.e. when testing vault agent
setups but also when playing around with vault in local setups. In our
tests we can now make use of this option to test more vault features.
i.e. adding this feature has uncovered the need for a `StateDirectory`.

* Update nixos/modules/services/security/vault.nix

Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>

Co-authored-by: Jonas Chevalier <zimbatm@zimbatm.com>
Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
2022-07-05 10:54:11 +02:00