a bunch of stuff, including upgrade to wayland and ndi streaming to imac

This commit is contained in:
Sebastian Moser
2025-01-12 18:50:01 +01:00
parent cfd9bfccbd
commit 40f190de88
29 changed files with 1813 additions and 55 deletions

View File

@@ -9,25 +9,36 @@
inputs.home-manager.nixosModules.home-manager
../users/me/headless.nix
../users/root/default.nix
../users/server/headles.nix
../users/files/headless.nix
];
# mac address for wakeonlan: 00:19:99:fd:28:23
# allow acern to ssh into server
users.users.server.openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHTV1VoNAjMha5IP+qb8XABDo02pW3iN0yPBIbSqZA27 me@acern"
];
#users.users.server.openssh.authorizedKeys.keys = [
#"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHTV1VoNAjMha5IP+qb8XABDo02pW3iN0yPBIbSqZA27 me@acern"
#];
# allow server user to shutdown fusu
security.sudo.extraRules = [
{
users = [ "server" ];
commands = [ { command = "/run/current-system/sw/bin/shutdown"; options = [ "SETENV" "NOPASSWD" ]; } ];
}
];
#security.sudo.extraRules = [
#{
#users = [ "server" ];
#commands = [ { command = "/run/current-system/sw/bin/shutdown"; options = [ "SETENV" "NOPASSWD" ]; } ];
#}
#];
boot.supportedFilesystems = [ "zfs" ];
boot.zfs.package = pkgs.zfs_unstable;
boot.zfs.forceImportRoot = false;
networking.hostId = "7552c83e";
fileSystems."/home/files/storage" = {
device = "storage";
fsType = "zfs";
};
virtualisation.libvirtd = {
enable = true;
@@ -39,7 +50,8 @@
# Use the GRUB 2 boot loader.
boot.loader.grub = {
enable = true;
device = "/dev/disk/by-id/ata-TOSHIBA_MQ04ABF100_11MYT5RBT";
#device = "/dev/disk/by-id/ata-TOSHIBA_MQ04ABF100_11MYT5RBT";
device = "nodev"; # don't install, when i do nixre -h fusu ... but when installing onto the two discs (sata hdd and nvme ssd) change to the device like above
efiSupport = false;
extraConfig = ''
set timeout=2
@@ -57,6 +69,7 @@
settings.PasswordAuthentication = false;
settings.KbdInteractiveAuthentication = false;
settings.PermitRootLogin = "yes";
ports = [ 49388 ];
settings.X11Forwarding = true;
@@ -76,11 +89,9 @@
8080 # for mitm proxy
5901 # vnc
25565 # mc server
25566 # mc server
];
networking.networkmanager.enable = true; # Easiest to use and most distros use this by default.
networking.networkmanager.enable = false; # Easiest to use and most distros use this by default.
# to build rpi images
boot.binfmt.emulatedSystems = [
@@ -111,7 +122,7 @@
prefixLength = 24;
} ];
networking = {
#usePredictableInterfaceNames = false;
usePredictableInterfaceNames = true;
defaultGateway = {
address = "192.168.1.1";
interface = "br0";

157
hosts/mac.nix Normal file
View File

@@ -0,0 +1,157 @@
{ 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
../users/me/headless.nix
../users/root/default.nix
];
networking.hostName = "mac";
networking.firewall.enable = false;
networking.useDHCP = true;
services.avahi = {
enable = true;
nssmdns = true;
publish = {
enable = true;
addresses = true;
domain = true;
hinfo = true;
userServices = true;
workstation = true;
};
};
# 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; [
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 -- ${myobs}/bin/obs";
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";
}

View File

@@ -10,6 +10,34 @@
# ??????????? TODO
# fileSystems."/".options = [ "noatime" "nodiratime" "discard" ];
/*
services.xserver.displayManager.gdm.enable = true;
services.xserver.displayManager.gdm.wayland = false;
services.xserver.desktopManager.plasma5.enable = true;
modules.battery_monitor.enable = true;
services.blueman.enable = true;
hardware.bluetooth.enable = true;
# Enable the gnome-keyring secrets vault.
# Will be exposed through DBus to programs willing to store secrets.
services.gnome.gnome-keyring.enable = true;
# enable Sway window manager
programs.sway = {
enable = true;
wrapperFeatures.gtk = true;
};
*/
#services.openssh.enable = true;
virtualisation.vmVariant.services.timesyncd.enable = lib.mkForce false;
services.nscd.enable = lib.mkForce false;
virtualisation.docker.enable = true;
@@ -21,6 +49,8 @@
'';
services.xserver.displayManager.xserverArgs = [ "-listen tcp" ];
nixpkgs.config.allowUnfree = lib.mkForce true;
programs.nix-ld.enable = true;
programs.steam.enable = true;
@@ -33,8 +63,10 @@
imports = [
../common/all.nix
../common/nixos-headless.nix
../common/nixos-graphical.nix
#../common/nixos-graphical.nix
../common/nixos-wayland.nix
../common/building.nix
../mods/battery_monitor.nix
inputs.networkmanager.nixosModules.networkmanager
inputs.home-manager.nixosModules.home-manager
@@ -48,6 +80,17 @@
environment.systemPackages = with pkgs; [
grim # screenshot functionality
slurp # screenshot functionality
wl-clipboard # wl-copy and wl-paste for copy/paste from stdin / stdout
mako # notification system developed by swaywm maintainer
(pkgs.wrapOBS {
plugins = with obs-studio-plugins; [
obs-ndi
obs-teleport
];
})
slint-lsp
cifs-utils
nfs-utils
@@ -159,8 +202,19 @@
security.polkit.enable = true;
services.rpcbind.enable = true;
services.avahi.enable = true;
services.avahi.hostName = "c2vi";
#services.avahi.hostName = "c2vi";
services.avahi = {
enable = true;
nssmdns = true;
publish = {
enable = true;
addresses = true;
domain = true;
hinfo = true;
userServices = true;
workstation = true;
};
};
networking.networkmanager.enable = true;
#networking.networkmanager.extraConfig = ''
@@ -170,7 +224,7 @@
#networking.useDHCP = lib.mkForce true;
networking.firewall.allowPing = true;
networking.firewall.enable = true;
networking.firewall.enable = false;
services.samba.openFirewall = true;
@@ -190,7 +244,7 @@
53 # allow dns
];
networking.search = [ "c2vi.local" ];
#networking.search = [ "c2vi.local" ];
#networking.hosts = {
#"10.1.1.3" = [ "phone" ];
#};
@@ -489,8 +543,8 @@
############################## swap and hibernate ###################################
swapDevices = [ { device = "/dev/lvm0/swap"; } ];
boot.resumeDevice = "/dev/lvm0/swap";
swapDevices = [ { device = "/swapfile"; } ];
boot.resumeDevice = "/swapfile";
services.logind = {
extraConfig = ''
HandlePowerKey=suspend-then-hibernate
@@ -500,7 +554,7 @@
lidSwitchDocked = "ignore";
};
systemd.sleep.extraConfig = ''
HibernateDelaySec=2h
HibernateDelaySec=27h
HibernateMode=shutdown
'';
}

View File

@@ -1 +0,0 @@
hi