Skip to content

Instantly share code, notes, and snippets.

@haslersn
haslersn / default.nix
Created March 23, 2019 23:08
Does not work
{ pkgsPath ? <nixpkgs>, crossSystem ? null }:
let
mozOverlay = import (
builtins.fetchTarball https://github.com/mozilla/nixpkgs-mozilla/archive/master.tar.gz
);
pkgs = import pkgsPath {
overlays = [ mozOverlay ];
inherit crossSystem;
};
{ lib, ... }:
{
flipNames = attrs:
lib.mapAttrs
(_: lib.foldl (a: b: a // b) {})
(lib.zipAttrs
(lib.mapAttrsToList
(n: v: lib.mapAttrs (n': v': { ${n} = v'; }) v)
attrs
{ ...}:
{
#...
nixpkgs.overlays = [
(import ./overlay.nix)
];
#...
let
krops = builtins.fetchGit "https://cgit.krebsco.de/krops/";
lib = import "${krops}/lib";
pkgs = import "${krops}/pkgs" {};
mksrc = name: lib.evalSource [ {
systems.file = toString ./systems;
nixos-config.symlink = "systems/${name}/config.nix";
nixpkgs.git = {
ref = "nixos-18.09";
@haslersn
haslersn / riot-web.nix
Created February 21, 2019 00:07
NixOS container hosting Riot-Web
{
privateNetwork = true;
hostAddress = "192.168.101.1";
localAddress = "192.168.101.2";
autoStart = true;
config = { config, pkgs, ... }: {
services.nginx = {
enable = true;
virtualHosts."localhost".root = pkgs.riot-web;
};
@haslersn
haslersn / lsmod
Created February 18, 2019 22:39
lsmod difference without ZFS support -> with ZFS support on Fujitsu Lifebook U748
diff --git a/lsmod-sorted b/lsmod-sorted
index 6c919ff..1e45496 100644
--- a/lsmod-sorted
+++ b/lsmod-sorted
@@ -25,13 +25,13 @@ cryptd 24576 3 crypto_simd,ghash_clmulni_intel,aesni_intel
crypto_simd 16384 1 aesni_intel
dax 24576 1 dm_mod
dm_mod 131072 6
-drm 380928 5 drm_kms_helper,i915
+drm 380928 9 drm_kms_helper,i915
@haslersn
haslersn / build.log
Last active January 9, 2019 20:32
[nixpkgs] nvidia-x11 doesn't build on unstable
these derivations will be built:
/nix/store/8220ck2qcp4yvjzvfl38qacdfn9jhza7-nvidia-x11-410.78-4.20.drv
building '/nix/store/8220ck2qcp4yvjzvfl38qacdfn9jhza7-nvidia-x11-410.78-4.20.drv'...
unpacking sources
tail: error writing 'standard output': Broken pipe
Creating directory NVIDIA-Linux-x86_64-410.78
Verifying archive integrity... OK
Uncompressing NVIDIA Accelerated Graphics Driver for Linux-x86_64 410.78/nix/store/c3kfa2zpvihxkaxx15nwg5yr4d22zadh-NVIDIA-Linux-x86_64-410.78.run: line 1000: /build/makeself.pYcK9sEY/xz: No such file or directory
tail: error writing 'standard output': Broken pipe
/nix/store/c3kfa2zpvihxkaxx15nwg5yr4d22zadh-NVIDIA-Linux-x86_64-410.78.run: line 991: /dev/tty: No such device or address
@haslersn
haslersn / default.nix
Created November 5, 2018 14:01
[Nix] Ansible environment
with import <nixpkgs> {};
buildEnv {
name = "stuvus_config-env";
paths = [
ansible
jq
(python2.withPackages(ps: with ps; [ pyyaml jmespath ]))
];
}
@haslersn
haslersn / shell.nix
Created September 24, 2018 16:26
Code that works with `nix-shell` but not with `nix-shell -E 'code'`
with import <nixpkgs> {};
stdenv.mkDerivation {
name = "my-nix-shell";
buildInputs = [ (import ./default.nix) ];
}