From 4f471484b3a1e16230979a8406503a220b9101f4 Mon Sep 17 00:00:00 2001 From: Chris Wells Date: Tue, 10 Sep 2024 14:51:28 -0500 Subject: I think this is almost working! --- modules/plato/default.nix | 39 ++++++++++++++++++++++++--------------- 1 file changed, 24 insertions(+), 15 deletions(-) (limited to 'modules/plato/default.nix') diff --git a/modules/plato/default.nix b/modules/plato/default.nix index ac0c5d7..74fe8c1 100644 --- a/modules/plato/default.nix +++ b/modules/plato/default.nix @@ -55,25 +55,36 @@ in { }; }; - _finalPackage = mkOption { + finalPackage = mkOption { type = types.package; internal = true; readOnly = true; - default = pkgs.symlinkJoin { + default = pkgs.mergePaths { name = "plato-package"; paths = [ + (pkgs.linkFarm "plato" [{ + name = removePrefix "/" cfg.devicePath; + path = cfg.package.out; + }]) cfg._createdFiles - # (pkgs.linkFarm "plato-files" [{ - # name = removePrefix "/" cfg.devicePath; - # path = cfg.package.out; - # }]) - (pkgs.runCommandLocal "plato-files" {} '' - mkdir -p "$(dirname "$out${cfg.devicePath}")" - cp -r "${cfg.package.out}" "$out${cfg.devicePath}" - '') cfg.package.KoboRoot ]; }; + # pkgs.symlinkJoin { + # name = "plato-package"; + # paths = [ + # cfg._createdFiles + # # (pkgs.linkFarm "plato-files" [{ + # # name = removePrefix "/" cfg.devicePath; + # # path = cfg.package.out; + # # }]) + # (pkgs.runCommandLocal "plato-files" {} '' + # mkdir -p "$(dirname "$out${cfg.devicePath}")" + # cp -r "${cfg.package.out}" "$out${cfg.devicePath}" + # '') + # cfg.package.KoboRoot + # ]; + # }; }; _allFiles = mkOption { @@ -173,6 +184,7 @@ in { config = mkMerge [ { + info.plato = cfg.enable; plato.file = { "Settings.toml" = mkIf (cfg.settings != {}) { source = toml.generate "Settings.toml" cfg.settings; @@ -205,11 +217,8 @@ in { }; } (mkIf cfg.enable { - koboroot.include = singleton cfg._finalPackage; - # singleton (pkgs.linkFarm [{ - # name = cfg.devicePath; - # path = cfg._allFiles; - # }]); + koboroot.include = singleton cfg.finalPackage; + nickel.menu.item = mkIf cfg.nickel.enable { plato = singleton { -- cgit v1.2.3