rduplain / nixd Goto Github PK
View Code? Open in Web Editor NEWnixd builds unix environments
License: BSD 2-Clause "Simplified" License
nixd builds unix environments
License: BSD 2-Clause "Simplified" License
In one of my projects, I have a script at ./bin/nixd_env which looks like this:
#!/bin/bash
export GEM_HOME=$PWD/nixd/usr
export RUBYOPT=rubygems
for dir in $PWD/nixd/bin $PWD/nixd/usr/bin $PWD/nixd/opt/*/bin ; do
export PATH=$dir:$PATH
done
for dir in $PWD/src/python2/*; do
export PYTHONPATH=$dir:$PYTHONPATH
done
exec $@
Callers look like this:
./bin/nixd_env nixd install all
./bin/nixd_env python2.7 -m SimpleHTTPServer
Since nixd provides environments, having a shell activation script would be very convenient. This would likely require a hook for package scripts to provide environment variables, where nixd picks up the entire environment based only on what's provided by package scripts.
Consider adding a 'clean' command, both top-level and in package scripts. A clean recipe is:
rm -fr nixd/usr/ nixd/opt/ nixd/src/ nixd/var/
However, removing nixd/src/ is inconvenient if you do not have NIXD_MIRROR set. An alternative would be to have clean be:
rm -fr nixd/usr/ nixd/opt/ nixd/var/
nixd/bin/nixd clean
Each package script would then remove any files in src which are added during pretest and install.
All arguments in v0.3 are positional and straightforward to parse using shift
. Everything is configurable through environment variables but in some cases, that's an implementation detail. Provide flags for NIXD_VERBOSE and NIXD_DIR.
Here is a good discussion on getopt vs getopts:
http://blog.onetechnical.com/2012/07/16/bash-getopt-versus-getopts/
I prefer use of GNU-style long options, e.g. -v and --verbose, which rules out getopts.
Support nixd help
and nixd help command
.
Currently, nixd prints a useful message when called without arguments, showing the configuration variables and describing each of the available subcommands. The published README covers all topics, and nixd logs a lot of useful messages when verbose. But nixd does not have a help command.
reinstall would work just like install, but would ignore the check command result of each package script.
I have been looking for a better name than "check" for the function/subcommand which checks whether or not there is work to do for a package script. So far, "check" has served well because it is short/simple and does not have the same ambiguity issue that names like "test", "configtest", and "ready" have. That is, the notion of being ready is different from the perspective of writing the script as from running it.
nixd will check if there's work to do as a means to assert that the package script's intent is consistent with the project's needs. As a consistency check, "assert" is clearer than "check".
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.