mirror of
https://github.com/nix-community/nix-on-droid.git
synced 2025-11-08 19:46:07 +01:00
Add modules
This commit is contained in:
parent
5cc656fffc
commit
f40362898a
19 changed files with 1045 additions and 0 deletions
67
modules/environment/path.nix
Normal file
67
modules/environment/path.nix
Normal 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.";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue