meta: reorganize nix-os and hosts to single directory nixos
This commit is contained in:
parent
be46e02c61
commit
cb05ce5b44
76 changed files with 54 additions and 52 deletions
|
@ -1,46 +0,0 @@
|
|||
{ config, lib, pkgs, options, ... }:
|
||||
|
||||
# proot.dconf.rules
|
||||
# proot.dconf.profiles.<profile>.rulesToApply
|
||||
# proot.dconf.profiles.<profile>.extraRules
|
||||
let
|
||||
cfg = config.proot.dconf;
|
||||
profileOpts = lib.types.submodule {
|
||||
options = {
|
||||
rulesToApply = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.str;
|
||||
default = lib.attrNames cfg.rules;
|
||||
description = "A list of rules keys to apply for profile";
|
||||
};
|
||||
extraRules = lib.mkOption {
|
||||
type = lib.types.attrs;
|
||||
default = {};
|
||||
description = "An attrset of additional dconf rules to apply ontop of selected";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
mapper = _: value: {
|
||||
databases = lib.singleton {
|
||||
settings = lib.filterAttrs (key: _: lib.elem key value.rulesToApply) cfg.rules // value.extraRules;
|
||||
};
|
||||
};
|
||||
in
|
||||
{
|
||||
options.proot.dconf = {
|
||||
rules = lib.mkOption {
|
||||
type = lib.types.attrs;
|
||||
default = {};
|
||||
description = "An attrset of dconf rules to pull from";
|
||||
};
|
||||
profiles = lib.mkOption {
|
||||
type = lib.types.attrsOf profileOpts;
|
||||
default = {};
|
||||
description = "An attret of profiles to create, with pulled rules";
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
programs.dconf.profiles = lib.mapAttrs mapper cfg.profiles;
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue