Skip to content

Instantly share code, notes, and snippets.

View domenkozar's full-sized avatar
💭
I may be slow to respond.

Domen Kožar domenkozar

💭
I may be slow to respond.
View GitHub Profile
#!/usr/bin/env nix-shell
#!nix-shell -i runghc -p "haskellPackages.ghcWithPackages (pkgs: with pkgs; [servant-generic servant-client])"
#!nix-shell -I nixpkgs=http://nixos.org/channels/nixpkgs-unstable/nixexprs.tar.xz
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE UndecidableInstances #-}
#!/usr/bin/env nix-shell
#!nix-shell -i runghc -p "haskellPackages.ghcWithPackages (pkgs: with pkgs; [servant-generic servant-client])"
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE OverloadedStrings #-}
# Just put this in your cron (Runs every 1 minute).
# * * * * * /home/YOURUSERNAME/bin/suspend-on-low-battery
source /nix/var/nix/profiles/system/etc/profile
UPOWER=$(nix-build -A upower '<nixpkgs>')/bin/upower
NOTIFY_SEND=$(nix-build -A libnotify '<nixpkgs>')/bin/notify-send
DISPLAY=:0.0
battery_device=`$UPOWER -e | grep -i battery | head -n 1`
@domenkozar
domenkozar / nixos-on-dell-9560.org
Last active August 25, 2023 17:07 — forked from grahamc/nixos-on-dell-9560.org
NixOS on a Dell 15" 9560 with the 4K screen.
- git clone https://github.com/facebook/rocksdb.git
- mkdir rocksdb\build
- cd rocksdb\build
- cmake -G "Visual Studio 14 2015 Win64" -DOPTDBG=1 -DXPRESS=1 ..
- msbuild rocksdb.sln /p:Configuration=Release /m
- cd ..\..
- git clone https://github.com/serokell/rocksdb-haskell.git
- cd rocksdb-haskell
- stack build --test --extra-lib-dirs="..\rocksdb\build\Release" --extra-include-dirs="..\rocksdb\include"
ghc:
lookupSymbol failed in relocateSection (RELOC_GOT)
/nix/store/5an661jgv6655kf37srva02jwzpavw9n-rocksdb-4.13/lib/librocksdb.a: unknown symbol `___dso_handle'
ghc: Could not on-demand load symbol '__ZNSt3__16vectorINS_4pairIN7rocksdb10HistogramsENS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEEENS7_ISA_EEED1Ev'
ghc:
lookupSymbol failed in relocateSection (RELOC_GOT)
/nix/store/5an661jgv6655kf37srva02jwzpavw9n-rocksdb-4.13/lib/librocksdb.a: unknown symbol `___dso_handle'
ghc: Could not on-demand load symbol '__ZN7rocksdb19ColumnFamilyOptionsC2ERKS0_'
@domenkozar
domenkozar / README.md
Last active December 15, 2016 19:08 — forked from anonymous/vms-domen.nix

NOTE: /hugetlbsfs is expected to be mounted NOTE: Control numa core assignment by setting baseCore. First VM will get baseCore+1 assigned, second VM baseCore+2, etc

Building resources

$ nix-build --arg baseCore 0 --arg numVms 12 -A test_env vms-domen.nix -o test_env
$ cp -L test_env/* /mnt/mydisk/

Running VMs

@domenkozar
domenkozar / bower.json
Created October 19, 2016 14:19
bower2nix resolution support
{
"name": "pux-starter-app",
"homepage": "https://github.com/alexmingoia/pux-starter-app",
"authors": [
"Alex Mingoia <talk@alexmingoia.com>"
],
"description": "Starter Pux application using webpack with hot-reloading.",
"main": "support/index.js",
"license": "BSD3",
"dependencies": {
### Keybase proof
I hereby claim:
* I am domenkozar on github.
* I am ielectric (https://keybase.io/ielectric) on keybase.
* I have a public key whose fingerprint is E96C 15A0 8D17 CE3B 17B0 C7AB C2FF BCAF D2C2 4246
To claim this, I am signing this object:
configureFlags: --verbose --prefix=/nix/store/376znh75w6j6hw3i2bv61lc3z8sp0ppj-elm-compiler-0.17.1 --libdir=$prefix/lib/$compiler --libsubdir=$pkgid --with-gcc=gcc --package-db=/tmp/nix-build-elm-compiler-0.17.1.drv-0/package.conf.d --enable-split-objs --disable-library-profiling --disable-profiling --disable-shared --enable-library-vanilla
--disable-executable-dynamic --enable-tests