Add modules

This commit is contained in:
Tobias Happ 2019-11-24 00:37:40 +01:00 committed by Alexander Sosedkin
parent 5cc656fffc
commit f40362898a
19 changed files with 1045 additions and 0 deletions

View file

@ -0,0 +1,67 @@
# Licensed under GNU Lesser General Public License v3 or later, see COPYING.
# Copyright (c) 2019 Alexander Sosedkin and other contributors, see AUTHORS.
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.environment;
in
{
###### interface
options = {
environment = {
packages = mkOption {
type = types.listOf types.package;
default = [];
description = "List of packages to be installed as user packages.";
};
path = mkOption {
type = types.package;
readOnly = true;
internal = true;
description = "Derivation for installing user packages.";
};
};
};
###### implementation
config = {
build.activation.installPackages = ''
$DRY_RUN_CMD nix-env --install ${cfg.path}
'';
environment = {
packages = [
(pkgs.callPackage ../../nix-on-droid { })
pkgs.bashInteractive
pkgs.cacert
pkgs.coreutils
pkgs.less # since nix tools really want a pager available, #27
pkgs.nix
];
path = pkgs.buildEnv {
name = "nix-on-droid-path";
paths = cfg.packages;
meta = {
description = "Environment of packages installed through nix-on-droid.";
};
};
};
};
}