Skip to content

Instantly share code, notes, and snippets.

@dustinlacewell-wk
Created October 13, 2017 17:34
Show Gist options
  • Save dustinlacewell-wk/c76a1d4eff158d84daac9dcd9fb29122 to your computer and use it in GitHub Desktop.
Save dustinlacewell-wk/c76a1d4eff158d84daac9dcd9fb29122 to your computer and use it in GitHub Desktop.
with (import <nixpkgs> {});
with builtins;
stdenv.mkDerivation {
name = "dot-emacs";
buildInputs = [ emacs ];
buildCommand = ''
source ${stdenv}/setup
mkdir -p $out
echo "Hello World" > $out/emacs.cfg
'';
}
#> nix-build ~/src/dotfiles
these derivations will be built:
/nix/store/24l8p5md7jn8x7sgx5g2xgk6qflm0vkj-dot-weechat.drv
/nix/store/9kig1f2jkjkvb5dxpp46zw8p691k3k5l-dot-emacs.drv
building path(s) ‘/nix/store/19i5gygdx9pa2xzzak4blg6iwjl1p8kv-dot-emacs’
building path(s) ‘/nix/store/m065zv7x2cfpr2jr1lwzakkv19dip3jw-dot-weechat’
/nix/store/19i5gygdx9pa2xzzak4blg6iwjl1p8kv-dot-emacs
/nix/store/m065zv7x2cfpr2jr1lwzakkv19dip3jw-dot-weechat
#> ls -la
total 16
drwxr-xr-x 4 dustinlacewell wheel 136 Oct 13 12:32 .
drwxrwxrwt 32 root wheel 1088 Oct 13 12:32 ..
lrwxr-xr-x 1 dustinlacewell wheel 53 Oct 13 12:32 result -> /nix/store/19i5gygdx9pa2xzzak4blg6iwjl1p8kv-dot-emacs
lrwxr-xr-x 1 dustinlacewell wheel 55 Oct 13 12:32 result-2 -> /nix/store/m065zv7x2cfpr2jr1lwzakkv19dip3jw-dot-weechat
#> ls result/
emacs.cfg
#> ls result-2/
weechat.cfg
with (import <nixpkgs> {});
with builtins;
stdenv.mkDerivation {
name = "dot-weechat";
buildInputs = [ weechat ];
buildCommand = ''
source ${stdenv}/setup
mkdir -p $out
echo "Hello World" > $out/weechat.cfg
'';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment