feat: add foot and clean up config
This commit is contained in:
@@ -35,11 +35,6 @@
|
||||
packagePath = [ "nautilus" ];
|
||||
};
|
||||
|
||||
terminal = {
|
||||
command = "kitty";
|
||||
desktopId = "kitty.desktop";
|
||||
packagePath = [ "kitty" ];
|
||||
};
|
||||
};
|
||||
|
||||
services = {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
homeDirectory,
|
||||
lib,
|
||||
terminalPackage,
|
||||
terminal,
|
||||
}:
|
||||
{
|
||||
settingsVersion = 53;
|
||||
@@ -260,7 +260,7 @@
|
||||
pinnedApps = [ ];
|
||||
useApp2Unit = false;
|
||||
sortByMostUsed = true;
|
||||
terminalCommand = "${lib.getExe terminalPackage} -e";
|
||||
terminalCommand = lib.concatStringsSep " " ([ terminal.command ] ++ terminal.execArgs);
|
||||
customLaunchPrefixEnabled = false;
|
||||
customLaunchPrefix = "";
|
||||
viewMode = "grid";
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
{
|
||||
browserCommand,
|
||||
lib,
|
||||
terminalPackage,
|
||||
terminalCommand,
|
||||
}:
|
||||
{
|
||||
"Mod+Return" = {
|
||||
action.spawn = "${lib.getExe terminalPackage}";
|
||||
action.spawn = terminalCommand;
|
||||
hotkey-overlay.title = "Terminal";
|
||||
};
|
||||
"Mod+B" = {
|
||||
|
||||
@@ -38,10 +38,7 @@ in
|
||||
inherit pkgs;
|
||||
path = repo.desktop.fileManager.packagePath;
|
||||
};
|
||||
terminalPackage = repoHelpers.resolvePackagePath {
|
||||
inherit pkgs;
|
||||
path = repo.desktop.terminal.packagePath;
|
||||
};
|
||||
terminalCommand = config.repo.terminal.primary.command;
|
||||
outputs = lib.mapAttrs (
|
||||
_: display:
|
||||
{
|
||||
@@ -160,17 +157,12 @@ in
|
||||
};
|
||||
};
|
||||
|
||||
binds =
|
||||
if terminalPackage != null then
|
||||
import ./_bindings.nix {
|
||||
inherit
|
||||
browserCommand
|
||||
lib
|
||||
;
|
||||
terminalPackage = terminalPackage;
|
||||
}
|
||||
else
|
||||
{ };
|
||||
binds = import ./_bindings.nix {
|
||||
inherit
|
||||
browserCommand
|
||||
terminalCommand
|
||||
;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -4,20 +4,17 @@
|
||||
...
|
||||
}:
|
||||
let
|
||||
repo = config.repo;
|
||||
repoHelpers = repo.helpers;
|
||||
|
||||
mkNoctaliaSettings =
|
||||
{
|
||||
homeDirectory,
|
||||
lib,
|
||||
terminalPackage,
|
||||
terminal,
|
||||
}:
|
||||
import ./_noctalia-config.nix {
|
||||
inherit
|
||||
homeDirectory
|
||||
lib
|
||||
terminalPackage
|
||||
terminal
|
||||
;
|
||||
};
|
||||
|
||||
@@ -25,24 +22,15 @@ let
|
||||
{
|
||||
homeDirectory,
|
||||
lib,
|
||||
pkgs,
|
||||
terminal,
|
||||
}:
|
||||
let
|
||||
terminalPackage = repoHelpers.resolvePackagePath {
|
||||
inherit pkgs;
|
||||
path = repo.desktop.terminal.packagePath;
|
||||
};
|
||||
in
|
||||
if terminalPackage == null then
|
||||
{ }
|
||||
else
|
||||
mkNoctaliaSettings {
|
||||
inherit
|
||||
homeDirectory
|
||||
lib
|
||||
terminalPackage
|
||||
;
|
||||
};
|
||||
mkNoctaliaSettings {
|
||||
inherit
|
||||
homeDirectory
|
||||
lib
|
||||
terminal
|
||||
;
|
||||
};
|
||||
|
||||
mkPortableSettings =
|
||||
baseSettings:
|
||||
@@ -78,8 +66,9 @@ in
|
||||
}:
|
||||
let
|
||||
baseSettings = mkBaseSettings {
|
||||
inherit lib pkgs;
|
||||
inherit lib;
|
||||
homeDirectory = config.home.homeDirectory;
|
||||
terminal = config.repo.terminal.primary;
|
||||
};
|
||||
settings =
|
||||
if baseSettings == { } || !osConfig.meta.machine.portable then
|
||||
|
||||
+122
-41
@@ -1,24 +1,66 @@
|
||||
{ config, ... }:
|
||||
let
|
||||
repo = config.repo;
|
||||
repoHelpers = repo.helpers;
|
||||
in
|
||||
{
|
||||
flake.modules.nixos.terminfo =
|
||||
{ pkgs, ... }:
|
||||
let
|
||||
terminalPackage = repoHelpers.resolvePackagePath {
|
||||
inherit pkgs;
|
||||
path = repo.desktop.terminal.packagePath;
|
||||
|
||||
mkPrimaryTerminalOption =
|
||||
lib:
|
||||
lib.mkOption {
|
||||
type = lib.types.submodule {
|
||||
options = {
|
||||
package = lib.mkOption {
|
||||
type = lib.types.package;
|
||||
};
|
||||
|
||||
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 = [ ];
|
||||
};
|
||||
};
|
||||
};
|
||||
in
|
||||
{
|
||||
environment.systemPackages = [
|
||||
terminalPackage.terminfo
|
||||
];
|
||||
};
|
||||
|
||||
flake.modules.homeManager.terminal =
|
||||
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,
|
||||
pkgs,
|
||||
@@ -27,38 +69,65 @@ in
|
||||
let
|
||||
repoTheme = repo.theme.kanagawa;
|
||||
palette = repoTheme.palette;
|
||||
terminalPackage = repoHelpers.resolvePackagePath {
|
||||
inherit pkgs;
|
||||
path = repo.desktop.terminal.packagePath;
|
||||
};
|
||||
terminalDesktopId = repo.desktop.terminal.desktopId;
|
||||
hex = lib.removePrefix "#";
|
||||
in
|
||||
{
|
||||
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 = {
|
||||
programs.foot = {
|
||||
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 = {
|
||||
enable = true;
|
||||
package = pkgs.kitty;
|
||||
font = {
|
||||
name = "JetBrains Mono";
|
||||
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;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -52,7 +52,8 @@ in
|
||||
homeModules.sops
|
||||
homeModules.git
|
||||
homeModules.ssh-client
|
||||
homeModules.terminal
|
||||
homeModules.primary-terminal-foot
|
||||
homeModules.terminal-kitty
|
||||
homeModules.theme
|
||||
homeModules.vicinae
|
||||
homeModules.xdg
|
||||
|
||||
@@ -21,7 +21,6 @@ in
|
||||
imports = [
|
||||
nixosModules.host-base
|
||||
|
||||
nixosModules.terminfo
|
||||
nixosModules.sops-host-ssh-key
|
||||
nixosModules.openssh
|
||||
nixosModules.caddy
|
||||
@@ -35,6 +34,8 @@ in
|
||||
./_disk.nix
|
||||
];
|
||||
|
||||
environment.enableAllTerminfo = true;
|
||||
|
||||
users.users.${account.name}.linger = true;
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user