From cded5bfdf7df57e7215ef37ca41b29468f2c4d61 Mon Sep 17 00:00:00 2001 From: Nico Date: Sat, 30 Aug 2025 18:13:07 +1000 Subject: [PATCH] users: add deploy --- flake.nix | 1 + modules/users/deploy.nix | 28 ++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 modules/users/deploy.nix diff --git a/flake.nix b/flake.nix index 28fcd00..f8f3bd4 100644 --- a/flake.nix +++ b/flake.nix @@ -52,6 +52,7 @@ ./modules/users/nico.nix ./modules/users/alex.nix + ./modules/users/deploy.nix ./modules/hardware/secureboot.nix lanzaboote.nixosModules.lanzaboote diff --git a/modules/users/deploy.nix b/modules/users/deploy.nix new file mode 100644 index 0000000..9af6eb4 --- /dev/null +++ b/modules/users/deploy.nix @@ -0,0 +1,28 @@ +{ config, lib, pkgs, ...}: + +{ + users.users.deploy = { + isNormalUser = true; + home = "/var/empty"; + group = "deploy"; + }; + + users.groups.deploy = {}; + + users.users.deploy.openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILXwl+UyfeN/9M/z21mlVS3guYEqIjtgAf5pCPkjXhR0" + ]; + + security.sudo.extraRules = [ + { + users = [ "deploy" ]; + runAs = "root"; + commands = [ + { + command = "ALL"; + options = [ "NOPASSWD" ]; + } + ]; + } + ]; +}