This commit is contained in:
Robin Appelman 2023-11-10 23:17:59 +01:00
commit d21f4184ad
5 changed files with 155 additions and 1 deletions

1
.envrc Normal file
View file

@ -0,0 +1 @@
use flake

View file

@ -9,7 +9,7 @@ jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v4
- name: Compile sourcepawn - name: Compile sourcepawn
uses: spiretf/spcomp@v0.1 uses: spiretf/spcomp@v0.1
with: with:

2
.gitignore vendored
View file

@ -1 +1,3 @@
.idea .idea
result*
.direnv

115
flake.lock generated Normal file
View file

@ -0,0 +1,115 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1699646590,
"narHash": "sha256-f81xS0qN6H1ULTyArpZgdjsly4FY0BnvPXdmSb7hq+o=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "1d55765508b8316798429875712dc1ef5e62a2fa",
"type": "github"
},
"original": {
"id": "nixpkgs",
"ref": "release-23.05",
"type": "indirect"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs",
"spire": "spire",
"utils": "utils_2"
}
},
"spire": {
"inputs": {
"nixpkgs": [
"nixpkgs"
],
"utils": "utils"
},
"locked": {
"lastModified": 1699654291,
"narHash": "sha256-+hzjb53GoBqtba9uwBwcEbaDeztjmiQGSDkWndDDduY=",
"owner": "spiretf",
"repo": "nix",
"rev": "2c9023b27e01d6119688792fee7707ba7854c1ad",
"type": "github"
},
"original": {
"owner": "spiretf",
"repo": "nix",
"type": "github"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"systems_2": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1687709756,
"narHash": "sha256-Y5wKlQSkgEK2weWdOu4J3riRd+kV/VCgHsqLNTTWQ/0=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "dbabf0ca0c0c4bce6ea5eaf65af5cb694d2082c7",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"utils_2": {
"inputs": {
"systems": "systems_2"
},
"locked": {
"lastModified": 1694529238,
"narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "ff7b65b44d01cf9ba6a71320833626af21126384",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

36
flake.nix Normal file
View file

@ -0,0 +1,36 @@
{
inputs = {
utils.url = "github:numtide/flake-utils";
nixpkgs.url = "nixpkgs/release-23.05";
spire.url = "github:spiretf/nix";
spire.inputs.nixpkgs.follows = "nixpkgs";
spire.inputs.flake-utils.follows = "utils";
};
outputs = {
self,
nixpkgs,
utils,
spire,
}:
utils.lib.eachSystem spire.systems (system: let
overlays = [spire.overlays.default];
pkgs = (import nixpkgs) {
inherit system overlays;
};
inherit (pkgs) lib;
spEnv = pkgs.sourcepawn.buildEnv (with pkgs.sourcepawn.includes; [sourcemod curl]);
in rec {
packages = rec {
mapdownloader = pkgs.buildSourcePawnScript {
name = "mapdownloader";
src = ./plugin/mapdownloader.sp;
includes = with pkgs.sourcepawn.includes; [curl];
};
default = mapdownloader;
};
devShells.default = pkgs.mkShell {
nativeBuildInputs = with pkgs; [spEnv];
};
});
}