zaphyra's git: nixfiles

zaphyra and void's nixfiles

commit 9d434add1a1172b9f9d5e6fe97562cc41eb57df1
parent 68047fddf7ca8ba9cc257e6930e8c4a72eed1360
Author: Katja (zaphyra) <git@ctu.cx>
Date: Mon, 9 Jun 2025 20:14:42 +0200

config/nixos/modules/programs: add `steam`
2 files changed, 74 insertions(+), 0 deletions(-)
A
config/nixos/modules/programs/steam.nix
|
48
++++++++++++++++++++++++++++++++++++++++++++++++
A
hosts/polaris/syncthing.nix
|
26
++++++++++++++++++++++++++
diff --git a/config/nixos/modules/programs/steam.nix b/config/nixos/modules/programs/steam.nix
@@ -0,0 +1,48 @@
+{
+  povSelf,
+  pkgs,
+  lib,
+  config,
+  ...
+}:
+
+let
+  inherit (lib) types;
+  cfg = lib.getAttrFromPath povSelf config;
+
+in
+{
+
+  options.enable = {
+    type = types.bool;
+    default = false;
+  };
+
+  config = lib.mkIf cfg.enable {
+    assertions = [
+      {
+        assertion = cfg.enable -> config.modules.unfree.enable;
+        message = ''
+          The programs.steam module uses unfree software.
+          To use it you need to set modules.unfree.enable to true.
+        '';
+      }
+      {
+        assertion = cfg.enable -> config.modules.filesystem.impermernance.home.enable;
+        message = ''
+          The programs.steam module can't be used when impermancence is used inside of home-directories.
+        '';
+      }
+    ];
+    modules.unfree.list = [
+      "steam"
+      "steam-unwrapped"
+    ];
+    programs.steam = {
+      enable = true;
+      remotePlay.openFirewall = true;
+      dedicatedServer.openFirewall = true;
+    };
+  };
+
+}
diff --git a/hosts/polaris/syncthing.nix b/hosts/polaris/syncthing.nix
@@ -0,0 +1,26 @@
+{ config, ... }:
+
+{
+
+  fileSystems = {
+    "/nix/persist/home/zaphyra/syncthing" = {
+      fsType = "zfs";
+      device = "${config.networking.hostName}/data/home/zaphyra/syncthing";
+    };
+    "/nix/persist/home/zaphyra/syncthing/Documents" = {
+      fsType = "zfs";
+      device = "${config.networking.hostName}/data/home/zaphyra/syncthing/documents";
+    };
+    "/nix/persist/home/zaphyra/syncthing/Pictures" = {
+      fsType = "zfs";
+      device = "${config.networking.hostName}/data/home/zaphyra/syncthing/pictures";
+    };
+  };
+
+  modules.presets.zaphyra.syncthing = {
+    enable = false;
+    dataDir = "/nix/persist/home/zaphyra/syncthing";
+    configDir = "/nix/persist/home/zaphyra/syncthing/syncthingConfig";
+  };
+
+}