From 309adacfa4d49b6ec833cb079165806247a97ab3 Mon Sep 17 00:00:00 2001 From: emptyynes Date: Thu, 2 Oct 2025 04:33:03 +0700 Subject: [PATCH] kinda testing dungeonclub --- affine/main.nix | 2 +- dungeonclub/dungeonclub.nix | 14 ++++++++++++++ dungeonclub/main.nix | 8 ++++++++ dungeonclub/options.nix | 28 ++++++++++++++++++++++++++++ dungeonclub/package.nix | 15 +++++++++++++++ flake.lock | 12 ++++++------ flake.nix | 8 ++++++++ marzban/main.nix | 2 +- 8 files changed, 81 insertions(+), 8 deletions(-) create mode 100644 dungeonclub/dungeonclub.nix create mode 100644 dungeonclub/main.nix create mode 100644 dungeonclub/options.nix create mode 100644 dungeonclub/package.nix diff --git a/affine/main.nix b/affine/main.nix index f1e4aa5..f578d19 100644 --- a/affine/main.nix +++ b/affine/main.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: +{ ... }: { imports = [ diff --git a/dungeonclub/dungeonclub.nix b/dungeonclub/dungeonclub.nix new file mode 100644 index 0000000..d9bf768 --- /dev/null +++ b/dungeonclub/dungeonclub.nix @@ -0,0 +1,14 @@ +{ pkgs, lib, config, ... }: + +let + dungeonclub-static = "/var/lib/dungeonclub"; + dungeonclub-config = config.services.dungeonclub; +in { + config = lib.mkIf dungeonclub-config.enable { + system.activationScripts.dungeonclub-dir = '' + mkdir -p ${dungeonclub-static}/{config,db,storage} + ''; + + + }; +} \ No newline at end of file diff --git a/dungeonclub/main.nix b/dungeonclub/main.nix new file mode 100644 index 0000000..3b0662a --- /dev/null +++ b/dungeonclub/main.nix @@ -0,0 +1,8 @@ +{ ... }: + +{ + imports = [ + ./options.nix + ./dungeonclub.nix + ]; +} \ No newline at end of file diff --git a/dungeonclub/options.nix b/dungeonclub/options.nix new file mode 100644 index 0000000..a2fed52 --- /dev/null +++ b/dungeonclub/options.nix @@ -0,0 +1,28 @@ +{ lib, ... }: + +{ + options = with lib; with types; { + services.dungeonclub = { + enable = mkEnableOption "Dungeon Club - Virtual Tabletop"; + + package = mkOption { type = package; default = pkgs.dungeonclub; description = "Dungeon Club package to use"; }; + + # build = { + # config-yaml = { + # storage-mb-per-campaign = mkOption { type = int; default = 500; }; + # prefabs-per-campaign = mkOption { type = int; default = 20; }; + # scenes-per-campaign = mkOption { type = int; default = 20; }; + # maps-per-campaign = mkOption { type = int; default = 10; }; + # campaigns-per-account = mkOption { type = int; default = 10; }; + # }; + # copy-music = mkOption { type = bool; default = true; }; + # download-icons = mkOption { type = bool; default = true; }; + # }; + options = { + mock-account = mkOption { type = bool; default = true; }; + music = mkOption { type = bool; default = false; }; + port = mkOption { type = int; default = 7070; }; + }; + }; + }; +} diff --git a/dungeonclub/package.nix b/dungeonclub/package.nix new file mode 100644 index 0000000..3770c25 --- /dev/null +++ b/dungeonclub/package.nix @@ -0,0 +1,15 @@ +{ pkgs }: + +pkgs.buildDartApplication rec { + pname = "dungeonclub"; + version = "1.1"; + + src = pkgs.fetchFromGitHub { + owner = "doodlezucc"; + repo = "dungeonclub"; + rev = "master"; + hash = "sha256-U6enz8yJcc4Wf8m54eYIAnVg/jsGi247Wy8lp1r1wg4="; + }; + + pubspecLockFile = ./pubspec.lock; +} \ No newline at end of file diff --git a/flake.lock b/flake.lock index 425f2dd..6ce47e6 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1758791193, - "narHash": "sha256-F8WmEwFoHsnix7rt290R0rFXNJiMbClMZyIC/e+HYf0=", + "lastModified": 1759143472, + "narHash": "sha256-TvODmeR2W7yX/JmOCmP+lAFNkTT7hAxYcF3Kz8SZV3w=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "25e53aa156d47bad5082ff7618f5feb1f5e02d01", + "rev": "5ed4e25ab58fd4c028b59d5611e14ea64de51d23", "type": "github" }, "original": { @@ -17,11 +17,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1758690382, - "narHash": "sha256-NY3kSorgqE5LMm1LqNwGne3ZLMF2/ILgLpFr1fS4X3o=", + "lastModified": 1759036355, + "narHash": "sha256-0m27AKv6ka+q270dw48KflE0LwQYrO7Fm4/2//KCVWg=", "owner": "nixos", "repo": "nixpkgs", - "rev": "e643668fd71b949c53f8626614b21ff71a07379d", + "rev": "e9f00bd893984bc8ce46c895c3bf7cac95331127", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index decd8d2..eea309b 100644 --- a/flake.nix +++ b/flake.nix @@ -11,5 +11,13 @@ affine = import ./affine/main.nix; marzban = import ./marzban/main.nix; }; + + packages = (nixpkgs.lib.genAttrs [ "x86_64-linux" ]) (system: + { + dungeonclub = import ./dungeonclub/package.nix { + pkgs = import nixpkgs { inherit system; }; + }; + } + ); }; } \ No newline at end of file diff --git a/marzban/main.nix b/marzban/main.nix index 85c2f36..a4b14ba 100644 --- a/marzban/main.nix +++ b/marzban/main.nix @@ -1,4 +1,4 @@ -{pkgs, lib, stdenv, config, ...}: +{ ... }: { imports = [