From c19d6791a3b31fecf1993dd44798b54c62109858 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Mon, 2 Dec 2024 11:17:49 +0100 Subject: [PATCH] userborn: enable by default I have tested this for a wile without any issues. If it works find in srvos, we can propose this to nixos itself. Co-authored-by: zowoq <59103226+zowoq@users.noreply.github.com> --- nixos/common/default.nix | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/nixos/common/default.nix b/nixos/common/default.nix index c84ce70d..be7909c6 100644 --- a/nixos/common/default.nix +++ b/nixos/common/default.nix @@ -1,6 +1,11 @@ # A default configuration that applies to all servers. # Common configuration across *all* the machines -{ config, lib, ... }: +{ + config, + lib, + options, + ... +}: { imports = [ @@ -15,6 +20,11 @@ ./zfs.nix ]; + # Create users with https://github.com/nikstur/userborn rather than our perl script. + # Don't enable if we detect impermanence, which is not compatible with it: https://github.com/nix-community/impermanence/pull/223 + # as well as agenix: https://github.com/ryantm/agenix/pull/255 + services.userborn.enable = lib.mkIf (!(options.environment ? persistence || options ? age)) (lib.mkDefault true); + # Use systemd during boot as well except: # - systems with raids as this currently require manual configuration: https://github.com/NixOS/nixpkgs/issues/210210 # - for containers we currently rely on the `stage-2` init script that sets up our /etc