Every Nix derivation produces a Nix store output that has 3 things:
- Executables
- Libraries
- Data
Executables are always exported using the PATH environment variable. This is pretty much automatic.
| use std::str; | |
| fn main() { | |
| // -- FROM: vec of chars -- | |
| let src1: Vec<char> = vec!['j','{','"','i','m','m','y','"','}']; | |
| // to String | |
| let string1: String = src1.iter().collect::<String>(); | |
| // to str | |
| let str1: &str = &src1.iter().collect::<String>(); | |
| // to vec of byte |
When you create a derivation, and you later run nix-build on the Nix
derivation. Nix will transport the source to a chrooted temporary build
directory (this actually can be configured in NixOS configuration.nix). The
reason to do this is to ensure deterministic builds in a clean environment.
However the environment is so clean that no dependencies that you don't
explicitly declare will be available in that environment. Also things that you
take for granted like PATH is something that needs to be explicitly built.
Nix generally assumes run-time dependencies is a subset of the build-time dependencies.
This means many Nix builder functions try to automatically scan the output for runtime dependencies and "rewrite" them for runtime usage.
However shell scripts which are often exported by packages do not get this automatic scanning treatment.
This means you have to use the makeWrapper package and use either the makeWrapper or wrapProgram utility functions.
| ;; switch to english input method when switching to normal mode | |
| ;; and switch back when entering insert/replace modes | |
| ;; need external script support, currently mac-only | |
| (defvar default-im "com.apple.keylayout.Dvorak" "Default ascii-only input method") | |
| (defvar prev-im (substring (shell-command-to-string "~/bin/im-select") 0 -1) | |
| "IM that I use when starting Emacs and exiting insert mode") | |
| (defun im-use-dvorak () | |
| "Switch to Dvorak input method on a Mac. im-select is a tool | |
| provided at http://git.io/ndA8Mw" |