Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 36 additions & 18 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

72 changes: 55 additions & 17 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# SPDX-License-Identifier: Apache-2.0
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11";
flake-utils.url = "github:numtide/flake-utils";
rust-overlay = {
url = "github:oxalica/rust-overlay";
Expand All @@ -17,9 +17,13 @@
url = "github:QBayLogic/mdbook-drawio";
inputs.nixpkgs.follows = "nixpkgs";
};
hls-source = {
url = "github:haskell/haskell-language-server?ref=2.13.0.0";
flake = false;
};
};

outputs = { self, nixpkgs, flake-utils, rust-overlay, pre-commit-hooks, mdbook-drawio-flake }: flake-utils.lib.eachDefaultSystem (
outputs = { self, nixpkgs, flake-utils, rust-overlay, pre-commit-hooks, mdbook-drawio-flake, hls-source }: flake-utils.lib.eachDefaultSystem (
system:
let
verilog-ethernet = import ./nix/verilog-ethernet.nix {
Expand All @@ -32,17 +36,48 @@
inherit pkgs;
};

hls-overlay = final: prev: {
haskell-language-server =
(prev.haskell-language-server.override { supportedGhcVersions = [ "910" ]; })
.overrideDerivation (old: {
src = pkgs.fetchFromGitHub {
owner = "haskell";
repo = "haskell-language-server";
rev = "88ccebe0649f7c41be97d49a986bbfd4185982f6";
sha256 = "sha256-hR4MtfespgqAEa/vWXNsIOcEcLQNIVaEAHqZJbTaV/g=";
};
});
# What GHC version HLS should support
hlsGhcVersion = "910";
# What the HLS version should be
# NOTE: this does not *SET* the version! It merely 'pretends' to be the version set by this value
# To update the actual HLS version, run: `nix flake update hls-source`
# If weird HLS dependency issues accur, this is the variable you should most likely update
hlsVersion = "2.13.0.0";

hls-overlay = final: prev: let
setSource = pkg: src-path: (prev.haskell.lib.compose.overrideCabal (drv: {
version = hlsVersion;
src = hls-source // {
outPath = "${hls-source.outPath}/${src-path}";
};
# Disable HLS tests for faster compilation :)
doCheck = false;
}) pkg);

setSourceDirect = pkg: prev.haskell.lib.compose.overrideCabal (drv: {
version = hlsVersion;
src = hls-source;
}) pkg;

addEditDistance = pkg: pkg.overrideAttrs (drv: {
# edit-distance doesn't get automatically added to the dependencies list for some reason
# This manually adds it to the dependencies
propagatedBuildInputs = drv.propagatedBuildInputs ++ [ prev.haskell.packages."ghc${hlsGhcVersion}".edit-distance ];
});

# Make the new package set containing the up-to-date versions of HLS and it's in-repository plugins
latestHLSPackages = prev.haskell.packages."ghc${hlsGhcVersion}".extend (_: p: {
ghcide = setSource p.ghcide "ghcide";
hls-graph = addEditDistance (setSource p.hls-graph "hls-graph");
hls-test-utils = setSource p.hls-test-utils "hls-test-utils";
hls-plugin-api = setSource p.hls-plugin-api "hls-plugin-api";
haskell-language-server = setSourceDirect p.haskell-language-server;
});
in {
# Override haskell-* sets to match the one containing the latest HLS packages
haskell = prev.haskell // { "ghc${hlsGhcVersion}" = latestHLSPackages; };
haskellPackages = latestHLSPackages;
haskell-language-server = latestHLSPackages.haskell-language-server;
};
overlays = [ (import rust-overlay) hls-overlay ];

Expand Down Expand Up @@ -73,10 +108,13 @@
pkgs.haskell-language-server
pkgs.haskell.compiler.ghc910
pkgs.pkg-config
pkgs.python3Full
# python3Full is removed
# Bluetooth is enabled by default and tkinter has been split off into the package set
pkgs.python3
pkgs.python3Packages.tkinter
pkgs.python3Packages.matplotlib
pkgs.python3Packages.scipy
pkgs.python3Packages.GitPython
pkgs.python3Packages.gitpython
pkgs.python3Packages.pyaml
pkgs.libz
pkgs.sbt
Expand All @@ -94,7 +132,7 @@
# Simulation report generation
pkgs.dot2tex
pkgs.texlive.combined.scheme-medium
pkgs.poppler_utils
pkgs.poppler-utils

(pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml)

Expand All @@ -107,7 +145,7 @@

# CI scripts
pkgs.python3Packages.docopt
pkgs.python3Packages.dateutil
pkgs.python3Packages.python-dateutil
mc
pkgs.pcre
pkgs.getent
Expand Down