-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
80 lines (71 loc) · 2.47 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
{
description = "A rofi plugin that adds the ability to launch recent projects in JetBrains IDEs";
nixConfig = {
extra-substituters = ["https://rofi-jetbrains.cachix.org"];
extra-trusted-public-keys = ["rofi-jetbrains.cachix.org-1:jCHjg5XBg0A17G5/n1QBD39fxbg++URiJCvEuC5cnCs="];
};
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
crane.url = "github:ipetkov/crane";
fenix = {
url = "github:nix-community/fenix";
inputs.nixpkgs.follows = "nixpkgs";
inputs.rust-analyzer-src.follows = "";
};
};
outputs = {flake-parts, ...} @ inputs:
flake-parts.lib.mkFlake {inherit inputs;} {
systems = ["x86_64-linux" "aarch64-linux" "i686-linux"];
debug = true;
perSystem = {
pkgs,
system,
crane,
...
}: rec {
_module.args = {
pkgs = import inputs.nixpkgs {
inherit system;
config = {};
overlays = [inputs.fenix.overlays.default];
};
crane =
(inputs.crane.mkLib pkgs).overrideToolchain
(pkgs': (pkgs'.fenix.stable.withComponents ["cargo" "rustc" "rust-src" "clippy" "rustfmt"]));
};
packages = {
default = packages.rofi-jetbrains;
rofi-jetbrains = pkgs.callPackage ./. {inherit crane;};
rofi-jetbrains-next = pkgs.callPackage ./. {
inherit crane;
rofi_next = true;
};
};
devShells = {
default = pkgs.callPackage ./shell.nix {inherit crane;};
};
apps = let
mkRofiPackage = rofi: plugin:
if builtins.hasAttr "override" rofi
then rofi.override (old: {plugins = (old.plugins or []) ++ [plugin];})
else rofi;
in {
default =
if builtins.getEnv "WAYLAND_DISPLAY" == ""
then apps.rofi
else apps.rofi-wayland;
rofi-wayland = {
type = "app";
program = "${mkRofiPackage pkgs.rofi-wayland packages.rofi-jetbrains-next}/bin/rofi";
meta.description = "rofi-wayland cli with the `rofi-jetbrains` plugin pre-installed";
};
rofi = {
type = "app";
program = "${mkRofiPackage pkgs.rofi packages.rofi-jetbrains}/bin/rofi";
meta.description = "rofi cli with the `rofi-jetbrains` plugin pre-installed";
};
};
};
};
}