mirror of
https://github.com/atuinsh/atuin.git
synced 2026-10-11 22:29:51 +00:00
chore: update flake.nix (#3509)
Co-authored-by: Marko Vejnovic <[email protected]>
This commit is contained in:
co-authored by
Marko Vejnovic
parent
67d39afe82
commit
2f9357e724
@@ -31,3 +31,11 @@ jobs:
|
||||
- uses: cachix/install-nix-action@v31
|
||||
- name: Run nix build
|
||||
run: nix build --print-build-logs
|
||||
nixfmt:
|
||||
runs-on: depot-ubuntu-24.04
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: cachix/install-nix-action@v31
|
||||
# Run `nix fmt` to fix any failures here
|
||||
- name: Check nix formatting
|
||||
run: nix fmt -- --check $(git ls-files '*.nix')
|
||||
|
||||
@@ -32,3 +32,14 @@ jobs:
|
||||
|
||||
- name: Run nix build
|
||||
run: nix build --print-build-logs
|
||||
|
||||
nixfmt:
|
||||
runs-on: depot-ubuntu-24.04
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
- uses: cachix/install-nix-action@v31
|
||||
|
||||
# Run `nix fmt` to fix any failures here
|
||||
- name: Check nix formatting
|
||||
run: nix fmt -- --check $(git ls-files '*.nix')
|
||||
|
||||
@@ -22,9 +22,9 @@ rustPlatform.buildRustPackage {
|
||||
allowBuiltinFetchGit = true;
|
||||
};
|
||||
|
||||
nativeBuildInputs = [installShellFiles];
|
||||
nativeBuildInputs = [ installShellFiles ];
|
||||
|
||||
buildInputs = lib.optionals stdenv.isDarwin [libiconv];
|
||||
buildInputs = lib.optionals stdenv.isDarwin [ libiconv ];
|
||||
|
||||
postInstall = ''
|
||||
installShellCompletion --cmd atuin \
|
||||
|
||||
+9
-10
@@ -1,10 +1,9 @@
|
||||
(import
|
||||
(
|
||||
let lock = builtins.fromJSON (builtins.readFile ./flake.lock); in
|
||||
fetchTarball {
|
||||
url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
|
||||
sha256 = lock.nodes.flake-compat.locked.narHash;
|
||||
}
|
||||
)
|
||||
{ src = ./.; }
|
||||
).defaultNix
|
||||
(import (
|
||||
let
|
||||
lock = builtins.fromJSON (builtins.readFile ./flake.lock);
|
||||
in
|
||||
fetchTarball {
|
||||
url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
|
||||
sha256 = lock.nodes.flake-compat.locked.narHash;
|
||||
}
|
||||
) { src = ./.; }).defaultNix
|
||||
|
||||
Generated
+37
-37
@@ -8,11 +8,11 @@
|
||||
"rust-analyzer-src": "rust-analyzer-src"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1758609765,
|
||||
"narHash": "sha256-VIYu7R9Yc/CItjmzLSm21Lr9DgpEsKL5H+JUu8KDTn4=",
|
||||
"lastModified": 1780735433,
|
||||
"narHash": "sha256-VU1o4Rjte0jCdV/b+7ng7k1ka42wOvoargx2f1ZB8Ik=",
|
||||
"owner": "nix-community",
|
||||
"repo": "fenix",
|
||||
"rev": "05545a7f3cd5cd5628b195520758e56e6734b90a",
|
||||
"rev": "6d8f78e4d9aaac5faf2ad6e776462e41f15bdaeb",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -24,11 +24,11 @@
|
||||
"flake-compat": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1747046372,
|
||||
"narHash": "sha256-CIVLLkVgvHYbgI2UpXvIIBJ12HWgX+fjA8Xf8PUmqCY=",
|
||||
"lastModified": 1767039857,
|
||||
"narHash": "sha256-vNpUSpF5Nuw8xvDLj2KCwwksIbjua2LZCqhV1LNRDns=",
|
||||
"owner": "edolstra",
|
||||
"repo": "flake-compat",
|
||||
"rev": "9100a0f413b0c601e0533d1d94ffd501ce2e7885",
|
||||
"rev": "5edf11c44bc78a0d334f6334cdaf7d60d732daab",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -37,31 +37,31 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-utils": {
|
||||
"flake-parts": {
|
||||
"inputs": {
|
||||
"systems": "systems"
|
||||
"nixpkgs-lib": "nixpkgs-lib"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1731533236,
|
||||
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
|
||||
"lastModified": 1778716662,
|
||||
"narHash": "sha256-m1Yf0wZ8j1OHjTc2UwHwyQRSnNeSgLJOd7q5Y45hzi4=",
|
||||
"owner": "hercules-ci",
|
||||
"repo": "flake-parts",
|
||||
"rev": "f7c1a2d347e4c52d5fb8d10cb4d94b5884e546fb",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"owner": "hercules-ci",
|
||||
"repo": "flake-parts",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1758446476,
|
||||
"narHash": "sha256-5rdAi7CTvM/kSs6fHe1bREIva5W3TbImsto+dxG4mBo=",
|
||||
"lastModified": 1780747962,
|
||||
"narHash": "sha256-IX7G1dlKrOqPOImfbo7ADDfV5yU1+j+MRChI3TL4tAA=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "a1f79a1770d05af18111fbbe2a3ab2c42c0f6cd0",
|
||||
"rev": "cbb5cf358f50aa6acc9efd6113b7bcfbc352cd73",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -71,22 +71,37 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs-lib": {
|
||||
"locked": {
|
||||
"lastModified": 1777168982,
|
||||
"narHash": "sha256-GOkGPcboWE9BmGCRMLX3worL4EMnsnG8MyKmXNeYuhQ=",
|
||||
"owner": "nix-community",
|
||||
"repo": "nixpkgs.lib",
|
||||
"rev": "f5901329dade4a6ea039af1433fb087bd9c1fe14",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-community",
|
||||
"repo": "nixpkgs.lib",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"fenix": "fenix",
|
||||
"flake-compat": "flake-compat",
|
||||
"flake-utils": "flake-utils",
|
||||
"flake-parts": "flake-parts",
|
||||
"nixpkgs": "nixpkgs"
|
||||
}
|
||||
},
|
||||
"rust-analyzer-src": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1758556272,
|
||||
"narHash": "sha256-9amq6LAd0CFF3dLrJUItPiG64MQOG4QPrvjbjpa6NFc=",
|
||||
"lastModified": 1780646242,
|
||||
"narHash": "sha256-H8JxLhK8tuSDy1DEYpwK4iExw4jP4/mfH2SR9ZZJpj8=",
|
||||
"owner": "rust-lang",
|
||||
"repo": "rust-analyzer",
|
||||
"rev": "d05355db16dc526bb16bd84769ea840668d7015e",
|
||||
"rev": "09b33150cb25cd5a42fe3451272f1cce53afa6a0",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -95,21 +110,6 @@
|
||||
"repo": "rust-analyzer",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"systems": {
|
||||
"locked": {
|
||||
"lastModified": 1681028828,
|
||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"type": "github"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
flake-parts.url = "github:hercules-ci/flake-parts";
|
||||
flake-compat = {
|
||||
url = "github:edolstra/flake-compat";
|
||||
flake = false;
|
||||
@@ -12,63 +12,66 @@
|
||||
};
|
||||
};
|
||||
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-OATSZm98Es5kIFuqaba+UvkQtFsVgJEBMmS+t6od5/U=";
|
||||
};
|
||||
in
|
||||
pkgs.makeRustPlatform {
|
||||
inputs@{ flake-parts, fenix, ... }:
|
||||
flake-parts.lib.mkFlake { inherit inputs; } {
|
||||
systems = [
|
||||
"x86_64-linux"
|
||||
"aarch64-linux"
|
||||
"x86_64-darwin"
|
||||
"aarch64-darwin"
|
||||
];
|
||||
perSystem =
|
||||
{ pkgs, system, ... }:
|
||||
let
|
||||
toolchain = fenix.packages.${system}.fromToolchainFile {
|
||||
file = ./rust-toolchain.toml;
|
||||
sha256 = "sha256-OATSZm98Es5kIFuqaba+UvkQtFsVgJEBMmS+t6od5/U=";
|
||||
};
|
||||
atuin = pkgs.callPackage ./atuin.nix {
|
||||
rustPlatform = pkgs.makeRustPlatform {
|
||||
cargo = toolchain;
|
||||
rustc = toolchain;
|
||||
};
|
||||
};
|
||||
in
|
||||
{
|
||||
packages = {
|
||||
inherit atuin;
|
||||
default = atuin;
|
||||
};
|
||||
|
||||
formatter = pkgs.nixfmt;
|
||||
|
||||
devShells.default = pkgs.mkShell {
|
||||
inputsFrom = [ atuin ];
|
||||
|
||||
nativeBuildInputs =
|
||||
(with pkgs; [
|
||||
cargo-edit
|
||||
rust-analyzer
|
||||
])
|
||||
++ [ toolchain ];
|
||||
|
||||
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
|
||||
'';
|
||||
};
|
||||
};
|
||||
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;
|
||||
flake.overlays.default = final: _: {
|
||||
inherit (inputs.self.packages.${final.stdenv.hostPlatform.system}) atuin;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user