diff options
Diffstat (limited to 'flake.nix')
-rw-r--r-- | flake.nix | 29 |
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; + }; + }; + }); +} |