From 0ce37aa008def65634ce53690fd2504798306343 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Tue, 8 Sep 2020 13:34:36 +0800 Subject: [PATCH] nixops: add experimental users --- nixops/experimental-users.nix | 11 +++++++++++ nixops/nixops.nix | 2 +- nixops/rpi.nix | 5 +++-- 3 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 nixops/experimental-users.nix diff --git a/nixops/experimental-users.nix b/nixops/experimental-users.nix new file mode 100644 index 00000000..56ae5381 --- /dev/null +++ b/nixops/experimental-users.nix @@ -0,0 +1,11 @@ +{ pkgs, ... }: + +{ + jaime = { + isNormalUser = true; + extraGroups = ["wheel" "plugdev" "dialout"]; + openssh.authorizedKeys.keys = [ + "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDPZGCpGW8n+cbGJbIa6Xqp/RpjbRXm55FfGCgw5uQzSk3MJraYaYZVUw4Z4n3WF0XyFirlgOf9RRxYM2GQoXaiq+qwPK1u4GvLTthGtfJ7LJJMjV4ouxooK205jTxp9mb3WTxzMRkcRK44B9tTZH7e36f+snBjCQRsjDTjZaYaxIUQ10gij+I4Cpq9EKrTf7fLgv+56tI6nxz3n8zeihklPOlCauA1WCN8nEU5PxRXL7Fi67kiXBoJJyUmhPg40YhC0zLhOzm7OhhM7RyIGB3bAyF1Q5GKScpPCYiAlm8j9VmQFHtulozs4cwypAOzMr48ekS3VMD1PPwbhHOOlSB1 jaime@jaime-ThinkPad" + ]; + }; +} diff --git a/nixops/nixops.nix b/nixops/nixops.nix index 79270137..9ee5f506 100644 --- a/nixops/nixops.nix +++ b/nixops/nixops.nix @@ -2,7 +2,7 @@ network.enableRollback = true; rpi-1 = import ./rpi.nix { host = "rpi-1"; rpi4 = false; }; - rpi-2 = import ./rpi.nix { host = "rpi-2"; rpi4 = false; }; + rpi-2 = import ./rpi.nix { host = "rpi-2"; rpi4 = false; experimental-users = true; }; rpi-3 = import ./rpi.nix { host = "rpi-3"; rpi4 = true; }; rpi-4 = import ./rpi.nix { host = "rpi-4"; rpi4 = true; }; rpi-5 = import ./rpi.nix { host = "rpi-5"; rpi4 = true; }; diff --git a/nixops/rpi.nix b/nixops/rpi.nix index d7a41f11..9a2aea39 100644 --- a/nixops/rpi.nix +++ b/nixops/rpi.nix @@ -1,4 +1,4 @@ -{ host, rpi4 }: +{ host, rpi4, experimental-users ? false }: { config, pkgs, ... }: let @@ -47,7 +47,8 @@ in users.extraGroups.plugdev = { }; users.mutableUsers = false; users.defaultUserShell = pkgs.fish; - users.extraUsers = (import ./common-users.nix { inherit pkgs; }) // { + users.extraUsers = (import ./common-users.nix { inherit pkgs; }) // + (pkgs.lib.optionalAttrs experimental-users (import ./experimental-users.nix { inherit pkgs; })) // { nix = { isNormalUser = true; };