diff --git a/nixos/common/default.nix b/nixos/common/default.nix index c84ce70d..7521d95b 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,13 @@ ./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.environment.persistence.enable) || 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