Old-materusPC: network and audio update
This commit is contained in:
parent
e901f042fb
commit
cff5051f75
|
@ -9,6 +9,7 @@
|
||||||
[
|
[
|
||||||
# Include the results of the hardware scan.
|
# Include the results of the hardware scan.
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
|
./network.nix
|
||||||
];
|
];
|
||||||
boot.supportedFilesystems = [ "ntfs" ];
|
boot.supportedFilesystems = [ "ntfs" ];
|
||||||
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
||||||
|
@ -38,10 +39,6 @@
|
||||||
services.flatpak.enable = true;
|
services.flatpak.enable = true;
|
||||||
services.gvfs.enable = true;
|
services.gvfs.enable = true;
|
||||||
|
|
||||||
networking.hostName = "Old-materusPC"; # Define your hostname.
|
|
||||||
# Pick only one of the below networking options.
|
|
||||||
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
|
|
||||||
networking.networkmanager.enable = true; # Easiest to use and most distros use this by default.
|
|
||||||
|
|
||||||
# Set your time zone.
|
# Set your time zone.
|
||||||
time.timeZone = "Europe/Warsaw";
|
time.timeZone = "Europe/Warsaw";
|
||||||
|
@ -103,7 +100,13 @@
|
||||||
jack.enable = true;
|
jack.enable = true;
|
||||||
};
|
};
|
||||||
hardware.pulseaudio.enable = false;
|
hardware.pulseaudio.enable = false;
|
||||||
|
services.udev = {
|
||||||
|
extraRules = ''
|
||||||
|
KERNEL=="rtc0", GROUP="audio"
|
||||||
|
KERNEL=="hpet", GROUP="audio"
|
||||||
|
DEVPATH=="/devices/virtual/misc/cpu_dma_latency", OWNER="root", GROUP="audio", MODE="0660"
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
virtualisation.podman = {
|
virtualisation.podman = {
|
||||||
|
@ -115,7 +118,7 @@
|
||||||
|
|
||||||
users.users.materus = {
|
users.users.materus = {
|
||||||
isNormalUser = true;
|
isNormalUser = true;
|
||||||
extraGroups = [ "wheel" "networkmanager" "kvm" "input" "libvirt" "libvirtd" "podman" ];
|
extraGroups = [ "wheel" "networkmanager" "kvm" "input" "libvirt" "libvirtd" "podman" "audio" "pipewire" ];
|
||||||
shell = pkgs.zsh;
|
shell = pkgs.zsh;
|
||||||
description = "Mateusz Słodkowicz";
|
description = "Mateusz Słodkowicz";
|
||||||
|
|
||||||
|
@ -177,6 +180,7 @@
|
||||||
xz
|
xz
|
||||||
zip
|
zip
|
||||||
gzip
|
gzip
|
||||||
|
sops
|
||||||
|
|
||||||
tree
|
tree
|
||||||
mc
|
mc
|
||||||
|
@ -285,11 +289,7 @@
|
||||||
services.openssh.enable = true;
|
services.openssh.enable = true;
|
||||||
|
|
||||||
|
|
||||||
# Open ports in the firewall.
|
|
||||||
networking.firewall.allowedTCPPorts = [ 24800 5900 5357 4656 ];
|
|
||||||
networking.firewall.allowedUDPPorts = [ 24800 5900 3702 4656 ];
|
|
||||||
# Or disable the firewall altogether.
|
|
||||||
networking.firewall.enable = true;
|
|
||||||
|
|
||||||
# Copy the NixOS configuration file and link it from the resulting system
|
# Copy the NixOS configuration file and link it from the resulting system
|
||||||
# (/run/current-system/configuration.nix). This is useful in case you
|
# (/run/current-system/configuration.nix). This is useful in case you
|
||||||
|
|
|
@ -74,6 +74,7 @@
|
||||||
|
|
||||||
home.packages = [
|
home.packages = [
|
||||||
pkgs.papirus-icon-theme
|
pkgs.papirus-icon-theme
|
||||||
|
(materusArg.pkgs.polymc.wrap { extraJDKs = [ pkgs.graalvm-ce ]; })
|
||||||
];
|
];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,52 @@
|
||||||
|
{ config, pkgs, lib, materusArg, ... }:
|
||||||
|
{
|
||||||
|
sops.templates."networkmanager.env".content = ''
|
||||||
|
WIREGUARD_PRIVATEKEY="${config.sops.placeholder.wg-key}"
|
||||||
|
'';
|
||||||
|
|
||||||
|
networking.useDHCP = lib.mkDefault true;
|
||||||
|
networking.hostName = "Old-materusPC";
|
||||||
|
networking.wireless.iwd.enable = true;
|
||||||
|
networking.networkmanager.enable = true;
|
||||||
|
# Open ports in the firewall.
|
||||||
|
networking.firewall.allowedTCPPorts = [ 24800 5900 5357 4656 ];
|
||||||
|
networking.firewall.allowedUDPPorts = [ 24800 5900 3702 4656 ];
|
||||||
|
# Or disable the firewall altogether.
|
||||||
|
networking.firewall.enable = true;
|
||||||
|
networking.networkmanager.settings = {
|
||||||
|
connectivity = {
|
||||||
|
uri = "http://nmcheck.gnome.org/check_network_status.txt";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
networking.networkmanager.ensureProfiles.environmentFiles = [
|
||||||
|
config.sops.templates."networkmanager.env".path
|
||||||
|
];
|
||||||
|
networking.networkmanager.ensureProfiles.profiles = {
|
||||||
|
wg0 = {
|
||||||
|
connection = {
|
||||||
|
id = "wg0";
|
||||||
|
type = "wireguard";
|
||||||
|
interface-name = "wg0";
|
||||||
|
};
|
||||||
|
wireguard = {
|
||||||
|
private-key = "$WIREGUARD_PRIVATEKEY";
|
||||||
|
};
|
||||||
|
"wireguard-peer.${materusArg.wireguard.pubKeys.valkyrie}" = {
|
||||||
|
endpoint = "${materusArg.ips.valkyrie}:${materusArg.wireguard.port}";
|
||||||
|
allowed-ips = "${materusArg.ip-masks.wireguard.general};";
|
||||||
|
};
|
||||||
|
ipv4 = {
|
||||||
|
address1 = "${materusArg.ips.wireguard.Old-materusPC}/23";
|
||||||
|
dns = "${materusArg.ips.wireguard.valkyrie};";
|
||||||
|
method = "manual";
|
||||||
|
never-default = "true";
|
||||||
|
};
|
||||||
|
ipv6 = {
|
||||||
|
addr-gen-mode = "stable-privacy";
|
||||||
|
method = "disabled";
|
||||||
|
};
|
||||||
|
proxy = { };
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -40,6 +40,7 @@
|
||||||
extraRules = ''
|
extraRules = ''
|
||||||
KERNEL=="rtc0", GROUP="audio"
|
KERNEL=="rtc0", GROUP="audio"
|
||||||
KERNEL=="hpet", GROUP="audio"
|
KERNEL=="hpet", GROUP="audio"
|
||||||
|
DEVPATH=="/devices/virtual/misc/cpu_dma_latency", OWNER="root", GROUP="audio", MODE="0660"
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
|
|
Loading…
Reference in New Issue