From 1d517e4ce6fa91f67d713128c0a52c59e1235db7 Mon Sep 17 00:00:00 2001 From: TheArcaneBrony Date: Sun, 11 Dec 2022 21:30:28 +0100 Subject: Deduplicate some configuration Signed-off-by: TheArcaneBrony --- modules/base-server.nix | 45 +++++++++++++++++++++++++++++++++++++++++ modules/base.nix | 54 ++++++++++++++----------------------------------- 2 files changed, 60 insertions(+), 39 deletions(-) create mode 100644 modules/base-server.nix (limited to 'modules') diff --git a/modules/base-server.nix b/modules/base-server.nix new file mode 100644 index 0000000..0e060e1 --- /dev/null +++ b/modules/base-server.nix @@ -0,0 +1,45 @@ +{ config, pkgs, ... }: + +{ + imports = + [ + ./base.nix + ]; + + boot = { + loader = { + grub = { + enable = true; + version = 2; + device = "/dev/sda"; # nodev for EFI only + + # EFI + efiSupport = false; + efiInstallAsRemovable = false; + }; + }; + }; + + networking = { + hostName = lib.mkDefault "Rory-nix-base-server"; + firewall = { + enable = false; + # allowedTCPPorts = [ ... ]; + # allowedUDPPorts = [ ... ]; + }; + }; + + services = { + openssh = { + enable = true; + #allow more logins in cases where i have many ssh keys on a system + extraConfig = '' + MaxAuthTries 32 + ''; + }; + }; + + + system.stateVersion = "22.11"; # DO NOT EDIT! +} + diff --git a/modules/base.nix b/modules/base.nix index 8f2102b..69cb20e 100644 --- a/modules/base.nix +++ b/modules/base.nix @@ -3,46 +3,30 @@ { imports = [ - ./hardware-configuration.nix - ./packages/vim.nix - ./users.nix + ./packages/vim.nix + ./users.nix ]; - boot = { - loader = { - grub = { - enable = true; - version = 2; - device = "/dev/sda"; # nodev for EFI only - - # EFI - efiSupport = false; - efiInstallAsRemovable = false; - }; - }; - }; - networking = { - hostName = lib.mkDefault "Rory-nix-base"; - - firewall = { - enable = false; - # allowedTCPPorts = [ ... ]; - # allowedUDPPorts = [ ... ]; - }; + hostName = lib.mkDefault "Rory-nix-base"; + firewall = { + enable = false; + # allowedTCPPorts = [ ... ]; + # allowedUDPPorts = [ ... ]; + }; }; #time.timeZone = "Europe/Brussels"; i18n.defaultLocale = "en_US.UTF-8"; services = { - openssh = { - enable = true; - #allow more logins in cases where i have many ssh keys on a system - extraConfig = '' - MaxAuthTries 32 - ''; - }; + openssh = { + enable = true; + #allow more logins in cases where i have many ssh keys on a system + extraConfig = '' + MaxAuthTries 32 + ''; + }; }; security.sudo.wheelNeedsPassword = false; @@ -51,14 +35,6 @@ sound.enable = true; hardware.pulseaudio.enable = true; - users.users.Rory = { - isNormalUser = true; - extraGroups = [ "wheel" ]; - packages = with pkgs; [ - ]; - initialPassword = "password"; - }; - environment.systemPackages = with pkgs; [ wget neofetch -- cgit 1.4.1