diff options
author | Tim <contact@bytim.eu> | 2025-04-24 14:42:26 +0200 |
---|---|---|
committer | Tim <contact@bytim.eu> | 2025-04-24 14:42:26 +0200 |
commit | b67e236302332eb9cd6c8e32e5dca5bc33ffbe5d (patch) | |
tree | eb609ef361ec830c7e0f073d3cea01752596cc7f | |
parent | 0fb8b2f7af9538bd45a9a7e41e64a6610b898fb0 (diff) | |
download | VPNAuth-b67e236302332eb9cd6c8e32e5dca5bc33ffbe5d.tar.xz VPNAuth-b67e236302332eb9cd6c8e32e5dca5bc33ffbe5d.zip |
Add nix support
-rw-r--r-- | .gitignore | 4 | ||||
-rw-r--r-- | deps.nix | 49 | ||||
-rw-r--r-- | flake.lock | 61 | ||||
-rw-r--r-- | flake.nix | 29 |
4 files changed, 143 insertions, 0 deletions
@@ -488,3 +488,7 @@ VPNAuth.Server/vpnauth.db VPNAuth.Server/vpnauth.db-shm VPNAuth.Server/vpnauth.db-wal VPNAuth.Server/config.json + +# nix +out/ +result diff --git a/deps.nix b/deps.nix new file mode 100644 index 0000000..8338f90 --- /dev/null +++ b/deps.nix @@ -0,0 +1,49 @@ +{ fetchNuGet }: [ + (fetchNuGet { pname = "Humanizer.Core"; version = "2.14.1"; hash = "sha256-EXvojddPu+9JKgOG9NSQgUTfWq1RpOYw7adxDPKDJ6o="; }) + (fetchNuGet { pname = "Microsoft.Bcl.AsyncInterfaces"; version = "7.0.0"; hash = "sha256-1e031E26iraIqun84ad0fCIR4MJZ1hcQo4yFN+B7UfE="; }) + (fetchNuGet { pname = "Microsoft.Build.Framework"; version = "17.8.3"; hash = "sha256-Rp4dN8ejOXqclIKMUXYvIliM6IYB7WMckMLwdCbVZ34="; }) + (fetchNuGet { pname = "Microsoft.Build.Locator"; version = "1.7.8"; hash = "sha256-VhZ4jiJi17Cd5AkENXL1tjG9dV/oGj0aY67IGYd7vNs="; }) + (fetchNuGet { pname = "Microsoft.CodeAnalysis.Analyzers"; version = "3.3.4"; hash = "sha256-qDzTfZBSCvAUu9gzq2k+LOvh6/eRvJ9++VCNck/ZpnE="; }) + (fetchNuGet { pname = "Microsoft.CodeAnalysis.Common"; version = "4.8.0"; hash = "sha256-3IEinVTZq6/aajMVA8XTRO3LTIEt0PuhGyITGJLtqz4="; }) + (fetchNuGet { pname = "Microsoft.CodeAnalysis.CSharp"; version = "4.8.0"; hash = "sha256-MmOnXJvd/ezs5UPcqyGLnbZz5m+VedpRfB+kFZeeqkU="; }) + (fetchNuGet { pname = "Microsoft.CodeAnalysis.CSharp.Workspaces"; version = "4.8.0"; hash = "sha256-WNzc+6mKqzPviOI0WMdhKyrWs8u32bfGj2XwmfL7bwE="; }) + (fetchNuGet { pname = "Microsoft.CodeAnalysis.Workspaces.Common"; version = "4.8.0"; hash = "sha256-X8R4SpWVO/gpip5erVZf5jCCx8EX3VzIRtNrQiLDIoM="; }) + (fetchNuGet { pname = "Microsoft.CodeAnalysis.Workspaces.MSBuild"; version = "4.8.0"; hash = "sha256-hxpMKC6OF8OaIiSZhAgJ+Rw7M8nqS6xHdUURnRRxJmU="; }) + (fetchNuGet { pname = "Microsoft.Data.Sqlite.Core"; version = "9.0.4"; hash = "sha256-OJs5gZSKnmDabm6UehVhzYFtsgEmScyNrzbQ+ojiRoI="; }) + (fetchNuGet { pname = "Microsoft.EntityFrameworkCore"; version = "9.0.4"; hash = "sha256-zjIBv5cnhTVzG7YE+tqSI+havSCAHQdCE3Ha4JjecuQ="; }) + (fetchNuGet { pname = "Microsoft.EntityFrameworkCore.Abstractions"; version = "9.0.4"; hash = "sha256-CaGhHINjggzaZSmdP51BBM4osWKpbck/2DgoMVCR3bc="; }) + (fetchNuGet { pname = "Microsoft.EntityFrameworkCore.Analyzers"; version = "9.0.4"; hash = "sha256-Htc1qQ8dTS+tGDaT0gQVsZNtVar3p/LT54YcFkoHTLI="; }) + (fetchNuGet { pname = "Microsoft.EntityFrameworkCore.Design"; version = "9.0.4"; hash = "sha256-mwW5DH+pX0cRx+wRHoh850u2b6/SxvvhBkKjwe8wRiQ="; }) + (fetchNuGet { pname = "Microsoft.EntityFrameworkCore.Relational"; version = "9.0.4"; hash = "sha256-cZ8qUtvGgICA8F2XS9sNci14AzLC84mcGv6GibifYKc="; }) + (fetchNuGet { pname = "Microsoft.EntityFrameworkCore.Sqlite"; version = "9.0.4"; hash = "sha256-9KBVCa/lr6UX2WFrMAU+S4WD0AG51kLI6YP9GxQmZK8="; }) + (fetchNuGet { pname = "Microsoft.EntityFrameworkCore.Sqlite.Core"; version = "9.0.4"; hash = "sha256-pka9/9W+B4gVY7H7VJ3qCSaEJJW5Thqd6LAdQaIMRQ0="; }) + (fetchNuGet { pname = "Microsoft.Extensions.Caching.Abstractions"; version = "9.0.4"; hash = "sha256-/VJBbIJzRXjzQ07s4Bicb+WNV0ZAC+/naG2nLVxFvjU="; }) + (fetchNuGet { pname = "Microsoft.Extensions.Caching.Memory"; version = "9.0.4"; hash = "sha256-5uynkW+dK61Zp1+vs5uW6mwpnkZl7mH/bGSQoGjJH2c="; }) + (fetchNuGet { pname = "Microsoft.Extensions.Configuration.Abstractions"; version = "9.0.4"; hash = "sha256-5hwq73FCWAJJ8Yb1VHaaryJJhUUiVsetPTrPLlo8N9o="; }) + (fetchNuGet { pname = "Microsoft.Extensions.DependencyInjection"; version = "9.0.4"; hash = "sha256-ck7PqIL/3vodYky+d7YX218n+detOoEjZeMr1EqTFPg="; }) + (fetchNuGet { pname = "Microsoft.Extensions.DependencyInjection.Abstractions"; version = "9.0.4"; hash = "sha256-6WcGpsAYRhrpHloEom0oVP7Ff4Gh/O1XWJETJJ3LvEQ="; }) + (fetchNuGet { pname = "Microsoft.Extensions.DependencyModel"; version = "9.0.4"; hash = "sha256-ziWOK9GykM9HufwYy18FYu6AyOncLOeumi3F/4W3AVE="; }) + (fetchNuGet { pname = "Microsoft.Extensions.Logging"; version = "9.0.4"; hash = "sha256-Vj+NGOamKeuMrLNUWlVKFFkz7IKGIv6h1A5X4CK9D5E="; }) + (fetchNuGet { pname = "Microsoft.Extensions.Logging.Abstractions"; version = "9.0.4"; hash = "sha256-n0ZRhQ7U/5Kv1hVqUXGoa5gfrhzcy77yFhfonjq6VFc="; }) + (fetchNuGet { pname = "Microsoft.Extensions.Options"; version = "9.0.4"; hash = "sha256-QyjtRCG+L9eyH/UWHf/S+7/ZiSOmuGNoKGO9nlXmjxI="; }) + (fetchNuGet { pname = "Microsoft.Extensions.Primitives"; version = "9.0.4"; hash = "sha256-v/Ygyo1TMTUbnhdQSV2wzD4FOgAEWd1mpESo3kZ557g="; }) + (fetchNuGet { pname = "Mono.TextTemplating"; version = "3.0.0"; hash = "sha256-VlgGDvgNZb7MeBbIZ4DE2Nn/j2aD9k6XqNHnASUSDr0="; }) + (fetchNuGet { pname = "SQLitePCLRaw.bundle_e_sqlite3"; version = "2.1.10"; hash = "sha256-kZIWjH/TVTXRIsHPZSl7zoC4KAMBMWmgFYGLrQ15Occ="; }) + (fetchNuGet { pname = "SQLitePCLRaw.core"; version = "2.1.10"; hash = "sha256-gpZcYwiJVCVwCyJu0R6hYxyMB39VhJDmYh9LxcIVAA8="; }) + (fetchNuGet { pname = "SQLitePCLRaw.lib.e_sqlite3"; version = "2.1.10"; hash = "sha256-m2v2RQWol+1MNGZsx+G2N++T9BNtQGLLHXUjcwkdCnc="; }) + (fetchNuGet { pname = "SQLitePCLRaw.provider.e_sqlite3"; version = "2.1.10"; hash = "sha256-MLs3jiETLZ7k/TgkHynZegCWuAbgHaDQKTPB0iNv7Fg="; }) + (fetchNuGet { pname = "System.CodeDom"; version = "6.0.0"; hash = "sha256-uPetUFZyHfxjScu5x4agjk9pIhbCkt5rG4Axj25npcQ="; }) + (fetchNuGet { pname = "System.Collections.Immutable"; version = "7.0.0"; hash = "sha256-9an2wbxue2qrtugYES9awshQg+KfJqajhnhs45kQIdk="; }) + (fetchNuGet { pname = "System.Composition"; version = "7.0.0"; hash = "sha256-YjhxuzuVdAzRBHNQy9y/1ES+ll3QtLcd2o+o8wIyMao="; }) + (fetchNuGet { pname = "System.Composition.AttributedModel"; version = "7.0.0"; hash = "sha256-3s52Dyk2J66v/B4LLYFBMyXl0I8DFDshjE+sMjW4ubM="; }) + (fetchNuGet { pname = "System.Composition.Convention"; version = "7.0.0"; hash = "sha256-N4MkkBXSQkcFKsEdcSe6zmyFyMmFOHmI2BNo3wWxftk="; }) + (fetchNuGet { pname = "System.Composition.Hosting"; version = "7.0.0"; hash = "sha256-7liQGMaVKNZU1iWTIXvqf0SG8zPobRoLsW7q916XC3M="; }) + (fetchNuGet { pname = "System.Composition.Runtime"; version = "7.0.0"; hash = "sha256-Oo1BxSGLETmdNcYvnkGdgm7JYAnQmv1jY0gL0j++Pd0="; }) + (fetchNuGet { pname = "System.Composition.TypedParts"; version = "7.0.0"; hash = "sha256-6ZzNdk35qQG3ttiAi4OXrihla7LVP+y2fL3bx40/32s="; }) + (fetchNuGet { pname = "System.IO.Pipelines"; version = "7.0.0"; hash = "sha256-W2181khfJUTxLqhuAVRhCa52xZ3+ePGOLIPwEN8WisY="; }) + (fetchNuGet { pname = "System.Memory"; version = "4.5.3"; hash = "sha256-Cvl7RbRbRu9qKzeRBWjavUkseT2jhZBUWV1SPipUWFk="; }) + (fetchNuGet { pname = "System.Reflection.Metadata"; version = "7.0.0"; hash = "sha256-GwAKQhkhPBYTqmRdG9c9taqrKSKDwyUgOEhWLKxWNPI="; }) + (fetchNuGet { pname = "System.Runtime.CompilerServices.Unsafe"; version = "6.0.0"; hash = "sha256-bEG1PnDp7uKYz/OgLOWs3RWwQSVYm+AnPwVmAmcgp2I="; }) + (fetchNuGet { pname = "System.Text.Json"; version = "9.0.4"; hash = "sha256-oIOqfOIIUXXVkfFiTCI9wwIJBETQqF7ZcOJv2iYuq1s="; }) + (fetchNuGet { pname = "System.Threading.Channels"; version = "7.0.0"; hash = "sha256-Cu0gjQsLIR8Yvh0B4cOPJSYVq10a+3F9pVz/C43CNeM="; }) +] diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..c68aab2 --- /dev/null +++ b/flake.lock @@ -0,0 +1,61 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1745391562, + "narHash": "sha256-sPwcCYuiEopaafePqlG826tBhctuJsLx/mhKKM5Fmjo=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "8a2f738d9d1f1d986b5a4cd2fd2061a7127237d7", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..1ef2fb6 --- /dev/null +++ b/flake.nix @@ -0,0 +1,29 @@ +{ + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + flake-utils.url = "github:numtide/flake-utils"; + }; + outputs = { self, flake-utils, nixpkgs }: + flake-utils.lib.eachDefaultSystem (system: + let pkgs = nixpkgs.legacyPackages.${system}; + in { + packages = { + # Build the backend using 'nix build --extra-experimental-features nix-command --extra-experimental-features flakes .#server' + server = pkgs.buildDotnetModule rec { + pname = "VPNAuth.Server"; + version = "0.0.1"; + src = ./.; + projectFile = "VPNAuth.Server/VPNAuth.Server.csproj"; + dotnet-sdk = pkgs.dotnetCorePackages.sdk_9_0; + dotnet-runtime = pkgs.dotnetCorePackages.dotnet_9.aspnetcore; + + # To create or update the deps.nix file run the following steps from the project root: + # 1. Create a nix-shell using 'nix-shell -p nuget-to-nix dotnetCorePackages.sdk_9_0' + # 2. Run 'rm -rf out/' inside the nix-shell + # 3. Run 'dotnet restore VPNAuth.Server --packages out' inside the nix-shell + # 4. Run 'nuget-to-nix out > deps.nix' inside the nix-shell + nugetDeps = ./deps.nix; + }; + }; + }); +} |