diff --git a/README.md b/README.md index 731c925..a3c0305 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ Here's an example: processTrees = forEachSupportedSystem ( { pkgs, system }: { - postgres = pkgs.lib.mkProcessTree { + postgres = pkgs.up.mkProcessTree { description = "Run Postgres locally"; packages = with pkgs; [ @@ -148,7 +148,7 @@ Here's how you can create a task runner in your flake: taskRunners = forEachSupportedSystem ( { pkgs, system }: { - work = pkgs.lib.mkTaskRunner { + work = pkgs.up.mkTaskRunner { name = "work"; description = "Run linters and formatters"; packages = with pkgs; [ @@ -238,7 +238,7 @@ The function converts each task into a proper Bash script using [`writeShellAppl Here's an example: ```nix -pkgs.lib.mkTaskRunner { +pkgs.up.mkTaskRunner { name = "rt"; description = "Rust development tasks 🦀"; environment.RUST_LOG = "trace"; @@ -290,13 +290,13 @@ Here's an example: ### Benchmark tasks -Up has a special function called `mkBenchmarkTask` that generates benchmarking tasks that use [hyperfine]. +Up has a special function called `mkBenchmark` that generates benchmarking tasks that use [hyperfine]. Here's an example task: ```nix { run-benchmarks = - pkgs.lib.mkBenchmarkTask { + pkgs.up.mkBenchmark { description = "Benchmark the CLI"; after = [ "build" ]; commands = [ @@ -335,7 +335,7 @@ Here's an example task: ```nix { - rebuild-site = pkgs.lib.mkWatch { + rebuild-site = pkgs.up.mkWatch { description = "Rebuild site upon change"; packages = [ pkgs.pnpm ]; command = "pnpm run build"; @@ -392,7 +392,7 @@ Here's an example: ```nix let - procs = pkgs.lib.mkTool { + procs = pkgs.up.mkTool { name = "procs"; tool = pkgs.bottom; args = [ diff --git a/example/flake.lock b/example/flake.lock index 852dd8a..49c8ebf 100644 --- a/example/flake.lock +++ b/example/flake.lock @@ -8,12 +8,12 @@ "rust-analyzer-src": "rust-analyzer-src" }, "locked": { - "lastModified": 1775029908, - "narHash": "sha256-QuPn+EN/097aBLeSqbQ7vOwc5TSOb68bAxg1+mknfmw=", - "rev": "380f1969f440e683333af5746caac76811b4a1a8", - "revCount": 2612, + "lastModified": 1777624102, + "narHash": "sha256-thSyElkje577x/kAbP72nHlfiFc1a+tCudskLPHXe9s=", + "rev": "4d81601e0b73f20d81d066754ad0e7d1e7f75a06", + "revCount": 2646, "type": "tarball", - "url": "https://api.flakehub.com/f/pinned/nix-community/fenix/0.1.2612%2Brev-380f1969f440e683333af5746caac76811b4a1a8/019d4845-48ec-7293-9e63-11b3620f4a54/source.tar.gz" + "url": "https://api.flakehub.com/f/pinned/nix-community/fenix/0.1.2646%2Brev-4d81601e0b73f20d81d066754ad0e7d1e7f75a06/019de2eb-4157-78e2-99a4-47e0ab7416f5/source.tar.gz" }, "original": { "type": "tarball", @@ -65,11 +65,11 @@ "rust-analyzer-src": { "flake": false, "locked": { - "lastModified": 1774948198, - "narHash": "sha256-oVPo0/3CXM/5uFKu1ZwP7osSV2tiQIFU09Y3UzNbm7g=", + "lastModified": 1777583169, + "narHash": "sha256-dVJ4+wrRKc8oIgp3rLOFSq1obt/sCKlXy3h47qof/w0=", "owner": "rust-lang", "repo": "rust-analyzer", - "rev": "63b3eff38ef1c216480147dd53b0e4365d55f269", + "rev": "aa64e4828a2bbba44463c1229a81c748d3cce583", "type": "github" }, "original": { diff --git a/example/flake.nix b/example/flake.nix index aa8431f..f67ba94 100644 --- a/example/flake.nix +++ b/example/flake.nix @@ -12,14 +12,17 @@ outputs = { self, ... }@inputs: let + inherit (inputs.nixpkgs) lib; + supportedSystems = [ "x86_64-linux" "aarch64-linux" "aarch64-darwin" ]; + forEachSupportedSystem = f: - inputs.nixpkgs.lib.genAttrs supportedSystems ( + lib.genAttrs supportedSystems ( system: f { inherit system; @@ -51,7 +54,7 @@ processTrees = forEachSupportedSystem ( { pkgs, system }: { - dev = pkgs.lib.mkProcessTree { + dev = pkgs.up.mkProcessTree { name = "dev"; aliases = [ "d" ]; @@ -93,7 +96,7 @@ taskRunners = forEachSupportedSystem ( { pkgs, ... }: { - proto = pkgs.lib.mkTaskRunner { + proto = pkgs.up.mkTaskRunner { name = "proto"; description = "Protobuf-related tasks"; @@ -149,7 +152,7 @@ aliases = [ "l" ]; command = "buf lint"; }; - watch-gen = pkgs.lib.mkWatch { + watch-gen = pkgs.up.mkWatch { description = "Regenerate stubs on .proto change"; aliases = [ "w" diff --git a/flake.nix b/flake.nix index d80f3d9..5fd943e 100644 --- a/flake.nix +++ b/flake.nix @@ -37,12 +37,12 @@ lib = import ./lib; overlays.default = final: prev: { - lib = - prev.lib - // (self.lib { - inherit (prev) lib; - pkgs = prev; - }); + up = ( + import ./lib { + inherit (final) lib; + pkgs = final; + } + ); }; schemas = { diff --git a/lib/benchmark.nix b/lib/benchmark.nix index 51de5e7..bab296a 100644 --- a/lib/benchmark.nix +++ b/lib/benchmark.nix @@ -24,7 +24,7 @@ assert lib.assertMsg ( runs == null || (minRuns == null && maxRuns == null) -) "mkBenchmarkTask: 'runs' and 'minRuns'/'maxRuns' are mutually exclusive"; +) "mkBenchmark: 'runs' and 'minRuns'/'maxRuns' are mutually exclusive"; let esc = lib.escapeShellArg; diff --git a/lib/default.nix b/lib/default.nix index 32765f9..48f8093 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -58,7 +58,7 @@ let taskModule = import ./task.nix { inherit lib mkScript pkgs; }; in { - mkBenchmarkTask = import ./benchmark.nix { + mkBenchmark = import ./benchmark.nix { inherit lib pkgs