-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
51 lines (42 loc) · 1.64 KB
/
flake.nix
File metadata and controls
51 lines (42 loc) · 1.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
{
description = "Development shell for VCODE RoCC Accelerator & Chipyard";
# Nixpkgs version to use
inputs.nixpkgs.url = "nixpkgs/nixos-23.05";
outputs = { self, nixpkgs }:
let
# System types to support.
# I have only ever tested this on x86_64-linux, so we limit to that.
supportedSystems = [ "x86_64-linux" ]; # "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ];
# Helper function to generate an attrset '{ x86_64-linux = f "x86_64-linux"; ... }'.
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
# Nixpkgs instantiated for supported system types.
nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; });
in
{
# This flake does not provide any packages
packages = {};
# This flake does not provide any packages, so it cannot have apps
# either.
# apps is meant to play with the "nix run" command.
apps = {};
# What we really want
devShells = forAllSystems (system:
let pkgs = nixpkgsFor.${system};
in {
default = pkgs.mkShell {
name = "vcode-rocc-shell";
nativeBuildInputs = with pkgs; [
sbt # Scala Build Tool
scala # Compiler
scalafmt # Linter
metals # LSP Server
gtkwave # A waveform viewer for VCD files
# keep this line if you use bash
bashInteractive
];
# Ensure locales are present
LOCALE_ARCHIVE = "${pkgs.glibcLocales}/lib/locale/locale-archive";
};
});
};
}