aboutsummaryrefslogtreecommitdiff
path: root/flake.nix
diff options
context:
space:
mode:
authorTim <contact@bytim.eu>2025-04-24 14:42:26 +0200
committerTim <contact@bytim.eu>2025-04-24 14:42:26 +0200
commitb67e236302332eb9cd6c8e32e5dca5bc33ffbe5d (patch)
treeeb609ef361ec830c7e0f073d3cea01752596cc7f /flake.nix
parent0fb8b2f7af9538bd45a9a7e41e64a6610b898fb0 (diff)
downloadVPNAuth-b67e236302332eb9cd6c8e32e5dca5bc33ffbe5d.tar.xz
VPNAuth-b67e236302332eb9cd6c8e32e5dca5bc33ffbe5d.zip
Add nix support
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix29
1 files changed, 29 insertions, 0 deletions
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;
+ };
+ };
+ });
+}