From f5c10e7bdeae95daf2f5d1d9a1a852feec821ee4 Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Thu, 24 Mar 2022 13:52:24 -0400 Subject: [PATCH] Codium build almost works --- flake-compat.nix | 9 +++++++++ flake.lock | 17 ++++++++++++++++ flake.nix | 52 ++++++++++++++++++++++++++---------------------- 3 files changed, 54 insertions(+), 24 deletions(-) create mode 100644 flake-compat.nix diff --git a/flake-compat.nix b/flake-compat.nix new file mode 100644 index 00000000..dab420bb --- /dev/null +++ b/flake-compat.nix @@ -0,0 +1,9 @@ +let + lock = builtins.fromJSON (builtins.readFile ./flake.lock); + inherit (lock.nodes.flake-compat.locked) owner repo rev narHash; + flake-compat = builtins.fetchTarball { + url = "https://github.com/${owner}/${repo}/archive/${rev}.tar.gz"; + sha256 = narHash; + }; +in +import flake-compat { src = ./.; } diff --git a/flake.lock b/flake.lock index 6248e100..ee618311 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,21 @@ { "nodes": { + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1641205782, + "narHash": "sha256-4jY7RCWUoZ9cKD8co0/4tFARpWB+57+r1bLLvXNJliY=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "b7547d3eed6f32d06102ead8991ec52ab0a4f1a7", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1647893727, @@ -18,6 +34,7 @@ }, "root": { "inputs": { + "flake-compat": "flake-compat", "nixpkgs": "nixpkgs" } } diff --git a/flake.nix b/flake.nix index a3005bf6..155482eb 100644 --- a/flake.nix +++ b/flake.nix @@ -3,11 +3,16 @@ inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + flake-compat = { + url = "github:edolstra/flake-compat"; + flake = false; + }; }; outputs = { self , nixpkgs + , flake-compat }: let # Generate a user-friendly version number. @@ -32,37 +37,36 @@ pkgs = nixpkgsFor."${system}"; in { - # In case we don't want to provide an editor, this defaultShell will - # provide only coq packages we need. + # In case we don't want to provide an editor, this defaultShell will provide only coq packages we need. defaultShell = pkgs.mkShell { buildInputs = with pkgs; [ yarn - ]; - }; - # This is the defaultShell, but overriden to add one additional buildInput, - # vscodium! - vscodium = self.devShells.${system}.defaultShell.overrideAttrs (old: { - buildInputs = - let - vscodeWithRescript = pkgs.vscode-with-extensions.override { + (pkgs.vscode-with-extensions.override { vscode = pkgs.vscodium; vscodeExtensions = pkgs.vscode-utils.extensionsFromVscodeMarketplace [ +# { +# name = "rescript-vscode"; +# publisher = "rescript-lang"; +# version = "1.2.1"; +# # sha256 = "sha256-b0gCaEzt5yAj53oLFZSXSD3bum9J1fYes/uf9+OlUek="; +# } { - name = "rescript-vscode"; - publisher = "rescript-lang"; - version = "1.2.1"; - sha256 = "sha256-b0gCaEzt5yAj53oLFZSXSD3bum9J1fYes/uf9+OlUek="; + name = "vim"; + publisher = "vscodevim"; + version = "1.22.2"; + sha256 = "sha256-dtIlgODzRdoMKnG9050ZcCX3w15A/R3FaMc+ZylvBbU="; + } + { + name = "vscode-typescript-next"; + publisher = "ms-vscode"; + version = "4.7.20220323"; + sha256 = "sha256-mjiBCyg5As/XAU9I5k6jEZWGJA3P6P5o1roe2bS7aUI="; } ]; - }; - in - old.buildInputs - ++ [ - vscodeWithRescript - ]; - }); - defaultPackage.${system} = self.packages.${system}.yarn; - }); - defaultPackage.x86_64-linux = self.devShells.defaultPackage.x86_64-linux; + }) + ]; + }; + } + ); }; }