Init build support
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
xeals 2020-10-15 18:54:14 +11:00
parent bcff2d4406
commit d8faba3481
Signed by: xeals
GPG Key ID: A498C7AF27EC6B5C
6 changed files with 125 additions and 14 deletions

40
.drone.jsonnet Normal file
View File

@ -0,0 +1,40 @@
local Pipeline(channel) = {
kind: "pipeline",
type: "docker",
name: channel,
environment: {
NUR_REPO: "xeals",
// NIX_PATH: "nixpkgs=channel:" + channel,
CACHIX_CACHE: "xeals",
CACHIX_SIGNING_KEY: { from_secret: "cachix_key" },
},
steps: [
{
name: "build",
image: "nixos/nix",
commands: [
"nix-channel --add https://nixos.org/channels/" + channel + " nixos",
"nix-channel --update",
"nix-build ci.nix -A buildOutputs",
"nix eval -f default.nix 'lib'",
"nix eval -f default.nix 'modules'",
"nix eval -f default.nix 'overlays'"
]
},
{
name: "deploy",
image: "nixpkgs/cachix",
commands: [
'nix-build ci.nix -A cacheOutputs | cachix push "${CACHIX_CACHE}"'//,
// 'if [[ "cron" != "${DRONE_BUILD_EVENT}" && -z "${DRONE_PULL_REQUEST}" && "master" = "${DRONE_BRANCH}" ]]; then
// curl -XPOST "https://nur-update.herokuapp.com/update?repo=${NUR_REPO}"; fi'
]
}
]
};
[
Pipeline("nixpkgs-unstable"),
Pipeline("nixos-unstable"),
Pipeline("nixos-20.03"),
]

76
.drone.yml Normal file
View File

@ -0,0 +1,76 @@
---
kind: pipeline
type: docker
name: nixpkgs-unstable
platform:
os: linux
arch: amd64
steps:
- name: build
image: nixos/nix
commands:
- nix-channel --add https://nixos.org/channels/nixpkgs-unstable nixos
- nix-channel --update
- nix-build ci.nix -A buildOutputs
- nix eval -f default.nix 'lib'
- nix eval -f default.nix 'modules'
- nix eval -f default.nix 'overlays'
- name: deploy
image: nixpkgs/cachix
commands:
- nix-build ci.nix -A cacheOutputs | cachix push "${CACHIX_CACHE}"
---
kind: pipeline
type: docker
name: nixos-unstable
platform:
os: linux
arch: amd64
steps:
- name: build
image: nixos/nix
commands:
- nix-channel --add https://nixos.org/channels/nixos-unstable nixos
- nix-channel --update
- nix-build ci.nix -A buildOutputs
- nix eval -f default.nix 'lib'
- nix eval -f default.nix 'modules'
- nix eval -f default.nix 'overlays'
- name: deploy
image: nixpkgs/cachix
commands:
- nix-build ci.nix -A cacheOutputs | cachix push "${CACHIX_CACHE}"
---
kind: pipeline
type: docker
name: nixos-20.03
platform:
os: linux
arch: amd64
steps:
- name: build
image: nixos/nix
commands:
- nix-channel --add https://nixos.org/channels/nixos-20.03 nixos
- nix-channel --update
- nix-build ci.nix -A buildOutputs
- nix eval -f default.nix 'lib'
- nix eval -f default.nix 'modules'
- nix eval -f default.nix 'overlays'
- name: deploy
image: nixpkgs/cachix
commands:
- nix-build ci.nix -A cacheOutputs | cachix push "${CACHIX_CACHE}"
...

1
.envrc Normal file
View File

@ -0,0 +1 @@
eval "$(lorri direnv)"

View File

@ -14,8 +14,5 @@
modules = import ./modules; # NixOS modules
overlays = import ./overlays; # nixpkgs overlays
example-package = pkgs.callPackage ./pkgs/example-package { };
# some-qt5-package = pkgs.libsForQt5.callPackage ./pkgs/some-qt5-package { };
# ...
}
}

View File

@ -1,10 +0,0 @@
{ stdenv }:
stdenv.mkDerivation rec {
name = "example-package-${version}";
version = "1.0";
src = ./.;
buildPhase = "echo echo Hello World > example";
installPhase = "install -Dm755 example $out";
}

7
shell.nix Normal file
View File

@ -0,0 +1,7 @@
{ pkgs ? import <nixpkgs> {} }:
pkgs.mkShell {
buildInputs = [
pkgs.jsonnet pkgs.drone-cli
];
}