preparation for qemu server testing
This commit is contained in:
parent
1fdf900886
commit
cf9c5917af
6 changed files with 48 additions and 32 deletions
11
common.nix
11
common.nix
|
|
@ -50,10 +50,15 @@
|
|||
};
|
||||
networkmanager = {
|
||||
enable = true;
|
||||
dns = "dnsmasq";
|
||||
ensureProfiles = {
|
||||
environmentFiles = [ "/secrets/wifi.env" ];
|
||||
profiles.wifi = {
|
||||
profiles.home-wifi = {
|
||||
wifi-security.key-mgmt = "sae";
|
||||
connection = {
|
||||
type = "wifi";
|
||||
id = "home-wifi";
|
||||
};
|
||||
ipv6 = {
|
||||
method = "manual";
|
||||
gateway = "fc01::1";
|
||||
|
|
@ -62,10 +67,6 @@
|
|||
method = "manual";
|
||||
gateway = "10.1.0.1";
|
||||
};
|
||||
connection = {
|
||||
id = "wifi";
|
||||
type = "802-11-wireless";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,14 +1,22 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
{
|
||||
programs.niri.enable = true;
|
||||
hardware.bluetooth.enable = true;
|
||||
environment.systemPackages = [ pkgs.qemu ];
|
||||
imports = [ ../common.nix ./hardware.nix ];
|
||||
boot.kernelParams = [ "hibernate.compressor=lz4" ];
|
||||
programs = {
|
||||
niri.enable = true;
|
||||
virt-manager.enable = true;
|
||||
};
|
||||
virtualisation.libvirtd = {
|
||||
enable = true;
|
||||
qemu.swtpm.enable = true;
|
||||
};
|
||||
users.users.bogale = {
|
||||
uid = 1551;
|
||||
isNormalUser = true;
|
||||
extraGroups = [ "wheel" ];
|
||||
hashedPasswordFile = "/secrets/user/bogale-pw";
|
||||
extraGroups = [ "wheel" "libvirtd" "networkmanager" ];
|
||||
};
|
||||
networking = {
|
||||
hostName = "nixos-desktop";
|
||||
|
|
@ -17,11 +25,28 @@
|
|||
configFile = "/secrets/awg/2.conf";
|
||||
address = [ "10.0.0.3/32" "fc00::3/128" ];
|
||||
};
|
||||
networkmanager.ensureProfiles.profiles.wifi = {
|
||||
wifi.ssid = "bogale_5";
|
||||
ipv6.addresses = "fc01::3/64";
|
||||
ipv4.addresses = "10.1.0.3/16";
|
||||
wifi-security.psk = "$BOGALE_5_PSK";
|
||||
networkmanager.ensureProfiles.profiles = {
|
||||
dhcp-eth.connection = {
|
||||
id = "dhcp-eth";
|
||||
type = "ethernet";
|
||||
};
|
||||
home-wifi = {
|
||||
wifi.ssid = "bogale_5";
|
||||
ipv6.addresses = "fc01::3/64";
|
||||
ipv4.addresses = "10.1.0.3/16";
|
||||
wifi-security.psk = "$BOGALE_5_PSK";
|
||||
};
|
||||
phone-wifi = {
|
||||
wifi.ssid = "Hello world";
|
||||
connection = {
|
||||
type = "wifi";
|
||||
id = "phone-wifi";
|
||||
};
|
||||
wifi-security = {
|
||||
key-mgmt = "sae";
|
||||
psk = "$HELLO_WORLD_PSK";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
services = {
|
||||
|
|
@ -40,7 +65,7 @@
|
|||
enable = true;
|
||||
settings.default_session = {
|
||||
user = "greeter";
|
||||
command = "${pkgs.noctalia-greeter}/bin/noctalia-greeter-session -- --session niri --user bogale";
|
||||
command = "${pkgs.noctalia-greeter}/bin/noctalia-greeter-session";
|
||||
};
|
||||
};
|
||||
displayManager.noctalia-greeter = {
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@
|
|||
services = {
|
||||
dnsmasq.settings = {
|
||||
enable-tftp = true;
|
||||
bind-dynamic = true;
|
||||
interface = "enp1s0";
|
||||
tftp-root = "/srv/tftp";
|
||||
dhcp-boot = "grubx64.efi";
|
||||
|
|
@ -41,7 +42,11 @@
|
|||
enableIPv6 = true;
|
||||
internalInterfaces = [ "enp1s0" ];
|
||||
};
|
||||
networkmanager.ensureProfiles.profiles.ethernet = {
|
||||
networkmanager.ensureProfiles.profiles.static-eth = {
|
||||
connection = {
|
||||
id = "static-eth";
|
||||
type = "ethernet";
|
||||
};
|
||||
ipv6 = {
|
||||
method = "manual";
|
||||
addresses = "fc02::1/64";
|
||||
|
|
@ -50,10 +55,6 @@
|
|||
method = "manual";
|
||||
addresses = "10.2.0.1/16";
|
||||
};
|
||||
connection = {
|
||||
id = "ethernet";
|
||||
type = "802-3-ethernet";
|
||||
};
|
||||
};
|
||||
};
|
||||
systemd = {
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
"L /root/backup/server/http - - - - /srv/http"
|
||||
"L /root/backup/server/acme - - - - /var/lib/acme"
|
||||
"L /root/backup/server/mail - - - - /var/spool/mail"
|
||||
"L /root/backup/server/forgejo - - - - /var/lib/forgejo/dump"
|
||||
"L /root/backup/server/forgejo - - - - /var/lib/forgejo"
|
||||
"L /root/backup/server/vaultwarden - - - - /var/lib/vaultwarden"
|
||||
"L /root/backup/server/postgresql - - - - /var/backup/postgresql"
|
||||
];
|
||||
|
|
@ -36,7 +36,7 @@
|
|||
configFile = "/secrets/awg/1.conf";
|
||||
address = [ "10.0.0.2/32" "fc00::2/128" ];
|
||||
};
|
||||
networkmanager.ensureProfiles.profiles.wifi = {
|
||||
networkmanager.ensureProfiles.profiles.home-wifi = {
|
||||
wifi.ssid = "bogale_2.4";
|
||||
ipv6.addresses = "fc01::2/64";
|
||||
ipv4.addresses = "10.1.0.2/16";
|
||||
|
|
@ -49,7 +49,7 @@
|
|||
vmail.gid = 1819;
|
||||
};
|
||||
users = {
|
||||
nginx.extraGroups = [ "php" "acme" ];
|
||||
nginx.extraGroups = [ "php" "acme" "grafana" ];
|
||||
root.openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPTb4c1ISQSV34GN27GgaJ08jpiRM3Wul/iSWjQ6emTq" ];
|
||||
php = {
|
||||
uid = 1568;
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@
|
|||
server = {
|
||||
enable_gzip = true;
|
||||
protocol = "socket";
|
||||
socket_mode = "0666";
|
||||
root_url = "https://bogaledev.ru/grafana";
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -45,11 +45,6 @@
|
|||
forgejo = {
|
||||
enable = true;
|
||||
database.type = "postgres";
|
||||
dump = {
|
||||
enable = true;
|
||||
type = "tar.zst";
|
||||
interval = "16:00";
|
||||
};
|
||||
settings = {
|
||||
service = {
|
||||
ENABLE_CAPTCHA = true;
|
||||
|
|
@ -104,11 +99,6 @@
|
|||
"/".extraConfig = phpPool;
|
||||
"/local/".extraConfig = "${phpPool} ${localNetworks}";
|
||||
"/git/".proxyPass = "http://unix:/run/forgejo/forgejo.sock:/";
|
||||
"/local/net/".extraConfig = ''
|
||||
allow fc01::/64;
|
||||
allow 10.1.0.0/16;
|
||||
deny all;
|
||||
'';
|
||||
"/vw/" = {
|
||||
proxyWebsockets = true;
|
||||
extraConfig = localNetworks;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue