nix/docker builds
This commit is contained in:
parent
8ec674e6e4
commit
5d35469a86
|
@ -1,2 +1,3 @@
|
|||
/target
|
||||
.env
|
||||
/result
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
{ pkgs ? import <nixpkgs> { }, sources ? import ./nix/sources.nix
|
||||
, naersk ? import sources.naersk { } }:
|
||||
with pkgs;
|
||||
|
||||
let
|
||||
srcNoTarget = dir:
|
||||
builtins.filterSource
|
||||
(path: type: type != "directory" || builtins.baseNameOf path != "target")
|
||||
dir;
|
||||
naersk = pkgs.callPackage sources.naersk { };
|
||||
src = srcNoTarget ./.;
|
||||
remapPathPrefix = true;
|
||||
in naersk.buildPackage {
|
||||
inherit src remapPathPrefix;
|
||||
buildInputs = with pkgs; [ pkg-config openssl libgit2 ];
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
{ system ? builtins.currentSystem }:
|
||||
|
||||
let
|
||||
pkgs = import <nixpkgs> { };
|
||||
callPackage = pkgs.lib.callPackageWith pkgs;
|
||||
gitea-release = callPackage ./default.nix { };
|
||||
|
||||
dockerImage = pkg:
|
||||
pkgs.dockerTools.buildLayeredImage {
|
||||
name = "xena/gitea-release";
|
||||
tag = "${gitea-release.version}";
|
||||
|
||||
contents = [ pkg ];
|
||||
|
||||
config = {
|
||||
Cmd = [ "/bin/gitea-release" "drone" ];
|
||||
WorkingDir = "/";
|
||||
};
|
||||
};
|
||||
|
||||
in dockerImage gitea-release
|
|
@ -1,4 +1,16 @@
|
|||
{
|
||||
"naersk": {
|
||||
"branch": "master",
|
||||
"description": "Build rust crates in Nix. No configuration, no code generation, no IFD. Sandbox friendly.",
|
||||
"homepage": "",
|
||||
"owner": "nmattia",
|
||||
"repo": "naersk",
|
||||
"rev": "a82fd7dc31a58c462b6dfa9d9d886fa2cc75dfd4",
|
||||
"sha256": "00bjwir52y6jbf0b22qy9qxramw35k5fc7kp9hymr1zgpmw9kbwg",
|
||||
"type": "tarball",
|
||||
"url": "https://github.com/nmattia/naersk/archive/a82fd7dc31a58c462b6dfa9d9d886fa2cc75dfd4.tar.gz",
|
||||
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
|
||||
},
|
||||
"nixpkgs-mozilla": {
|
||||
"branch": "master",
|
||||
"description": "mozilla related nixpkgs (extends nixos/nixpkgs repo)",
|
||||
|
|
Loading…
Reference in New Issue