fix: fix nix build (#24)
* fix: fix nix build * feat: automatically prefix ANYRUN_PLUGINS with the nix store
This commit is contained in:
43
README.md
43
README.md
@@ -33,6 +33,7 @@ Here are the libraries you need to have to build & run it:
|
|||||||
- `glib2 (libgobject-2.0 libgio-2.0 libglib-2.0)`
|
- `glib2 (libgobject-2.0 libgio-2.0 libglib-2.0)`
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
[](https://repology.org/project/anyrun/versions)
|
[](https://repology.org/project/anyrun/versions)
|
||||||
|
|
||||||
### Nix
|
### Nix
|
||||||
@@ -66,48 +67,6 @@ You can use the flake:
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
_Note: The flake does not install the plugins anywhere like /etc/anyrun/plugins.
|
|
||||||
Make sure to specify full paths to the plugins in your config,
|
|
||||||
by managing it in Nix/home-manager, and using the full path, like this (in hm):_
|
|
||||||
|
|
||||||
```nix
|
|
||||||
xdg.configFile."anyrun/config.ron".text = ''
|
|
||||||
Config(
|
|
||||||
// `width` and `vertical_offset` use an enum for the value it can be either:
|
|
||||||
// Absolute(n): The absolute value in pixels
|
|
||||||
// Fraction(n): A fraction of the width or height of the full screen (depends on exclusive zones and the settings related to them) window respectively
|
|
||||||
|
|
||||||
// How wide the input box and results are.
|
|
||||||
width: Absolute(800),
|
|
||||||
|
|
||||||
// Where Anyrun is located on the screen: Top, Center
|
|
||||||
position: Top,
|
|
||||||
|
|
||||||
// How much the runner is shifted vertically
|
|
||||||
vertical_offset: Fraction(0.3),
|
|
||||||
|
|
||||||
// Hide match and plugin info icons
|
|
||||||
hide_icons: false,
|
|
||||||
|
|
||||||
// ignore exclusive zones, f.e. Waybar
|
|
||||||
ignore_exclusive_zones: false,
|
|
||||||
|
|
||||||
// Layer shell layer: Background, Bottom, Top, Overlay
|
|
||||||
layer: Overlay,
|
|
||||||
|
|
||||||
// Hide the plugin info panel
|
|
||||||
hide_plugin_info: true,
|
|
||||||
|
|
||||||
// Close window when a click outside the main box is received
|
|
||||||
close_on_click: false,
|
|
||||||
|
|
||||||
plugins: [
|
|
||||||
"${pkgs.anyrun}/lib/libapplications.so",
|
|
||||||
],
|
|
||||||
)
|
|
||||||
'';
|
|
||||||
```
|
|
||||||
|
|
||||||
### Manual installation
|
### Manual installation
|
||||||
|
|
||||||
Make sure all of the dependencies are installed, and then run the following commands in order:
|
Make sure all of the dependencies are installed, and then run the following commands in order:
|
||||||
|
17
default.nix
17
default.nix
@@ -1,10 +1,9 @@
|
|||||||
# default.nix
|
# default.nix
|
||||||
{
|
{
|
||||||
lib,
|
lib,
|
||||||
naersk,
|
|
||||||
glib,
|
glib,
|
||||||
targetPlatform,
|
|
||||||
makeWrapper,
|
makeWrapper,
|
||||||
|
rustPlatform,
|
||||||
atk,
|
atk,
|
||||||
gtk3,
|
gtk3,
|
||||||
gtk-layer-shell,
|
gtk-layer-shell,
|
||||||
@@ -16,7 +15,7 @@
|
|||||||
}: let
|
}: let
|
||||||
cargoToml = builtins.fromTOML (builtins.readFile ./anyrun/Cargo.toml);
|
cargoToml = builtins.fromTOML (builtins.readFile ./anyrun/Cargo.toml);
|
||||||
in
|
in
|
||||||
naersk.lib."${targetPlatform.system}".buildPackage {
|
rustPlatform.buildRustPackage {
|
||||||
src = ./.;
|
src = ./.;
|
||||||
|
|
||||||
buildInputs = [
|
buildInputs = [
|
||||||
@@ -27,9 +26,18 @@ in
|
|||||||
librsvg
|
librsvg
|
||||||
gtk-layer-shell
|
gtk-layer-shell
|
||||||
];
|
];
|
||||||
|
|
||||||
|
cargoLock = {
|
||||||
|
lockFile = ./Cargo.lock;
|
||||||
|
outputHashes = {
|
||||||
|
"kidex-common-0.1.0" = "sha256-sPzCTK0gdIYkKWxrtoPJ/F2zrG2ZKHOSmANW2g00fSQ=";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
checkInputs = [cargo rustc];
|
checkInputs = [cargo rustc];
|
||||||
|
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs = [
|
||||||
|
pkg-config
|
||||||
makeWrapper
|
makeWrapper
|
||||||
rustfmt
|
rustfmt
|
||||||
rustc
|
rustc
|
||||||
@@ -46,7 +54,8 @@ in
|
|||||||
|
|
||||||
postInstall = ''
|
postInstall = ''
|
||||||
wrapProgram $out/bin/anyrun \
|
wrapProgram $out/bin/anyrun \
|
||||||
--set GDK_PIXBUF_MODULE_FILE "$(echo ${librsvg.out}/lib/gdk-pixbuf-2.0/*/loaders.cache)"
|
--set GDK_PIXBUF_MODULE_FILE "$(echo ${librsvg.out}/lib/gdk-pixbuf-2.0/*/loaders.cache)" \
|
||||||
|
--prefix ANYRUN_PLUGINS : $out/lib
|
||||||
'';
|
'';
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
|
27
flake.lock
generated
27
flake.lock
generated
@@ -1,32 +1,12 @@
|
|||||||
{
|
{
|
||||||
"nodes": {
|
"nodes": {
|
||||||
"naersk": {
|
|
||||||
"inputs": {
|
|
||||||
"nixpkgs": [
|
|
||||||
"nixpkgs"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1679567394,
|
|
||||||
"narHash": "sha256-ZvLuzPeARDLiQUt6zSZFGOs+HZmE+3g4QURc8mkBsfM=",
|
|
||||||
"owner": "nmattia",
|
|
||||||
"repo": "naersk",
|
|
||||||
"rev": "88cd22380154a2c36799fe8098888f0f59861a15",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "nmattia",
|
|
||||||
"repo": "naersk",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1682109806,
|
"lastModified": 1682960002,
|
||||||
"narHash": "sha256-d9g7RKNShMLboTWwukM+RObDWWpHKaqTYXB48clBWXI=",
|
"narHash": "sha256-5Zjh4pT3lAjFGN1gVrjqj1LLJHKCAlGdLD8raU7oEMc=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "2362848adf8def2866fabbffc50462e929d7fffb",
|
"rev": "8670e496ffd093b60e74e7fa53526aa5920d09eb",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -38,7 +18,6 @@
|
|||||||
},
|
},
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"naersk": "naersk",
|
|
||||||
"nixpkgs": "nixpkgs"
|
"nixpkgs": "nixpkgs"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -3,23 +3,18 @@
|
|||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
||||||
naersk = {
|
|
||||||
url = "github:nmattia/naersk";
|
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = {
|
outputs = {
|
||||||
self,
|
self,
|
||||||
nixpkgs,
|
nixpkgs,
|
||||||
naersk,
|
|
||||||
}: let
|
}: let
|
||||||
cargoToml = builtins.fromTOML (builtins.readFile ./anyrun/Cargo.toml);
|
cargoToml = builtins.fromTOML (builtins.readFile ./anyrun/Cargo.toml);
|
||||||
supportedSystems = ["x86_64-linux" "aarch64-linux"];
|
supportedSystems = ["x86_64-linux" "aarch64-linux"];
|
||||||
forAllSystems = f: nixpkgs.lib.genAttrs supportedSystems (system: f system);
|
forAllSystems = f: nixpkgs.lib.genAttrs supportedSystems (system: f system);
|
||||||
in {
|
in {
|
||||||
overlay = final: prev: {
|
overlay = final: prev: {
|
||||||
"${cargoToml.package.name}" = final.callPackage ./. {inherit naersk;};
|
"${cargoToml.package.name}" = final.callPackage ./. {};
|
||||||
};
|
};
|
||||||
|
|
||||||
packages = forAllSystems (system: let
|
packages = forAllSystems (system: let
|
||||||
|
Reference in New Issue
Block a user