9148838e12
Add the docker group to the runner services and allow passwordless nixos-rebuild for the gitea-runner user.
107 lines
2.7 KiB
Nix
107 lines
2.7 KiB
Nix
{ ... }:
|
|
|
|
{
|
|
imports = [
|
|
../../modules/base.nix
|
|
../../modules/docker.nix
|
|
../../modules/libvirtd.nix
|
|
./firewall.nix
|
|
./hardware.nix
|
|
];
|
|
|
|
networking = {
|
|
hostName = "cloud-pc";
|
|
useDHCP = false;
|
|
defaultGateway = "192.168.1.1";
|
|
nameservers = [
|
|
"192.168.1.1"
|
|
"1.1.1.1"
|
|
];
|
|
|
|
interfaces.enp2s0.ipv4.addresses = [
|
|
{
|
|
address = "192.168.1.5";
|
|
prefixLength = 24;
|
|
}
|
|
];
|
|
};
|
|
|
|
fileSystems."/opt/data" = {
|
|
device = "/dev/disk/by-uuid/ae278333-4116-4225-9b95-595496fadd26";
|
|
fsType = "ext4";
|
|
options = [ "nofail" ];
|
|
};
|
|
|
|
fileSystems."/opt/samba" = {
|
|
device = "/dev/disk/by-uuid/89024d30-1ab6-4b2e-b23b-62837455b24a";
|
|
fsType = "ext4";
|
|
options = [ "nofail" ];
|
|
};
|
|
|
|
fileSystems."/mnt/backup" = {
|
|
device = "/dev/disk/by-uuid/940a9a4e-10cf-4380-9d22-a71549066561";
|
|
fsType = "ext4";
|
|
options = [ "nofail" ];
|
|
};
|
|
|
|
systemd.network.wait-online.anyInterface = true;
|
|
|
|
boot.loader.systemd-boot.enable = true;
|
|
boot.loader.efi.canTouchEfiVariables = true;
|
|
|
|
services.zerotierone = {
|
|
enable = true;
|
|
joinNetworks = [
|
|
"743993800fa5a34c"
|
|
];
|
|
};
|
|
|
|
systemd.tmpfiles.rules = [
|
|
"d /opt/data/postgres 0755 ada users - -"
|
|
"d /opt/data/nextcloud 0755 ada users - -"
|
|
"d /opt/data/gitea 0755 ada users - -"
|
|
"d /opt/data/gitea-runner 0755 ada users - -"
|
|
"d /opt/data/syncthing 0755 ada users - -"
|
|
"d /opt/data/zerotier 0755 ada users - -"
|
|
"d /opt/configs/nextcloud 0755 ada users - -"
|
|
"d /opt/configs/nextcloud/app 0755 ada users - -"
|
|
"d /opt/configs/syncthing 0755 ada users - -"
|
|
"d /opt/samba 0755 ada users - -"
|
|
"d /opt/samba/media 0755 ada users - -"
|
|
"d /opt/samba/documents 0755 ada users - -"
|
|
"d /opt/samba/backups_win 0755 ada users - -"
|
|
"d /mnt/backup 0755 ada users - -"
|
|
"d /mnt/backup/restic 0755 ada users - -"
|
|
"d /mnt/backup/restic/services 0755 ada users - -"
|
|
"d /mnt/backup/restic/samba 0755 ada users - -"
|
|
"d /mnt/backup/devices 0755 ada users - -"
|
|
"d /mnt/backup/devices/proxmox 0755 ada users - -"
|
|
"d /mnt/backup/devices/ada-x1 0755 ada users - -"
|
|
"d /mnt/yandex 0755 ada users - -"
|
|
];
|
|
|
|
services.gitea-actions-runner.instances."cloud-pc" = {
|
|
enable = true;
|
|
name = "cloud-pc";
|
|
url = "https://git.ada-dev.ru";
|
|
tokenFile = "/etc/gitea-runner/cloud-pc.token";
|
|
labels = [ "cloud-pc" "cloud-pc-nixos" ];
|
|
};
|
|
|
|
systemd.services."gitea-runner-cloud-pc".serviceConfig.SupplementaryGroups = [ "docker" ];
|
|
|
|
security.sudo.extraRules = [
|
|
{
|
|
users = [ "gitea-runner" ];
|
|
commands = [
|
|
{
|
|
command = "/run/current-system/sw/bin/nixos-rebuild";
|
|
options = [ "NOPASSWD" ];
|
|
}
|
|
];
|
|
}
|
|
];
|
|
|
|
system.stateVersion = "25.11";
|
|
}
|