From d9f629f3a9175e9af01131b3c356942098028dba Mon Sep 17 00:00:00 2001 From: ooks-io Date: Fri, 1 Nov 2024 12:47:49 +1100 Subject: [PATCH] admin: add group www --- modules/home/workstation/gaming/options.nix | 31 +++++++++++ .../workstation/gaming/world-of-warcraft.nix | 55 +++++++++++++++++++ modules/home/workstation/gaming/wow.nix | 1 + modules/nixos/base/admin.nix | 1 + modules/nixos/base/builder.nix | 12 ++++ 5 files changed, 100 insertions(+) create mode 100644 modules/home/workstation/gaming/options.nix create mode 100644 modules/home/workstation/gaming/world-of-warcraft.nix create mode 100644 modules/nixos/base/builder.nix diff --git a/modules/home/workstation/gaming/options.nix b/modules/home/workstation/gaming/options.nix new file mode 100644 index 0000000..f6061ed --- /dev/null +++ b/modules/home/workstation/gaming/options.nix @@ -0,0 +1,31 @@ +{ + lib, + config, + ... +}: let + inherit (lib) mkIf mkEnableOption mkOption; + inherit (lib.types) str; + cfg = config.ooknet.gaming; +in { + options.ooknet.gaming = { + enable = mkEnableOption; + + gamesPath = mkOption { + type = str; + default = "${config.home.homeDirectory}/Games"; + description = "Location where games will be stored."; + }; + + prefixPath = mkOption { + type = str; + default = "${cfg.gamesPath}/prefixes"; + }; + compatDataPath = mkOption { + type = str; + default = "${cfg.prefixPath}/compatdata"; + }; + }; + config = mkIf cfg.enable { + xdg.userDirs.XDG_GAMES_DIR = cfg.gamesPath; + }; +} diff --git a/modules/home/workstation/gaming/world-of-warcraft.nix b/modules/home/workstation/gaming/world-of-warcraft.nix new file mode 100644 index 0000000..5bb944c --- /dev/null +++ b/modules/home/workstation/gaming/world-of-warcraft.nix @@ -0,0 +1,55 @@ +{ + lib, + config, + pkgs, + ... +}: let + inherit (lib) mkIf mkEnableOption mkOption; + inherit (lib.types) str package; + inherit (config.ooknet) gaming; + gamesDir = config.xdg.userDirs.extraConfig.XDG_GAMES_DIR; + cfg = config.ooknet.gaming.world-of-warcraft; +in { + options.ooknet.gaming.world-of-warcraft = { + enable = mkEnableOption "Enable the World of Warcraft module"; + + proton = { + package = mkOption { + type = package; + default = pkgs.proton-ge-custom; + }; + prefix = { + path = mkOption { + type = str; + default = "${gaming.prefixPath}/WoW"; + }; + }; + compatDataPath = mkOption { + type = str; + default = "${gaming.compatDataPath}/"; + }; + }; + + gamePrefixPath = mkOption { + type = str; + default = "${cfg.winePrefixesPath}/WoW"; + description = "Location where the World of Warcraft prefix will be stored."; + }; + + gamePath = mkOption { + type = str; + default = "${cfg.world-of-warcraft.gamePrefixPath}/drive_c/Program Files (x86)/World of Warcraft"; + description = "Location where the World of Warcraft installation will be symlinked."; + }; + + gameSharedPath = mkOption { + type = str; + default = "${cfg.wineProgramsPath}/World Of Warcraft"; + description = "Location where World of Warcraft game files are stored."; + }; + }; + config = + mkIf cfg.enable { + }; +} + diff --git a/modules/home/workstation/gaming/wow.nix b/modules/home/workstation/gaming/wow.nix index 0c82934..9ca101e 100644 --- a/modules/home/workstation/gaming/wow.nix +++ b/modules/home/workstation/gaming/wow.nix @@ -2,6 +2,7 @@ lib, osConfig, pkgs, + self', ... }: let inherit (lib) mkIf elem; diff --git a/modules/nixos/base/admin.nix b/modules/nixos/base/admin.nix index 319472d..64bf329 100644 --- a/modules/nixos/base/admin.nix +++ b/modules/nixos/base/admin.nix @@ -30,6 +30,7 @@ in { "libvirtd" "streamer" "torrenter" + "www" ]; }; }; diff --git a/modules/nixos/base/builder.nix b/modules/nixos/base/builder.nix new file mode 100644 index 0000000..d37d94c --- /dev/null +++ b/modules/nixos/base/builder.nix @@ -0,0 +1,12 @@ +{ + keys, + config, + ... +}: let + inherit (config.ooknet.host) admin; +in { + users = { + groups.builder = {}; + users.builder = (key: ''command="nix-daemon --stdio",no-agent-forwarding,no-port-forwarding,no-pty,no-user-rc,no-X11-forwarding ${key}'') keys.users.${admin.name}; + }; +}