Skip to content

Instantly share code, notes, and snippets.

❄️
1970 /nix/store

Daiderd Jordan LnL7

❄️
1970 /nix/store
View GitHub Profile
@LnL7
LnL7 / config.json
Created Jun 17, 2020
OfBorg Configuration
View config.json
{
"runner": {
"identity": "test-builder"
},
"checkout": {
"root": "/tmp/ofborg"
},
"nix": {
"system": "x86_64-linux",
"remote": "daemon",
View hydra-job-revision
hydra-job-revision() {
local jobseteval job=$1
shift 1
case "$job" in
*'/'*) ;;
*) job="nixpkgs/trunk/$job" ;;
esac
case "$job" in
'http://'*|'https://'*) ;;
*) job="https://hydra.nixos.org/job/$job" ;;
View Dockerfile
FROM lnl7/nix:2.3.6
RUN nix-store --repair-path $(nix-store -qR $(which nix))
COPY entrypoint.sh /
ENTRYPOINT /entrypoint.sh
View configuration.nix
{ config, lib, ... }:
{
imports = [ ./example-module.nix ];
example.enable = true;
}
@LnL7
LnL7 / update
Last active Jul 13, 2020
Git deploy hook
View update
#!/usr/bin/env bash
set -e
BRANCH=master
TARGET=/etc/nixos
ref="$1"
oldrev="$2"
newrev="$3"
View zfs-configuration.nix
{
# FIXME: do this properly and contribute
systemd.services.zfs-mount.requires = [ "zfs-import.target" ];
systemd.services.zfs-mount.wantedBy = [ "local-fs.target" ];
}
View prometheus-configuration.nix.nix
{
services.nginx.virtualHosts."hostname".locations."/prometheus".proxyPass = "http://127.0.0.1:9090";
services.prometheus.enable = true;
services.prometheus.stateDir = "prometheus2";
services.prometheus.extraFlags = [ "--web.external-url=http://hostname/prometheus/" "--storage.tsdb.retention.time=3d" ];
services.prometheus.scrapeConfigs = [
{
job_name = "node";
static_configs = [{ targets = ["hostname:9100"]; labels.distro = "nixos"; }];
View main.rs
error[E0277]: the size for values of type `dyn std::error::Error + std::marker::Send + std::marker::Sync` cannot be known at compilation time
--> src/main.rs:9:78
|
67 | .map_err(|err| tide::Error::new(StatusCode::InternalServerError, err))?;
| ^^^ doesn't have a size known at compile-time
|
= help: the trait `std::marker::Sized` is not implemented for `dyn std::error::Error + std::marker::Send + std::marker::Sync`
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
= note: required because of the requirements on the impl of `std::error::Error` for `std::boxed::Box<dyn std::error::Error + std::marker::Send + std::marker::Sync>`
View gist:27b2bd61bbc2ba5d505b5f112c93e532
$ deploy
[master 86679e5] system: ybsqjcm5kcfvsqqwga4v7xsd8x240y88
1 file changed, 2 insertions(+), 2 deletions(-)
Enumerating objects: 5, done.
Counting objects: 100% (5/5), done.
Delta compression using up to 8 threads
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 342 bytes | 342.00 KiB/s, done.
Total 3 (delta 1), reused 0 (delta 0), pack-reused 0
remote:
View gist:e2a08608c9c3ad8f53374580f4e58e0c
$ deploy
[master 86679e5] system: ybsqjcm5kcfvsqqwga4v7xsd8x240y88
1 file changed, 2 insertions(+), 2 deletions(-)
Enumerating objects: 5, done.
Counting objects: 100% (5/5), done.
Delta compression using up to 8 threads
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 342 bytes | 342.00 KiB/s, done.
Total 3 (delta 1), reused 0 (delta 0), pack-reused 0
remote:
You can’t perform that action at this time.