summary refs log tree commit diff stats
path: root/flake.nix
diff options
context:
space:
mode:
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix61
1 files changed, 29 insertions, 32 deletions
diff --git a/flake.nix b/flake.nix
index c3234ee..4540e05 100644
--- a/flake.nix
+++ b/flake.nix
@@ -1,9 +1,23 @@
 {
-  description = "LaTeX project manager";
+  description = "A latex project manager";
 
   inputs = {
     nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
 
+    crane = {
+      url = "github:ipetkov/crane";
+      inputs = {
+        nixpkgs.follows = "nixpkgs";
+      };
+    };
+    rust-overlay = {
+      url = "github:oxalica/rust-overlay";
+      inputs = {
+        nixpkgs.follows = "nixpkgs";
+        flake-utils.follows = "flake-utils";
+      };
+    };
+
     # inputs for following
     systems = {
       url = "github:nix-systems/x86_64-linux"; # only evaluate for this system
@@ -12,35 +26,18 @@
       url = "github:edolstra/flake-compat";
       flake = false;
     };
-    crane = {
-      url = "github:ipetkov/crane";
-      inputs = {
-        nixpkgs.follows = "nixpkgs";
-        flake-compat.follows = "flake-compat";
-        flake-utils.follows = "flake-utils";
-        rust-overlay.follows = "rust-overlay";
-      };
-    };
     flake-utils = {
       url = "github:numtide/flake-utils";
       inputs = {
         systems.follows = "systems";
       };
     };
-    rust-overlay = {
-      url = "github:oxalica/rust-overlay";
-      inputs = {
-        nixpkgs.follows = "nixpkgs";
-        flake-utils.follows = "flake-utils";
-      };
-    };
   };
 
   outputs = {
-    self,
     nixpkgs,
-    crane,
     flake-utils,
+    crane,
     rust-overlay,
     ...
   }:
@@ -50,11 +47,17 @@
         overlays = [(import rust-overlay)];
       };
 
-      #rust-nightly = pkgs.rust-bin.selectLatestNightlyWith (toolchain: toolchain.default);
-      rust-stable = pkgs.rust-bin.stable.latest.default;
-
-      craneLib = (crane.mkLib pkgs).overrideToolchain rust-stable;
+      nightly = false;
+      rust_minimal =
+        if nightly
+        then pkgs.rust-bin.selectLatestNightlyWith (toolchain: toolchain.minimal)
+        else pkgs.rust-bin.stable.latest.minimal;
+      rust_default =
+        if nightly
+        then pkgs.rust-bin.selectLatestNightlyWith (toolchain: toolchain.default)
+        else pkgs.rust-bin.stable.latest.default;
 
+      craneLib = (crane.mkLib pkgs).overrideToolchain rust_minimal;
       craneBuild = craneLib.buildPackage {
         src = craneLib.cleanCargoSource ./.;
 
@@ -63,21 +66,15 @@
     in {
       packages.default = craneBuild;
 
-      app.default = {
-        type = "app";
-        program = "${self.packages.${system}.default}/bin/lpm";
+      checks = {
+        inherit craneBuild;
       };
 
       devShells.default = pkgs.mkShell {
         packages = with pkgs; [
-          nil
-          alejandra
-          statix
-          ltex-ls
           cocogitto
 
-          rust-stable
-          rust-analyzer
+          rust_default
           cargo-edit
         ];
       };