Commit graph

180 commits

Author SHA1 Message Date
Artturin
4bc672b803 v2.2.0 2025-07-19 15:02:36 +03:00
Artturin
582fa11586 cargo clippy --fix 2025-07-19 15:01:29 +03:00
Artturin
ca003ff5e6 flake.lock: Update
Flake lock file updates:

• Updated input 'naersk':
    'github:nix-community/naersk/0473954e399eec0081ee816f3430c17d1f7e5a42?narHash=sha256-QNo234SxSB2lLavaT2d%2Bg%2BZ2WB7o7w29vYkM6zfRLi4%3D' (2025-07-07)
  → 'github:nix-community/naersk/0e72363d0938b0208d6c646d10649164c43f4d64?narHash=sha256-uldUBFkZe/E7qbvxa3mH1ItrWZyT6w1dBKJQF/3ZSsc%3D' (2025-07-16)
• Added input 'naersk/fenix':
    'github:nix-community/fenix/bf0d6f70f4c9a9cf8845f992105652173f4b617f?narHash=sha256-z6QEu4ZFuHiqdOPbYss4/Q8B0BFhacR8ts6jO/F/aOU%3D' (2025-07-14)
• Added input 'naersk/fenix/nixpkgs':
    follows 'naersk/nixpkgs'
• Added input 'naersk/fenix/rust-analyzer-src':
    'github:rust-lang/rust-analyzer/591e3b7624be97e4443ea7b5542c191311aa141d?narHash=sha256-EJcdxw3aXfP8Ex1Nm3s0awyH9egQvB2Gu%2BQEnJn2Sfg%3D' (2025-07-13)
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/9b008d60392981ad674e04016d25619281550a9d?narHash=sha256-mgFxAPLWw0Kq%2BC8P3dRrZrOYEQXOtKuYVlo9xvPntt8%3D' (2025-07-08)
  → 'github:NixOS/nixpkgs/8131c0ea9df6293a247be743a387ff725e464db7?narHash=sha256-pGvcN/yiJ4e3/hgvTwkyZvl6c3HuLLCY/hjEzDuQB54%3D' (2025-07-18)
2025-07-19 14:59:03 +03:00
Artturin
f90146b546
Merge pull request #103 from culxttes/nix-locate-top-level
feat: remove "top-level" argument of "nix-locate"
2025-07-19 13:48:57 +03:00
Artturin
4d9c93a0c4
Merge pull request #85 from Pandapip1/command-not-found-handle 2025-07-18 12:57:43 +03:00
Artturin
8767be1ae3 Rename comma-command-not-found.sh 2025-07-18 12:53:19 +03:00
Culottes
2dab620c7a
feat: remove "top-level" argument of "nix-locate" 2025-07-18 08:48:21 +02:00
Artturin
5f5499610e Add --ask for use in command-not-found 2025-07-15 20:50:11 +03:00
Gavin John
c89af24f00 Add command-not-found handler 2025-07-15 19:02:05 +03:00
Artturin
27ce74dda2 v2.1.0 2025-07-14 01:57:28 +03:00
Artturin
7c120ad582 Make comma overrideable 2025-07-13 21:03:02 +03:00
Artturin
1f6804946d Add formatter attr 2025-07-13 20:28:06 +03:00
Artturin
8c5b3898d1 Format 2025-07-13 20:27:22 +03:00
Artturin
4d64424458
Merge pull request #102 from thiagokokada/cache-settings 2025-07-13 20:20:42 +03:00
Thiago Kenji Okada
fd8adc78e8 Update README.md with cache instructions 2025-07-12 13:01:11 +01:00
Thiago Kenji Okada
febd4fc25d Add --cache-level flag
This is u8 flag that accepts the following options:
- 0: completely disables caching
- 1: only cache choices
- 2: also caches paths

Setting the default to 2 to keep the current behavior.

Fixes: #90.
2025-07-12 12:51:39 +01:00
Thiago Kenji Okada
d98bc3269f Print path for debug in Cache::new() 2025-07-12 12:37:49 +01:00
Thiago Kenji Okada
61f57140a8 Document missing flags 2025-07-12 12:10:20 +01:00
Artturin
98736ccbdf Remove missed --update reference 2025-07-12 00:52:14 +03:00
Artturin
867a9f37f4 cargo fmt 2025-07-11 16:52:21 +03:00
Artturin
242cdfcea8 Remove deprecated feature --update 2025-07-11 16:52:14 +03:00
Artturin
8ca7dabea8 Add quotes release.sh 2025-07-11 16:16:00 +03:00
Artturin
9551b0d484 v2.0.0 2025-07-11 13:53:35 +03:00
Artturin
3d3dc5d885 "Fix" unused return value of std::os::unix::process::CommandExt::exec that must be used 2025-07-11 13:41:15 +03:00
Artturin
8e5a0b68e1 cargo clippy --fix 2025-07-11 13:33:09 +03:00
Artturin
b750419664 cargo update & cargo upgrade 2025-07-11 13:27:35 +03:00
Artturin
18b3455673 flake.lock: Update
Flake lock file updates:

• Updated input 'flake-compat':
    'github:edolstra/flake-compat/0f9255e01c2351cc7d116c072cb317785dd33b33?narHash=sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U%3D' (2023-10-04)
  → 'github:edolstra/flake-compat/9100a0f413b0c601e0533d1d94ffd501ce2e7885?narHash=sha256-CIVLLkVgvHYbgI2UpXvIIBJ12HWgX%2BfjA8Xf8PUmqCY%3D' (2025-05-12)
• Updated input 'naersk':
    'github:nix-community/naersk/3fb418eaf352498f6b6c30592e3beb63df42ef11?narHash=sha256-r/xppY958gmZ4oTfLiHN0ZGuQ%2BRSTijDblVgVLFi1mw%3D' (2024-07-23)
  → 'github:nix-community/naersk/0473954e399eec0081ee816f3430c17d1f7e5a42?narHash=sha256-QNo234SxSB2lLavaT2d%2Bg%2BZ2WB7o7w29vYkM6zfRLi4%3D' (2025-07-07)
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/b833ff01a0d694b910daca6e2ff4a3f26dee478c?narHash=sha256-tLGCFEFTB5TaOKkpfw3iYT9dnk4awTP/q4w%2BROpMfuw%3D' (2024-09-01)
  → 'github:NixOS/nixpkgs/9b008d60392981ad674e04016d25619281550a9d?narHash=sha256-mgFxAPLWw0Kq%2BC8P3dRrZrOYEQXOtKuYVlo9xvPntt8%3D' (2025-07-08)
• Updated input 'utils':
    'github:numtide/flake-utils/b1d9ab70662946ef0850d488da1c9019f3a9752a?narHash=sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ%3D' (2024-03-11)
  → 'github:numtide/flake-utils/11707dc2f618dd54ca8739b309ec4fc024de578b?narHash=sha256-l0KFg5HjrsfsO/JpG%2Br7fRrqm12kzFHyUHqHCVpMMbI%3D' (2024-11-13)
2025-07-11 13:19:11 +03:00
Artturin
cc78f61726
Merge pull request #101 from thiagokokada/implement-eval-cache 2025-07-11 13:13:47 +03:00
Thiago Kenji Okada
c4d04f7373 Use nix build in get_command_path instead of hack around nix shell 2025-07-08 22:59:30 +01:00
Thiago Kenji Okada
b96f3eeb27 Reduce copies 2025-07-08 11:38:29 +01:00
Thiago Kenji Okada
9df8f0c1ef Add some basic logging for caching
Can be enabled with `export RUST_LOG=debug` or `export RUST_LOG=trace`
2025-07-08 09:36:06 +01:00
Thiago Kenji Okada
25e3004217 Support cache for path in --print-path 2025-07-07 23:00:23 +01:00
Thiago Kenji Okada
a79fa651f0 Move state file from $XDG_STATE_HOME/comma-choices to $XDG_STATE_HOME/comma/choices
This is because the recent changes in the cache made the old format
incompatible with the new one, but also because this is more inline
with XDG Base Directory specs.
2025-07-07 18:03:49 +01:00
Thiago Kenji Okada
23fb608731 Implement cache for path
Instead of only caching the derivation name, in this PR we also cache
the path from the derivation itself. This result in much faster
subsequent runs:

Before:

```
$ hyperfine "./result/bin/comma ls"
Benchmark 1: ./result/bin/comma ls
  Time (mean ± σ):     990.1 ms ±  94.5 ms    [User: 368.8 ms, System: 129.8 ms]
  Range (min … max):   900.8 ms … 1212.4 ms    10 runs
```

After:

```
$ hyperfine "./result/bin/comma ls"
Benchmark 1: ./result/bin/comma ls
  Time (mean ± σ):      29.4 ms ±   5.7 ms    [User: 10.5 ms, System: 4.8 ms]
  Range (min … max):    10.8 ms …  50.3 ms    56 runs
```

All runs done in macOS (15.5), I expect the results to be even better on
Linux.
2025-07-07 18:03:49 +01:00
Thiago Kenji Okada
c32f2527fc Fix clippy warning 2025-07-07 14:14:45 +01:00
Artturin
650c41b59b
Merge pull request #96 from nix-community/dependabot/github_actions/cachix/install-nix-action-31
Bump cachix/install-nix-action from 30 to 31
2025-03-19 21:12:40 +02:00
dependabot[bot]
33a6114a83
Bump cachix/install-nix-action from 30 to 31
Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from 30 to 31.
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Commits](https://github.com/cachix/install-nix-action/compare/v30...v31)

---
updated-dependencies:
- dependency-name: cachix/install-nix-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-17 11:19:02 +00:00
Artturin
17fb129e37 Add LICENSE file, The license was already specified in the Cargo.toml
Dunno what names to put after the year so I just put what's in `authors`
in `Cargo.toml`
2024-11-27 20:31:54 +02:00
Artturin
ae61728cb9
Merge pull request #82 from diniamo/sensible-print
feat: redo the print-package option
2024-11-15 20:21:34 +02:00
Artturin
10e4dccce1
Merge pull request #81 from tek/tek/db-dir
Use $NIX_INDEX_DATABASE/files if the var contains a directory
2024-11-01 20:50:29 +02:00
Artturin
85e93306db
Merge pull request #88 from nix-community/dependabot/github_actions/cachix/install-nix-action-30
Bump cachix/install-nix-action from 29 to 30
2024-11-01 20:44:57 +02:00
Artturin
dd41970e94 Cont 0e0a5d2023
This is more efficient because we don't need a another store path.
2024-10-16 22:43:53 +03:00
Artturin
d76648345f Set src instead of root
In this case they're the same
2024-10-14 00:52:14 +03:00
Artturin
0e0a5d2023 Fix warning on nix lazy-trees
`warning: Performing inefficient double copy of path '/home/artturin/nixgits/comma/' to the store. This can typically be avoided by rewriting an attribute like `src = ./.` to `src = builtins.path { path = ./.; name = "source"; }`.`
2024-10-13 22:37:40 +03:00
dependabot[bot]
3f717c6755
Bump cachix/install-nix-action from 29 to 30
Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from 29 to 30.
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Commits](https://github.com/cachix/install-nix-action/compare/v29...v30)

---
updated-dependencies:
- dependency-name: cachix/install-nix-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-07 11:34:14 +00:00
Artturin
b05a25e575
Merge pull request #87 from nix-community/dependabot/github_actions/cachix/install-nix-action-v29
Bump cachix/install-nix-action from V28 to 29
2024-09-30 18:27:22 +03:00
dependabot[bot]
ef6b51818f
Bump cachix/install-nix-action from V28 to 29
Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from V28 to 29. This release includes the previously tagged commit.
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Commits](https://github.com/cachix/install-nix-action/compare/V28...v29)

---
updated-dependencies:
- dependency-name: cachix/install-nix-action
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-30 11:44:54 +00:00
Artturin
15cf8efd8d
Merge pull request #86 from nix-community/dependabot/github_actions/cachix/install-nix-action-V28
Bump cachix/install-nix-action from V27 to 28
2024-09-20 02:30:44 +03:00
Artturin
24c04fbe92 v1.9.0 2024-09-18 20:38:29 +03:00
dependabot[bot]
77a85086b8
Bump cachix/install-nix-action from V27 to 28
Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from V27 to 28. This release includes the previously tagged commit.
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Commits](https://github.com/cachix/install-nix-action/compare/V27...V28)

---
updated-dependencies:
- dependency-name: cachix/install-nix-action
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-16 11:56:03 +00:00