From 070e412becf1dd801907a8fdc1719547d9207d66 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Sat, 12 Oct 2024 01:02:04 +0300 Subject: [PATCH] flake: clean up default devShell; add standalone nix shell --- flake.nix | 37 ++++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/flake.nix b/flake.nix index 5025388..6efd6f7 100644 --- a/flake.nix +++ b/flake.nix @@ -13,7 +13,6 @@ outputs = { self, flake-parts, - nixpkgs, systems, ... } @ inputs: @@ -32,19 +31,25 @@ # provide the formatter for nix fmt formatter = pkgs.alejandra; - devShells.default = pkgs.mkShell { - inputsFrom = builtins.attrValues self'.packages; + devShells = { + default = pkgs.mkShell { + inputsFrom = builtins.attrValues self'.packages; + packages = with pkgs; [ + rustc # rust compiler + gcc + cargo # rust package manager + clippy # opinionated rust formatter + ]; + }; - packages = with pkgs; [ - alejandra # nix formatter - rustfmt # rust formatter - statix # lints and suggestions - deadnix # clean up unused nix code - rustc # rust compiler - gcc - cargo # rust package manager - clippy # opinionated rust formatter - ]; + nix = pkgs.mkShellNoCC { + packages = with pkgs; [ + alejandra # nix formatter + rustfmt # rust formatter + statix # lints and suggestions + deadnix # clean up unused nix code + ]; + }; }; packages = let @@ -60,9 +65,11 @@ }; in { default = self'.packages.anyrun; - anyrun = callPackage ./nix/default.nix {inherit inputs lockFile;}; - anyrun-with-all-plugins = pkgs.callPackage ./nix/default.nix { + # By default the anyrun package is built without any plugins + # as per the `dontBuildPlugins` arg. + anyrun = callPackage ./nix/default.nix {inherit inputs lockFile;}; + anyrun-with-all-plugins = callPackage ./nix/default.nix { inherit inputs lockFile; dontBuildPlugins = false; };