Format Flake
This commit is contained in:
parent
ff72e9d520
commit
6af528ff9e
38
flake.nix
38
flake.nix
|
@ -13,45 +13,46 @@
|
|||
docker-utils.url = "github:collinarnett/docker-utils";
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, crane, flake-utils, docker-utils, ... }:
|
||||
flake-utils.lib.eachDefaultSystem (system:
|
||||
let
|
||||
outputs = {
|
||||
self,
|
||||
nixpkgs,
|
||||
crane,
|
||||
flake-utils,
|
||||
docker-utils,
|
||||
...
|
||||
}:
|
||||
flake-utils.lib.eachDefaultSystem (system: let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
|
||||
craneLib = crane.mkLib pkgs;
|
||||
|
||||
# Common arguments can be set here to avoid repeating them later
|
||||
# Note: changes here will rebuild all dependency crates
|
||||
commonArgs = {
|
||||
src = craneLib.cleanCargoSource ./.;
|
||||
strictDeps = true;
|
||||
|
||||
buildInputs = with pkgs;[
|
||||
buildInputs = with pkgs;
|
||||
[
|
||||
openssl
|
||||
pkg-config
|
||||
] ++ pkgs.lib.optionals pkgs.stdenv.isDarwin [
|
||||
# Additional darwin specific inputs can be set here
|
||||
]
|
||||
++ pkgs.lib.optionals pkgs.stdenv.isDarwin [
|
||||
pkgs.libiconv
|
||||
];
|
||||
};
|
||||
|
||||
my-crate = craneLib.buildPackage (commonArgs // {
|
||||
my-crate = craneLib.buildPackage (commonArgs
|
||||
// {
|
||||
cargoArtifacts = craneLib.buildDepsOnly commonArgs;
|
||||
|
||||
# Additional environment variables or build phases/hooks can be set
|
||||
# here *without* rebuilding all dependency crates
|
||||
# MY_CUSTOM_VAR = "some value";
|
||||
});
|
||||
|
||||
dockerImage = pkgs.dockerTools.buildImage {
|
||||
name = "git.gmem.ca/arch/duplikate";
|
||||
tag = "latest-${system}";
|
||||
config = {
|
||||
Cmd = [ "${my-crate}/bin/duplikate" ];
|
||||
Cmd = ["${my-crate}/bin/duplikate"];
|
||||
};
|
||||
};
|
||||
in
|
||||
{
|
||||
in {
|
||||
checks = {
|
||||
inherit my-crate;
|
||||
};
|
||||
|
@ -78,13 +79,8 @@
|
|||
};
|
||||
|
||||
devShells.default = craneLib.devShell {
|
||||
# Inherit inputs from checks.
|
||||
checks = self.checks.${system};
|
||||
|
||||
# Additional dev-shell environment variables can be set directly
|
||||
# MY_CUSTOM_DEVELOPMENT_VAR = "something else";
|
||||
|
||||
# Extra inputs can be added here; cargo and rustc are provided by default.
|
||||
packages = with pkgs; [
|
||||
rust-analyzer
|
||||
];
|
||||
|
|
Loading…
Reference in a new issue