Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doc improvement #17

Merged
merged 3 commits into from
May 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 9 additions & 11 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ repos:
rev: v8.18.2
hooks:
- id: gitleaks
stages: [commit]

- repo: local
hooks:
Expand All @@ -18,20 +19,17 @@ repos:
args: [--fixup, --wip, --commit-file]
stages: [commit-msg]

- id: fmt
name: Lint Check
entry: cargo
- id: typos
name: Check for typos
entry: typos
language: system
files: .*
args: [fmt, --check]
pass_filenames: false
stages: [commit]

- repo: https://github.com/FeryET/pre-commit-rust
rev: v1.1.0
hooks:
- id: fmt
stages: [commit]
- id: clippy
name: Check clippy suggestions
entry: cargo
language: system
files: .*
args: [clippy]
pass_filenames: false
stages: [commit]
14 changes: 10 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,23 @@ This programs makes use of x-scheme-handler to open the program that is currentl

# Example installation

## Using cargo
### Using cargo

### From crates.io
#### From crates.io

Execute `cargo install rofi-obsidian`

### From source
#### From source

Clone the repository and execute `cargo install`

## Manually
### Using Nix Flakes

```sh
nix profile install github:Nydragon/rofi-obsidian
```

### Manually

Either add the binary to your $PATH environment variable or move it into the $XDG_CONFIG_HOME/rofi/scripts folder.

Expand Down
22 changes: 14 additions & 8 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-pkg = rustPlatform.buildRustPackage {
pname = manifest.name;
version = manifest.version;
src = ./.;
Expand All @@ -38,15 +38,18 @@
};
in
{
packages = {
rustPackage = myRustBuild;
packages = rec {
rofi-obsidian = rofi-obsidian-pkg;
default = rofi-obsidian;
};
defaultPackage = myRustBuild;
devShell = pkgs.mkShell {

devShells.default = pkgs.mkShell {
buildInputs = [
(rustVersion.override { extensions = [ "rust-src" ]; })
pkgs.git-cliff
pkgs.committed
pkgs.pre-commit
pkgs.typos
];
shellHook =
let
Expand All @@ -55,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

echo "Use ${rofiDebug} to build and run the debuging version with rofi."
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
Loading