43 lines
935 B
Nix
43 lines
935 B
Nix
|
{
|
||
|
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||
|
outputs = {
|
||
|
self,
|
||
|
nixpkgs,
|
||
|
}: let
|
||
|
inherit (self) outputs;
|
||
|
supportedSystems = [
|
||
|
"x86_64-linux"
|
||
|
"aarch64-linux"
|
||
|
|
||
|
"x86_64-darwin"
|
||
|
"aarch64-darwin"
|
||
|
];
|
||
|
forEachSupportedSystem = nixpkgs.lib.genAttrs supportedSystems;
|
||
|
in {
|
||
|
packages = forEachSupportedSystem (system: let
|
||
|
pkgs = import nixpkgs {inherit system;};
|
||
|
in {
|
||
|
modal = pkgs.stdenv.mkDerivation {
|
||
|
srcs = [./modal.c];
|
||
|
name = "myenv";
|
||
|
buildInputs = with pkgs; [clang];
|
||
|
};
|
||
|
|
||
|
default = outputs.packages.${system}.modal;
|
||
|
});
|
||
|
|
||
|
devShells = forEachSupportedSystem (system: let
|
||
|
pkgs = import nixpkgs {inherit system;};
|
||
|
in {
|
||
|
c-dev = pkgs.mkShell {
|
||
|
buildInputs = with pkgs; [
|
||
|
clang
|
||
|
lldb
|
||
|
];
|
||
|
};
|
||
|
|
||
|
default = outputs.devShells.${system}.c-dev;
|
||
|
});
|
||
|
};
|
||
|
}
|