45 lines
841 B
Nix
45 lines
841 B
Nix
![]() |
{
|
||
|
config,
|
||
|
lib,
|
||
|
pkgs,
|
||
|
...
|
||
|
}:
|
||
|
|
||
|
{
|
||
|
imports = [ ];
|
||
|
|
||
|
options.me = {
|
||
|
nix_index.enable = lib.mkOption {
|
||
|
type = lib.types.bool;
|
||
|
default = false;
|
||
|
example = true;
|
||
|
description = "Whether we want to install nix_index.";
|
||
|
};
|
||
|
};
|
||
|
|
||
|
config = lib.mkIf config.me.nix_index.enable (
|
||
|
lib.mkMerge [
|
||
|
{
|
||
|
environment.systemPackages = with pkgs; [
|
||
|
nix-index-unwrapped
|
||
|
];
|
||
|
|
||
|
environment.persistence."/state" = lib.mkIf (!config.me.buildingIso) {
|
||
|
hideMounts = true;
|
||
|
users.talexander = {
|
||
|
directories = [
|
||
|
{
|
||
|
directory = ".cache/nix-index";
|
||
|
user = "talexander";
|
||
|
group = "talexander";
|
||
|
mode = "0755";
|
||
|
}
|
||
|
];
|
||
|
};
|
||
|
};
|
||
|
|
||
|
}
|
||
|
]
|
||
|
);
|
||
|
}
|