added mini-pc nix conf
This commit is contained in:
@@ -1,26 +0,0 @@
|
|||||||
name: Deploy cloud-pc
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
stack:
|
|
||||||
description: "Stack to deploy (leave empty to reconcile all)"
|
|
||||||
required: false
|
|
||||||
push:
|
|
||||||
paths:
|
|
||||||
- ".gitea/workflows/deploy-cloud-pc.yml"
|
|
||||||
- "cloud-pc/**"
|
|
||||||
schedule:
|
|
||||||
- cron: "0 4 * * *"
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
deploy:
|
|
||||||
runs-on: cloud-pc
|
|
||||||
steps:
|
|
||||||
- name: Sync repo
|
|
||||||
run: |
|
|
||||||
git config --global --replace-all safe.directory /opt/services
|
|
||||||
git -C /opt/services pull --ff-only
|
|
||||||
|
|
||||||
- name: Deploy stacks
|
|
||||||
run: /opt/services/scripts/deploy.sh cloud-pc "${{ inputs.stack }}"
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
name: Deploy mini-pc
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
stack:
|
|
||||||
description: "Stack to deploy (leave empty to reconcile all)"
|
|
||||||
required: false
|
|
||||||
push:
|
|
||||||
paths:
|
|
||||||
- ".gitea/workflows/deploy-mini-pc.yml"
|
|
||||||
- "mini-pc/**"
|
|
||||||
schedule:
|
|
||||||
- cron: "0 4 * * *"
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
deploy:
|
|
||||||
runs-on: mini-pc
|
|
||||||
steps:
|
|
||||||
- name: Sync repo
|
|
||||||
run: |
|
|
||||||
git config --global --replace-all safe.directory /opt/services
|
|
||||||
git -C /opt/services pull --ff-only
|
|
||||||
|
|
||||||
- name: Deploy stacks
|
|
||||||
run: /opt/services/scripts/deploy.sh mini-pc "${{ inputs.stack }}"
|
|
||||||
@@ -12,5 +12,12 @@
|
|||||||
./hosts/cloud-pc.nix
|
./hosts/cloud-pc.nix
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
nixosConfigurations.mini-pc = nixpkgs.lib.nixosSystem {
|
||||||
|
system = "x86_64-linux";
|
||||||
|
modules = [
|
||||||
|
./hosts/mini-pc.nix
|
||||||
|
];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,22 @@
|
|||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
networking.hostName = "cloud-pc";
|
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" = {
|
fileSystems."/opt/data" = {
|
||||||
device = "/dev/disk/by-uuid/ae278333-4116-4225-9b95-595496fadd26";
|
device = "/dev/disk/by-uuid/ae278333-4116-4225-9b95-595496fadd26";
|
||||||
@@ -45,5 +60,29 @@
|
|||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
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 - -"
|
||||||
|
];
|
||||||
|
|
||||||
system.stateVersion = "25.11";
|
system.stateVersion = "25.11";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,47 @@
|
|||||||
|
{ pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
../modules/base.nix
|
||||||
|
../modules/docker.nix
|
||||||
|
../modules/firewall-mini-pc.nix
|
||||||
|
./mini-pc-hardware-configuration.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
networking = {
|
||||||
|
hostName = "mini-pc";
|
||||||
|
useDHCP = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
boot.loader.systemd-boot.enable = true;
|
||||||
|
boot.loader.efi.canTouchEfiVariables = true;
|
||||||
|
|
||||||
|
virtualisation.libvirtd = {
|
||||||
|
enable = true;
|
||||||
|
qemu = {
|
||||||
|
package = pkgs.qemu_kvm;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
services.zerotierone = {
|
||||||
|
enable = true;
|
||||||
|
joinNetworks = [
|
||||||
|
"743993800fa5a34c"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
systemd.tmpfiles.rules = [
|
||||||
|
"d /opt/data/adguard 0755 ada users - -"
|
||||||
|
"d /opt/data/adguard/work 0755 ada users - -"
|
||||||
|
"d /opt/data/caddy 0755 ada users - -"
|
||||||
|
"d /opt/data/gitea-runner 0755 ada users - -"
|
||||||
|
"d /opt/data/uptime-kuma 0755 ada users - -"
|
||||||
|
"d /opt/data/vaultwarden 0755 ada users - -"
|
||||||
|
"d /opt/data/zerotier 0755 ada users - -"
|
||||||
|
"d /opt/configs/adguard 0755 ada users - -"
|
||||||
|
"d /opt/configs/caddy 0755 ada users - -"
|
||||||
|
"d /opt/configs/caddy/lego 0755 ada users - -"
|
||||||
|
];
|
||||||
|
|
||||||
|
system.stateVersion = "25.11";
|
||||||
|
}
|
||||||
@@ -47,26 +47,5 @@
|
|||||||
"d /opt/services 0755 ada users - -"
|
"d /opt/services 0755 ada users - -"
|
||||||
"d /opt/data 0755 ada users - -"
|
"d /opt/data 0755 ada users - -"
|
||||||
"d /opt/configs 0755 ada users - -"
|
"d /opt/configs 0755 ada users - -"
|
||||||
"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 - -"
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
{
|
||||||
|
networking.firewall = {
|
||||||
|
enable = true;
|
||||||
|
allowedTCPPorts = [
|
||||||
|
22
|
||||||
|
53
|
||||||
|
80
|
||||||
|
443
|
||||||
|
784
|
||||||
|
853
|
||||||
|
3001
|
||||||
|
3015
|
||||||
|
4438
|
||||||
|
5443
|
||||||
|
8088
|
||||||
|
10380
|
||||||
|
];
|
||||||
|
allowedUDPPorts = [
|
||||||
|
53
|
||||||
|
443
|
||||||
|
784
|
||||||
|
9993
|
||||||
|
5443
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user