158 lines
3.6 KiB
Nix
158 lines
3.6 KiB
Nix
{ config, pkgs, ... }:
|
||
|
||
{
|
||
imports =
|
||
[ # Include the results of the hardware scan.
|
||
./hardware-configuration.nix
|
||
];
|
||
|
||
# Bootloader.
|
||
boot = {
|
||
loader = {
|
||
systemd-boot.enable = true;
|
||
efi.canTouchEfiVariables = true;
|
||
};
|
||
kernelPackages = pkgs.linuxPackages_latest;
|
||
};
|
||
|
||
networking = {
|
||
hostName = "play";
|
||
networkmanager.enable = true;
|
||
firewall.allowedTCPPorts = [ 8080 5432 ];
|
||
# firewall.allowedUDPPorts = [ ... ];
|
||
interfaces.ens18.ipv4.addresses = [ {
|
||
address = "10.0.0.100";
|
||
prefixLength = 24;
|
||
} ];
|
||
defaultGateway = "10.0.0.1";
|
||
nameservers = [ "10.0.0.1" ];
|
||
};
|
||
|
||
# Set your time zone.
|
||
time.timeZone = "Europe/Zurich";
|
||
|
||
system.autoUpgrade = {
|
||
enable = true;
|
||
allowReboot = true;
|
||
rebootWindow = {
|
||
lower = "01:00";
|
||
upper = "03:00";
|
||
};
|
||
};
|
||
|
||
# Select internationalisation properties.
|
||
i18n.defaultLocale = "en_US.UTF-8";
|
||
|
||
# Configure keymap in X11
|
||
services.xserver.xkb = {
|
||
layout = "ch";
|
||
variant = "";
|
||
};
|
||
|
||
# Configure console keymap
|
||
console.keyMap = "sg";
|
||
|
||
# Define a user account. Don't forget to set a password with ‘passwd’.
|
||
users.users.tte = {
|
||
isNormalUser = true;
|
||
description = "tte";
|
||
extraGroups = [ "networkmanager" "wheel" ];
|
||
packages = with pkgs; [];
|
||
};
|
||
|
||
# Allow unfree packages
|
||
nixpkgs.config.allowUnfree = true;
|
||
|
||
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
||
|
||
# List packages installed in system profile
|
||
environment.systemPackages = with pkgs; [
|
||
vim
|
||
wget
|
||
curl
|
||
git
|
||
];
|
||
|
||
# Enable the OpenSSH daemon.
|
||
services = {
|
||
openssh = {
|
||
enable = true;
|
||
# settings.PermitRootLogin = "without-password";
|
||
};
|
||
qemuGuest.enable = true;
|
||
};
|
||
|
||
virtualisation = {
|
||
docker = {
|
||
enable = true;
|
||
rootless = {
|
||
enable = true;
|
||
setSocketVariable = true;
|
||
};
|
||
};
|
||
oci-containers.containers = {
|
||
db_recipes = {
|
||
image = "postgres:16-alpine";
|
||
environmentFiles = [
|
||
/root/tandoor/.env
|
||
];
|
||
volumes = [
|
||
"/root/tandoor/postgresql:/var/lib/postgresql/data"
|
||
];
|
||
};
|
||
web_recipes = {
|
||
image = "vabene1111/recipes";
|
||
environmentFiles = [
|
||
/root/tandoor/.env
|
||
];
|
||
volumes = [
|
||
"staticfiles:/opt/recipes/staticfiles"
|
||
"nginx_config:/opt/recipes/nginx/conf.d"
|
||
"/root/tandoor/mediafiles:/opt/recipes/mediafiles"
|
||
];
|
||
dependsOn = [ "db_recipes" ];
|
||
};
|
||
nginx_recipes = {
|
||
image = "nginx:mainline-alpine";
|
||
ports = [
|
||
"8080:80"
|
||
];
|
||
environmentFiles = [
|
||
/root/tandoor/.env
|
||
];
|
||
volumes = [
|
||
"nginx_config:/etc/nginx/conf.d:ro"
|
||
"staticfiles:/static:ro"
|
||
"/root/tandoor/mediafiles:/media:ro"
|
||
];
|
||
dependsOn = [ "web_recipes" ];
|
||
};
|
||
};
|
||
};
|
||
|
||
systemd = {
|
||
services = {
|
||
"gitea-actions-runner" = {
|
||
enable = true;
|
||
environment = {
|
||
PATH = "/home/someUser/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin";
|
||
};
|
||
serviceConfig = {
|
||
ExecStart = "/root/runner/act_runner daemon";
|
||
ExecReload = "/bin/kill -s HUP $MAINPID";
|
||
WorkingDirectory = "/root/runner";
|
||
TimeoutSec = 0;
|
||
RestartSec = 10;
|
||
Restart = "always";
|
||
User = "root";
|
||
};
|
||
wantedBy = [ "multi-user.target" ];
|
||
};
|
||
};
|
||
};
|
||
|
||
# leave installation default
|
||
system.stateVersion = "24.05"; # Did you read the comment?
|
||
|
||
}
|