nix/package: init

This commit is contained in:
2026-02-12 12:27:59 +09:00
parent 0cb9e7d49b
commit 1c072b2356
3 changed files with 37 additions and 2 deletions

3
.gitignore vendored
View File

@@ -1 +1,4 @@
output/
result
result-*

View File

@@ -1,5 +1,5 @@
{
description = "development shell";
description = "RCON -> Bluemap player position API converter";
inputs.nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
@@ -7,11 +7,19 @@
let
system = "x86_64-linux";
pkgs = import nixpkgs { inherit system; };
inherit (pkgs) lib;
in {
devShells.x86_64-linux.default = pkgs.mkShell {
devShells.${system}.default = pkgs.mkShell {
buildInputs = with pkgs; [
clang
];
};
packages.${system} = let
src = lib.cleanSource ./.;
in {
default = self.packages.${system}.wamf;
wamf = pkgs.callPackage ./nix/package.nix { inherit src; };
};
};
}

24
nix/package.nix Normal file
View File

@@ -0,0 +1,24 @@
{
lib,
src,
stdenv,
}:
stdenv.mkDerivation {
pname = "where-are-my-friends";
version = "0.1.0";
inherit src;
makeFlags = [
"prefix=$(out)"
"CC=${stdenv.cc.targetPrefix}cc"
];
meta = {
description = "RCON -> Bluemap player position API converter";
homepage = "https://git.pvv.ntnu.no/Projects/where-are-my-friends";
platforms = lib.platforms.unix;
mainProgram = "wamf";
};
}