1
0
Fork 0
mirror of https://codeberg.org/demostf/sync.git synced 2026-06-03 16:44:07 +02:00

flake rework

This commit is contained in:
Robin Appelman 2024-11-22 21:30:45 +01:00
commit b0ae2c7927
14 changed files with 577 additions and 531 deletions

19
nix/docker.nix Normal file
View file

@ -0,0 +1,19 @@
{ dockerTools
, demostf-sync
,
}:
dockerTools.buildLayeredImage {
name = "demostf/sync";
tag = "latest";
maxLayers = 5;
contents = [
demostf-sync
dockerTools.caCertificates
];
config = {
Cmd = [ "sync" ];
ExposedPorts = {
"80/tcp" = { };
};
};
}

4
nix/overlay.nix Normal file
View file

@ -0,0 +1,4 @@
prev: final: {
demostf-sync = final.callPackage ./package.nix { };
demostf-sync-docker = final.callPackage ./docker.nix { };
}

26
nix/package.nix Normal file
View file

@ -0,0 +1,26 @@
{ stdenv
, rustPlatform
, lib
, pkg-config
, openssl
,
}:
let
inherit (lib.sources) sourceByRegex;
inherit (builtins) fromTOML readFile;
src = sourceByRegex ../. [ "Cargo.*" "(src)(/.*)?" ];
version = (fromTOML (readFile ../Cargo.toml)).package.version;
in
rustPlatform.buildRustPackage rec {
pname = "demostf-sync";
inherit src version;
buildInputs = [ openssl ];
nativeBuildInputs = [ pkg-config ];
cargoLock = {
lockFile = ../Cargo.lock;
};
}