diff --git a/flake.lock b/flake.lock index 8c97f55..626b650 100644 --- a/flake.lock +++ b/flake.lock @@ -94,11 +94,11 @@ }, "nixpkgs-stable": { "locked": { - "lastModified": 1788807765, - "narHash": "sha256-J9oC0bKnkXUrMegqRTXVkyDFJ0gn2U/Qpoo9HgGMQmA=", + "lastModified": 1789114715, + "narHash": "sha256-ugpsyk3NM2s87vXfUiIIiibbJ4Pp0JPS5p/3mfs+q+c=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "93108a538f079596c9a16c72cf03e9322782b6dd", + "rev": "21a67dc470149f337cecafbe965d8d252a390518", "type": "github" }, "original": { @@ -110,11 +110,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1788752844, - "narHash": "sha256-VaWGJ6+cIYN2erfSecbRV+4ljI185Ty2wUrXyvQbgOw=", + "lastModified": 1789006805, + "narHash": "sha256-xB8mKMOx1IA9vTDNLmJZ6n4wCMq/cuWBBOzGCRnqxrU=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "dc5d91f840324650bac8c379428c7037a416959a", + "rev": "8ce4ef6cb6f871616146b9fe26d2a5ae594e94fe", "type": "github" }, "original": { @@ -208,11 +208,11 @@ ] }, "locked": { - "lastModified": 1788337237, - "narHash": "sha256-gkSH8VUtCo6hnysNmb9DbTuDepH2t5pv+QWjP75xKAk=", + "lastModified": 1788914643, + "narHash": "sha256-4GuMPW90JSxXWDPUB9M+1m7fYbe3H0apOd86/zBQ2Kw=", "owner": "Mic92", "repo": "sops-nix", - "rev": "fbf759290e0cb0a98dfc813a4eb7d53ad1dacb57", + "rev": "13616fff713a9f94055c66f15687ebdc17a335df", "type": "github" }, "original": { @@ -266,11 +266,11 @@ ] }, "locked": { - "lastModified": 1788750954, - "narHash": "sha256-EYvJQO94UaWA+a6q93pUxvJ9+nULWvwgBQYvR1h3fLI=", + "lastModified": 1789183649, + "narHash": "sha256-M08rk8a5WepjMphE6W1pIdP3AhzpcBSMUJ0zzaGMOgM=", "owner": "0xc000022070", "repo": "zen-browser-flake", - "rev": "c23f077620acaf093f581172604656f59d450b46", + "rev": "f091fa4f590babf9a9ea3ac12524512cbb132e29", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 3887fd3..e99561a 100644 --- a/flake.nix +++ b/flake.nix @@ -29,7 +29,15 @@ nixpkgs-unstable, ... }@inputs: + let + system = "x86_64-linux"; + pkgs = nixpkgs-unstable.legacyPackages.${system}; + in { + packages.${system} = { + cargo-pretty = pkgs.callPackage ./shared/pkgs/cargo-pretty { }; + }; + formatter.x86_64-linux = nixpkgs-stable.legacyPackages.x86_64-linux.nixfmt-tree; nixosConfigurations = { diff --git a/shared/cli/shell.nix b/shared/cli/shell.nix index ff8eb13..6e0274f 100644 --- a/shared/cli/shell.nix +++ b/shared/cli/shell.nix @@ -30,6 +30,10 @@ zoxide init fish | source alias cd z + + alias crun "cargo pretty run" + alias cbuild "cargo pretty build" + alias ctest "cargo nextest run" ''; }; }; diff --git a/shared/dev/rust.nix b/shared/dev/rust.nix index 1514b5a..d497b5d 100644 --- a/shared/dev/rust.nix +++ b/shared/dev/rust.nix @@ -2,6 +2,7 @@ pkgs, lib, config, + inputs, ... }: { @@ -18,6 +19,8 @@ rustup gcc + inputs.self.packages.${pkgs.system}.cargo-pretty + cargo-features-manager cargo-outdated diff --git a/shared/pkgs/cargo-pretty/default.nix b/shared/pkgs/cargo-pretty/default.nix new file mode 100644 index 0000000..965ae03 --- /dev/null +++ b/shared/pkgs/cargo-pretty/default.nix @@ -0,0 +1,27 @@ +{ + lib, + rustPlatform, + fetchFromGitHub, +}: + +rustPlatform.buildRustPackage (finalAttrs: { + pname = "cargo-pretty"; + version = "0.3.0"; + + src = fetchFromGitHub { + owner = "romancitodev"; + repo = "cargo-pretty"; + rev = "v${finalAttrs.version}"; + hash = "sha256-6Nv/Yo2Z10YbEnqYGWwN3AxnJfv1aXPvn/JAcZ87Y4k="; + }; + + cargoHash = "sha256-d9u8pyxzx+SNvQiCobTMul+KSuXMkGc//GAtBKIWd6k="; + + meta = { + description = "A cargo build wrapper with a live, animated status view"; + mainProgram = "cargo-pretty"; + homepage = "https://github.com/romancitodev/cargo-pretty"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ tobinio ]; + }; +})