291 lines
6.5 KiB
Nix
291 lines
6.5 KiB
Nix
{ secretsDir, pkgs, inputs, ... }: let
|
|
|
|
myobs = pkgs.wrapOBS {
|
|
plugins = with pkgs.obs-studio-plugins; [
|
|
obs-ndi
|
|
obs-teleport
|
|
];
|
|
};
|
|
|
|
|
|
in {
|
|
|
|
imports = [
|
|
../common/all.nix
|
|
../common/nixos.nix
|
|
../common/building.nix
|
|
|
|
inputs.home-manager.nixosModules.home-manager
|
|
inputs.networkmanager.nixosModules.networkmanager
|
|
../users/me/headless.nix
|
|
../users/root/default.nix
|
|
];
|
|
|
|
networking.hostName = "mac";
|
|
networking.firewall.enable = false;
|
|
services.avahi = {
|
|
enable = true;
|
|
nssmdns = true;
|
|
publish = {
|
|
enable = true;
|
|
addresses = true;
|
|
domain = true;
|
|
hinfo = true;
|
|
userServices = true;
|
|
workstation = true;
|
|
};
|
|
};
|
|
networking.firewall.allowedTCPPorts = [
|
|
8888 # for general usage
|
|
9999 # for general usage
|
|
6000 # Xserver
|
|
5900 # vnc for win VM
|
|
5901 # vnc
|
|
5902 # vnc
|
|
4400 # rdp win VM
|
|
];
|
|
|
|
boot.kernelModules = [ "usbip_core" ];
|
|
boot.extraModprobeConfig = "options kvm_intel nested=1";
|
|
|
|
# to build rpi images
|
|
boot.binfmt.emulatedSystems = [
|
|
"aarch64-linux"
|
|
];
|
|
|
|
virtualisation.libvirtd = {
|
|
enable = true;
|
|
qemuOvmf = true;
|
|
qemuSwtpm = true;
|
|
#qemuOvmfPackage = pkgs.OVMFFull;
|
|
};
|
|
|
|
# Use the GRUB 2 boot loader.
|
|
boot.loader.grub = {
|
|
enable = true;
|
|
#device = "/dev/nbd1";
|
|
device = "nodev";
|
|
efiSupport = true;
|
|
extraConfig = ''
|
|
set timeout=2
|
|
'';
|
|
};
|
|
|
|
environment.systemPackages = with pkgs; [
|
|
passt
|
|
mount
|
|
pkgs.hicolor-icon-theme
|
|
efibootmgr
|
|
tcpdump
|
|
];
|
|
|
|
|
|
fileSystems."/" = {
|
|
device = "/dev/disk/by-label/mac-root";
|
|
fsType = "ext4";
|
|
};
|
|
|
|
fileSystems."/boot" = {
|
|
device = "/dev/disk/by-label/EFI";
|
|
fsType = "vfat";
|
|
};
|
|
|
|
networking = {
|
|
#usePredictableInterfaceNames = false;
|
|
defaultGateway = {
|
|
address = "192.168.1.1";
|
|
interface = "enp2s0";
|
|
};
|
|
nameservers = [ "1.1.1.1" "8.8.8.8" ];
|
|
interfaces = {
|
|
"enp2s0" = {
|
|
name = "enp2s0";
|
|
ipv4.addresses = [
|
|
{ address = "192.168.1.33"; prefixLength = 24;}
|
|
];
|
|
};
|
|
};
|
|
};
|
|
|
|
services.openssh = {
|
|
enable = true;
|
|
# require public key authentication for better security
|
|
settings.PasswordAuthentication = false;
|
|
settings.KbdInteractiveAuthentication = false;
|
|
settings.PermitRootLogin = "no";
|
|
|
|
settings.X11Forwarding = true;
|
|
|
|
extraConfig = ''
|
|
X11UseLocalhost no
|
|
'';
|
|
};
|
|
|
|
###################################################### the kiosk stuff
|
|
|
|
boot.plymouth.enable = true;
|
|
services.dbus.enable = true;
|
|
|
|
fonts.enableDefaultPackages = true;
|
|
xdg.icons.enable = true;
|
|
gtk.iconCache.enable = true;
|
|
|
|
services.udisks2.enable = false;
|
|
hardware.opengl.enable = true;
|
|
hardware.enableRedistributableFirmware = true;
|
|
|
|
systemd.services."cage@" = {
|
|
enable = true;
|
|
after = [ "systemd-user-sessions.service" "dbus.socket" "systemd-logind.service" "getty@%i.service" "plymouth-deactivate.service" "plymouth-quit.service" ];
|
|
before = [ "graphical.target" ];
|
|
wants = [ "dbus.socket" "systemd-logind.service" "plymouth-deactivate.service" ];
|
|
wantedBy = [ "graphical.target" ];
|
|
conflicts = [ "getty@%i.service" ]; # "plymouth-quit.service" "plymouth-quit-wait.service"
|
|
|
|
restartIfChanged = false;
|
|
serviceConfig = {
|
|
ExecStart = "${pkgs.cage}/bin/cage -d -- ${pkgs.moonlight-qt}/bin/moonlight";
|
|
User = "root";
|
|
|
|
# ConditionPathExists = "/dev/tty0";
|
|
IgnoreSIGPIPE = "no";
|
|
|
|
# Log this user with utmp, letting it show up with commands 'w' and
|
|
# 'who'. This is needed since we replace (a)getty.
|
|
UtmpIdentifier = "%I";
|
|
UtmpMode = "user";
|
|
# A virtual terminal is needed.
|
|
TTYPath = "/dev/%I";
|
|
TTYReset = "yes";
|
|
TTYVHangup = "yes";
|
|
TTYVTDisallocate = "yes";
|
|
# Fail to start if not controlling the virtual terminal.
|
|
StandardInput = "tty-fail";
|
|
#StandardOutput = "syslog";
|
|
#StandardError = "syslog";
|
|
# Set up a full (custom) user session for the user, required by Cage.
|
|
PAMName = "cage";
|
|
};
|
|
};
|
|
|
|
security.pam.services.cage.text = ''
|
|
auth required pam_unix.so nullok
|
|
account required pam_unix.so
|
|
session required pam_unix.so
|
|
session required ${pkgs.systemd}/lib/security/pam_systemd.so
|
|
'';
|
|
|
|
systemd.targets.graphical.wants = [ "cage@tty1.service" ];
|
|
|
|
systemd.defaultUnit = "graphical.target";
|
|
|
|
|
|
############################# networkmanager
|
|
networking.networkmanager.enable = true;
|
|
|
|
networking.networkmanager.profiles = {
|
|
home = {
|
|
connection = {
|
|
id = "home";
|
|
uuid = "a02273d9-ad12-395e-8372-f61129635b6f";
|
|
type = "ethernet";
|
|
autoconnect-priority = "-999";
|
|
interface-name = "enp2s0";
|
|
};
|
|
ipv4 = {
|
|
address1 = "192.168.1.33/24,192.168.1.1";
|
|
dns = "1.1.1.1;";
|
|
method = "manual";
|
|
};
|
|
};
|
|
|
|
pw = {
|
|
connection = {
|
|
id = "pw";
|
|
uuid = "e0103dac-7da0-4e32-a01b-487b8c4c813c";
|
|
type = "wifi";
|
|
interface-name = "wlp3s0";
|
|
};
|
|
|
|
wifi = {
|
|
hidden = "true";
|
|
mode = "infrastructure";
|
|
ssid = builtins.readFile "${secretsDir}/wifi-ssid";
|
|
};
|
|
|
|
wifi-security = {
|
|
key-mgmt = "wpa-psk";
|
|
psk = builtins.readFile "${secretsDir}/wifi-password";
|
|
};
|
|
|
|
ipv4 = {
|
|
#address1 = "192.168.20.11/24";
|
|
dns = "1.1.1.1;8.8.8.8;";
|
|
method = "auto";
|
|
};
|
|
};
|
|
|
|
hot = {
|
|
connection = {
|
|
id = "hot";
|
|
uuid = "ab51de8a-9742-465a-928b-be54a83ab6a3";
|
|
type = "wifi";
|
|
autoconnect = false;
|
|
interface-name = "wlp3s0";
|
|
};
|
|
wifi = {
|
|
mac-address = "0C:96:E6:E3:64:03";
|
|
mode = "ap";
|
|
ssid = "c2vi-mac";
|
|
};
|
|
|
|
ipv4 = {
|
|
method = "shared";
|
|
};
|
|
};
|
|
|
|
share = {
|
|
connection = {
|
|
id = "share";
|
|
uuid = "f55f34e3-4595-4642-b1f6-df3185bc0a04";
|
|
type = "ethernet";
|
|
autoconnect = false;
|
|
interface-name = "enp2s0";
|
|
};
|
|
|
|
ethernet = {
|
|
mac-address = "C8:2A:14:0B:7F:3D";
|
|
};
|
|
|
|
ipv4 = {
|
|
address1 = "192.168.4.1/24";
|
|
method = "shared";
|
|
};
|
|
|
|
ipv6 = {
|
|
addr-gen-mode = "stable-privacy";
|
|
method = "auto";
|
|
};
|
|
};
|
|
|
|
dhcp = {
|
|
connection = {
|
|
id = "dhcp";
|
|
uuid = "c006389a-1697-4f77-91c3-95b466f85f13";
|
|
type = "ethernet";
|
|
autoconnect = "false";
|
|
interface-name = "enp2s0";
|
|
};
|
|
|
|
ethernet = {
|
|
mac-address = "C8:2A:14:0B:7F:3D";
|
|
};
|
|
|
|
ipv4 = {
|
|
method = "auto";
|
|
};
|
|
};
|
|
|
|
};
|
|
}
|