Skip to content
Open
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
13 changes: 13 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: 2
updates:
# Update Cargo deps
- package-ecosystem: cargo
directory: "/"
schedule:
interval: "weekly"

# Update used workflows
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: daily
13 changes: 8 additions & 5 deletions .github/workflows/nix-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
workflow_dispatch:
pull_request:
branches: ["master"]
paths-ignore:
- .gitignore
- README.md

jobs:
check-flake:
Expand All @@ -15,10 +18,9 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main
- uses: cachix/install-nix-action@v31
with:
logger: pretty
nix_path: nixpkgs=channel:nixos-unstable

- name: Check Flake
run: nix flake check --accept-flake-config
Expand Down Expand Up @@ -53,8 +55,9 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- uses: cachix/install-nix-action@v26
- uses: DeterminateSystems/magic-nix-cache-action@main
- uses: cachix/install-nix-action@v31
with:
nix_path: nixpkgs=channel:nixos-unstable

- name: Build anyrun from the defined matrix
run: nix build .#${{ matrix.package }} --print-build-logs --extra-substituters "https://anyrun.cachix.org"
13 changes: 6 additions & 7 deletions .github/workflows/nix-cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ on:
workflow_call:
workflow_dispatch:
push:
branches:
- master
branches: ["master"]
paths-ignore:
- .gitignore
- README.md
Expand All @@ -19,10 +18,9 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main
- uses: cachix/install-nix-action@v31
with:
logger: pretty
nix_path: nixpkgs=channel:nixos-unstable

- name: Check Flake
run: nix flake check --accept-flake-config
Expand Down Expand Up @@ -57,8 +55,9 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- uses: cachix/install-nix-action@v26
- uses: DeterminateSystems/magic-nix-cache-action@main
- uses: cachix/install-nix-action@v31
with:
nix_path: nixpkgs=channel:nixos-unstable

- uses: cachix/cachix-action@v14
with:
Expand Down
13 changes: 13 additions & 0 deletions .taplo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[formatting]
align_entries = true
column_width = 100
compact_arrays = false
reorder_inline_tables = true
reorder_keys = true

[[rule]]
include = [ "**/Cargo.toml" ]
keys = [ "package" ]

[rule.formatting]
reorder_keys = false
5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
[workspace]
resolver = "2"
members = [
"anyrun",
"anyrun-plugin",
Expand All @@ -14,5 +13,7 @@ members = [
"plugins/stdin",
"plugins/dictionary",
"plugins/websearch",
"plugins/nix-run", "plugins/niri-focus",
"plugins/nix-run",
"plugins/niri-focus",
]
resolver = "2"
4 changes: 2 additions & 2 deletions anyrun-macros/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "anyrun-macros"
name = "anyrun-macros"
version = "25.9.3"
edition = "2021"

Expand All @@ -10,4 +10,4 @@ proc-macro = true

[dependencies]
quote = "1.0.37"
syn = { version = "2.0.85", features = ["full"] }
syn = { features = [ "full" ], version = "2.0.85" }
6 changes: 3 additions & 3 deletions anyrun-plugin/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[package]
name = "anyrun-plugin"
name = "anyrun-plugin"
version = "25.9.3"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
abi_stable = "0.11.1"
abi_stable = "0.11.1"
anyrun-interface = { git = "https://github.com/anyrun-org/anyrun-interface" }
anyrun-macros = { path = "../anyrun-macros" }
anyrun-macros = { path = "../anyrun-macros" }
25 changes: 13 additions & 12 deletions anyrun/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
[package]
name = "anyrun"
name = "anyrun"
version = "25.9.3"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
anyrun-macros = { path = "../anyrun-macros" }
abi_stable = "0.11.1"
ron = "0.8.0"
serde = { version = "1.0.210", features = ["derive"] }
anyrun-interface = { git = "https://github.com/anyrun-org/anyrun-interface" }
abi_stable = "0.11.1"
anyrun-interface = { git = "https://github.com/anyrun-org/anyrun-interface" }
anyrun-macros = { path = "../anyrun-macros" }
anyrun-provider-ipc = { git = "https://github.com/anyrun-org/anyrun-provider" }
clap = { version = "4.2.7", features = ["derive"] }
relm4 = { git = "https://github.com/Kirottu/Relm4", branch = "service" }

clap = { features = [ "derive" ], version = "4.2.7" }
gtk4 = "0.10.0"
gtk4-layer-shell = "0.6.3"
gtk4 = { version = "0.10.0", features = ["v4_12"] }
serde_json = "1.0.143"
tokio = { version = "1.47.1", features = ["sync", "rt-multi-thread", "net", "macros"] }
tree_magic_mini = "3.2.0"
relm4 = { branch = "service", git = "https://github.com/Kirottu/Relm4" }
ron = "0.8.0"
serde = { features = [ "derive" ], version = "1.0.210" }
serde_json = "1.0.143"
tokio = { features = [ "sync", "rt-multi-thread", "net", "macros" ], version = "1.47.1" }
tree_magic_mini = "3.2.0"
49 changes: 42 additions & 7 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
self',
config,
pkgs,
system,
...
}:
let
Expand All @@ -51,13 +52,16 @@
};
in
{
default = self'.packages.anyrun;
anyrun-provider = inputs.anyrun-provider.packages.${system}.default;

# By default the anyrun package is built without any plugins
# as per the `dontBuildPlugins` arg.
anyrun = callPackage ./nix/packages/anyrun.nix { inherit inputs lockFile; };
anyrun-with-all-plugins = callPackage ./nix/packages/anyrun.nix {
anyrun = callPackage ./nix/packages/anyrun.nix {
inherit inputs lockFile;
inherit (self.packages.${system}) anyrun-provider;
};

anyrun-with-all-plugins = self.packages.${system}.anyrun.override {
dontBuildPlugins = false;
};

Expand All @@ -77,7 +81,7 @@
websearch = mkPlugin "websearch";
niri-focus = mkPlugin "niri-focus";

anyrun-provider = inputs.anyrun-provider.packages.${pkgs.system}.default;
default = self'.packages.anyrun;
};

# Set up an overlay from packages exposed by this flake
Expand All @@ -88,10 +92,11 @@
inputsFrom = builtins.attrValues self'.packages;
packages = with pkgs; [
rustc
gcc
cargo

clippy
rustfmt
taplo
];
};

Expand All @@ -104,8 +109,38 @@
};
};

# provide the formatter for nix fmt
formatter = pkgs.alejandra;
# Provides the default formatter for 'nix fmt', which will format the
# entire tree with Alejandra. The wrapper script is necessary due to
# changes to the behaviour of Nix, which now encourages wrappers for
# tree-wide formatting.
formatter = pkgs.writeShellApplication {
name = "nix3-fmt-wrapper";

runtimeInputs = [
pkgs.nixfmt
pkgs.fd
pkgs.taplo
];

text = ''
# Find Nix files in the tree and format them with Alejandra
fd "$@" -t f -e nix -x nixfmt -q '{}'

# Same for TOML files, but with Taplo
fd "$@" -t f -e toml -x taplo fmt '{}'
'';
};

# Provides checks to be built an ran on 'nix flake check'. They can also
# be built individually with 'nix build' as described below.
checks = {
# Check if codebase is properly formatted.
# This can be initiated with `nix build .#checks.<system>.nix-fmt`
# or with `nix flake check`
nix-fmt = pkgs.runCommand "nix-fmt-check" { nativeBuildInputs = [ pkgs.nixfmt ]; } ''
nixfmt --check ${self} < /dev/null | tee $out
'';
};
};

flake = {
Expand Down
27 changes: 23 additions & 4 deletions nix/modules/home-manager.nix
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ let
attrs
;

defaultPackage = self.packages.${pkgs.stdenv.hostPlatform.system}.default;
defaultProvider = self.packages.${pkgs.stdenv.hostPlatform.system}.anyrun-provider;
defaultPackage = self.packages.${pkgs.stdenv.hostplatform.system}.default;
defaultProvider = defaultProvider.passthru.anyrun-provider or null;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a typo.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which part, passthru?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

defaultProvider = defaultProvider.<the rest>

cfg = config.programs.anyrun;
in
{
Expand All @@ -58,7 +58,11 @@ in
description = ''
Enable running Anyrun as a daemon, allowing for faster startup speed.

NOTE: This is required for clipboard functionality.
::: {.note}

This is required for the clipboard functionality

:::
'';
};

Expand All @@ -72,6 +76,7 @@ in
Anyrun package to use. Defaults to the one provided by the flake.
'';
};

config =
let
mkNumericOption =
Expand Down Expand Up @@ -119,6 +124,7 @@ in
provider = mkOption {
type = package;
default = defaultProvider;
defaultText = literalExpression "anyrun.packages.${pkgs.stdenv.hostPlatform.sytstem}.default.passthru.anyrun-provider";
description = ''
The program that is used for loading the plugins, and for the communcation with them.
'';
Expand Down Expand Up @@ -359,6 +365,19 @@ in
(assertNumeric cfg.config.height)
(assertNumeric cfg.config.x)
(assertNumeric cfg.config.y)

{
assertion = cfg.package.anyrun-provider != null;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't this trigger every time a package does have a valid passthru instead of only when it doesn't? Also, since you can still configure the provider through the module (programs.anyrun.config.provider) shouldn't that case disable this assertion since it is a valid way of configuring the provider?

message = ''
Anyrun expects 'anyrun-provider' to be exposed under 'passthru.anyrun-provider'. This is done
automatically in the Anyrun flake, but may not be the case if you are using the Home Manager
module from the Anyrun flake with 'pkgs.anyrun'. You may consider:

1. Using the Home Manager module from Home Manager to keep using 'pkgs.anyrun'
2. Using the Home Manager module from Anyrun, but don't override the package (recommended)
3. Ensure that your Anyrun package correctly provides 'anyrun-provider' under the passthru attr
'';
}
];

warnings =
Expand Down Expand Up @@ -414,7 +433,7 @@ in
if cfg.config.maxEntries == null then "None" else "Some(${toString cfg.config.maxEntries})"
},
plugins: ${toJSON parsedPlugins},
provider: "${lib.getExe cfg.config.provider}",
provider: ${if cfg.config.provider == null then "None" else "${lib.getExe cfg.config.provider}"},
${optionalString (cfg.config.extraLines != null) cfg.config.extraLines}
${keybinds}
)
Expand Down
Loading
Loading