refactor shell out into nix/ and add nix package

This commit is contained in:
jacekpoz 2024-04-18 17:46:50 +02:00
parent 8f574a8d39
commit 19910fa8bc
Signed by: poz
SSH key fingerprint: SHA256:JyLeVWE4bF3tDnFeUpUaJsPsNlJyBldDGV/dIKSLyN8
3 changed files with 47 additions and 15 deletions

View file

@ -13,21 +13,17 @@
devShells = forEachSystem (
system: let
pkgs = pkgsForEach.${system};
in {
default = pkgs.mkShell {
name = "osu++";
nativeBuildInputs = with pkgs; [
gcc
gnumake
# for clang-format
clang-tools
];
buildInputs = with pkgs; [
sfml
];
};
in rec {
osuplusplus = import ./nix/shell.nix {inherit pkgs;};
default = osuplusplus;
}
);
packages = forEachSystem (
system: let
pkgs = pkgsForEach.${system};
in rec {
osuplusplus = import ./nix/default.nix {inherit (pkgs) lib stdenv sfml;};
default = osuplusplus;
}
);
};

21
nix/default.nix Normal file
View file

@ -0,0 +1,21 @@
{
lib,
stdenv,
sfml,
}:
stdenv.mkDerivation {
pname = "osu++";
version = "0.1.0";
src = ../.;
buildInputs = [
sfml
];
meta = with lib; {
homepage = "https://git.jacekpoz.pl/jacekpoz/osuplusplus";
description = "An osu client written in C++ using SMFL.";
license = licenses.agpl3;
};
}

15
nix/shell.nix Normal file
View file

@ -0,0 +1,15 @@
{pkgs}:
pkgs.mkShell {
name = "osu++";
nativeBuildInputs = with pkgs; [
gcc
gnumake
# for clang-format
clang-tools
];
buildInputs = with pkgs; [
sfml
];
}