From 5072597827745526ad0a459e3d5b3a7c3f0f532e Mon Sep 17 00:00:00 2001 From: Origami404 Date: Sun, 17 May 2026 10:04:41 +0800 Subject: [PATCH] =?UTF-8?q?host:=20=E6=8A=BD=E5=87=BA=E6=88=91=E7=9A=84?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hosts/eris/configuration.nix | 14 +++----------- hosts/modules/users/origami.nix | 13 +++++++++++++ hosts/oparic-local-dev/configuration.nix | 13 ++----------- 3 files changed, 18 insertions(+), 22 deletions(-) create mode 100644 hosts/modules/users/origami.nix diff --git a/hosts/eris/configuration.nix b/hosts/eris/configuration.nix index ccb8e6a..4a54c12 100644 --- a/hosts/eris/configuration.nix +++ b/hosts/eris/configuration.nix @@ -11,6 +11,7 @@ ./hardware-configuration.nix inputs.sops-nix.nixosModules.sops ../modules/nix-cache.nix + ../modules/users/origami.nix ]; boot.loader = { @@ -145,19 +146,10 @@ services.tailscale.enable = true; # Users - programs.fish.enable = true; users.groups.origami.gid = 1000; - users.users.origami = { - isNormalUser = true; - shell = pkgs.fish; - description = "Origami404"; - group = "origami"; - extraGroups = [ "networkmanager" "wheel" ]; - openssh.authorizedKeys.keys = [ - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAZxRoweHoLfoaydPqhsLnc4EGgwTp7Uz1DZ2DG447B+ origami@fedora" - ]; - }; + users.users.origami.extraGroups = [ "wheel" "networkmanager" ]; security.sudo.wheelNeedsPassword = false; + sops.defaultSopsFile = ../../secrets/ssh-private.yaml; sops.defaultSopsFormat = "yaml"; sops.age.keyFile = "/home/origami/.config/sops/age/keys.txt"; diff --git a/hosts/modules/users/origami.nix b/hosts/modules/users/origami.nix new file mode 100644 index 0000000..9f616d9 --- /dev/null +++ b/hosts/modules/users/origami.nix @@ -0,0 +1,13 @@ +{ + ... +}: +{ + users.users.origami = { + isNormalUser = true; + description = "Origami404"; + group = "origami"; + openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJyrUiSdpTC+vP+pNDChehLG+ChYL2By2LtjmVJiHmaf origami@eris" + ]; + }; +} diff --git a/hosts/oparic-local-dev/configuration.nix b/hosts/oparic-local-dev/configuration.nix index 3073f3e..633fbfe 100644 --- a/hosts/oparic-local-dev/configuration.nix +++ b/hosts/oparic-local-dev/configuration.nix @@ -6,6 +6,7 @@ ./hardware-configuration.nix inputs.sops-nix.nixosModules.sops ../modules/nix-cache.nix + ../modules/users/origami.nix ]; # BIOS + GRUB, 安装到 MBR @@ -78,18 +79,8 @@ services.qemuGuest.enable = true; # 用户 - programs.fish.enable = true; users.groups.origami.gid = 1000; - users.users.origami = { - isNormalUser = true; - shell = pkgs.fish; - description = "Origami404"; - group = "origami"; - extraGroups = [ "wheel" ]; - openssh.authorizedKeys.keys = [ - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAZxRoweHoLfoaydPqhsLnc4EGgwTp7Uz1DZ2DG447B+ origami@fedora" - ]; - }; + users.users.origami.extraGroups = [ "wheel" ]; security.sudo.wheelNeedsPassword = false; sops.defaultSopsFile = ../../secrets/ssh-private.yaml;