blob: 9dc788cb128e78adde344b0d0898497617734c2e (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
{ config, lib, ... }:
with lib;
{
options.vuizvui = {
modifyNixPath = mkOption {
type = types.bool;
default = true;
description = ''
Whether to modify NIX_PATH for vuizvui, so that <nixpkgs> points
to the path within the Nix channel instead of the
<literal>nixpkgs</literal> or <literal>nixos</literal> channel from the
root user.
'';
};
channelName = mkOption {
type = types.str;
default = "vuizvui";
description = ''
The channel name which is used to refer to <literal>vuizvui</literal>.
'';
};
};
config = {
nixpkgs.config.packageOverrides = pkgs: {
inherit (import ../../pkgs {
# We need to make sure to incorporate other package overrides,
# otherwise we are unable to override packages in vuizvui.*.
pkgs = pkgs // config.nixpkgs.config.packageOverrides pkgs;
}) vuizvui;
};
nix.binaryCachePublicKeys = [
"headcounter.org:/7YANMvnQnyvcVB6rgFTdb8p5LG1OTXaO+21CaOSBzg="
];
nix.nixPath = let
rootChannelsPath = "/nix/var/nix/profiles/per-user/root/channels";
channelPath = "${rootChannelsPath}/${config.vuizvui.channelName}";
in mkIf config.vuizvui.modifyNixPath (mkOverride 90 [
"vuizvui=${channelPath}"
"nixpkgs=${channelPath}/nixpkgs"
"nixos-config=/etc/nixos/configuration.nix"
rootChannelsPath
]);
};
}
|