host: 抽出我的用户配置

This commit is contained in:
2026-05-17 10:04:41 +08:00
parent 75bea9d610
commit 5072597827
3 changed files with 18 additions and 22 deletions
+3 -11
View File
@@ -11,6 +11,7 @@
./hardware-configuration.nix ./hardware-configuration.nix
inputs.sops-nix.nixosModules.sops inputs.sops-nix.nixosModules.sops
../modules/nix-cache.nix ../modules/nix-cache.nix
../modules/users/origami.nix
]; ];
boot.loader = { boot.loader = {
@@ -145,19 +146,10 @@
services.tailscale.enable = true; services.tailscale.enable = true;
# Users # Users
programs.fish.enable = true;
users.groups.origami.gid = 1000; users.groups.origami.gid = 1000;
users.users.origami = { users.users.origami.extraGroups = [ "wheel" "networkmanager" ];
isNormalUser = true;
shell = pkgs.fish;
description = "Origami404";
group = "origami";
extraGroups = [ "networkmanager" "wheel" ];
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAZxRoweHoLfoaydPqhsLnc4EGgwTp7Uz1DZ2DG447B+ origami@fedora"
];
};
security.sudo.wheelNeedsPassword = false; security.sudo.wheelNeedsPassword = false;
sops.defaultSopsFile = ../../secrets/ssh-private.yaml; sops.defaultSopsFile = ../../secrets/ssh-private.yaml;
sops.defaultSopsFormat = "yaml"; sops.defaultSopsFormat = "yaml";
sops.age.keyFile = "/home/origami/.config/sops/age/keys.txt"; sops.age.keyFile = "/home/origami/.config/sops/age/keys.txt";
+13
View File
@@ -0,0 +1,13 @@
{
...
}:
{
users.users.origami = {
isNormalUser = true;
description = "Origami404";
group = "origami";
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJyrUiSdpTC+vP+pNDChehLG+ChYL2By2LtjmVJiHmaf origami@eris"
];
};
}
+2 -11
View File
@@ -6,6 +6,7 @@
./hardware-configuration.nix ./hardware-configuration.nix
inputs.sops-nix.nixosModules.sops inputs.sops-nix.nixosModules.sops
../modules/nix-cache.nix ../modules/nix-cache.nix
../modules/users/origami.nix
]; ];
# BIOS + GRUB, 安装到 MBR # BIOS + GRUB, 安装到 MBR
@@ -78,18 +79,8 @@
services.qemuGuest.enable = true; services.qemuGuest.enable = true;
# 用户 # 用户
programs.fish.enable = true;
users.groups.origami.gid = 1000; users.groups.origami.gid = 1000;
users.users.origami = { users.users.origami.extraGroups = [ "wheel" ];
isNormalUser = true;
shell = pkgs.fish;
description = "Origami404";
group = "origami";
extraGroups = [ "wheel" ];
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAZxRoweHoLfoaydPqhsLnc4EGgwTp7Uz1DZ2DG447B+ origami@fedora"
];
};
security.sudo.wheelNeedsPassword = false; security.sudo.wheelNeedsPassword = false;
sops.defaultSopsFile = ../../secrets/ssh-private.yaml; sops.defaultSopsFile = ../../secrets/ssh-private.yaml;