Skip to content

Commit

Permalink
[nix] locked nixpkgs for VCS
Browse files Browse the repository at this point in the history
  • Loading branch information
unlsycn committed Sep 14, 2024
1 parent 6aa6186 commit cac0c8f
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions templates/chisel/nix/pkgs/vcs-fhs-env.nix
Original file line number Diff line number Diff line change
@@ -1,11 +1,28 @@
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: 2024 Jiuyang Liu <[email protected]>

{ buildFHSEnv
, vcStaticHome
# This is a bit dirty.
# Since VCS are close source toolchains, we have no way to fix it for environment changes.
# So here we have to lock the whole nixpkgs to a working version.
#
# For convenience, we still use the nixpkgs defined in flake to "callPackage" this derivation.
# But the buildFHSEnv, targetPkgs is still from the locked nixpkgs.
{ vcStaticHome
, snpslmdLicenseFile
, fetchFromGitHub
}:
buildFHSEnv {
let
nixpkgsSrcs = fetchFromGitHub {
owner = "NixOS";
repo = "nixpkgs";
"rev" = "c374d94f1536013ca8e92341b540eba4c22f9c62";
"hash" = "sha256-Z/ELQhrSd7bMzTO8r7NZgi9g5emh+aRKoCdaAv5fiO0=";
};

# The vcs we have only support x86-64_linux
lockedPkgs = import nixpkgsSrcs { system = "x86_64-linux"; };
in
lockedPkgs.buildFHSEnv {
name = "vcs-fhs-env";

profile = ''
Expand Down

0 comments on commit cac0c8f

Please sign in to comment.