A6/flake.nix

51 lines
1.4 KiB
Nix
Raw Permalink Normal View History

2024-12-04 16:44:31 -07:00
{
description = "CSCI200 Lab 6C";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
inputs.flake-utils.url = "github:numtide/flake-utils";
outputs = { nixpkgs, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system: let pkgs = nixpkgs.legacyPackages.${system}; in {
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
sfml
];
packages = with pkgs; [
gcc
clang-tools
];
};
packages.default = pkgs.stdenv.mkDerivation rec {
pname = "A6";
version = "1";
src = nixpkgs.lib.fileset.toSource {
root = ./.;
fileset = nixpkgs.lib.fileset.unions [ ./main.cpp ./Makefile ./mazePack ];
};
buildInputs = with pkgs; [
sfml
];
nativeBuildInputs = with pkgs; [
gcc
];
buildPhase = ''
make
'';
installPhase = ''
runHook preInstall
mkdir -p $out/bin
cp ./${pname} $out/bin/
runHook postInstall
'';
};
});
}