1
0
Fork 0
mirror of https://github.com/mdlayher/homelab.git synced 2024-12-14 11:47:32 +00:00

nixos/lib: factor out matt user configuration

This commit is contained in:
Matt Layher 2020-04-26 11:42:29 -04:00
parent f7c2cb2afd
commit 75d0f8af07
3 changed files with 24 additions and 26 deletions

14
nixos/lib/users.nix Normal file
View file

@ -0,0 +1,14 @@
{ config, ... }:
{
# Set up matt's account, enable sudo and SSH login.
users.users.matt = {
isNormalUser = true;
uid = 1000;
extraGroups = [ "wheel" ];
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIN5i5d0mRKAf02m+ju+I1KrAYw3Ny2IHXy88mgyragBN Matt Layher (mdlayher@gmail.com)"
];
};
}

View file

@ -14,6 +14,9 @@ in {
<nixos-hardware/pcengines/apu>
./hardware-configuration.nix
# Base system configuration.
./lib/users.nix
# Base router networking.
./networking.nix
./nftables.nix
@ -168,16 +171,6 @@ in {
};
};
users.users.matt = {
isNormalUser = true;
uid = 1000;
extraGroups = [ "wheel" ];
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIN5i5d0mRKAf02m+ju+I1KrAYw3Ny2IHXy88mgyragBN Matt Layher (mdlayher@gmail.com)"
];
};
system = {
# Automatic upgrades.
autoUpgrade = { enable = true; };

View file

@ -8,6 +8,9 @@
imports = [
# Hardware configuration.
./hardware-configuration.nix
# Base system configuration.
./lib/users.nix
];
networking = {
@ -127,22 +130,10 @@
webExternalUrl = "https://prometheus.servnerr.com";
};
users.users = {
matt = {
isNormalUser = true;
uid = 1000;
extraGroups = [ "wheel" ]; # Enable sudo for the user.
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIN5i5d0mRKAf02m+ju+I1KrAYw3Ny2IHXy88mgyragBN Matt Layher (mdlayher@gmail.com)"
];
};
# root SSH key for remote builds.
root.openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOnN7NbaDhuuBQYPtlLtoUyyS6Q3cjJ/VPrw2IQ31R6F NixOS distributed build"
];
};
# root SSH key for remote builds.
users.users.root.openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOnN7NbaDhuuBQYPtlLtoUyyS6Q3cjJ/VPrw2IQ31R6F NixOS distributed build"
];
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions