Files
atuin-mirror/flake.nix
Marc Jakobi dc5cb308b5 build(nix): prevent deprecation warning on evaluation (#3006)
Evaluating the overlay produces the following evaluation warning:
`'system' has been renamed to/replaced by 'stdenv.hostPlatform.system'`

<!-- Thank you for making a PR! Bug fixes are always welcome, but if
you're adding a new feature or changing an existing one, we'd really
appreciate if you open an issue, post on the forum, or drop in on
Discord -->

## Checks
- [x] I am happy for maintainers to push small adjustments to this PR,
to speed up the review cycle
- [x] I have checked that there are no existing pull requests for the
same thing
2025-12-02 16:52:14 -08:00

75 lines
2.1 KiB
Nix

{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
fenix = {
url = "github:nix-community/fenix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
{ self
, nixpkgs
, flake-utils
, fenix
, ...
}:
flake-utils.lib.eachDefaultSystem
(system:
let
pkgs = nixpkgs.outputs.legacyPackages.${system};
in
{
packages.atuin = pkgs.callPackage ./atuin.nix {
rustPlatform =
let
toolchain =
fenix.packages.${system}.fromToolchainFile
{
file = ./rust-toolchain.toml;
sha256 = "sha256-SDu4snEWjuZU475PERvu+iO50Mi39KVjqCeJeNvpguU=";
};
in
pkgs.makeRustPlatform {
cargo = toolchain;
rustc = toolchain;
};
};
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}";
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
'';
});
})
// {
overlays.default = final: prev: {
inherit (self.packages.${final.stdenv.hostPlatform.system}) atuin;
};
};
}