53 lines
1.5 KiB
Nix
53 lines
1.5 KiB
Nix
# Example NixOS configuration using the Bitpoll flake
|
|
{ config, pkgs, ... }:
|
|
|
|
{
|
|
imports = [
|
|
# Include your hardware configuration
|
|
./hardware-configuration.nix
|
|
];
|
|
|
|
# Enable flakes
|
|
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
|
|
|
# Basic system configuration
|
|
boot.loader.systemd-boot.enable = true;
|
|
boot.loader.efi.canTouchEfiVariables = true;
|
|
|
|
networking.hostName = "bitpoll-server";
|
|
networking.firewall.allowedTCPPorts = [ 8080 22 ];
|
|
|
|
# Enable SSH for remote management
|
|
services.openssh.enable = true;
|
|
|
|
# Bitpoll service configuration
|
|
services.bitpoll = {
|
|
enable = true;
|
|
port = 8080;
|
|
host = "0.0.0.0"; # Listen on all interfaces
|
|
allowedHosts = [
|
|
"bitpoll.example.com"
|
|
"localhost"
|
|
"127.0.0.1"
|
|
];
|
|
|
|
# Optional: Use a secret key file for better security
|
|
# secretKeyFile = "/etc/bitpoll/secret-key";
|
|
};
|
|
|
|
# Create a user for administration
|
|
users.users.admin = {
|
|
isNormalUser = true;
|
|
extraGroups = [ "wheel" ]; # Enable 'sudo' for the admin user
|
|
openssh.authorizedKeys.keys = [
|
|
# Add your SSH public key here
|
|
# "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC..."
|
|
];
|
|
};
|
|
|
|
# This value determines the NixOS release from which the default
|
|
# settings for stateful data, like file locations and database versions
|
|
# on your system were taken. It's perfectly fine and recommended to leave
|
|
# this value at the release version of the first install of this system.
|
|
system.stateVersion = "25.05";
|
|
}
|