From 280e9a5ca46e6e5e266871577436abc811d22262 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Sun, 9 Jun 2024 22:31:44 +0200 Subject: [PATCH] nixos/nix: move trusted-user to config This avoids having to define root when trying to add another user as trusted user, similar to the other options. --- nixos/modules/config/nix.nix | 2 +- nixos/modules/profiles/installation-device.nix | 2 +- nixos/modules/profiles/macos-builder.nix | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/nixos/modules/config/nix.nix b/nixos/modules/config/nix.nix index b5fe0a3bd1ce..9505c60d4f63 100644 --- a/nixos/modules/config/nix.nix +++ b/nixos/modules/config/nix.nix @@ -302,7 +302,6 @@ in trusted-users = mkOption { type = types.listOf types.str; - default = [ "root" ]; example = [ "root" "alice" "@wheel" ]; description = '' A list of names of users that have additional rights when @@ -376,6 +375,7 @@ in environment.etc."nix/nix.conf".source = nixConf; nix.settings = { trusted-public-keys = [ "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" ]; + trusted-users = [ "root" ]; substituters = mkAfter [ "https://cache.nixos.org/" ]; system-features = mkDefault ( [ "nixos-test" "benchmark" "big-parallel" "kvm" ] ++ diff --git a/nixos/modules/profiles/installation-device.nix b/nixos/modules/profiles/installation-device.nix index 913b6fc204dd..7e5aec053df9 100644 --- a/nixos/modules/profiles/installation-device.nix +++ b/nixos/modules/profiles/installation-device.nix @@ -125,7 +125,7 @@ with lib; ''; # allow nix-copy to live system - nix.settings.trusted-users = [ "root" "nixos" ]; + nix.settings.trusted-users = [ "nixos" ]; # Install less voices for speechd to save some space services.speechd.package = pkgs.speechd.override { diff --git a/nixos/modules/profiles/macos-builder.nix b/nixos/modules/profiles/macos-builder.nix index 786e26cf98f7..bf8414e1e108 100644 --- a/nixos/modules/profiles/macos-builder.nix +++ b/nixos/modules/profiles/macos-builder.nix @@ -123,7 +123,7 @@ in max-free = cfg.max-free; - trusted-users = [ "root" user ]; + trusted-users = [ user ]; }; services = {