68b5044cc0
"nix-env -i" profiles, as a container for flexible configuration at the style of nixos, to be defined in .nixpkgs/config.nix, with the main target of generating an activation script. svn path=/nixpkgs/trunk/; revision=33445
27 lines
469 B
Nix
27 lines
469 B
Nix
{ pkgs, config, ... }:
|
|
|
|
let
|
|
script = pkgs.writeScriptBin "usernixos" (''
|
|
#!${pkgs.bash}/bin/bash
|
|
'' + config.activationContents);
|
|
in
|
|
with pkgs.lib;
|
|
{
|
|
options = {
|
|
activation = mkOption {
|
|
default = {};
|
|
};
|
|
|
|
activationContents = mkOption {
|
|
default = "";
|
|
internal = true;
|
|
merge = concatStringsSep "\n";
|
|
description = ''
|
|
Commands to run at activation
|
|
'';
|
|
};
|
|
};
|
|
|
|
config.activation.toplevel = script;
|
|
}
|