forked from anyrun-org/anyrun
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathflake.nix
119 lines (100 loc) · 3.23 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
{
description = "A wayland native, highly customizable runner.";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-parts = {
url = "github:hercules-ci/flake-parts";
inputs.nixpkgs-lib.follows = "nixpkgs";
};
};
outputs = inputs @ {flake-parts, ...}:
flake-parts.lib.mkFlake {inherit inputs;} {
systems = ["x86_64-linux" "aarch64-linux"];
perSystem = {
config,
self',
inputs',
pkgs,
system,
...
}: let
inherit (inputs.nixpkgs) lib;
inherit (lib) getExe;
in {
# provide the formatter for nix fmt
formatter = pkgs.alejandra;
devShells.default = pkgs.mkShell {
inputsFrom = builtins.attrValues self'.packages;
packages = with pkgs; [
alejandra # nix formatter
rustfmt # rust formatter
statix # lints and suggestions
deadnix # clean up unused nix code
rustc # rust compiler
gcc
cargo # rust package manager
clippy # opinionated rust formatter
];
};
packages = let
lockFile = ./Cargo.lock;
in rec {
anyrun = pkgs.callPackage ./nix/default.nix {inherit inputs lockFile;};
# alias nix build .# to anyrun
default = anyrun;
anyrun-with-all-plugins = pkgs.callPackage ./nix/default.nix {
inherit inputs lockFile;
dontBuildPlugins = false;
};
# expose each plugin as a package
applications = pkgs.callPackage ./nix/plugins/default.nix {
inherit inputs lockFile;
name = "applications";
};
dictionary = pkgs.callPackage ./nix/plugins/default.nix {
inherit inputs lockFile;
name = "dictionary";
};
kidex = pkgs.callPackage ./nix/plugins/default.nix {
inherit inputs lockFile;
name = "kidex";
};
randr = pkgs.callPackage ./nix/plugins/default.nix {
inherit inputs lockFile;
name = "randr";
};
rink = pkgs.callPackage ./nix/plugins/default.nix {
inherit inputs lockFile;
name = "rink";
};
shell = pkgs.callPackage ./nix/plugins/default.nix {
inherit inputs lockFile;
name = "shell";
};
stdin = pkgs.callPackage ./nix/plugins/default.nix {
inherit inputs lockFile;
name = "stdin";
};
symbols = pkgs.callPackage ./nix/plugins/default.nix {
inherit inputs lockFile;
name = "symbols";
};
translate = pkgs.callPackage ./nix/plugins/default.nix {
inherit inputs lockFile;
name = "translate";
};
websearch = pkgs.callPackage ./nix/plugins/default.nix {
inherit inputs lockFile;
name = "websearch";
};
};
};
flake = _: rec {
nixosModules.home-manager = homeManagerModules.default;
homeManagerModules = rec {
anyrun = import ./nix/hm-module.nix inputs.self;
default = anyrun;
};
};
};
}