From 5e74a874ba578243e915cee1a28b4cc42f06c66c Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Sun, 29 Dec 2024 15:45:52 -0500 Subject: [PATCH] Persist sound settings (for example, muted status) and do not enable wireguard in built ISO. --- nix/configuration/roles/sound/default.nix | 10 ++++++ nix/configuration/roles/wireguard/default.nix | 34 ++++++++++--------- 2 files changed, 28 insertions(+), 16 deletions(-) diff --git a/nix/configuration/roles/sound/default.nix b/nix/configuration/roles/sound/default.nix index 88a729b..af92f09 100644 --- a/nix/configuration/roles/sound/default.nix +++ b/nix/configuration/roles/sound/default.nix @@ -60,4 +60,14 @@ '') ]; }; + + environment.persistence."/persist" = lib.mkIf (!config.me.buildingIso) { + hideMounts = true; + users.talexander = { + directories = [ + ".local/state/wireplumber" # Sound settings + ]; + }; + }; + } diff --git a/nix/configuration/roles/wireguard/default.nix b/nix/configuration/roles/wireguard/default.nix index 007e3ea..7de9fc7 100644 --- a/nix/configuration/roles/wireguard/default.nix +++ b/nix/configuration/roles/wireguard/default.nix @@ -8,25 +8,27 @@ { imports = [ ]; - networking.firewall.allowedUDPPorts = [ 51821 ]; - networking.wireguard.enable = true; - networking.wg-quick.interfaces.drmario.configFile = "/persist/manual/wireguard/drmario.conf"; - systemd.services."wg-quick-drmario".after = [ - "nss-lookup.target" - "systemd-resolved.service" - "multi-user.target" - ]; + config = lib.mkIf (!config.me.buildingIso) { + networking.firewall.allowedUDPPorts = [ 51821 ]; + networking.wireguard.enable = true; + networking.wg-quick.interfaces.drmario.configFile = "/persist/manual/wireguard/drmario.conf"; + systemd.services."wg-quick-drmario".after = [ + "nss-lookup.target" + "systemd-resolved.service" + "multi-user.target" + ]; - systemd.services."wg-quick-drmario".preStart = "${pkgs.toybox}/bin/sleep 10"; + systemd.services."wg-quick-drmario".preStart = "${pkgs.toybox}/bin/sleep 10"; - networking.wg-quick.interfaces.wgh.configFile = "/persist/manual/wireguard/wgh.conf"; - systemd.services."wg-quick-wgh".after = [ - "nss-lookup.target" - "systemd-resolved.service" - "multi-user.target" - ]; + networking.wg-quick.interfaces.wgh.configFile = "/persist/manual/wireguard/wgh.conf"; + systemd.services."wg-quick-wgh".after = [ + "nss-lookup.target" + "systemd-resolved.service" + "multi-user.target" + ]; - systemd.services."wg-quick-wgh".preStart = "${pkgs.toybox}/bin/sleep 10"; + systemd.services."wg-quick-wgh".preStart = "${pkgs.toybox}/bin/sleep 10"; + }; # environment.systemPackages = with pkgs; [ # wireguard-tools