networking, users etc

This commit is contained in:
♥ Minnie ♥ 2023-10-30 21:46:44 +00:00
parent e42ce4e91b
commit 6063234389

View file

@ -20,6 +20,12 @@
# You can also split up your configuration and import pieces of it here: # You can also split up your configuration and import pieces of it here:
# ./users.nix # ./users.nix
# Import common configurations
../common/system-tools.nix
# Import our docker containers
./containers
# Import your generated (nixos-generate-config) hardware configuration # Import your generated (nixos-generate-config) hardware configuration
./hardware-configuration.nix ./hardware-configuration.nix
]; ];
@ -50,6 +56,13 @@
}; };
nix = { nix = {
gc = {
# Automatically run the garbage collector an a specified time.
automatic = true;
dates = "weekly";
options = "--delete-older-than 30d";
};
# This will add each flake input as a registry # This will add each flake input as a registry
# To make nix3 commands consistent with your flake # To make nix3 commands consistent with your flake
registry = lib.mapAttrs (_: value: {flake = value;}) inputs; registry = lib.mapAttrs (_: value: {flake = value;}) inputs;
@ -66,7 +79,28 @@
}; };
}; };
networking.hostName = "viridian"; networking = {
hostName = "viridian";
domain = "kanto.dev";
networkmanager.enable = true;
firewall = {
enable = true;
allowedTCPPorts = [
53 # pihole-FTL (DNS)
80 # traefik (HTTP)
443 # traefik (HTTPS)
8096 # jellyfin
32372 # qbittorrent
];
allowedUDPPorts = [
53 # pihole-FTL (DNS)
80 # traefik (HTTP)
443 # traefik (HTTPS)
8096 # jellyfin
32372 # qbittorrent
];
};
};
boot.loader = { boot.loader = {
systemd-boot.enable = true; systemd-boot.enable = true;
@ -76,10 +110,13 @@
}; };
}; };
programs.zsh.enable = true;
users.users = { users.users = {
admin = { admin = {
isNormalUser = true; isNormalUser = true;
extraGroups = [ "wheel" "docker" ]; extraGroups = [ "networkmanager" "wheel" "docker" ];
shell = pkgs.zsh;
openssh.authorizedKeys.keyFiles = [ ../fuchsia/id_ed25519_sk.pub ]; openssh.authorizedKeys.keyFiles = [ ../fuchsia/id_ed25519_sk.pub ];
}; };
}; };
@ -89,9 +126,9 @@
services.openssh = { services.openssh = {
enable = true; enable = true;
# Forbid root login through SSH. # Forbid root login through SSH.
permitRootLogin = "no"; settings.PermitRootLogin = "no";
# Use keys only. Remove if you want to SSH using password (not recommended) # Use keys only. Remove if you want to SSH using password (not recommended)
passwordAuthentication = false; settings.PasswordAuthentication = false;
}; };
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion # https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion