Skip to content

Commit 2f5f51b

Browse files
Mic92zowoq
andcommitted
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 <[email protected]>
1 parent 528f3ec commit 2f5f51b

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

nixos/common/default.nix

+13-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
# A default configuration that applies to all servers.
22
# Common configuration across *all* the machines
3-
{ config, lib, ... }:
3+
{
4+
config,
5+
lib,
6+
options,
7+
...
8+
}:
49
{
510

611
imports = [
@@ -15,6 +20,13 @@
1520
./zfs.nix
1621
];
1722

23+
# Create users with https://github.com/nikstur/userborn rather than our perl script.
24+
# Don't enable if we detect impermanence, which is not compatible with it: https://github.com/nix-community/impermanence/pull/223
25+
# as well as agenix: https://github.com/ryantm/agenix/pull/255
26+
services.userborn.enable = lib.mkIf (
27+
!((options.environment ? persistence && options.environment.persistence.enable) || options ? age)
28+
) (lib.mkDefault true);
29+
1830
# Use systemd during boot as well except:
1931
# - systems with raids as this currently require manual configuration: https://github.com/NixOS/nixpkgs/issues/210210
2032
# - for containers we currently rely on the `stage-2` init script that sets up our /etc

0 commit comments

Comments
 (0)