~ruther/nix-envs

d78625b32bd1853274fbaf9b9cf1cc17e64966cf — Rutherther 1 year, 6 months ago dbb5204 main
feat: add qtrvsim program
3 files changed, 99 insertions(+), 0 deletions(-)

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

A programs/qtrvsim/flake.lock => programs/qtrvsim/flake.lock +61 -0
@@ 0,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": 1696435587,
        "narHash": "sha256-otsVJPs+YMXjTJFEJ3ZzvaJ1e3Q74aStE2MSb2dxuZM=",
        "owner": "nixos",
        "repo": "nixpkgs",
        "rev": "e49c28b3baa3a93bdadb8966dd128f9985ea0a09",
        "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 programs/qtrvsim/flake.nix => programs/qtrvsim/flake.nix +37 -0
@@ 0,0 1,37 @@
{
  description = "QtMips package";


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

  outputs = { self, flake-utils, nixpkgs }: 
  let
    system = "x86_64-linux";
    pkgs = import nixpkgs {
      system = "${system}";
    };
    riscPkgs = import nixpkgs {
      crossSystem.config = "riscv64-none-elf";
      system = "${system}";
    };
  in {
    packages.${system} = {
      qtrvsim = pkgs.qtrvsim;
      default = self.packages.${system}.qtrvsim;
    };

    devShells.${system}.default = riscPkgs.mkShell {
      packages = [
        pkgs.qtrvsim
      ];

      buildInputs = [
        riscPkgs.buildPackages.binutils
        riscPkgs.buildPackages.gcc
      ];
    };
  };
}

Do not follow this link