diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5790a7d --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +result +*/bin +*/obj diff --git a/console/Program.cs b/console/Program.cs new file mode 100644 index 0000000..3751555 --- /dev/null +++ b/console/Program.cs @@ -0,0 +1,2 @@ +// See https://aka.ms/new-console-template for more information +Console.WriteLine("Hello, World!"); diff --git a/console/console.csproj b/console/console.csproj new file mode 100644 index 0000000..fd4bd08 --- /dev/null +++ b/console/console.csproj @@ -0,0 +1,10 @@ + + + + Exe + net9.0 + enable + enable + + + diff --git a/dotnet-nix-testing.sln b/dotnet-nix-testing.sln new file mode 100644 index 0000000..788b265 --- /dev/null +++ b/dotnet-nix-testing.sln @@ -0,0 +1,34 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.0.31903.59 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "console", "console\console.csproj", "{DA7E69E4-09C2-45F5-9D98-D477D3B5B6FD}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {DA7E69E4-09C2-45F5-9D98-D477D3B5B6FD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {DA7E69E4-09C2-45F5-9D98-D477D3B5B6FD}.Debug|Any CPU.Build.0 = Debug|Any CPU + {DA7E69E4-09C2-45F5-9D98-D477D3B5B6FD}.Debug|x64.ActiveCfg = Debug|Any CPU + {DA7E69E4-09C2-45F5-9D98-D477D3B5B6FD}.Debug|x64.Build.0 = Debug|Any CPU + {DA7E69E4-09C2-45F5-9D98-D477D3B5B6FD}.Debug|x86.ActiveCfg = Debug|Any CPU + {DA7E69E4-09C2-45F5-9D98-D477D3B5B6FD}.Debug|x86.Build.0 = Debug|Any CPU + {DA7E69E4-09C2-45F5-9D98-D477D3B5B6FD}.Release|Any CPU.ActiveCfg = Release|Any CPU + {DA7E69E4-09C2-45F5-9D98-D477D3B5B6FD}.Release|Any CPU.Build.0 = Release|Any CPU + {DA7E69E4-09C2-45F5-9D98-D477D3B5B6FD}.Release|x64.ActiveCfg = Release|Any CPU + {DA7E69E4-09C2-45F5-9D98-D477D3B5B6FD}.Release|x64.Build.0 = Release|Any CPU + {DA7E69E4-09C2-45F5-9D98-D477D3B5B6FD}.Release|x86.ActiveCfg = Release|Any CPU + {DA7E69E4-09C2-45F5-9D98-D477D3B5B6FD}.Release|x86.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/flake.nix b/flake.nix index 1c40347..38f912e 100644 --- a/flake.nix +++ b/flake.nix @@ -23,13 +23,40 @@ pkgs, system, ... - }: { + }: rec { # Per-system attributes can be defined here. The self' and inputs' # module parameters provide easy access to attributes of the same # system. - # Equivalent to inputs'.nixpkgs.legacyPackages.hello; - packages.default = pkgs.hello; + packages.default = packages.console; + + packages.console = with pkgs; + buildDotnetModule { + pname = "dotnet-nix-testing"; + version = "0.1"; + + src = ./.; + + projectFile = "dotnet-nix-testing.sln"; + # nugetDeps = ./deps.json; # see "Generating and updating NuGet dependencies" section for details + + # buildInputs = [ + # referencedProject + # ]; # `referencedProject` must contain `nupkg` in the folder structure. + + dotnet-sdk = dotnetCorePackages.sdk_9_0; + dotnet-runtime = dotnetCorePackages.runtime_9_0; + + executables = ["console"]; # This wraps "$out/lib/$pname/foo" to `$out/bin/foo`. + # executables = []; # Don't install any executables. + + # packNupkg = true; # This packs the project as "foo-0.1.nupkg" at `$out/share`. + + # runtimeDeps = [ffmpeg]; # This will wrap ffmpeg's library path into `LD_LIBRARY_PATH`. + + meta.mainProgram = "console"; + }; + devShells.default = with pkgs; mkShell { @@ -38,7 +65,6 @@ ( with dotnetCorePackages; combinePackages [ - sdk_8_0 sdk_9_0 ] )