2023-02-15 10:04:07 +01:00
|
|
|
{
|
|
|
|
inputs = {
|
|
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
|
|
|
flake-utils.url = "github:numtide/flake-utils";
|
2023-03-01 20:51:31 +01:00
|
|
|
flake-compat = {
|
|
|
|
url = "github:edolstra/flake-compat";
|
|
|
|
flake = false;
|
|
|
|
};
|
2024-06-13 13:10:44 +02:00
|
|
|
fenix = {
|
|
|
|
url = "github:nix-community/fenix";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
2023-02-15 10:04:07 +01:00
|
|
|
};
|
|
|
|
outputs = {
|
|
|
|
self,
|
|
|
|
nixpkgs,
|
|
|
|
flake-utils,
|
2024-06-13 13:10:44 +02:00
|
|
|
fenix,
|
2023-02-15 10:04:07 +01:00
|
|
|
...
|
|
|
|
}:
|
|
|
|
flake-utils.lib.eachDefaultSystem (system: let
|
|
|
|
pkgs = nixpkgs.outputs.legacyPackages.${system};
|
|
|
|
in {
|
|
|
|
packages.atuin = pkgs.callPackage ./atuin.nix {
|
2023-10-30 09:18:26 +01:00
|
|
|
inherit (pkgs.darwin.apple_sdk.frameworks) Security SystemConfiguration AppKit;
|
2024-06-13 13:10:44 +02:00
|
|
|
rustPlatform = let
|
|
|
|
toolchain =
|
|
|
|
fenix.packages.${system}.fromToolchainFile
|
|
|
|
{
|
|
|
|
file = ./rust-toolchain.toml;
|
2024-08-14 13:35:36 +02:00
|
|
|
sha256 = "sha256-3jVIIf5XPnUU1CRaTyAiO0XHVbJl12MSx3eucTXCjtE=";
|
2024-06-13 13:10:44 +02:00
|
|
|
};
|
|
|
|
in
|
|
|
|
pkgs.makeRustPlatform {
|
|
|
|
cargo = toolchain;
|
|
|
|
rustc = toolchain;
|
|
|
|
};
|
2023-02-15 10:04:07 +01:00
|
|
|
};
|
|
|
|
packages.default = self.outputs.packages.${system}.atuin;
|
|
|
|
|
|
|
|
devShells.default = self.packages.${system}.default.overrideAttrs (super: {
|
|
|
|
nativeBuildInputs = with pkgs;
|
|
|
|
super.nativeBuildInputs
|
|
|
|
++ [
|
|
|
|
cargo-edit
|
|
|
|
clippy
|
|
|
|
rustfmt
|
|
|
|
];
|
|
|
|
RUST_SRC_PATH = "${pkgs.rustPlatform.rustLibSrc}";
|
2024-01-30 15:04:15 +01:00
|
|
|
|
|
|
|
shellHook = ''
|
|
|
|
echo >&2 "Setting development database path"
|
|
|
|
export ATUIN_DB_PATH="/tmp/atuin_dev.db"
|
|
|
|
export ATUIN_RECORD_STORE_PATH="/tmp/atuin_records.db"
|
|
|
|
|
|
|
|
if [ -e "''${ATUIN_DB_PATH}" ]; then
|
|
|
|
echo >&2 "''${ATUIN_DB_PATH} already exists, you might want to double-check that"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -e "''${ATUIN_RECORD_STORE_PATH}" ]; then
|
|
|
|
echo >&2 "''${ATUIN_RECORD_STORE_PATH} already exists, you might want to double-check that"
|
|
|
|
fi
|
|
|
|
'';
|
2023-02-15 10:04:07 +01:00
|
|
|
});
|
2023-10-29 19:27:52 +01:00
|
|
|
})
|
|
|
|
// {
|
|
|
|
overlays.default = final: prev: {
|
|
|
|
inherit (self.packages.${final.system}) atuin;
|
|
|
|
};
|
|
|
|
};
|
2023-02-15 10:04:07 +01:00
|
|
|
}
|