mirror of
https://codeberg.org/demostf/sync.git
synced 2026-06-03 16:44:07 +02:00
flake rework
This commit is contained in:
parent
82e79ef01d
commit
b0ae2c7927
14 changed files with 577 additions and 531 deletions
19
nix/docker.nix
Normal file
19
nix/docker.nix
Normal 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
4
nix/overlay.nix
Normal 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
26
nix/package.nix
Normal 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;
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue