infrastructure/config/hosts/ostara/nixos.nix
2021-08-27 03:54:27 +01:00

82 lines
1.4 KiB
Nix

{ meta, config, pkgs, lib, ... }:
with lib;
{
# Imports
imports = with meta; [
profiles.hardware.eeepc-1015pem
services.kattv
];
# Terraform
deploy.tf = {
resources.ostara = {
provider = "null";
type = "resource";
connection = {
port = head config.services.openssh.ports;
host = config.network.addresses.private.ipv4.address;
};
};
};
# File Systems and Swap
fileSystems = {
"/" = {
device = "/dev/disk/by-uuid/469a684b-eb8f-48a8-8f98-be58528312c4";
fsType = "ext4";
};
};
swapDevices = [{ device = "/dev/disk/by-uuid/2223e305-79c9-45b3-90d7-560dcc45775a"; }];
# Bootloader
boot.loader.grub = {
enable = true;
version = 2;
device = "/dev/sda";
};
# Hardware
services.logind.lidSwitchExternalPower = "ignore";
# Networking
networking = {
hostName = "ostara";
hostId = "9f89b327";
useDHCP = false;
interfaces.enp1s0.ipv4.addresses = singleton {
inherit (config.network.addresses.private.ipv4) address;
prefixLength = 24;
};
defaultGateway = config.network.privateGateway;
};
network = {
addresses = {
private = {
ipv4.address = "192.168.1.32";
};
};
};
# Firewall
network.firewall = {
public = {
interfaces = singleton "enp1s0";
tcp.ports = [ 9981 9982 ];
};
};
# State
system.stateVersion = "20.09";
}