diff options
| author | Sophie Forrest <git@sophieforrest.com> | 2024-09-10 13:34:09 +1200 |
|---|---|---|
| committer | Sophie Forrest <git@sophieforrest.com> | 2024-09-10 13:38:00 +1200 |
| commit | 50e5cd743022ae5d28b477899c22b415afba12e1 (patch) | |
| tree | 0d53ccc70d4f01776834f0d0edfadc1b1cb57292 /flake.nix | |
| parent | c37c398a30f42da130142f0b2271d74b2c0465e1 (diff) | |
chore: use devenv
Diffstat (limited to '')
| -rw-r--r-- | flake.nix | 66 |
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; + }; + }; + }; } |