refactor: further progress
This commit is contained in:
@@ -1,32 +1,46 @@
|
||||
{ config, ... }:
|
||||
let
|
||||
metaLib = config.meta.lib;
|
||||
metaRepo = metaLib.repo;
|
||||
repo = config.repo;
|
||||
repoHelpers = repo.helpers;
|
||||
in
|
||||
{
|
||||
flake.modules.homeManager.terminal =
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
repoTheme = metaRepo.theme.kanagawa;
|
||||
repoTheme = repo.theme.kanagawa;
|
||||
palette = repoTheme.palette;
|
||||
terminal = metaLib.resolveRepoTerminal {
|
||||
terminalPackage = repoHelpers.resolvePackagePath {
|
||||
inherit pkgs;
|
||||
path = repo.desktop.terminal.packagePath;
|
||||
};
|
||||
terminalDesktopId = repo.desktop.terminal.desktopId;
|
||||
in
|
||||
{
|
||||
assertions = metaLib.mkTerminalAssertions {
|
||||
inherit terminal;
|
||||
requireDesktopEntry = true;
|
||||
};
|
||||
assertions = [
|
||||
{
|
||||
assertion = terminalPackage != null;
|
||||
message = "Unknown terminal package `${lib.showAttrPath repo.desktop.terminal.packagePath}`.";
|
||||
}
|
||||
{
|
||||
assertion = repo.desktop.terminal.command == "kitty";
|
||||
message = "The terminal feature currently only supports kitty.";
|
||||
}
|
||||
{
|
||||
assertion =
|
||||
terminalPackage == null
|
||||
|| terminalDesktopId == null
|
||||
|| builtins.pathExists "${terminalPackage}/share/applications/${terminalDesktopId}";
|
||||
message = "Terminal package `${lib.showAttrPath repo.desktop.terminal.packagePath}` must provide `${terminalDesktopId}`.";
|
||||
}
|
||||
];
|
||||
|
||||
xdg.terminal-exec = {
|
||||
enable = true;
|
||||
settings.default = lib.optional (terminal.desktopId != null) terminal.desktopId;
|
||||
settings.default = lib.optional (terminalDesktopId != null) terminalDesktopId;
|
||||
};
|
||||
|
||||
programs.kitty = {
|
||||
|
||||
Reference in New Issue
Block a user