mirror of
https://github.com/obsqrbtz/clrsync.git
synced 2026-04-08 20:19:04 +03:00
try to set default package
This commit is contained in:
@@ -7,6 +7,12 @@
|
|||||||
with lib;
|
with lib;
|
||||||
let
|
let
|
||||||
cfg = config.programs.clrsync;
|
cfg = config.programs.clrsync;
|
||||||
|
|
||||||
|
defaultPackage =
|
||||||
|
if args ? inputs && args.inputs ? clrsync
|
||||||
|
then args.inputs.clrsync.packages.${pkgs.system}.default or null
|
||||||
|
else null;
|
||||||
|
|
||||||
templateType = types.submodule {
|
templateType = types.submodule {
|
||||||
options = {
|
options = {
|
||||||
enabled = mkOption {
|
enabled = mkOption {
|
||||||
@@ -49,7 +55,8 @@ in
|
|||||||
options.programs.clrsync = {
|
options.programs.clrsync = {
|
||||||
enable = mkEnableOption "clrsync color synchronization";
|
enable = mkEnableOption "clrsync color synchronization";
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
type = types.package;
|
type = types.nullOr types.package;
|
||||||
|
default = defaultPackage;
|
||||||
defaultText = literalExpression "inputs.clrsync.packages.\${pkgs.system}.default";
|
defaultText = literalExpression "inputs.clrsync.packages.\${pkgs.system}.default";
|
||||||
description = "The clrsync package to use.";
|
description = "The clrsync package to use.";
|
||||||
};
|
};
|
||||||
@@ -104,7 +111,15 @@ in
|
|||||||
assertions = [
|
assertions = [
|
||||||
{
|
{
|
||||||
assertion = cfg.package != null;
|
assertion = cfg.package != null;
|
||||||
message = "programs.clrsync.package must be set. Add clrsync as a flake input and set: programs.clrsync.package = inputs.clrsync.packages.\${pkgs.system}.default;";
|
message = ''
|
||||||
|
programs.clrsync.package could not be automatically determined.
|
||||||
|
Please add clrsync to your flake inputs and pass it via extraSpecialArgs:
|
||||||
|
|
||||||
|
home-manager.extraSpecialArgs = { inherit inputs; };
|
||||||
|
|
||||||
|
Or manually set:
|
||||||
|
programs.clrsync.package = inputs.clrsync.packages.''${pkgs.system}.default;
|
||||||
|
'';
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user