Add camelot initial config
This commit is contained in:
parent
93ee7e50e5
commit
fb74188d21
39
configurations/camelot/default.nix
Normal file
39
configurations/camelot/default.nix
Normal file
|
@ -0,0 +1,39 @@
|
|||
{ pkgs, config, lib, ... }:
|
||||
{
|
||||
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ];
|
||||
boot.initrd.kernelModules = [ "dm-snapshot" ];
|
||||
boot.kernelModules = [ "kvm-intel" ];
|
||||
boot.extraModulePackages = [ ];
|
||||
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
|
||||
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
|
||||
filesystems = [
|
||||
{
|
||||
mountpoint = "/";
|
||||
deviceUUID = "966d0ec0-7a7b-4987-91cf-6493e9f5126c";
|
||||
fsType = "ext4";
|
||||
}
|
||||
{
|
||||
mountpoint = "/boot";
|
||||
deviceUUID = "901B-0D68";
|
||||
fsType = "vfat";
|
||||
}
|
||||
];
|
||||
|
||||
swapDeviceUUID = "a7c628ab-c5cb-4094-89d0-19b153fbead4";
|
||||
|
||||
server.networking.enableSSH = true;
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
neovim
|
||||
];
|
||||
|
||||
machineUsers = {
|
||||
dala = {
|
||||
description = "Dala";
|
||||
groups = [ "wheel" ];
|
||||
uid = 1000;
|
||||
shell = pkgs.bash;
|
||||
};
|
||||
};
|
||||
}
|
|
@ -6,4 +6,12 @@
|
|||
enableHomeManager = true;
|
||||
stateVersion = "23.11";
|
||||
};
|
||||
|
||||
camelot = {
|
||||
machineType = "server";
|
||||
nixpkgsUnstable = false;
|
||||
system = "x86_64-linux";
|
||||
enableHomeManager = false;
|
||||
stateVersion = "23.11";
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
{ lib, config, ... }:
|
||||
with lib;
|
||||
{ }
|
||||
{
|
||||
imports = [
|
||||
./network.nix
|
||||
];
|
||||
}
|
||||
|
|
28
modules/server/network.nix
Normal file
28
modules/server/network.nix
Normal file
|
@ -0,0 +1,28 @@
|
|||
{ lib, config, ... }:
|
||||
with lib;
|
||||
{
|
||||
options.server.networking.enableSSH = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
example = false;
|
||||
};
|
||||
|
||||
options.server.networking.enableNginx = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
example = false;
|
||||
};
|
||||
|
||||
config = {
|
||||
services.openssh = mkIf config.server.networking.enableSSH {
|
||||
enable = true;
|
||||
settings.PermitRootLogin = "no";
|
||||
};
|
||||
|
||||
networking.firewall.allowedTCPPorts = [
|
||||
(mkIf config.services.nginx.enable 80)
|
||||
(mkIf config.services.nginx.enable 443)
|
||||
(mkIf config.server.networking.enableSSH 22)
|
||||
];
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue