diff --git a/flake.nix b/flake.nix index a6b94ce..5e4b3f6 100644 --- a/flake.nix +++ b/flake.nix @@ -24,7 +24,7 @@ rustc = rustVersion; }; - myRustBuild = rustPlatform.buildRustPackage { + rofi-obsidian = rustPlatform.buildRustPackage { pname = manifest.name; version = manifest.version; src = ./.; @@ -38,10 +38,11 @@ }; in { - packages = { - rustPackage = myRustBuild; + packages = rec { + inherit rofi-obsidian; + default = rofi-obsidian; }; - defaultPackage = myRustBuild; + devShell = pkgs.mkShell { buildInputs = [ (rustVersion.override { extensions = [ "rust-src" ]; }) @@ -57,15 +58,18 @@ bin = "rofi-obsidian"; rofiDebug = "rofi-obsidian-debug"; rofiRelease = "rofi-obsidian-release"; + RED = "\\033[0;31m"; + NC = "\\033[0m"; in '' alias ${rofiDebug}="${cargo} build && ${rofi} -show o -modes o:./target/debug/${bin}" alias ${rofiRelease}="${cargo} build --profile release && ${rofi} -show o -modes o:./target/release/${bin}" + ${pkgs.pre-commit}/bin/pre-commit install -f + printf "\n${RED}INFO -----------${NC}\n\n"; echo "Use ${rofiDebug} to build and run the debugging version with rofi." echo "Use ${rofiRelease} to build and run the release version with rofi." - - ${pkgs.pre-commit}/bin/pre-commit install -f + printf "\n${RED}INFO -----------${NC}\n\n"; ''; }; }