Add initial Bitpoll Nix flake and example configuration
This commit is contained in:
parent
1b58a0ded8
commit
8de81ea2ab
4 changed files with 631 additions and 0 deletions
53
example-configuration.nix
Normal file
53
example-configuration.nix
Normal file
|
@ -0,0 +1,53 @@
|
|||
# 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";
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue