mirror of
https://github.com/nix-community/nix-on-droid.git
synced 2025-11-08 19:46:07 +01:00
nix: Add nixPath option
This commit is contained in:
parent
07c4406897
commit
e3f821de81
1 changed files with 41 additions and 22 deletions
|
|
@ -1,4 +1,9 @@
|
|||
# Copyright (c) 2019-2021, see AUTHORS. Licensed under MIT License, see LICENSE.
|
||||
# Copyright (c) 2019-2022, see AUTHORS. Licensed under MIT License, see LICENSE.
|
||||
|
||||
# Based on
|
||||
# https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/services/misc/nix-daemon.nix
|
||||
# (Copyright (c) 2003-2022 Eelco Dolstra and the Nixpkgs/NixOS contributors,
|
||||
# licensed under MIT License as well)
|
||||
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
|
|
@ -31,6 +36,16 @@ in
|
|||
'';
|
||||
};
|
||||
|
||||
nixPath = mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = [];
|
||||
description = ''
|
||||
The default Nix expression search path, used by the Nix
|
||||
evaluator to look up paths enclosed in angle brackets
|
||||
(e.g. <literal><nixpkgs></literal>).
|
||||
'';
|
||||
};
|
||||
|
||||
substituters = mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = [];
|
||||
|
|
@ -62,8 +77,8 @@ in
|
|||
|
||||
###### implementation
|
||||
|
||||
config = {
|
||||
|
||||
config = mkMerge [
|
||||
{
|
||||
environment.etc = {
|
||||
"nix/nix.conf".text = ''
|
||||
sandbox = false
|
||||
|
|
@ -83,7 +98,11 @@ in
|
|||
"nix-on-droid.cachix.org-1:56snoMJTXmDRC1Ei24CmKoUqvHJ9XCp+nidK7qkMQrU="
|
||||
];
|
||||
};
|
||||
}
|
||||
|
||||
};
|
||||
(mkIf (cfg.nixPath != []) {
|
||||
environment.sessionVariables.NIX_PATH = cfg.nixPath;
|
||||
})
|
||||
];
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue