2021-04-17 22:06:11 +00:00
|
|
|
{
|
2022-09-22 14:38:38 +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";
|
2022-05-28 12:36:32 +00:00
|
|
|
overlays = [ (import rust-overlay) ];
|
|
|
|
pkgs = import nixpkgs { inherit system overlays; };
|
2022-02-02 01:21:35 +00:00
|
|
|
in
|
|
|
|
rec {
|
|
|
|
# nix build
|
|
|
|
defaultPackage = packages.${name};
|
|
|
|
packages = {
|
2022-03-16 08:57:24 +00:00
|
|
|
${name} = naersk.lib.${system}.buildPackage {
|
2022-02-02 01:21:35 +00:00
|
|
|
pname = name;
|
|
|
|
root = ./.;
|
2022-09-28 20:20:41 +00:00
|
|
|
nativeBuildInputs = with pkgs; [ openssl.dev pkg-config ];
|
2022-02-02 01:21:35 +00:00
|
|
|
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
|
|
|
};
|
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 {
|
2022-02-02 01:21:35 +00:00
|
|
|
inputsFrom = builtins.attrValues self.packages.${system};
|
2022-05-28 18:03:27 +00:00
|
|
|
nativeBuildInputs = with pkgs; [
|
2022-05-28 12:36:32 +00:00
|
|
|
# Nix LSP + formatter
|
|
|
|
rnix-lsp
|
|
|
|
nixpkgs-fmt
|
|
|
|
|
|
|
|
# Rust env
|
|
|
|
(rust-bin.fromRustupToolchainFile ./rust-toolchain.toml)
|
2022-02-02 01:21:35 +00:00
|
|
|
cargo-watch
|
|
|
|
rust-analyzer
|
2022-05-28 12:36:32 +00:00
|
|
|
|
|
|
|
# Notmuch
|
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
|
|
|
};
|
|
|
|
}
|
|
|
|
);
|
|
|
|
}
|