summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSophie Forrest <git@sophieforrest.com>2024-09-06 14:22:04 +1200
committerSophie Forrest <git@sophieforrest.com>2024-09-06 14:22:04 +1200
commitf184cadd9965827398114958c5a99ae44f91e466 (patch)
treef74b39d51dbf0bc7b62b2ebefead10c41dc473a4
parent00f8270eaf318b12a42b517e1a514a2228a2d1bb (diff)
chore: add flake.nix
Package can now be built with Nix.
-rw-r--r--flake.lock58
-rw-r--r--flake.nix17
-rw-r--r--nix/package.nix23
3 files changed, 98 insertions, 0 deletions
diff --git a/flake.lock b/flake.lock
new file mode 100644
index 0000000..c130db3
--- /dev/null
+++ b/flake.lock
@@ -0,0 +1,58 @@
+{
+ "nodes": {
+ "flake-parts": {
+ "inputs": {
+ "nixpkgs-lib": "nixpkgs-lib"
+ },
+ "locked": {
+ "lastModified": 1725234343,
+ "narHash": "sha256-+ebgonl3NbiKD2UD0x4BszCZQ6sTfL4xioaM49o5B3Y=",
+ "owner": "hercules-ci",
+ "repo": "flake-parts",
+ "rev": "567b938d64d4b4112ee253b9274472dc3a346eb6",
+ "type": "github"
+ },
+ "original": {
+ "owner": "hercules-ci",
+ "repo": "flake-parts",
+ "type": "github"
+ }
+ },
+ "nixpkgs": {
+ "locked": {
+ "lastModified": 1725432240,
+ "narHash": "sha256-+yj+xgsfZaErbfYM3T+QvEE2hU7UuE+Jf0fJCJ8uPS0=",
+ "owner": "NixOS",
+ "repo": "nixpkgs",
+ "rev": "ad416d066ca1222956472ab7d0555a6946746a80",
+ "type": "github"
+ },
+ "original": {
+ "owner": "NixOS",
+ "ref": "nixos-unstable",
+ "repo": "nixpkgs",
+ "type": "github"
+ }
+ },
+ "nixpkgs-lib": {
+ "locked": {
+ "lastModified": 1725233747,
+ "narHash": "sha256-Ss8QWLXdr2JCBPcYChJhz4xJm+h/xjl4G0c0XlP6a74=",
+ "type": "tarball",
+ "url": "https://github.com/NixOS/nixpkgs/archive/356624c12086a18f2ea2825fed34523d60ccc4e3.tar.gz"
+ },
+ "original": {
+ "type": "tarball",
+ "url": "https://github.com/NixOS/nixpkgs/archive/356624c12086a18f2ea2825fed34523d60ccc4e3.tar.gz"
+ }
+ },
+ "root": {
+ "inputs": {
+ "flake-parts": "flake-parts",
+ "nixpkgs": "nixpkgs"
+ }
+ }
+ },
+ "root": "root",
+ "version": 7
+}
diff --git a/flake.nix b/flake.nix
new file mode 100644
index 0000000..faeac58
--- /dev/null
+++ b/flake.nix
@@ -0,0 +1,17 @@
+{
+ description = "Scraper that can parse all of Victoria University of Wellington's courses, and output them in a computer-readable JSON file.";
+
+ inputs = {
+ flake-parts.url = "github:hercules-ci/flake-parts";
+ nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
+ };
+
+ outputs = inputs @ {flake-parts, ...}:
+ flake-parts.lib.mkFlake {inherit inputs;} {
+ systems = ["x86_64-linux" "aarch64-linux" "aarch64-darwin" "x86_64-darwin"];
+
+ perSystem = {pkgs, ...}: {
+ packages.default = pkgs.callPackage ./nix/package.nix {};
+ };
+ };
+}
diff --git a/nix/package.nix b/nix/package.nix
new file mode 100644
index 0000000..4ef9ee6
--- /dev/null
+++ b/nix/package.nix
@@ -0,0 +1,23 @@
+{
+ lib,
+ rustPlatform,
+ ...
+}:
+rustPlatform.buildRustPackage {
+ pname = "vuw_course_scraper";
+ version = "0.1.0";
+
+ src =
+ builtins.path {
+ name = "vuw_course_scraper";
+ path = ../.;
+ };
+
+ cargoHash = "sha256-Smg9lDuh2IkMTumVJtjPm3hXnIJ+POmNe5z6xPcQCXI=";
+
+ meta = with lib; {
+ description = "Scraper that can parse all of Victoria University of Wellington's courses, and output them in a computer-readable JSON file.";
+ homepage = "https://codeberg.org/sophieforrest/vuw_course_scraper";
+ license = licenses.agpl3Plus;
+ };
+}