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
1a8ae407f5
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, ... }:
|
{ 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 {
|
substituters = mkOption {
|
||||||
type = types.listOf types.str;
|
type = types.listOf types.str;
|
||||||
default = [];
|
default = [];
|
||||||
|
|
@ -62,8 +77,8 @@ in
|
||||||
|
|
||||||
###### implementation
|
###### implementation
|
||||||
|
|
||||||
config = {
|
config = mkMerge [
|
||||||
|
{
|
||||||
environment.etc = {
|
environment.etc = {
|
||||||
"nix/nix.conf".text = ''
|
"nix/nix.conf".text = ''
|
||||||
sandbox = false
|
sandbox = false
|
||||||
|
|
@ -83,7 +98,11 @@ in
|
||||||
"nix-on-droid.cachix.org-1:56snoMJTXmDRC1Ei24CmKoUqvHJ9XCp+nidK7qkMQrU="
|
"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