From 94e095d62c3b54ac52f1b23d6d5e9d34459e7ef4 Mon Sep 17 00:00:00 2001 From: Ross Light Date: Fri, 24 Feb 2023 19:16:46 -0800 Subject: [PATCH] .devcontainer.json: add Codespaces configuration --- .devcontainer.json | 3 +++ shell.nix | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 .devcontainer.json create mode 100644 shell.nix diff --git a/.devcontainer.json b/.devcontainer.json new file mode 100644 index 0000000..6fdce8a --- /dev/null +++ b/.devcontainer.json @@ -0,0 +1,3 @@ +{ + "image": "ghcr.io/zombiezen/codespaces-nix" +} diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..3af6118 --- /dev/null +++ b/shell.nix @@ -0,0 +1,40 @@ +{ pkgs ? import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/7d0ed7f2e5aea07ab22ccb338d27fbe347ed2f11.tar.gz") {} +, gitVersion ? "latest" +}: + +let + defaultArgs = { + guiSupport = false; + sendEmailSupport = false; + svnSupport = false; + perlLibs = [pkgs.perlPackages.LWP pkgs.perlPackages.URI pkgs.perlPackages.TermReadKey]; + smtpPerlLibs = []; + }; + callPast = commit: relPath: args: pkgs.callPackage + ((fetchTarball "https://github.com/NixOS/nixpkgs/archive/${commit}.tar.gz") + "/" + relPath) + (defaultArgs // args); + + gits = { + "2.17.1" = callPast + "9db1f486e15107e417b63119ad5e1917ee126599" + "pkgs/applications/version-management/git-and-tools/git" + { + stdenv = pkgs.stdenv // { inherit (pkgs) lib; }; + python = pkgs.python3; + }; + "2.25.1" = callPast + "b2a903a3e7ac9c038ed5f6a3ee744496622e0b65" + "pkgs/applications/version-management/git-and-tools/git" + { + stdenv = pkgs.stdenv // { inherit (pkgs) lib; }; + }; + latest = pkgs.git; + }; +in + +pkgs.mkShell { + packages = [ + pkgs.go_1_20 + (builtins.getAttr gitVersion gits) + ]; +}