Skip to content

Instantly share code, notes, and snippets.

diff --git a/test/test-network/conf/25-tun.network b/test/test-network/conf/25-tun.network
new file mode 100644
index 0000000000..bbfba362b3
--- /dev/null
+++ b/test/test-network/conf/25-tun.network
@@ -0,0 +1,5 @@
+[Match]
+Name=tun99
+
+[Network]
diff --git a/src/network/networkd-dhcp6.c b/src/network/networkd-dhcp6.c
index d4d4182ee5..3b1fa5848b 100644
--- a/src/network/networkd-dhcp6.c
+++ b/src/network/networkd-dhcp6.c
@@ -1391,7 +1391,7 @@ int dhcp6_configure(Link *link) {
assert(link);
assert(link->network);
- if (!link_dhcp6_enabled(link) && !link_ipv6_accept_ra_enabled(link))
+ if (!link_dhcp6_enabled(link) && (!link_ipv6_accept_ra_enabled(link) || !link->hw_addr.length))
@Mic92
Mic92 / shell.nix
Last active October 28, 2020 17:52
Development environment to hack on llvm/clang
with import <nixpkgs> {};
let
gccForLibs = stdenv.cc.cc;
libc_lib = getLib stdenv.cc.libc;
in stdenv.mkDerivation {
name = "env";
buildInputs = [
bashInteractive
ninja
cmake
#!/usr/bin/env nix-shell
#!nix-shell -p nginx-config-formatter python3 -i python3
import os
import re
import shutil
import subprocess
import sys
from tempfile import TemporaryDirectory

not sure who started it => Outcome of one of the Berlin meetups ==> tomes of machines, where the hardware config was in multiple repos, It was expected that things are breaking with different nixos versions

Not easy to keep in sync with nixos channels

remove/add for different channels to make it work

Ideally, hardware-specific modules should only contain configuration that cannot be autodetected, e.g. no "enable Intel microcode" config. So quirks etc.

@Mic92
Mic92 / flake.nix
Last active July 30, 2020 15:56 — forked from Slabity/flake.nix
{
description = "Simple overlay flake";
inputs.nixpkgs.url = "nixpkgs/release-20.03";
outputs = inputs@{ self, nixpkgs }: {
apps.wine.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.wine.override ({
wineRelease = "staging";
wineBuild = "wineWow";
});
with import <nixpkgs> {};
let
shell = stdenv.mkDerivation {
name = "env";
dontUnpack = true;
installPhase = "touch $out";
buildInputs = [
tree
];
};
@Mic92
Mic92 / ssh-to-gpg.go
Last active August 9, 2021 14:54
Convert ssh private keys i.e. /etc/ssh/ssh_host_rsa_key to gpg
package main
import (
"crypto"
"crypto/rsa"
"fmt"
"io/ioutil"
"os"
"reflect"
"time"
@Mic92
Mic92 / default.nix
Last active July 2, 2020 09:06
stdenv with -nostdinc support
with import <nixpkgs> {};
let
libcPattern =
builtins.replaceStrings ["/"] ["\\/"] "${gcc.libc_dev}/include";
gcc' = wrapCCWith {
cc = gcc.cc;
bintools = binutils;
extraBuildCommands = ''
cat >> $out/nix-support/add-flags.sh <<'EOF'
if [[ "$@" = *-nostdinc* ]]; then
with import <nixpkgs> {};
let
mbedtlsVersion = "2.21.0";
mbedtls = fetchurl {
url = "https://github.com/ARMmbed/mbedtls/archive/mbedtls-${mbedtlsVersion}.tar.gz";
sha256 = "1f9dc0hpmp4g3l90wlk3glx5xl0hnnabmjagmr8fdbcnfl5r63ij";
};
mbedcryptoVersion = "3.1.0";
mbedcrypto = fetchurl {
url = "https://github.com/ARMmbed/mbed-crypto/archive/mbedcrypto-${mbedcryptoVersion}.tar.gz";