diff --git a/flake.nix b/flake.nix index 6cd9b8e..4308b44 100644 --- a/flake.nix +++ b/flake.nix @@ -4,8 +4,15 @@ flake-utils.url = "github:numtide/flake-utils"; rust-overlay.url = "github:oxalica/rust-overlay"; }; - outputs = { self, nixpkgs, flake-utils, rust-overlay, ... }: - flake-utils.lib.eachDefaultSystem (system: + outputs = + { + nixpkgs, + flake-utils, + rust-overlay, + ... + }: + flake-utils.lib.eachDefaultSystem ( + system: let manifest = (pkgs.lib.importTOML ./Cargo.toml).package; overlays = [ (import rust-overlay) ]; @@ -23,32 +30,39 @@ src = ./.; cargoLock.lockFile = ./Cargo.lock; - meta = with nixpkgs.lib; { + meta = { description = manifest.description; - license = licenses.unlicense; + license = nixpkgs.lib.licenses.unlicense; maintainers = [ ]; }; }; - in { - packages = { rustPackage = myRustBuild; }; + in + { + packages = { + rustPackage = myRustBuild; + }; defaultPackage = myRustBuild; devShell = pkgs.mkShell { - buildInputs = - [ (rustVersion.override { extensions = [ "rust-src" ]; }) ]; - shellHook = let - cargo = "${pkgs.cargo}/bin/cargo"; - rofi = "${pkgs.rofi}/bin/rofi"; - bin = "rofi-obsidian"; - rofiDebug = "rofi-obsidian-debug"; - rofiRelease = "rofi-obsidian-release"; - 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}" + buildInputs = [ + (rustVersion.override { extensions = [ "rust-src" ]; }) + pkgs.git-cliff + ]; + shellHook = + let + cargo = "${pkgs.cargo}/bin/cargo"; + rofi = "${pkgs.rofi}/bin/rofi"; + bin = "rofi-obsidian"; + rofiDebug = "rofi-obsidian-debug"; + rofiRelease = "rofi-obsidian-release"; + 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}" - echo "Use ${rofiDebug} to build and run the debuging version with rofi." - echo "Use ${rofiRelease} to build and run the release version with rofi." - ''; + echo "Use ${rofiDebug} to build and run the debuging version with rofi." + echo "Use ${rofiRelease} to build and run the release version with rofi." + ''; }; - }); - + } + ); }