Skip to content

Instantly share code, notes, and snippets.

View LnL7's full-sized avatar
❄️
1970 /nix/store

Daiderd Jordan LnL7

❄️
1970 /nix/store
View GitHub Profile
{
# FIXME: do this properly and contribute
systemd.services.zfs-mount.requires = [ "zfs-import.target" ];
systemd.services.zfs-mount.wantedBy = [ "local-fs.target" ];
}
{
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"; }];
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>`
$ 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:
$ 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:
{ pkgs ? import <nixpkgs> {} }:
let
script = pkgs.writeScriptBin "readme" ''
#!${pkgs.stdenv.shell}
cat ${./README.md}
'';
in
@LnL7
LnL7 / carnix-cfg.patch
Last active April 29, 2020 19:00
Carnix patches for Ofborg
diff --git a/src/cfg.rs b/src/cfg.rs
index 56f76a0..e4b9b44 100644
--- a/src/cfg.rs
+++ b/src/cfg.rs
@@ -49,12 +49,16 @@ fn to_nix_op(w: &mut Write, op: CfgOp, target: &[Cfg]) -> Result<(), Error> {
}
is_first = false;
match *cfg {
- Cfg::Op { op, ref operands } => to_nix_op(w, op, operands)?,
+ Cfg::Op { op, ref operands } => {
$ sudo cntr attach -t command cntr-/nix/store/gcqpj041jll6qgq3cbkp73rbx1vjh96d-foo
$ cd /var/lib/cntr
% ls
bin build dev etc nix proc run tmp var
% ls build
env-vars
$ cntr exec bash
bash-4.4$ pwd
/
$ lldb ./result/bin/hello
(lldb) target create "./result/bin/hello"
Current executable set to './result/bin/hello' (x86_64).
(lldb) run
Process 27935 launched: '/src/nixpkgs/result/bin/hello' (x86_64)
warning: (x86_64) /src/nixpkgs/result/bin/hello(0x0000000100000000) address 0x0000000100000000 maps to more than one section: hello.__TEXT and hello.__TEXT
warning: (x86_64) /src/nixpkgs/result/bin/hello(0x0000000100000000) address 0x0000000100001000 maps to more than one section: hello.__DATA and hello.__DATA
Process 27935 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x42)
frame #0: 0x0000000100000f64 hello`main + 4
$ lldb ./result/bin/hello
(lldb) target create "./result/bin/hello"
Current executable set to './result/bin/hello' (x86_64).
(lldb) run
Process 27935 launched: '/src/nixpkgs/result/bin/hello' (x86_64)
warning: (x86_64) /src/nixpkgs/result/bin/hello(0x0000000100000000) address 0x0000000100000000 maps to more than one section: hello.__TEXT and hello.__TEXT
warning: (x86_64) /src/nixpkgs/result/bin/hello(0x0000000100000000) address 0x0000000100001000 maps to more than one section: hello.__DATA and hello.__DATA
Process 27935 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x42)
frame #0: 0x0000000100000f64 hello`main + 4