From f6803239c7d4d398a22a41679c672a6b9bf9228b Mon Sep 17 00:00:00 2001 From: xinyangli Date: Sat, 23 Dec 2023 19:26:57 +0800 Subject: [PATCH] nix flake for npc --- npc/flake.lock | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++ npc/flake.nix | 24 ++++++++++++++++++++ 2 files changed, 85 insertions(+) create mode 100644 npc/flake.lock create mode 100644 npc/flake.nix diff --git a/npc/flake.lock b/npc/flake.lock new file mode 100644 index 0000000..9d7ed7c --- /dev/null +++ b/npc/flake.lock @@ -0,0 +1,61 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1701680307, + "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "4022d587cbbfd70fe950c1e2083a02621806a725", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1703013332, + "narHash": "sha256-+tFNwMvlXLbJZXiMHqYq77z/RfmpfpiI3yjL6o/Zo9M=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "54aac082a4d9bb5bbc5c4e899603abfb76a3f6d6", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "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 +} diff --git a/npc/flake.nix b/npc/flake.nix new file mode 100644 index 0000000..3c5c8af --- /dev/null +++ b/npc/flake.nix @@ -0,0 +1,24 @@ +{ + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = { self, ... }@inputs: with inputs; + flake-utils.lib.eachDefaultSystem (system: + let pkgs = nixpkgs.legacyPackages.${system}; in + { + devShells.default = pkgs.mkShell { + packages = with pkgs; [ + verilator + gtkwave + gcc + bear + ]; + shellHook = '' + export NEMU_HOME=/home/xin/repo/ysyx-workbench/nemu + ''; + }; + } + ); +}