summary refs log tree commit diff
path: root/flake.nix
diff options
context:
space:
mode:
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix66
1 files changed, 39 insertions, 27 deletions
diff --git a/flake.nix b/flake.nix
index 9e3b4dc..433b20a 100644
--- a/flake.nix
+++ b/flake.nix
@@ -1,29 +1,41 @@
 {
-	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 = {
-				lib,
-				pkgs,
-				...
-			}: {
-				packages.default = pkgs.callPackage ./nix/package.nix {};
-
-				devShells.default =
-					pkgs.mkShell {
-						nativeBuildInputs = let inherit (pkgs) openssl pkg-config; in [openssl openssl.dev pkg-config];
-
-						PKG_CONFIG_PATH = "${pkgs.openssl.dev}/lib/pkgconfig";
-						LD_LIBRARY_PATH = lib.makeLibraryPath [pkgs.openssl];
-					};
-			};
-		};
+  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";
+
+    devenv.url = "github:cachix/devenv";
+  };
+
+  outputs = inputs @ {flake-parts, ...}:
+    flake-parts.lib.mkFlake {inherit inputs;} {
+      imports = [inputs.devenv.flakeModule];
+
+      systems = ["x86_64-linux" "aarch64-linux" "aarch64-darwin" "x86_64-darwin"];
+
+      perSystem = {
+        lib,
+        pkgs,
+        ...
+      }: {
+        packages.default = pkgs.callPackage ./nix/package.nix {};
+
+        devenv.shells.default = {
+          env = {
+            LD_LIBRARY_PATH = lib.makeLibraryPath [pkgs.openssl];
+            PKG_CONFIG_PATH = "${pkgs.openssl.dev}/lib/pkgconfig";
+          };
+
+          languages = {
+            nix.enable = true;
+            rust.enable = true;
+          };
+
+          packages = let inherit (pkgs) openssl pkg-config; in [openssl openssl.dev pkg-config];
+
+          pre-commit.hooks.alejandra.enable = true;
+        };
+      };
+    };
 }