feat: add dotnet
This commit is contained in:
parent
1c8f6a7606
commit
9b3f73848c
12 changed files with 308 additions and 0 deletions
10
templates/dotnet/DotnetApplication/DotnetApplication.csproj
Normal file
10
templates/dotnet/DotnetApplication/DotnetApplication.csproj
Normal file
|
@ -0,0 +1,10 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net9.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
9
templates/dotnet/DotnetApplication/Program.cs
Normal file
9
templates/dotnet/DotnetApplication/Program.cs
Normal file
|
@ -0,0 +1,9 @@
|
|||
using System;
|
||||
|
||||
namespace DotnetApplication {
|
||||
class Program {
|
||||
static void Main(string[] args) {
|
||||
Console.WriteLine("Hello, world!");
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,68 @@
|
|||
{
|
||||
"format": 1,
|
||||
"restore": {
|
||||
"/home/artur/Projects/C#/JSchlattVideoGame/JSchlattVideoGame.csproj": {}
|
||||
},
|
||||
"projects": {
|
||||
"/home/artur/Projects/C#/JSchlattVideoGame/JSchlattVideoGame.csproj": {
|
||||
"version": "1.0.0",
|
||||
"restore": {
|
||||
"projectUniqueName": "/home/artur/Projects/C#/JSchlattVideoGame/JSchlattVideoGame.csproj",
|
||||
"projectName": "JSchlattVideoGame",
|
||||
"projectPath": "/home/artur/Projects/C#/JSchlattVideoGame/JSchlattVideoGame.csproj",
|
||||
"packagesPath": "/home/artur/.nuget/packages/",
|
||||
"outputPath": "/home/artur/Projects/C#/JSchlattVideoGame/obj/",
|
||||
"projectStyle": "PackageReference",
|
||||
"configFilePaths": [
|
||||
"/home/artur/.nuget/NuGet/NuGet.Config"
|
||||
],
|
||||
"originalTargetFrameworks": [
|
||||
"net9.0"
|
||||
],
|
||||
"sources": {
|
||||
"/nix/store/0w5k79zvjzingpnzz07ijqjbgsylcgfa-dotnet-sdk-9.0.100/share/dotnet/library-packs": {},
|
||||
"https://api.nuget.org/v3/index.json": {}
|
||||
},
|
||||
"frameworks": {
|
||||
"net9.0": {
|
||||
"targetAlias": "net9.0",
|
||||
"projectReferences": {}
|
||||
}
|
||||
},
|
||||
"warningProperties": {
|
||||
"warnAsError": [
|
||||
"NU1605"
|
||||
]
|
||||
},
|
||||
"restoreAuditProperties": {
|
||||
"enableAudit": "true",
|
||||
"auditLevel": "low",
|
||||
"auditMode": "all"
|
||||
},
|
||||
"SdkAnalysisLevel": "9.0.100"
|
||||
},
|
||||
"frameworks": {
|
||||
"net9.0": {
|
||||
"targetAlias": "net9.0",
|
||||
"imports": [
|
||||
"net461",
|
||||
"net462",
|
||||
"net47",
|
||||
"net471",
|
||||
"net472",
|
||||
"net48",
|
||||
"net481"
|
||||
],
|
||||
"assetTargetFallback": true,
|
||||
"warn": true,
|
||||
"frameworkReferences": {
|
||||
"Microsoft.NETCore.App": {
|
||||
"privateAssets": "all"
|
||||
}
|
||||
},
|
||||
"runtimeIdentifierGraphPath": "/nix/store/0w5k79zvjzingpnzz07ijqjbgsylcgfa-dotnet-sdk-9.0.100/share/dotnet/sdk/9.0.100/PortableRuntimeIdentifierGraph.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
||||
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
|
||||
<RestoreSuccess Condition=" '$(RestoreSuccess)' == '' ">True</RestoreSuccess>
|
||||
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
|
||||
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile>
|
||||
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">/home/artur/.nuget/packages/</NuGetPackageRoot>
|
||||
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">/home/artur/.nuget/packages/</NuGetPackageFolders>
|
||||
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
|
||||
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">6.12.0</NuGetToolVersion>
|
||||
</PropertyGroup>
|
||||
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
|
||||
<SourceRoot Include="/home/artur/.nuget/packages/" />
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -0,0 +1,2 @@
|
|||
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
||||
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" />
|
73
templates/dotnet/DotnetApplication/obj/project.assets.json
Normal file
73
templates/dotnet/DotnetApplication/obj/project.assets.json
Normal file
|
@ -0,0 +1,73 @@
|
|||
{
|
||||
"version": 3,
|
||||
"targets": {
|
||||
"net9.0": {}
|
||||
},
|
||||
"libraries": {},
|
||||
"projectFileDependencyGroups": {
|
||||
"net9.0": []
|
||||
},
|
||||
"packageFolders": {
|
||||
"/home/artur/.nuget/packages/": {}
|
||||
},
|
||||
"project": {
|
||||
"version": "1.0.0",
|
||||
"restore": {
|
||||
"projectUniqueName": "/home/artur/Projects/C#/JSchlattVideoGame/JSchlattVideoGame.csproj",
|
||||
"projectName": "JSchlattVideoGame",
|
||||
"projectPath": "/home/artur/Projects/C#/JSchlattVideoGame/JSchlattVideoGame.csproj",
|
||||
"packagesPath": "/home/artur/.nuget/packages/",
|
||||
"outputPath": "/home/artur/Projects/C#/JSchlattVideoGame/obj/",
|
||||
"projectStyle": "PackageReference",
|
||||
"configFilePaths": [
|
||||
"/home/artur/.nuget/NuGet/NuGet.Config"
|
||||
],
|
||||
"originalTargetFrameworks": [
|
||||
"net9.0"
|
||||
],
|
||||
"sources": {
|
||||
"/nix/store/0w5k79zvjzingpnzz07ijqjbgsylcgfa-dotnet-sdk-9.0.100/share/dotnet/library-packs": {},
|
||||
"https://api.nuget.org/v3/index.json": {}
|
||||
},
|
||||
"frameworks": {
|
||||
"net9.0": {
|
||||
"targetAlias": "net9.0",
|
||||
"projectReferences": {}
|
||||
}
|
||||
},
|
||||
"warningProperties": {
|
||||
"warnAsError": [
|
||||
"NU1605"
|
||||
]
|
||||
},
|
||||
"restoreAuditProperties": {
|
||||
"enableAudit": "true",
|
||||
"auditLevel": "low",
|
||||
"auditMode": "all"
|
||||
},
|
||||
"SdkAnalysisLevel": "9.0.100"
|
||||
},
|
||||
"frameworks": {
|
||||
"net9.0": {
|
||||
"targetAlias": "net9.0",
|
||||
"imports": [
|
||||
"net461",
|
||||
"net462",
|
||||
"net47",
|
||||
"net471",
|
||||
"net472",
|
||||
"net48",
|
||||
"net481"
|
||||
],
|
||||
"assetTargetFallback": true,
|
||||
"warn": true,
|
||||
"frameworkReferences": {
|
||||
"Microsoft.NETCore.App": {
|
||||
"privateAssets": "all"
|
||||
}
|
||||
},
|
||||
"runtimeIdentifierGraphPath": "/nix/store/0w5k79zvjzingpnzz07ijqjbgsylcgfa-dotnet-sdk-9.0.100/share/dotnet/sdk/9.0.100/PortableRuntimeIdentifierGraph.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"version": 2,
|
||||
"dgSpecHash": "1YIpH04Ngl4=",
|
||||
"success": true,
|
||||
"projectFilePath": "/home/artur/Projects/C#/JSchlattVideoGame/JSchlattVideoGame.csproj",
|
||||
"expectedPackageFiles": [],
|
||||
"logs": []
|
||||
}
|
58
templates/dotnet/flake.lock
generated
Normal file
58
templates/dotnet/flake.lock
generated
Normal file
|
@ -0,0 +1,58 @@
|
|||
{
|
||||
"nodes": {
|
||||
"flake-parts": {
|
||||
"inputs": {
|
||||
"nixpkgs-lib": "nixpkgs-lib"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1733312601,
|
||||
"narHash": "sha256-4pDvzqnegAfRkPwO3wmwBhVi/Sye1mzps0zHWYnP88c=",
|
||||
"owner": "hercules-ci",
|
||||
"repo": "flake-parts",
|
||||
"rev": "205b12d8b7cd4802fbcb8e8ef6a0f1408781a4f9",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "hercules-ci",
|
||||
"repo": "flake-parts",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1733212471,
|
||||
"narHash": "sha256-M1+uCoV5igihRfcUKrr1riygbe73/dzNnzPsmaLCmpo=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "55d15ad12a74eb7d4646254e13638ad0c4128776",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nixos",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs-lib": {
|
||||
"locked": {
|
||||
"lastModified": 1733096140,
|
||||
"narHash": "sha256-1qRH7uAUsyQI7R1Uwl4T+XvdNv778H0Nb5njNrqvylY=",
|
||||
"type": "tarball",
|
||||
"url": "https://github.com/NixOS/nixpkgs/archive/5487e69da40cbd611ab2cadee0b4637225f7cfae.tar.gz"
|
||||
},
|
||||
"original": {
|
||||
"type": "tarball",
|
||||
"url": "https://github.com/NixOS/nixpkgs/archive/5487e69da40cbd611ab2cadee0b4637225f7cfae.tar.gz"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"flake-parts": "flake-parts",
|
||||
"nixpkgs": "nixpkgs"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
42
templates/dotnet/flake.nix
Normal file
42
templates/dotnet/flake.nix
Normal file
|
@ -0,0 +1,42 @@
|
|||
{
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||
flake-parts.url = "github:hercules-ci/flake-parts";
|
||||
};
|
||||
|
||||
outputs = inputs @ {
|
||||
self,
|
||||
nixpkgs,
|
||||
...
|
||||
}:
|
||||
inputs.flake-parts.lib.mkFlake {inherit inputs;} {
|
||||
systems = ["x86_64-linux"];
|
||||
flake.overlays.default = final: prev: {
|
||||
dotnet-application = final.callPackage ./nix/derivation.nix {};
|
||||
};
|
||||
perSystem = {
|
||||
pkgs,
|
||||
system,
|
||||
self',
|
||||
...
|
||||
}: {
|
||||
_module.args.pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
overlays = [
|
||||
self.overlays.default
|
||||
];
|
||||
};
|
||||
|
||||
packages = {
|
||||
inherit (pkgs) dotnet-application;
|
||||
default = self'.packages.dotnet-application;
|
||||
};
|
||||
|
||||
devShells.default = pkgs.mkShell {
|
||||
packages = [
|
||||
pkgs.dotnetCorePackages.dotnet_9.sdk
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
13
templates/dotnet/nix/derivation.nix
Normal file
13
templates/dotnet/nix/derivation.nix
Normal file
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
buildDotnetModule,
|
||||
dotnetCorePackages,
|
||||
}:
|
||||
buildDotnetModule {
|
||||
pname = "DotnetApplication";
|
||||
version = "0.1.0";
|
||||
src = ../.;
|
||||
projectFile = "DotnetApplication/DotnetApplication.csproj";
|
||||
dotnet-sdk = dotnetCorePackages.dotnet_9.sdk;
|
||||
dotnet-runtime = dotnetCorePackages.dotnet_9.runtime;
|
||||
executables = ["DotnetApplication"];
|
||||
}
|
9
templates/dotnet/nix/shell.nix
Normal file
9
templates/dotnet/nix/shell.nix
Normal file
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
mkShell,
|
||||
dotnetCorePackages,
|
||||
}:
|
||||
mkShell {
|
||||
packages = [
|
||||
dotnetCorePackages.dotnet_9.sdk
|
||||
];
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue