Add NixOS host modules and runners
This commit is contained in:
@@ -0,0 +1,65 @@
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
../../modules/base.nix
|
||||
../../modules/docker.nix
|
||||
../../modules/libvirtd.nix
|
||||
../../modules/firewall-mini-pc.nix
|
||||
./hardware.nix
|
||||
];
|
||||
|
||||
networking = {
|
||||
hostName = "mini-pc";
|
||||
useDHCP = false;
|
||||
};
|
||||
|
||||
systemd.network = {
|
||||
enable = true;
|
||||
networks."10-lan" = {
|
||||
matchConfig.Name = "en*";
|
||||
networkConfig = {
|
||||
Address = "192.168.1.10/24";
|
||||
Gateway = "192.168.1.1";
|
||||
DNS = [
|
||||
"192.168.1.1"
|
||||
"1.1.1.1"
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
services.resolved.enable = false;
|
||||
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
|
||||
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 - -"
|
||||
];
|
||||
|
||||
services.gitea-actions-runner.instances."mini-pc-nixos" = {
|
||||
name = "mini-pc-nixos";
|
||||
url = "https://git.example.com"; # поменяй на свой URL
|
||||
tokenFile = "/etc/gitea-runner/mini-pc-nixos.token";
|
||||
labels = [ "mini-pc-nixos" ];
|
||||
};
|
||||
|
||||
system.stateVersion = "25.11";
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||
# and may be overwritten by future invocations. Please make changes
|
||||
# to /etc/nixos/configuration.nix instead.
|
||||
{ config, lib, pkgs, modulesPath, ... }:
|
||||
|
||||
{
|
||||
imports =
|
||||
[ (modulesPath + "/installer/scan/not-detected.nix")
|
||||
];
|
||||
|
||||
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" "sdhci_pci" ];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ "kvm-intel" ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
fileSystems."/" =
|
||||
{ device = "/dev/disk/by-uuid/a2fc1626-3301-44dd-9d00-fa7e8d216d25";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
fileSystems."/boot" =
|
||||
{ device = "/dev/disk/by-uuid/73C2-3F45";
|
||||
fsType = "vfat";
|
||||
options = [ "fmask=0022" "dmask=0022" ];
|
||||
};
|
||||
|
||||
swapDevices = [ ];
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
}
|
||||
Reference in New Issue
Block a user