feat: add foot and clean up config

This commit is contained in:
2026-04-27 15:27:27 +02:00
parent 8b31e1ca9f
commit bac6e4997b
8 changed files with 149 additions and 91 deletions
-5
View File
@@ -35,11 +35,6 @@
packagePath = [ "nautilus" ]; packagePath = [ "nautilus" ];
}; };
terminal = {
command = "kitty";
desktopId = "kitty.desktop";
packagePath = [ "kitty" ];
};
}; };
services = { services = {
+2 -2
View File
@@ -1,7 +1,7 @@
{ {
homeDirectory, homeDirectory,
lib, lib,
terminalPackage, terminal,
}: }:
{ {
settingsVersion = 53; settingsVersion = 53;
@@ -260,7 +260,7 @@
pinnedApps = [ ]; pinnedApps = [ ];
useApp2Unit = false; useApp2Unit = false;
sortByMostUsed = true; sortByMostUsed = true;
terminalCommand = "${lib.getExe terminalPackage} -e"; terminalCommand = lib.concatStringsSep " " ([ terminal.command ] ++ terminal.execArgs);
customLaunchPrefixEnabled = false; customLaunchPrefixEnabled = false;
customLaunchPrefix = ""; customLaunchPrefix = "";
viewMode = "grid"; viewMode = "grid";
+2 -3
View File
@@ -1,11 +1,10 @@
{ {
browserCommand, browserCommand,
lib, terminalCommand,
terminalPackage,
}: }:
{ {
"Mod+Return" = { "Mod+Return" = {
action.spawn = "${lib.getExe terminalPackage}"; action.spawn = terminalCommand;
hotkey-overlay.title = "Terminal"; hotkey-overlay.title = "Terminal";
}; };
"Mod+B" = { "Mod+B" = {
+4 -12
View File
@@ -38,10 +38,7 @@ in
inherit pkgs; inherit pkgs;
path = repo.desktop.fileManager.packagePath; path = repo.desktop.fileManager.packagePath;
}; };
terminalPackage = repoHelpers.resolvePackagePath { terminalCommand = config.repo.terminal.primary.command;
inherit pkgs;
path = repo.desktop.terminal.packagePath;
};
outputs = lib.mapAttrs ( outputs = lib.mapAttrs (
_: display: _: display:
{ {
@@ -160,17 +157,12 @@ in
}; };
}; };
binds = binds = import ./_bindings.nix {
if terminalPackage != null then
import ./_bindings.nix {
inherit inherit
browserCommand browserCommand
lib terminalCommand
; ;
terminalPackage = terminalPackage; };
}
else
{ };
}; };
}; };
} }
+6 -17
View File
@@ -4,20 +4,17 @@
... ...
}: }:
let let
repo = config.repo;
repoHelpers = repo.helpers;
mkNoctaliaSettings = mkNoctaliaSettings =
{ {
homeDirectory, homeDirectory,
lib, lib,
terminalPackage, terminal,
}: }:
import ./_noctalia-config.nix { import ./_noctalia-config.nix {
inherit inherit
homeDirectory homeDirectory
lib lib
terminalPackage terminal
; ;
}; };
@@ -25,22 +22,13 @@ let
{ {
homeDirectory, homeDirectory,
lib, lib,
pkgs, terminal,
}: }:
let
terminalPackage = repoHelpers.resolvePackagePath {
inherit pkgs;
path = repo.desktop.terminal.packagePath;
};
in
if terminalPackage == null then
{ }
else
mkNoctaliaSettings { mkNoctaliaSettings {
inherit inherit
homeDirectory homeDirectory
lib lib
terminalPackage terminal
; ;
}; };
@@ -78,8 +66,9 @@ in
}: }:
let let
baseSettings = mkBaseSettings { baseSettings = mkBaseSettings {
inherit lib pkgs; inherit lib;
homeDirectory = config.home.homeDirectory; homeDirectory = config.home.homeDirectory;
terminal = config.repo.terminal.primary;
}; };
settings = settings =
if baseSettings == { } || !osConfig.meta.machine.portable then if baseSettings == { } || !osConfig.meta.machine.portable then
+122 -41
View File
@@ -1,24 +1,66 @@
{ config, ... }: { config, ... }:
let let
repo = config.repo; repo = config.repo;
repoHelpers = repo.helpers;
in mkPrimaryTerminalOption =
{ lib:
flake.modules.nixos.terminfo = lib.mkOption {
{ pkgs, ... }: type = lib.types.submodule {
let options = {
terminalPackage = repoHelpers.resolvePackagePath { package = lib.mkOption {
inherit pkgs; type = lib.types.package;
path = repo.desktop.terminal.packagePath;
};
in
{
environment.systemPackages = [
terminalPackage.terminfo
];
}; };
flake.modules.homeManager.terminal = command = lib.mkOption {
type = lib.types.str;
};
desktopId = lib.mkOption {
type = lib.types.str;
};
execArgs = lib.mkOption {
type = lib.types.listOf lib.types.str;
default = [ ];
};
};
};
};
mkPrimaryTerminal =
{
desktopId,
packageFor,
terminalModule,
}:
{ lib, pkgs, ... }:
let
package = packageFor pkgs;
in
{
imports = [ terminalModule ];
options.repo.terminal.primary = mkPrimaryTerminalOption lib;
config = {
repo.terminal.primary = {
inherit
desktopId
package
;
command = lib.getExe package;
execArgs = [ "-e" ];
};
xdg.terminal-exec = {
enable = true;
settings.default = [ desktopId ];
};
};
};
in
{
flake.modules.homeManager.terminal-foot =
{ {
lib, lib,
pkgs, pkgs,
@@ -27,38 +69,65 @@ in
let let
repoTheme = repo.theme.kanagawa; repoTheme = repo.theme.kanagawa;
palette = repoTheme.palette; palette = repoTheme.palette;
terminalPackage = repoHelpers.resolvePackagePath { hex = lib.removePrefix "#";
inherit pkgs;
path = repo.desktop.terminal.packagePath;
};
terminalDesktopId = repo.desktop.terminal.desktopId;
in in
{ {
assertions = [ programs.foot = {
{
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; enable = true;
settings.default = lib.optional (terminalDesktopId != null) terminalDesktopId; package = pkgs.foot;
settings = {
main = {
font = "JetBrains Mono:size=11:fontfeatures=-liga:fontfeatures=-calt";
pad = "3x3";
}; };
bell.system = "no";
scrollback.lines = 10000;
colors-dark = {
background = hex palette.background;
foreground = hex palette.foreground;
selection-background = hex palette.selectionBackground;
selection-foreground = hex palette.selectionForeground;
urls = hex palette.url;
cursor = "${hex palette.background} ${hex palette.cursor}";
regular0 = hex palette.terminal.color0;
regular1 = hex palette.terminal.color1;
regular2 = hex palette.terminal.color2;
regular3 = hex palette.terminal.color3;
regular4 = hex palette.terminal.color4;
regular5 = hex palette.terminal.color5;
regular6 = hex palette.terminal.color6;
regular7 = hex palette.terminal.color7;
bright0 = hex palette.terminal.color8;
bright1 = hex palette.terminal.color9;
bright2 = hex palette.terminal.color10;
bright3 = hex palette.terminal.color11;
bright4 = hex palette.terminal.color12;
bright5 = hex palette.terminal.color13;
bright6 = hex palette.terminal.color14;
bright7 = hex palette.terminal.color15;
"16" = hex palette.terminal.color16;
"17" = hex palette.terminal.color17;
};
};
};
};
flake.modules.homeManager.terminal-kitty =
{ pkgs, ... }:
let
repoTheme = repo.theme.kanagawa;
palette = repoTheme.palette;
in
{
programs.kitty = { programs.kitty = {
enable = true; enable = true;
package = pkgs.kitty;
font = { font = {
name = "JetBrains Mono"; name = "JetBrains Mono";
size = 11; size = 11;
@@ -112,4 +181,16 @@ in
''; '';
}; };
}; };
flake.modules.homeManager.primary-terminal-foot = mkPrimaryTerminal {
desktopId = "foot.desktop";
packageFor = pkgs: pkgs.foot;
terminalModule = config.flake.modules.homeManager.terminal-foot;
};
flake.modules.homeManager.primary-terminal-kitty = mkPrimaryTerminal {
desktopId = "kitty.desktop";
packageFor = pkgs: pkgs.kitty;
terminalModule = config.flake.modules.homeManager.terminal-kitty;
};
} }
+2 -1
View File
@@ -52,7 +52,8 @@ in
homeModules.sops homeModules.sops
homeModules.git homeModules.git
homeModules.ssh-client homeModules.ssh-client
homeModules.terminal homeModules.primary-terminal-foot
homeModules.terminal-kitty
homeModules.theme homeModules.theme
homeModules.vicinae homeModules.vicinae
homeModules.xdg homeModules.xdg
+2 -1
View File
@@ -21,7 +21,6 @@ in
imports = [ imports = [
nixosModules.host-base nixosModules.host-base
nixosModules.terminfo
nixosModules.sops-host-ssh-key nixosModules.sops-host-ssh-key
nixosModules.openssh nixosModules.openssh
nixosModules.caddy nixosModules.caddy
@@ -35,6 +34,8 @@ in
./_disk.nix ./_disk.nix
]; ];
environment.enableAllTerminfo = true;
users.users.${account.name}.linger = true; users.users.${account.name}.linger = true;
}; };
} }