From e7a85b6881fdad9c092fcc9f1b0ce5615f668acd Mon Sep 17 00:00:00 2001 From: Yuval Kogman Date: Thu, 25 May 2023 22:23:06 +0300 Subject: [PATCH] Add C# development environment --- README.md | 13 +++++++++++++ csharp/.envrc | 1 + csharp/flake.lock | 43 +++++++++++++++++++++++++++++++++++++++++++ csharp/flake.nix | 31 +++++++++++++++++++++++++++++++ flake.nix | 5 +++++ 5 files changed, 93 insertions(+) create mode 100644 csharp/.envrc create mode 100644 csharp/flake.lock create mode 100644 csharp/flake.nix diff --git a/README.md b/README.md index eb7c07d..dfab59c 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,7 @@ Once your preferred template has been initialized, you can use the provided shel | Language/framework/tool | Template | | :----------------------- | :-----------------------------| | [Clojure] | [`clojure`](./clojure/) | +| [C#][csharp] | [`csharp`](./csharp/) | | [Cue] | [`cue`](./cue/) | | [Dhall] | [`dhall`](./dhall/) | | [Elixir] | [`elixir`](./elixir/) | @@ -65,6 +66,13 @@ The sections below list what each template includes. In all cases, you're free t - [Boot] 2.8.3 - [Leiningen] 2.9.8 +### [`csharp`](./csharp/) + +- [dotnet] sdk 7 +- [omnisharp-roslyn] +- [mono] +- [msbuild] + ### [`cue`](./cue/) - [Cue] 0.4.3 @@ -241,6 +249,7 @@ All of the templates have only the root [flake](./flake.nix) as a flake input. T [composer]: https://getcomposer.org/ [conftest]: https://www.conftest.dev [cross]: https://github.com/cross-rs/cross +[csharp]: https://dotnet.microsoft.com/en-us/languages/csharp [cue]: https://cuelang.org [damon]: https://github.com/hashicorp/damon [dhall]: https://dhall-lang.org @@ -256,6 +265,7 @@ All of the templates have only the root [flake](./flake.nix) as a flake input. T [dhall-to-nix]: https://github.com/dhall-lang/dhall-haskell/tree/master/dhall-nix [dhall-toml]: https://github.com/dhall-lang/dhall-haskell/tree/master/dhall-toml [dhall-yaml]: https://github.com/dhall-lang/dhall-haskell/tree/master/dhall-yaml +[dotnet]: https://dotnet.microsoft.com/en-us/ [dune]: https://dune.build [elixir]: https://elixir-lang.org [elm]: https://elm-lang.org @@ -279,6 +289,8 @@ All of the templates have only the root [flake](./flake.nix) as a flake input. T [mach-nix]: https://github.com/DavHau/mach-nix [maven]: https://maven.apache.org [mix]: https://elixir-lang.org/getting-started/mix-otp/introduction-to-mix.html +[mono]: https://www.mono-project.com/ +[msbuild]: https://github.com/dotnet/msbuild [nickel]: https://nickel-lang.org [nim]: https://nim-lang.org [nimble]: https://github.com/nim-lang/nimble @@ -297,6 +309,7 @@ All of the templates have only the root [flake](./flake.nix) as a flake input. T [ocaml]: https://ocaml.org [ocamlformat]: https://github.com/ocaml-ppx/ocamlformat [odoc]: https://github.com/ocaml/odoc +[omnisharp-roslyn]: https://github.com/OmniSharp/omnisharp-roslyn [opa]: https://openpolicyagent.org [packer]: https://packer.io [pip]: https://pypi.org/project/pip diff --git a/csharp/.envrc b/csharp/.envrc new file mode 100644 index 0000000..a5dbbcb --- /dev/null +++ b/csharp/.envrc @@ -0,0 +1 @@ +use flake . diff --git a/csharp/flake.lock b/csharp/flake.lock new file mode 100644 index 0000000..ecac920 --- /dev/null +++ b/csharp/flake.lock @@ -0,0 +1,43 @@ +{ + "nodes": { + "flake-utils": { + "locked": { + "lastModified": 1678901627, + "narHash": "sha256-U02riOqrKKzwjsxc/400XnElV+UtPUQWpANPlyazjH0=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "93a2b84fc4b70d9e089d029deacc3583435c2ed6", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1679163677, + "narHash": "sha256-VC0tc3EjJZFPXgucFQAYMIHce5nJWYR0kVCk4TVg6gg=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "c3912035d00ef755ab19394488b41feab95d2e40", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "release-22.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/csharp/flake.nix b/csharp/flake.nix new file mode 100644 index 0000000..089897e --- /dev/null +++ b/csharp/flake.nix @@ -0,0 +1,31 @@ +{ + description = "A Nix-flake-based C# development environment"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/release-22.11"; + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = + { self + , nixpkgs + , flake-utils + }: + + flake-utils.lib.eachDefaultSystem (system: + let + pkgs = import nixpkgs { inherit system; }; + in + { + devShells.default = pkgs.mkShell { + packages = with pkgs; [ + #dotnet-sdk_6 + dotnet-sdk_7 + #dotnet-sdk_8 + omnisharp-roslyn + mono + msbuild + ]; + }; + }); +} diff --git a/flake.nix b/flake.nix index 51cd3b9..9a247bf 100644 --- a/flake.nix +++ b/flake.nix @@ -15,6 +15,11 @@ description = "Clojure development environment"; }; + csharp = { + path = ./csharp; + description = "C# development environment"; + }; + cue = { path = ./cue; description = "Cue development environment";