Commit graph

35326 commits

Author SHA1 Message Date
Oliver Schmidt e362fe9c6d security/acme: limit concurrent certificate generations
fixes #232505

Implements the new option `security.acme.maxConcurrentRenewals` to limit
the number of certificate generation (or renewal) jobs that can run in
parallel. This avoids overloading the system resources with many
certificates or running into acme registry rate limits and network
timeouts.

Architecture considerations:
- simplicity, lightweight: Concerns have been voiced about making this
  already rather complex module even more convoluted. Additionally,
  locking solutions shall not significantly increase performance and
  footprint of individual job runs.
  To accomodate these concerns, this solution is implemented purely in
  Nix, bash, and using the light-weight `flock` util. To reduce
  complexity, jobs are already assigned their lockfile slot at system
  build time instead of dynamic locking and retrying. This comes at the
  cost of not always maxing out the permitted concurrency at runtime.
- no stale locks: Limiting concurrency via locking mechanism is usually
  approached with semaphores. Unfortunately, both SysV as well as
  POSIX-Semaphores are *not* released when the process currently locking
  them is SIGKILLed. This poses the danger of stale locks staying around
  and certificate renewal being blocked from running altogether.
  `flock` locks though are released when the process holding the file
  descriptor of the lock file is KILLed or terminated.
- lockfile generation: Lock files could either be created at build time
  in the Nix store or at script runtime in a idempotent manner.
  While the latter would be simpler to achieve, we might exceed the number
  of permitted concurrent runs during a system switch: Already running
  jobs are still locked on the existing lock files, while jobs started
  after the system switch will acquire locks on freshly created files,
  not being blocked by the still running services.
  For this reason, locks are generated and managed at runtime in the
  shared state directory `/var/lib/locks/`.

nixos/security/acme: move locks to /run

also, move over permission and directory management to systemd-tmpfiles

nixos/security/acme: fix some linter remarks in my code

there are some remarks left for existing code, not touching that

nixos/security/acme: redesign script locking flow

- get rid of subshell
- provide function for wrapping scripts in a locked environment

nixos/acme: improve visibility of blocking on locks

nixos/acme: add smoke test for concurrency limitation

heavily inspired by m1cr0man

nixos/acme: release notes entry on new concurrency limits

nixos/acme: cleanup, clarifications
2023-09-09 20:13:18 +02:00
hexchen 15db31b2d9 nixos/decklink: init 2023-09-09 19:45:50 +02:00
Janik 1ffb4e592e
Merge pull request #249964 from ambroisie/woodpecker-improvements 2023-09-09 19:30:34 +02:00
ajs124 0a3aa06b53
Merge pull request #253739 from mweinelt/firefox-102-removal
firefox-esr-102-unwrapped: remove
2023-09-09 19:25:42 +02:00
Lassulus b4f1091214
Merge pull request #252006 from ajs124/logrotate-extraParams 2023-09-09 19:12:20 +02:00
ajs124 f8df5ffdfe nixos/tt-rss: fix and significantly simplify database setup
the schema files referenced in the current preStart are empty.
other ones exist, but don't apply cleanly either.
calling update.php with --update-schema works for initial setup and
updates. if the database schema is already up to date, it's idempotent.
2023-09-09 19:11:54 +02:00
Janik eda85eb31d
Merge pull request #251062 from ajs124/restic-wrapper-script 2023-09-09 19:11:33 +02:00
Lassulus 72160fbdc1
Merge pull request #251302 from Mic92/buildbot
nixos/buildbot: support reload, buildbot-www-react: init 3.9
2023-09-09 19:09:06 +02:00
Artturi b3e16d6e10
Merge pull request #254166 from Artturin/fixthingy1 2023-09-09 19:56:02 +03:00
Yorick df123af8b8
Merge pull request #248502 from kurnevsky/wstunnel
wstunnel: correct listen option
2023-09-09 18:45:45 +02:00
Janne Heß 6b8306c21c
Merge pull request #249643 from amarshall/networkd-reload
nixos/networkd: Reload (not restart) when only .network units change
2023-09-09 17:31:09 +02:00
Janne Heß a71936c70f
Merge pull request #254027 from luochen1990/feature-better-binfmt
nixos/binfmt: improve type annotations
2023-09-09 17:24:53 +02:00
revol-xut 6f50091de7 nixos/listmonk: fixing datatype of options 2023-09-09 15:21:32 +02:00
Timothy DeHerrera 69bfaafc9d nixos/cfdyndns: add option to use CF token 2023-09-09 12:20:14 +00:00
Pierre Bourdon bc63dd8514
Merge pull request #254029 from delroth/sudo-maintainers
sudo, nixosTests.sudo: refresh set of maintainers
2023-09-09 13:44:02 +02:00
Artturin f25f2a4209 nixos/stage-2-init: dont use install to create /etc/nixos if it's a symlink
it should be checking that it is not a broken symlink but bash
conditionals are difficult

-d was causing the directory to not be created if it does not exist

```
$ install -m 0755 -d $PWD/hello
$ ls
hello/
$ ln -s something notexist
'notexist' -> 'something'
$ ls -l
lrwxrwxrwx artturin artturin 9 B Sat Sep  9 06:59:44 2023 notexist@ ⇒ something
drwxr-xr-x artturin artturin 2 B Sat Sep  9 06:59:36 2023 hello/
$ install -m 0755 -d $PWD/notexist
install: cannot change permissions of ‘/home/artturin/nixgits/my-nixpkgs/test/notexist’: No such file or directory
```
2023-09-09 07:22:05 +03:00
Weijia Wang 11f492ef73
Merge pull request #254089 from BruNeu/patch-1
nixos/stalwart-mail: fixed broken link
2023-09-09 01:12:03 +02:00
BruNeu c729c9746e nixos/stalwart-mail: fixed broken link 2023-09-08 23:59:03 +02:00
Maciej Krüger a833668968
Merge pull request #254078 from nbraud/hail 2023-09-08 23:04:34 +02:00
Salar Rahmanian e8210b2aac plausible: 1.4.4 -> 1.5.1 2023-09-08 20:54:05 +00:00
nicoo 8bb42ad1af nixos/hail: Remove module 2023-09-08 19:28:49 +00:00
pennae 6054951ae5
Merge pull request #253299 from pennae/jack-tools
jack-example-tools: init at 4
2023-09-08 15:23:25 +02:00
Pierre Bourdon 69defb96b5
nixosTests.sudo: use same maintainers as the package 2023-09-08 14:47:13 +02:00
LuoChen 9c5afb2f9a
nixos/binfmt: improve type annotations 2023-09-08 19:40:42 +08:00
Weijia Wang adb074b88d
Merge pull request #253142 from SuperSandro2000/patch-1
nixos/nginx: fix services.nginx.defaultListen description
2023-09-07 23:54:48 +02:00
Weijia Wang 4fbea0f80b
Merge pull request #253071 from linsui/yazi
nixos/yazi: init
2023-09-07 22:57:22 +02:00
Weijia Wang eb1c345512
Merge pull request #253048 from Mic92/openrbg
nixos/openrbg: set cpu model based on what microcode updates are enabled
2023-09-07 22:55:34 +02:00
Weijia Wang fdc0272b60
Merge pull request #249941 from FrancescoDeSimone/duplicati-service-fix
nixos/duplicati: add package option
2023-09-07 22:36:18 +02:00
Edward Tjörnhammar b8c871475a nixos/infiniband: add support for configurable guids 2023-09-07 19:59:33 +02:00
Kerstin Humm fc67d297de nixos/mobilizon: add release notes 2023-09-07 08:59:40 +00:00
Kerstin Humm 36ff7d5d5d mobilizon: init at 3.1.3
Co-Authored-By: Minijackson <minijackson@riseup.net>
Co-Authored-By: summersamara <summersamara@proton.me>
2023-09-07 08:59:40 +00:00
happysalada 5ae2b27518 nixos/surrealdb: incorporate beta 10 changes 2023-09-07 08:57:41 +00:00
Weijia Wang 024c8c2bd4
Merge pull request #247618 from Majiir/streamdeck-ui-3.0.1
streamdeck-ui: 2.0.6 -> 3.0.1
2023-09-07 10:24:22 +02:00
Majiir Paktu 44813a8a61 streamdeck-ui: split desktop items 2023-09-06 21:38:23 -04:00
Weijia Wang e45dcb6b8d
Merge pull request #251118 from jmbaur/tpm-crb-initrd
nixos/systemd-initrd: disable tpm-crb if on armv7l-linux
2023-09-07 02:54:26 +02:00
Weijia Wang 71c99509fd
Merge pull request #250224 from n0emis/grocy-4.0.2
grocy: 4.0.0 -> 4.0.2
2023-09-07 01:59:28 +02:00
Martin Weinelt ba881ef613
firefox-esr-102-unwrapped: remove
The Firefox ESR 102.0 series has reached its end of life.

Removes package and test and references to them.
2023-09-07 01:17:27 +02:00
Jared Baur c47f423a9d
nixos/systemd-initrd: disable tpm-crb if on armv7l-linux
In addition to the existing riscv64 exception, also disable adding the
tpm-crb module to the initrd if the host platform is armv7.
2023-09-07 00:38:55 +02:00
May 7f2ec624dd
auto-cpufreq: 1.7.1 -> 1.9.9 (#253595)
* auto-cpufreq: 1.7.1 -> 1.9.9

* fix test

* set `meta.buildDocsInSandbox = false`

required because description depends on restricted module argument pkgs
2023-09-06 23:41:24 +02:00
Samuel Dionne-Riel 2de1bd778c nixos/iso-image: Remove leftover false dichotomy between console/serial
Relying on the built-in UEFI console here was already necessary, so we
are losing nothing by removing the needless `serial` call, which hung
some systems.

This also makes the implementation much easier to understand.

Also, no ugly-font menu anymore!
2023-09-06 14:10:09 -04:00
Samuel Dionne-Riel 7fa7158c60 nixos/iso-image: graphicalGrub -> forceTextMode
This helps keep logic simpler, as what we do is forcing text mode, which
means the non-default case is `truthy`, making things easier to digest
in the config file.

Also renaming this option is considered "internal", since it lives only
within the `iso-image` namespace, and also not a breaking change since
it was not part of a stable release.
2023-09-06 14:09:03 -04:00
Samuel Dionne-Riel 07fb2f4a97 nixos/iso-image: Tear down GOP and rely on console for Linux boot
This solves an issue where *some systems* (tested on Steam Deck) the EFI
GOP may be broken during stage-1.
2023-09-06 14:09:02 -04:00
Samuel Dionne-Riel 47ae07a23f nixos/iso-image: Drop all unneeded FS modules
It's not like the iso-image will be anything else than isohybrid
FAT+iso9660...
2023-09-06 14:09:02 -04:00
Samuel Dionne-Riel d64b03a339 nixos/iso-image: Re-enable graphics mode
Which ***anyway*** was not disabled correctly. Following changes will
actually disable it.

What this did was disable the "themed" menu driver, but still continued
relying on the gfxterm infra, which in itself is why things were ugly
and weird.
2023-09-06 14:09:02 -04:00
Samuel Dionne-Riel dd936c21d7 nixos/iso-image: Check GRUB config on build 2023-09-06 14:09:02 -04:00
Samuel Dionne-Riel 8623ac4656 nixos/iso-image: Add common display resolutions
Hey, look at that, grub is the correct way around on a Steam Deck!
2023-09-06 14:09:02 -04:00
Samuel Dionne-Riel 080bff8159 nixos/iso-image: Use intrinsic UEFI console for serial output in GRUB
The `serial` console hangs on some systems. Unknown why.

Anyway, the way this worked right now relied on it telling the user on
the UEFI console how to enable it. So if I understand it correctly, it
will not cause any regression there.
2023-09-06 14:09:02 -04:00
Samuel Dionne-Riel fad94acaa8 nixos/iso-image: Make modules list easier to manage
With a bash array.

This change is morally a no-op.
2023-09-06 14:09:02 -04:00
Lin Jian ac4f5079f7 emacsPackages.mu4e: init at 1.10.7
This patch packages mu4e as an Emacs lisp package based on the mu4e
output of the multiple-output package mu, which makes mu4e a good
citizen of Emacs lisp packages in two aspects.

First, mu4e now utilizes the Emacs lisp package infrastructure in
Nixpkgs.  This allows users who want to do AOT native compilation for
non-default Emacs variants[0] to build only mu4e itself instead of the
whole mu package[1].

Second, mu4e now conforms to the Emacs builtin package manager[2].
Without this patch, mu4e autoloaded commands do not work
out-of-the-box[3] because its directory is added to load-path by
site-start.el after the initialization of package-directory-list,
which causes package-activate-all to not load mu4e-autoloads.el.  This
patch fixes this issue when mu4e is installed to Emacs using the
withPackages wrapper[4].

[0]: such as emacs-pgtk
[1]: mu.override { emacs = emacs-pgtk; }
[2]: package.el
[3]: either (require 'mu4e) or (require 'mu4e-autoloads) is needed to
be called before an autoloaded command is called
[4]: emacs-pgtk.pkgs.withPackages (epkgs: [ epkgs.mu4e ])
2023-09-06 16:27:13 +00:00
Weijia Wang 67160d51fe
Merge pull request #251987 from illdefined/akkoma
akkoma: 3.9.3 → 3.10.4
2023-09-06 16:03:52 +02:00