Skip to content

Commit

Permalink
nix: split out devshells to allow adding extra packages
Browse files Browse the repository at this point in the history
  • Loading branch information
JakeHillion committed Oct 24, 2024
1 parent d27fbb4 commit d0b6f3f
Showing 1 changed file with 20 additions and 6 deletions.
26 changes: 20 additions & 6 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
flake-utils.lib.eachSystem [ flake-utils.lib.system.x86_64-linux ] (
system:
let
pkgs = import nixpkgs { inherit system; };
defaultLlvmVersion = 16;

drgnSrc = pkgs.fetchFromGitHub {
owner = "JakeHillion";
Expand All @@ -32,8 +32,11 @@
};

mkOidPackage =
llvmPackages:
llvmVersion:
with pkgs;
let
llvmPackages = pkgs."llvmPackages_${toString llvmVersion}";
in
llvmPackages.stdenv.mkDerivation rec {
name = "oid";

Expand Down Expand Up @@ -95,13 +98,24 @@

outputs = [ "out" ];
};

mkOidDevShell =
pkg: with pkgs; pkgs.mkShell { buildInputs = [ ] ++ pkg.nativeBuildInputs ++ pkg.buildInputs; };

pkgs = import nixpkgs { inherit system; };
in
{
packages = rec {
default = oid-llvm16;
packages = {
default = self.packages.${system}."oid-llvm${toString defaultLlvmVersion}";

oid-llvm15 = mkOidPackage 15;
oid-llvm16 = mkOidPackage 16;
};
devShells = {
default = self.devShells.${system}."oid-llvm${toString defaultLlvmVersion}";

oid-llvm15 = mkOidPackage pkgs.llvmPackages_15;
oid-llvm16 = mkOidPackage pkgs.llvmPackages_16;
oid-llvm15 = mkOidDevShell self.packages.${system}.oid-llvm15;
oid-llvm16 = mkOidDevShell self.packages.${system}.oid-llvm16;
};

apps.default = {
Expand Down

0 comments on commit d0b6f3f

Please sign in to comment.