~ruther/verilog-riscv-semestral-project

6780861c7cfae12ae697eb9fdd8a8ed0edb7a460 — Rutherther 1 year, 5 months ago
chore: add flake environment
3 files changed, 107 insertions(+), 0 deletions(-)

A .envrc
A flake.lock
A flake.nix
A  => .envrc +1 -0
@@ 1,1 @@
use flake

A  => flake.lock +61 -0
@@ 1,61 @@
{
  "nodes": {
    "flake-utils": {
      "inputs": {
        "systems": "systems"
      },
      "locked": {
        "lastModified": 1694529238,
        "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=",
        "owner": "numtide",
        "repo": "flake-utils",
        "rev": "ff7b65b44d01cf9ba6a71320833626af21126384",
        "type": "github"
      },
      "original": {
        "owner": "numtide",
        "repo": "flake-utils",
        "type": "github"
      }
    },
    "nixpkgs": {
      "locked": {
        "lastModified": 1696177401,
        "narHash": "sha256-xSVZ+arFlQqWIArSGBA2wSyKHy9SRnIvkAHhDiMsT7o=",
        "owner": "NixOS",
        "repo": "nixpkgs",
        "rev": "fcf981a219ef7b910c83871ba202a883cbf7b3d6",
        "type": "github"
      },
      "original": {
        "owner": "NixOS",
        "ref": "release-23.05",
        "repo": "nixpkgs",
        "type": "github"
      }
    },
    "root": {
      "inputs": {
        "flake-utils": "flake-utils",
        "nixpkgs": "nixpkgs"
      }
    },
    "systems": {
      "locked": {
        "lastModified": 1681028828,
        "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
        "owner": "nix-systems",
        "repo": "default",
        "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
        "type": "github"
      },
      "original": {
        "owner": "nix-systems",
        "repo": "default",
        "type": "github"
      }
    }
  },
  "root": "root",
  "version": 7
}

A  => flake.nix +45 -0
@@ 1,45 @@
{
  description = "PAP verilog environment";

  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/release-23.05";
    flake-utils.url = "github:numtide/flake-utils";
  };

  outputs = { self, flake-utils, nixpkgs }: let
  in flake-utils.lib.eachDefaultSystem
      (system:
        let pkgs = import nixpkgs {
              inherit system;
              config.allowUnfree = true;
            };
            verilog-toolchain = with pkgs; symlinkJoin {
              name = "verilog-toolchain";
              meta.mainProgram = "verilog";
              paths = [
                verilog
                verilator
                gtkwave
              ];
            };
        in rec {

          packages.verilog = verilog-toolchain;
          packages.verilog-lsp = pkgs.svls;
          packages.default = packages.verilog;

          devShells.default = pkgs.mkShell {
            name = "pap-verilog";

            nativeBuildInputs = [
              packages.verilog
            ];

            packages = with pkgs; [
              # lsp
              packages.verilog-lsp
            ];
          };
        }
      );
}

Do not follow this link