summary refs log tree commit diff
path: root/flake.nix
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--flake.nix32
1 files changed, 19 insertions, 13 deletions
diff --git a/flake.nix b/flake.nix
index 65a3051..b671802 100644
--- a/flake.nix
+++ b/flake.nix
@@ -5,6 +5,17 @@
     flake-parts.url = "github:hercules-ci/flake-parts";
     nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
 
+    crane.url = "github:ipetkov/crane";
+    advisory-db = {
+      url = "github:rustsec/advisory-db";
+      flake = false;
+    };
+    fenix = {
+      url = "github:nix-community/fenix";
+      inputs.nixpkgs.follows = "nixpkgs";
+      inputs.rust-analyzer-src.follows = "";
+    };
+
     nix2container.url = "github:nlewo/nix2container";
     nix2container.inputs.nixpkgs.follows = "nixpkgs";
     mk-shell-bin.url = "github:rrbutani/nix-mk-shell-bin";
@@ -14,29 +25,24 @@
 
   outputs = inputs @ {flake-parts, ...}:
     flake-parts.lib.mkFlake {inherit inputs;} {
-      imports = [inputs.devenv.flakeModule];
+      imports = [
+        inputs.devenv.flakeModule
+        ./nix/package.nix
+      ];
 
       systems = ["x86_64-linux" "aarch64-linux" "aarch64-darwin" "x86_64-darwin"];
 
-      perSystem = {
-        lib,
-        pkgs,
-        ...
-      }: {
-        packages.default = pkgs.callPackage ./nix/package.nix {};
-
+      perSystem = {pkgs, ...}: {
         devenv.shells.default = {
-          env = {
-            LD_LIBRARY_PATH = lib.makeLibraryPath [pkgs.openssl];
-            PKG_CONFIG_PATH = "${pkgs.openssl.dev}/lib/pkgconfig";
-          };
+          # NOTE: env vars are maintained inside ./nix/package.nix.
 
           languages = {
             nix.enable = true;
             rust.enable = true;
           };
 
-          packages = let inherit (pkgs) cargo-nextest openssl pkg-config; in [cargo-nextest openssl openssl.dev pkg-config];
+          # NOTE: build dependencies are maintained inside ./nix/package.nix.
+          packages = with pkgs; [cargo-nextest];
 
           pre-commit.hooks.alejandra.enable = true;
         };