From d94b71d0a1472e89cd12590a9b2f0724ae332680 Mon Sep 17 00:00:00 2001 From: Scott Scoble Date: Fri, 15 May 2026 21:16:35 -0700 Subject: [PATCH] feat: scaffold Nix flake with dotnet-sdk_9, typst, and nodejs - devShells.default provides dotnetCorePackages.sdk_9_0, typst, nodejs - packages.default uses buildDotnetModule with net9.0 target via callPackage - Stub plugin/ project with minimal .csproj - .gitignore with .NET/Nix build artifacts --- .gitignore | 14 +++++++ deps.json | 1 + flake.lock | 27 +++++++++++++ flake.nix | 72 ++++++++++++++++++++++++++++++++++ plugin/jellyfin-lessons.csproj | 7 ++++ 5 files changed, 121 insertions(+) create mode 100644 .gitignore create mode 100644 deps.json create mode 100644 flake.lock create mode 100644 flake.nix create mode 100644 plugin/jellyfin-lessons.csproj diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9bd8ced --- /dev/null +++ b/.gitignore @@ -0,0 +1,14 @@ +# .NET build artifacts +bin/ +obj/ +*.dll + +# Nix +.result/ +result + +# IDE +.vs/ +.vscode/ +*.user +*.suo diff --git a/deps.json b/deps.json new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/deps.json @@ -0,0 +1 @@ +[] diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..0b0400a --- /dev/null +++ b/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1778443072, + "narHash": "sha256-zi7/fsqM/kFdNuED//4WOCUtezGtKKqRNORjMvfwjnA=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "da5ad661ba4e5ef59ba743f0d112cbc30e474f32", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..f9e1849 --- /dev/null +++ b/flake.nix @@ -0,0 +1,72 @@ +{ + description = "Jellyfin Lessons — a Jellyfin plugin"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + }; + + outputs = + { self, nixpkgs }: + let + forAllSystems = + fn: nixpkgs.lib.genAttrs nixpkgs.lib.systems.flakeExposed fn; + in + { + devShells = forAllSystems ( + system: + let + pkgs = nixpkgs.legacyPackages.${system}; + in + { + default = pkgs.mkShell { + packages = [ + pkgs.dotnetCorePackages.sdk_9_0 + pkgs.typst + pkgs.nodejs + ]; + + shellHook = '' + echo "jellyfin-lessons dev shell" + echo " dotnet: $(dotnet --version)" + echo " typst: $(typst --version)" + echo " node: $(node --version)" + ''; + }; + } + ); + + packages = forAllSystems ( + system: + let + pkgs = nixpkgs.legacyPackages.${system}; + in + { + default = pkgs.callPackage ( + { + buildDotnetModule, + dotnetCorePackages, + lib, + }: + buildDotnetModule { + pname = "jellyfin-lessons"; + version = "0.1.0"; + + src = self; + + projectFile = "plugin/jellyfin-lessons.csproj"; + nugetDeps = ./deps.json; + + dotnet-sdk = dotnetCorePackages.sdk_9_0; + dotnet-runtime = dotnetCorePackages.aspnetcore_9_0; + + meta = { + description = "Jellyfin Lessons plugin"; + license = lib.licenses.mit; + platforms = lib.platforms.all; + }; + } + ) { }; + } + ); + }; +} diff --git a/plugin/jellyfin-lessons.csproj b/plugin/jellyfin-lessons.csproj new file mode 100644 index 0000000..65111ca --- /dev/null +++ b/plugin/jellyfin-lessons.csproj @@ -0,0 +1,7 @@ + + + net9.0 + JellyfinLessons + jellyfin-lessons + +