From 4a93a8af94f5ab42426d91299014d92c6fe872a8 Mon Sep 17 00:00:00 2001 From: Yuval Kogman Date: Thu, 25 May 2023 22:19:25 +0300 Subject: [PATCH] Add unix shell script environment Only contains shellcheck, couldn't find other projects like explainshell or bash-language-server in nixpkgs --- README.md | 6 +++++ flake.nix | 5 ++++ shell/.envrc | 1 + shell/flake.lock | 61 ++++++++++++++++++++++++++++++++++++++++++++++++ shell/flake.nix | 26 +++++++++++++++++++++ 5 files changed, 99 insertions(+) create mode 100644 shell/.envrc create mode 100644 shell/flake.lock create mode 100644 shell/flake.nix diff --git a/README.md b/README.md index eb7c07d..6d58083 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,7 @@ Once your preferred template has been initialized, you can use the provided shel | [Ruby] | [`ruby`](./ruby/) | | [Rust] | [`rust`](./rust/) | | [Scala] | [`scala`](./scala/) | +| [Shell] | [`shell`](./shell/) | | [Zig] | [`zig`](./zig/) | ## Template contents @@ -220,6 +221,10 @@ The sections below list what each template includes. In all cases, you're free t - [Scala] 3.1.0 ([Java] 17.0.3) - [sbt] 1.7.1 +### [`shell`](./shell/) + +- [shellcheck] + ### [`zig`](./zig/) - [Zig] 0.9.1 @@ -313,6 +318,7 @@ All of the templates have only the root [flake](./flake.nix) as a flake input. T [rust]: https://rust-lang.org [rust-analyzer]: https://rust-analyzer.github.io [scala]: https://scala-lang.org +[shellcheck]: https://www.shellcheck.net/ [statix]: https://github.com/nerdypepper/statix [sbt]: https://www.scala-sbt.org [spago]: https://github.com/purescript/spago diff --git a/flake.nix b/flake.nix index 51cd3b9..bb768e8 100644 --- a/flake.nix +++ b/flake.nix @@ -130,6 +130,11 @@ description = "Scala development environment"; }; + shell = { + path = ./shell; + description = "Shell script development environment"; + }; + zig = { path = ./zig; description = "Zig development environment"; diff --git a/shell/.envrc b/shell/.envrc new file mode 100644 index 0000000..a5dbbcb --- /dev/null +++ b/shell/.envrc @@ -0,0 +1 @@ +use flake . diff --git a/shell/flake.lock b/shell/flake.lock new file mode 100644 index 0000000..10767eb --- /dev/null +++ b/shell/flake.lock @@ -0,0 +1,61 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1681202837, + "narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "cfacdce06f30d2b68473a46042957675eebb3401", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1685014919, + "narHash": "sha256-2hsL8OrGYmu68UHWVZbyN/ZyuJuESbvJF6ZqHVHUdXE=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "ea60cf854a9216d3276134ff2df67952766b4198", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "release-22.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/shell/flake.nix b/shell/flake.nix new file mode 100644 index 0000000..28da064 --- /dev/null +++ b/shell/flake.nix @@ -0,0 +1,26 @@ +{ + description = "A Nix-flake-based LaTeX 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; [ + shellcheck + ]; + }; + }); +}