This commit is contained in:
2025-09-12 01:46:27 +10:00
parent 38bd4239fe
commit 21697be45e
2 changed files with 68 additions and 28 deletions

View File

@@ -4,41 +4,47 @@
inputs = {
naersk.url = "github:nix-community/naersk";
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = {
self,
naersk,
nixpkgs,
}: let
system = "x86_64-linux";
pkgs = import nixpkgs {inherit system;};
naerskLib = pkgs.callPackage naersk {};
buildInputs = [pkgs.openssl];
nativeBuildInputs = [pkgs.pkg-config];
in {
packages.${system}.default = naerskLib.buildPackage {
src = ./.;
buildInputs = buildInputs;
nativeBuildInputs = nativeBuildInputs;
};
flake-utils,
}:
flake-utils.lib.eachDefaultSystem (
system: let
pkgs = import nixpkgs {
inherit system;
};
naerskLib = pkgs.callPackage naersk {};
buildInputs = [pkgs.openssl];
nativeBuildInputs = [pkgs.pkg-config];
in {
packages.${system}.default = naerskLib.buildPackage {
src = ./.;
buildInputs = buildInputs;
nativeBuildInputs = nativeBuildInputs;
};
devShells.${system}.default = pkgs.mkShell {
inputsFrom = [self.packages.${system}.default];
devShells.${system}.default = pkgs.mkShell {
inputsFrom = [self.packages.${system}.default];
packages = with pkgs; [
rustc
cargo
rustfmt
rust-analyzer
zsh
];
packages = with pkgs; [
rustc
cargo
rustfmt
rust-analyzer
zsh
];
shellHook = ''
export SHELL=${pkgs.zsh}/bin/zsh
# jump into zsh if we didn't already start in it
[ -z "$ZSH_VERSION" ] && exec ${pkgs.zsh}/bin/zsh -l
'';
};
};
shellHook = ''
export SHELL=${pkgs.zsh}/bin/zsh
# jump into zsh if we didn't already start in it
[ -z "$ZSH_VERSION" ] && exec ${pkgs.zsh}/bin/zsh -l
'';
};
}
);
}