Skip to content

Commit

Permalink
chore: add colour highlight to shellHook
Browse files Browse the repository at this point in the history
  • Loading branch information
nydragon committed May 29, 2024
1 parent e67c2f4 commit e8a0dee
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
rustc = rustVersion;
};

myRustBuild = rustPlatform.buildRustPackage {
rofi-obsidian = rustPlatform.buildRustPackage {
pname = manifest.name;
version = manifest.version;
src = ./.;
Expand All @@ -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" ]; })
Expand All @@ -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";
'';
};
}
Expand Down

0 comments on commit e8a0dee

Please sign in to comment.