Codium build almost works

This commit is contained in:
Quinn Dougherty 2022-03-24 13:52:24 -04:00
parent 64e8a3c62f
commit f5c10e7bde
3 changed files with 54 additions and 24 deletions

9
flake-compat.nix Normal file
View File

@ -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 = ./.; }

View File

@ -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"
}
}

View File

@ -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;
})
];
};
}
);
};
}