-
-
Notifications
You must be signed in to change notification settings - Fork 53
/
flake.nix
103 lines (92 loc) · 2.98 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
{
description = "A wayland native, highly customizable runner.";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
systems.url = "github:nix-systems/default-linux";
flake-parts = {
url = "github:hercules-ci/flake-parts";
inputs.nixpkgs-lib.follows = "nixpkgs";
};
};
outputs = {
self,
flake-parts,
systems,
...
} @ inputs:
flake-parts.lib.mkFlake {inherit inputs;} {
imports = [flake-parts.flakeModules.easyOverlay];
systems = import systems;
perSystem = {
self',
config,
pkgs,
...
}: let
inherit (pkgs) callPackage;
in {
packages = let
lockFile = ./Cargo.lock;
# Since all plugin derivations are called with the exact same arguments
# it is possible to streamline calling packages with a single function
# that takes name as an argument, and handles default inherits.
mkPlugin = name:
callPackage ./nix/packages/plugin.nix {
inherit inputs lockFile;
inherit name;
};
in {
default = self'.packages.anyrun;
# 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 {
inherit inputs lockFile;
dontBuildPlugins = false;
};
# Expose each plugin as a separate package. This uses the mkPlugin function
# to call the same derivation with same default inherits and the name of the
# plugin every time.
applications = mkPlugin "applications";
dictionary = mkPlugin "dictionary";
kidex = mkPlugin "kidex";
randr = mkPlugin "randr";
rink = mkPlugin "rink";
shell = mkPlugin "shell";
stdin = mkPlugin "stdin";
symbols = mkPlugin "symbols";
translate = mkPlugin "translate";
websearch = mkPlugin "websearch";
};
# Set up an overlay from packages exposed by this flake
overlayAttrs = config.packages;
devShells = {
default = pkgs.mkShell {
inputsFrom = builtins.attrValues self'.packages;
packages = with pkgs; [
rustc
gcc
cargo
clippy
rustfmt
];
};
nix = pkgs.mkShellNoCC {
packages = with pkgs; [
alejandra # formatter
statix # linter
deadnix # dead-code finder
];
};
};
# provide the formatter for nix fmt
formatter = pkgs.alejandra;
};
flake = {
homeManagerModules = {
anyrun = import ./nix/modules/home-manager.nix self;
default = self.homeManagerModules.anyrun;
};
};
};
}