Skip to content

Instantly share code, notes, and snippets.

View johanot's full-sized avatar

Johan Thomsen johanot

  • Danish Scout and Guide Association
  • Denmark
View GitHub Profile
{
certmgr = generic {};
certmgr-selfsigned = generic {
# The following patch makes it possible to use a self-signed x509 cert
# for the cfssl apiserver.
# TODO: remove patch when PR is merged.
patches = [
(fetchpatch {
url = "https://github.com/cloudflare/certmgr/pull/51.patch";
let
host = { ... }: {
networking.hostName = "foo";
disabledModules = [
"hardware/video/ati.nix"
"hardware/video/amdgpu-pro.nix" ];
};
bug = { config, lib, ... }:
let
host = { ... }: {
networking.hostName = "foo";
};
bug = { config, lib, ... }:
{
services.vmwareGuest = lib.mkIf (config.networking.hostName == "foo") {
enable = true;
headless = true;
config.dbc.host = mkDefault
(let
- byHostName = (import ../../hosts { inherit pkgs; }).allHostsbyName;
- netHostName = config.networking.hostName;
+ byHostName = (import ../../hosts { pkgs = import ../../common/nixpkgs.nix { version = "18.09"; }; }).allHostsbyName;
+ netHostName = "prometheus-p02";
in
if netHostName != "" && hasAttr netHostName byHostName
then byHostName.${netHostName}
{ config, pkgs, lib, ... }: with lib; with lib.types; {
options = {
dbc.host = lib.mkOption {
type = attrs;
description = ''
Holds host information as derived from JSON files in /hosts,
about the current host system being built.
'';
};
[nix-shell:~]$ nix-build '<nixpkgs>' --check -A tini
copying path '/nix/store/rc6k1h9iv8yf8y4s7x3l84nq8m07hj87-glibc-2.27-static' from 'https://cache.nixos.org'...
copying path '/nix/store/cr14xxbjmj0jry49c24i3p4ldmdvigl4-libuv-1.23.0' from 'https://cache.nixos.org'...
copying path '/nix/store/lnh9bl9a7al7p6jm36s8py4666qnw0p8-rhash-1.3.6' from 'https://cache.nixos.org'...
copying path '/nix/store/8m5fffwfjz3xjrvxjyv5nzc8wlydvaay-cmake-3.12.1' from 'https://cache.nixos.org'...
checking outputs of '/nix/store/65nzmm3fy0vsjayf4sx6j5m7dy937hmm-tini-0.18.0.drv'...
unpacking sources
unpacking source archive /nix/store/8i2437xbs4y487r24k45jddh0rg148w9-source
source root is source
{
reservations = with pkgs;
let
program = writeScript "cidr-filter.py" ''
#!${python3}/bin/python
import ipaddress
import json
import sys
{
reservations =
let
program = pkgs.writeText "cidr-filter.py" ''
import ipaddress
import json
import sys
with open(sys.argv[1]) as f:
data = json.load(f)
@johanot
johanot / gist:5d7cd3e29381d2ae70a94f7f7e540049
Created November 15, 2018 14:09
kubectl apply --prune -f namespaces.json --dry-run=false
namespace/user-af configured
namespace/user-anm configured
namespace/user-apo configured
namespace/user-atm configured
namespace/user-atu configured
namespace/user-ers configured
namespace/user-fd configured
@johanot
johanot / gist:4adb232cbc340e86304fac6e262fd6e1
Created November 15, 2018 14:09
kubectl apply --prune -f namespaces.json --dry-run=true
namespace/user-af configured (dry run)
namespace/user-anm configured (dry run)
namespace/user-apo configured (dry run)
namespace/user-atm configured (dry run)
namespace/user-atu configured (dry run)
namespace/user-ers configured (dry run)
namespace/user-fd configured (dry run)
namespace/user-hwha configured (dry run)
namespace/user-jbn configured (dry run)
namespace/user-jbr configured (dry run)