2021-04-17 22:06:11 +00:00
|
|
|
{
|
2022-02-02 01:21:35 +00:00
|
|
|
description = "Command-line interface for email management";
|
2021-04-17 22:06:11 +00:00
|
|
|
|
|
|
|
inputs = {
|
|
|
|
utils.url = "github:numtide/flake-utils";
|
|
|
|
rust-overlay.url = "github:oxalica/rust-overlay";
|
2022-02-02 01:21:35 +00:00
|
|
|
naersk.url = "github:nix-community/naersk";
|
2021-04-17 22:06:11 +00:00
|
|
|
flake-compat = {
|
|
|
|
url = "github:edolstra/flake-compat";
|
|
|
|
flake = false;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2022-02-02 01:21:35 +00:00
|
|
|
outputs = { self, nixpkgs, utils, rust-overlay, naersk, ... }:
|
2021-04-17 22:06:11 +00:00
|
|
|
utils.lib.eachDefaultSystem
|
|
|
|
(system:
|
2021-06-03 14:51:48 +00:00
|
|
|
let
|
2021-04-17 22:06:11 +00:00
|
|
|
name = "himalaya";
|
2021-06-03 14:51:48 +00:00
|
|
|
pkgs = import nixpkgs {
|
|
|
|
inherit system;
|
|
|
|
overlays = [
|
2021-04-17 22:06:11 +00:00
|
|
|
rust-overlay.overlay
|
|
|
|
(self: super: {
|
|
|
|
# Because rust-overlay bundles multiple rust packages into one
|
|
|
|
# derivation, specify that mega-bundle here, so that crate2nix
|
|
|
|
# will use them automatically.
|
|
|
|
rustc = self.rust-bin.stable.latest.default;
|
|
|
|
cargo = self.rust-bin.stable.latest.default;
|
|
|
|
})
|
|
|
|
];
|
|
|
|
};
|
2022-02-02 01:21:35 +00:00
|
|
|
naersk-lib = naersk.lib.${system};
|
|
|
|
in
|
|
|
|
rec {
|
|
|
|
# nix build
|
|
|
|
defaultPackage = packages.${name};
|
|
|
|
packages = {
|
|
|
|
${name} = naersk-lib.buildPackage {
|
|
|
|
pname = name;
|
|
|
|
root = ./.;
|
|
|
|
nativeBuildInputs = with pkgs; [ openssl.dev pkgconfig ];
|
|
|
|
overrideMain = _: {
|
2021-06-03 13:33:25 +00:00
|
|
|
postInstall = ''
|
|
|
|
mkdir -p $out/share/applications/
|
|
|
|
cp assets/himalaya.desktop $out/share/applications/
|
|
|
|
'';
|
2021-04-17 22:06:11 +00:00
|
|
|
};
|
|
|
|
};
|
2021-06-03 14:51:48 +00:00
|
|
|
"${name}-vim" = pkgs.vimUtils.buildVimPluginFrom2Nix {
|
|
|
|
inherit (packages.${name}) version;
|
|
|
|
name = "${name}-vim";
|
|
|
|
src = self;
|
|
|
|
buildInputs = [ packages.${name} ];
|
2021-08-03 13:11:52 +00:00
|
|
|
dontConfigure = false;
|
|
|
|
configurePhase = "cd vim/";
|
2021-06-03 14:51:48 +00:00
|
|
|
postInstall = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
ln -s ${packages.${name}}/bin/himalaya $out/bin/himalaya
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
2021-04-17 22:06:11 +00:00
|
|
|
|
2022-02-02 01:21:35 +00:00
|
|
|
# nix run
|
|
|
|
defaultApp = apps.${name};
|
2021-04-17 22:06:11 +00:00
|
|
|
apps.${name} = utils.lib.mkApp {
|
|
|
|
inherit name;
|
|
|
|
drv = packages.${name};
|
|
|
|
};
|
|
|
|
|
2022-02-02 01:21:35 +00:00
|
|
|
# nix develop
|
2021-04-17 22:06:11 +00:00
|
|
|
devShell = pkgs.mkShell {
|
|
|
|
RUST_SRC_PATH = "${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}";
|
2022-02-02 01:21:35 +00:00
|
|
|
inputsFrom = builtins.attrValues self.packages.${system};
|
|
|
|
buildInputs = with pkgs; [
|
|
|
|
cargo
|
|
|
|
cargo-watch
|
|
|
|
trunk
|
|
|
|
ripgrep
|
|
|
|
rust-analyzer
|
|
|
|
rustfmt
|
|
|
|
rnix-lsp
|
|
|
|
nixpkgs-fmt
|
2022-03-04 13:19:54 +00:00
|
|
|
notmuch
|
2022-02-02 01:21:35 +00:00
|
|
|
];
|
2021-04-17 22:06:11 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
);
|
|
|
|
}
|