build: Added thor as a nix package.

This commit is contained in:
Spencer Brower
2026-07-10 16:33:11 -04:00
parent 5adcdf12c1
commit 454f90f5cb
4 changed files with 49 additions and 25 deletions
Generated
-16
View File
@@ -65,27 +65,11 @@
"type": "github" "type": "github"
} }
}, },
"process-compose-flake": {
"locked": {
"lastModified": 1782060835,
"narHash": "sha256-Q8HH2t1l3MITtWCWY4ytcH5F/Q7aAHo3Iq/QTMAKTe0=",
"owner": "Platonic-Systems",
"repo": "process-compose-flake",
"rev": "464ff6880737f063c3f0d3d2c7781fda9190868f",
"type": "github"
},
"original": {
"owner": "Platonic-Systems",
"repo": "process-compose-flake",
"type": "github"
}
},
"root": { "root": {
"inputs": { "inputs": {
"flake-parts": "flake-parts", "flake-parts": "flake-parts",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs",
"nixpkgs-unstable": "nixpkgs-unstable", "nixpkgs-unstable": "nixpkgs-unstable",
"process-compose-flake": "process-compose-flake",
"treefmt-nix": "treefmt-nix" "treefmt-nix": "treefmt-nix"
} }
}, },
+38 -9
View File
@@ -6,7 +6,7 @@
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-parts.url = "github:hercules-ci/flake-parts"; flake-parts.url = "github:hercules-ci/flake-parts";
process-compose-flake.url = "github:Platonic-Systems/process-compose-flake"; # process-compose-flake.url = "github:Platonic-Systems/process-compose-flake";
treefmt-nix.url = "github:numtide/treefmt-nix"; treefmt-nix.url = "github:numtide/treefmt-nix";
treefmt-nix.inputs.nixpkgs.follows = "nixpkgs"; treefmt-nix.inputs.nixpkgs.follows = "nixpkgs";
}; };
@@ -16,7 +16,7 @@
, flake-parts , flake-parts
, nixpkgs , nixpkgs
, nixpkgs-unstable , nixpkgs-unstable
, process-compose-flake # , process-compose-flake
, treefmt-nix , treefmt-nix
}: }:
flake-parts.lib.mkFlake { inherit inputs; } { flake-parts.lib.mkFlake { inherit inputs; } {
@@ -66,14 +66,43 @@
}; };
}; };
/* #process-compose.default.settings.processes = { };
process-compose.default.settings.processes = {
web.command = "sudo ${pkgs.caddy}/bin/caddy run"; packages.default = pkgs.stdenv.mkDerivation rec {
mail.command = "${pkgs.mailhog}/bin/MailHog"; pname = "thor";
php.command = "${php}/bin/php-fpm -F -y php-fpm.conf"; version = nixpkgs.lib.trim (builtins.readFile ./version.txt);
redis.command = "${$pks.redis}/bin/redis-server"; src = ./.;
nativeBuildInputs = [
pkgs.odin
pkgs.pkg-config
];
buildInputs = [
pkgs.git
];
doCheck = true;
checkPhase = ''
runHook preCheck
odin test . -all-packages
runHook postCheck
'';
buildPhase = ''
runHook preBuild
odin build . -o:speed -out:${pname}-keep
echo "Listing filles..."
ls .
runHook postBuild
'';
installPhase = ''
runHook preInstall
install -Dm755 ${pname}-keep $out/bin/${pname}
runHook postInstall
'';
}; };
*/
devShells.default = pkgs.mkShell devShells.default = pkgs.mkShell
{ {
+10
View File
@@ -0,0 +1,10 @@
#+test
package main
import "core:testing"
@(test)
test_true :: proc(t: ^testing.T) {
testing.expect(t, true)
}
+1
View File
@@ -0,0 +1 @@
0.1.0