aboutsummaryrefslogtreecommitdiff
path: root/modules/nickel/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'modules/nickel/default.nix')
-rw-r--r--modules/nickel/default.nix46
1 files changed, 29 insertions, 17 deletions
diff --git a/modules/nickel/default.nix b/modules/nickel/default.nix
index c5736f0..30b40d4 100644
--- a/modules/nickel/default.nix
+++ b/modules/nickel/default.nix
@@ -57,7 +57,10 @@ in {
type = types.package;
readOnly = true;
internal = true;
- default = (pkgs.callPackage ../lib/merge-files.nix {}) (atrValues cfg.file);
+ default = symlinkJoin {
+ name = "nickel-files";
+ paths = mapAttrsToList (v: v._package) cfg.file;
+ };
};
path = mkOption {
@@ -77,7 +80,8 @@ in {
file = mkOption {
default = {};
- type = types.attrsOf (types.submodule (pkgs.callPackage ../lib/file-type.nix {});
+ type = types.attrsOf (types.submodule (pkgs.callPackage ../lib/file-type.nix {}));
+ apply = filterAttrs (_: v: v.enable);
};
menu = {
@@ -133,21 +137,29 @@ in {
};
};
- config = {
- nickel = {
- file = mkMerge [
- (mapAttrs (_: v: {
- text = concatMapStringsSep "\n" createGenerator v;
- }) cfg.menu.generator)
+ config = mkMerge [
+ {
+ nickel = {
+ file = mkMerge [
+ (mapAttrs (_: v: {
+ text = concatMapStringsSep "\n" createGenerator v;
+ }) cfg.menu.generator)
- (mapAttrs (_: v: {
- text = concatStringsSep "\n" (mapAttrsToList createExperimental v);
- }) cfg.menu.experimental)
+ (mapAttrs (_: v: {
+ text = concatStringsSep "\n" (mapAttrsToList createExperimental v);
+ }) cfg.menu.experimental)
- (mapAttrs (_: v: {
- text = concatMapStringsSep "\n" createMenuItem v;
- }) cfg.menu.item)
- ];
- };
- };
+ (mapAttrs (_: v: {
+ text = concatMapStringsSep "\n" createMenuItem v;
+ }) cfg.menu.item)
+ ];
+ };
+ }
+ (mkIf cfg.enable {
+ koboroot.include = singleton (pkgs.linkFarm [{
+ name = cfg.devicePath;
+ path = cfg._allFiles;
+ }]);
+ })
+ ];
}