This commit is contained in:
2026-05-31 10:56:54 +01:00
parent 73f436b560
commit fb5aa85711
9 changed files with 103 additions and 109 deletions

11
modules/common.nix Normal file
View File

@@ -0,0 +1,11 @@
{ config, lib, pkgs, ... }:
{
imports = [
./common/users.nix
./common/packages.nix
./common/services.nix
./common/networking.nix
./common/system.nix
];
}

View File

@@ -0,0 +1,15 @@
{ config, lib, pkgs, ... }:
{
time.timeZone = "Europe/London";
i18n.defaultLocale = "en_US.UTF-8";
console.keyMap = "uk";
networking = {
firewall.enable = true;
firewall.allowedTCPPorts = [ 22 ]; # SSH
hostName = config.networking.hostName or "nixos";
useDHCP = false;
usePredictableInterfaceNames = false;
};
}

View File

@@ -0,0 +1,18 @@
{ config, lib, pkgs, ... }:
{
environment.systemPackages = with pkgs; [
nano
vim
git
curl
wget
sops
age
inetutils
mtr
sysstat
dig
openssl
];
}

View File

@@ -0,0 +1,6 @@
{ config, lib, pkgs, ... }:
{
services.openssh.enable = true;
services.openssh.permitRootLogin = "no";
}

10
modules/common/system.nix Normal file
View File

@@ -0,0 +1,10 @@
{ config, lib, pkgs, ... }:
{
system.stateVersion = "25.11";
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
services.xserver.xkb.layout = "uk";
}

35
modules/common/users.nix Normal file
View File

@@ -0,0 +1,35 @@
{ config, lib, pkgs, ... }:
{
users.mutableUsers = false;
users.users.phoenix = {
isNormalUser = true;
description = "Phoenix";
extraGroups = [ "wheel" "networkmanager" ];
shell = pkgs.bash;
home = "/home/phoenix";
createHome = true;
useDefaultShell = true;
};
users.users.deploy = {
isNormalUser = true;
extraGroups = [ "wheel" "networkmanager" ];
home = "/home/deploy";
};
security.sudo.extraRules = [
{
users = [ "phoenix" ];
commands = [
{
command = "ALL";
options = [ "NOPASSWD" ];
}
];
}
];
nix.settings.trusted-users = [ "root" "@wheel" ];
}