add nix flake
Some checks failed
docs / test (push) Successful in 12s
webrepl / test (push) Has been cancelled

This commit is contained in:
trimill 2025-02-05 22:04:09 -05:00
parent 2f771c55ac
commit ab04411c93
3 changed files with 109 additions and 0 deletions

31
default.nix Normal file
View file

@ -0,0 +1,31 @@
{ pkgs ? import <nixpkgs> { }
, stdenv ? pkgs.stdenv
, lib ? stdenv.lib
, rustPlatform ? pkgs.rustPlatform
, fetchFromGitea ? pkgs.fetchFromGitea
}:
rustPlatform.buildRustPackage rec {
pname = "talc";
version = "0.2.2";
src = fetchFromGitea {
domain = "g.trimill.xyz";
owner = "trimill";
repo = "talc";
rev = "v${version}";
hash = "sha256-QhZzSbCmawHOKRNDb0RAGX6qvRNbW0bnznA4o61+/7U=";
};
cargoHash = "sha256-yJEUmOEo2BkLyi6A+89itBMjvgXBLjwY72k6YL80ooM=";
meta = with lib; {
description = "magnesium silicate-based programming language and terminal calculator";
homepage = "https://talc.trimill.xyz/";
license = licenses.lgpl3Plus;
maintainers = [{
name = "Freya Murphy";
email = "contact@freyacat.org";
}];
};
}

61
flake.lock generated Normal file
View file

@ -0,0 +1,61 @@
{
"nodes": {
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1738782063,
"narHash": "sha256-vN1z7l7DvnIPNO/iQZ3sMq5yqKX+ztNJp+aYRK40WXo=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "cf574db30e0c4a23e79ea8e6d0eb160f89b49af9",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "master",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

17
flake.nix Normal file
View file

@ -0,0 +1,17 @@
{
description = "magnesium silicate-based programming language and terminal calculator";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/master";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { nixpkgs, flake-utils, ... }@inputs:
flake-utils.lib.eachSystem [ "x86_64-linux" "i686-linux" "aarch64-linux" ] (system: let
pkgs = nixpkgs.legacyPackages.${system};
in rec {
packages.talc = pkgs.callPackage ./default.nix {};
legacyPackages = packages;
defaultPackage = packages.talc;
});
}