summary refs log tree commit diff stats
path: root/flake.nix
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-03-31 18:49:51 +0200
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-03-31 18:49:51 +0200
commite94e4304e9bfd64bdf934827ffdf0409c44d991c (patch)
treedc63e2dcc7a41bb2f7ac86ea08c815397cf0bc3a /flake.nix
parentStyle(treewide): Format (diff)
downloadlpm-e94e4304e9bfd64bdf934827ffdf0409c44d991c.tar.gz
lpm-e94e4304e9bfd64bdf934827ffdf0409c44d991c.zip
chore(treewide): Update this project to today's standards.
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
         ];
       };