flake/users/guanranwang/nixos/profiles/core/default.nix

59 lines
1.6 KiB
Nix
Raw Normal View History

2023-11-04 10:02:11 +00:00
{
pkgs,
config,
2023-11-17 05:38:25 +00:00
lib,
...
}: {
2023-11-04 10:02:11 +00:00
users.users."guanranwang" = {
isNormalUser = true;
description = "Guanran Wang";
extraGroups = [
"wheel" # administrator
"networkmanager" # access to networkmanager
"tss" # access to tpm devices
"vboxusers" # access to virtualbox
2023-11-04 10:02:11 +00:00
"nix-access-tokens" # access to github tokens
"libvirtd" # access to virt-manager
2023-11-04 10:02:11 +00:00
];
hashedPasswordFile = config.sops.secrets."hashed-passwd".path;
shell = pkgs.fish;
packages = [];
};
2023-11-17 05:38:25 +00:00
### for default shell
programs.fish.enable = true;
2023-11-17 05:38:25 +00:00
### Options
myFlake.nixos.networking.dns = lib.mkDefault "alidns";
time.timeZone = lib.mkDefault "Asia/Shanghai";
### Flakes
2023-11-04 10:02:11 +00:00
imports = [
2023-11-17 05:38:25 +00:00
../../../../../nixos/flake-modules/sops-nix.nix
../../../../../nixos/flake-modules/hosts.nix
2023-11-04 10:02:11 +00:00
];
2023-11-14 03:22:17 +00:00
2023-11-04 10:02:11 +00:00
### sops-nix
nix.extraOptions = "!include ${config.sops.secrets.nix-access-tokens.path}";
users.groups."nix-access-tokens" = {};
sops = {
2023-11-17 05:38:25 +00:00
defaultSopsFile = ../../../secrets/secrets.yaml;
age.sshKeyPaths = ["/nix/persist/system/etc/ssh/ssh_host_ed25519_key"];
2023-11-04 10:02:11 +00:00
gnupg.sshKeyPaths = [];
secrets = {
"hashed-passwd".neededForUsers = true; # Hashed user password
2023-11-04 10:02:11 +00:00
"wireless/home".path = "/var/lib/iwd/wangxiaobo.psk"; # Home wifi password
"nix-access-tokens" = {
group = config.users.groups."nix-access-tokens".name;
mode = "0440";
};
};
};
2023-11-14 03:22:17 +00:00
### home-manager
2023-11-17 05:38:25 +00:00
home-manager.users.guanranwang.imports = map (n: ../../../home-manager/${n}) [
"default.nix"
"profiles/command-line/nixos"
2023-11-14 03:22:17 +00:00
];
}