Repository navigation
Expand file tree
/
Copy pathflake.nix
More file actions
93 lines (80 loc) · 2.42 KB
/
Copy pathflake.nix
File metadata and controls
93 lines (80 loc) · 2.42 KB
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
{
description = "Fast magical cd alternative for lazy terminal navigators";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flakelight.url = "github:nix-community/flakelight";
home-manager.url = "github:nix-community/home-manager";
};
outputs =
{ flakelight, ... }:
flakelight ./. (
{ config, ... }:
{
package =
{
lib,
fetchFromGitHub,
rustPlatform,
nix-update-script,
...
}:
let
manifest = (lib.importTOML ./Cargo.toml).package;
in
rustPlatform.buildRustPackage (finalAttrs: {
pname = manifest.name;
version = manifest.version;
src = ./.;
passthru.updateScript = nix-update-script { };
cargoHash = "sha256-EPoVN3S+vQ1hwxWHUbYy1XSpEkswLDbl29lXV8IVCxA=";
meta = {
description = "Fast magical cd alternative for lacy terminal navigators";
homepage = "https://github.com/timothebot/lacy";
platforms = lib.platforms.all;
license = lib.licenses.mit;
mainProgram = "lacy";
maintainers = with lib.maintainers; [ ];
};
});
homeModule =
{
config,
lib,
pkgs,
...
}:
with lib;
let
cfg = config.programs.lacy;
in
{
options.programs.lacy = {
enable = mkEnableOption "lacy - magical cd alternative";
package = mkOption {
type = types.package;
default = pkgs.lacy;
description = "The lacy package to use.";
};
};
config = mkIf cfg.enable {
programs.bash.initExtra = mkIf config.programs.bash.enable ''
eval "$(${cfg.package}/bin/lacy init bash)"
'';
programs.zsh.initContent = mkIf config.programs.zsh.enable ''
eval "$(${cfg.package}/bin/lacy init zsh)"
'';
};
};
devShell = {
packages = pkgs: with pkgs; [ cargo rustc ];
};
app = { lacy, ... }: "${lacy}/bin/lacy";
systems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
}
);
}