This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
systemd.services.somemachine-rsync = { | |
after = [ | |
"zfs-import-tank.service" | |
]; | |
path = [ pkgs.rsync ]; | |
#this notifies another unit in case it fails, i get a text to my phone. | |
onFailure = [ | |
"unit-status@%n" | |
]; | |
script = '' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#10 is wan interface, 20 is lan, 25 is my bench/thing i want to keep away from internal. | |
#let established flows from bench to lan work | |
iptables -A FORWARD -i eno1.25 -o eno1.20 -m state --state ESTABLISHED,RELATED -j ACCEPT | |
#let bench to internet work | |
iptables -A FORWARD -i eno1.25 -o eno1.10 -j ACCEPT | |
#let established flows from internet to bench go | |
iptables -A FORWARD -i eno1.10 -o eno1.25 -m state --state ESTABLISHED,RELATED -j ACCEPT | |
#drop everything else. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[nix-shell:~]$ echo "(import ./default.nix).bar" | hnix - | |
import ./default.nix.bar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nix-repl> builtins.fetchGit { url = "https://github.com/dailykos/nixpkgs.git"; ref = "master"; } | |
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun | |
error: program 'git' failed with exit code 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0ogre:~% buildthis ./m6YaTZaL.txt | |
these derivations will be built: | |
/nix/store/xfazdy12k9bbnby3y1n77snmy073gnkc-rocketchat_2.10.5_amd64.deb.drv | |
/nix/store/ig4z35cb0y3v3wncyxh5iqq12nxspp8b-rocketchat-2.10.5.drv | |
these paths will be fetched (2.35 MiB download, 14.98 MiB unpacked): | |
/nix/store/2mjsfm0c4hkxamsn7rr6x2iabj95dak1-gconf-3.2.6 | |
/nix/store/3isyxdp6wmz7kabxqld8fky2ci51ql0s-libxkbfile-1.0.9 | |
/nix/store/amcjwgn9jchlpwr33d4gyk7qr3smqpss-ORBit2-2.14.19 | |
/nix/store/jlvwk1ijr4z3zq0nw34kkd88bjwrp7zi-dpkg-1.19.0.5 | |
/nix/store/wl5cg4fa3jj7jgnwxq7h5dbkrjc62iaw-libnotify-0.7.7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0ogre:~/t% nix-shell -p bundix | |
these paths will be fetched (0.01 MiB download, 0.03 MiB unpacked): | |
/nix/store/prirzp3f5gwl3k2lcnbr317gb7g6sfxb-bundix-2.3.1 | |
copying path '/nix/store/prirzp3f5gwl3k2lcnbr317gb7g6sfxb-bundix-2.3.1' from 'https://cache.nixos.org'... | |
[nix-shell:~/t]$ cat Gemfile | |
source 'https://rubygems.org' | |
gem 'nokogiri' | |
[nix-shell:~/t]$ bundix -l; bundix -i |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ configuration ? import ./lib/from-env.nix "NIXOS_CONFIG" <nixos-config> | |
, system ? builtins.currentSystem | |
}: | |
let | |
eval = import ./lib/eval-config.nix { | |
inherit system; | |
modules = [ configuration ]; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env nix-shell | |
#!nix-shell -p python27Packages.pygobject3 python27Packages.pygtk -i python | |
URL="http://git.alsa-project.org/?p=alsa.git;a=blob_plain;f=hda-analyzer/" | |
FILES=["hda_analyzer.py", "hda_guilib.py", "hda_codec.py", "hda_proc.py", | |
"hda_graph.py", "hda_mixer.py"] | |
try: | |
import gobject | |
import gtk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
services.openvpn.servers.example = { | |
config = someconfighere; | |
autoStart = true; | |
up = '' | |
echo nameserver $nameserver | ${pkgs.openresolv}/bin/resolvconf -a $dev | |
''; | |
down = '' | |
echo nameserver $nameserver | ${pkgs.openresolv}/bin/resolvconf -d $dev | |
''; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
if type nix-shell >/dev/null && [ -z "${IN_NIX_SHELL}" ]; then | |
exec nix-shell -p hello --run "${0} $@" | |
fi | |
hello |