add ghostty terminal & fix gtk cursor

This commit is contained in:
DACHXY 2024-12-28 13:51:21 +08:00
parent 155d78a407
commit f799d7eca2
14 changed files with 206 additions and 28 deletions

136
flake.lock generated
View file

@ -49,6 +49,61 @@
"type": "github"
}
},
"flake-compat_2": {
"flake": false,
"locked": {
"lastModified": 1696426674,
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1705309234,
"narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"ghostty": {
"inputs": {
"flake-compat": "flake-compat",
"nixpkgs-stable": "nixpkgs-stable",
"nixpkgs-unstable": "nixpkgs-unstable",
"zig": "zig"
},
"locked": {
"lastModified": 1735270886,
"narHash": "sha256-J4RCJJu19cKIT1LCiQytUGcpcNHB7e9lcj+xiRKKYmU=",
"owner": "ghostty-org",
"repo": "ghostty",
"rev": "b5f70b834bbf5350282cd13477ee98f9d85b5fb1",
"type": "github"
},
"original": {
"owner": "ghostty-org",
"repo": "ghostty",
"type": "github"
}
},
"gitignore": {
"inputs": {
"nixpkgs": [
@ -182,7 +237,7 @@
"hyprwayland-scanner": "hyprwayland-scanner",
"nixpkgs": "nixpkgs",
"pre-commit-hooks": "pre-commit-hooks",
"systems": "systems",
"systems": "systems_2",
"xdph": "xdph"
},
"locked": {
@ -400,6 +455,22 @@
}
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1733423277,
"narHash": "sha256-TxabjxEgkNbCGFRHgM/b9yZWlBj60gUOUnRT/wbVQR8=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "e36963a147267afc055f7cf65225958633e536bf",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "release-24.11",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-stable_2": {
"locked": {
"lastModified": 1730741070,
"narHash": "sha256-edm8WG19kWozJ/GqyYx2VjW99EdhjKwbY3ZwdlPAAlo=",
@ -416,6 +487,22 @@
}
},
"nixpkgs-unstable": {
"locked": {
"lastModified": 1733229606,
"narHash": "sha256-FLYY5M0rpa5C2QAE3CKLYAM6TwbKicdRK6qNrSHlNrE=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "566e53c2ad750c84f6d31f9ccb9d00f823165550",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-unstable_2": {
"locked": {
"lastModified": 1733749988,
"narHash": "sha256-+5qdtgXceqhK5ZR1YbP1fAUsweBIrhL38726oIEAtDs=",
@ -449,13 +536,13 @@
},
"pre-commit-hooks": {
"inputs": {
"flake-compat": "flake-compat",
"flake-compat": "flake-compat_2",
"gitignore": "gitignore",
"nixpkgs": [
"hyprland",
"nixpkgs"
],
"nixpkgs-stable": "nixpkgs-stable"
"nixpkgs-stable": "nixpkgs-stable_2"
},
"locked": {
"lastModified": 1734797603,
@ -473,16 +560,32 @@
},
"root": {
"inputs": {
"ghostty": "ghostty",
"home-manager": "home-manager",
"hyprgrass": "hyprgrass",
"hyprland": "hyprland",
"hyprland-plugins": "hyprland-plugins",
"nix-index-database": "nix-index-database",
"nixpkgs": "nixpkgs_2",
"nixpkgs-unstable": "nixpkgs-unstable"
"nixpkgs-unstable": "nixpkgs-unstable_2"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"systems_2": {
"locked": {
"lastModified": 1689347949,
"narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=",
@ -537,6 +640,31 @@
"repo": "xdg-desktop-portal-hyprland",
"type": "github"
}
},
"zig": {
"inputs": {
"flake-compat": [
"ghostty"
],
"flake-utils": "flake-utils",
"nixpkgs": [
"ghostty",
"nixpkgs-stable"
]
},
"locked": {
"lastModified": 1717848532,
"narHash": "sha256-d+xIUvSTreHl8pAmU1fnmkfDTGQYCn2Rb/zOwByxS2M=",
"owner": "mitchellh",
"repo": "zig-overlay",
"rev": "02fc5cc555fc14fda40c42d7c3250efa43812b43",
"type": "github"
},
"original": {
"owner": "mitchellh",
"repo": "zig-overlay",
"type": "github"
}
}
},
"root": "root",

View file

@ -9,6 +9,10 @@
nix-index-database.url = "github:nix-community/nix-index-database";
nix-index-database.inputs.nixpkgs.follows = "nixpkgs";
ghostty = {
url = "github:ghostty-org/ghostty";
};
hyprland.url = "github:hyprwm/Hyprland/main";
hyprland-plugins = {
url = "github:hyprwm/hyprland-plugins";

View file

@ -0,0 +1,14 @@
font-family = "CaskaydiaCove Nerd Font Mono"
font-size = 16
theme = catppuccin-macchiato
unfocused-split-opacity = 0.85
wait-after-command = false
shell-integration = detect
window-theme = ghostty
confirm-close-surface = false
window-decoration = false
keybind = ctrl+shift+zero=toggle_tab_overview

View file

@ -1,11 +1,14 @@
$mainMod = SUPER
$scripts = ~/.config/scripts/
$terminal = ghostty
$filemanager = thunar
$browser = firefox
bind = CTRL ALT, T, exec, kitty
bind = $mainMod, Return, exec, kitty
bind = CTRL ALT, T, exec, $terminal
bind = $mainMod, Return, exec, $terminal
bind = $mainMod, Q, killactive,
bind = $mainMod, M, exec, wlogout --protocol layer-shell
bind = $mainMod, E, exec, thunar
bind = $mainMod, E, exec, $filemanager
bind = $mainMod, V, togglefloating,
bind = ALT, SPACE, exec, rofi -config ~/.config/rofi/apps.rasi -show drun
bind = $mainMod ALT, W, exec, $scripts/waybarRestart.sh
@ -19,14 +22,13 @@ bind = $mainMod, PERIOD, exec, flatpak run it.mijorus.smile
bind = $mainMod, X, exec, sleep 0.1 && swaync-client -t -sw
bind = $mainMod SHIFT, C, centerwindow
bind = ,F11, fullscreen
bind = $mainMod, F, exec, $browser
bind = $mainMod, C, exec, NIXOS_OZONE_WL=1 code
# Cycle windows
bind = ALT, TAB, cyclenext
bind = ALT, TAB, bringactivetotop
bind = $mainMod, F, exec, firefox
bind = $mainMod, C, exec, NIXOS_OZONE_WL=1 code
bind = $mainMod, h, movefocus, l
bind = $mainMod, l, movefocus, r
bind = $mainMod, k, movefocus, u

View file

@ -97,7 +97,7 @@
"temperature",
"memory",
"custom/swaync",
"pulseaudio",
"pulseaudio"
]
}
]

View file

@ -58,7 +58,7 @@
"offscreen-css": true,
"offscreen-css-text": "(inactive)",
"rewrite": {
"(.*)> nvim": " $1",
"nvim . (.*)": " $1",
"(.*) - Discord": " $1",
"(.*) — Mozilla Firefox": " $1"
}
@ -159,7 +159,8 @@
"Brave-browser",
"Spotify",
"thunar",
"vlc"
"vlc",
"com.mitchellh.ghostty"
]
},

View file

@ -39,5 +39,9 @@ in
source = "${configDir}/fcitx5";
};
".config/electron-flags.conf".source = "${configDir}/electron/electron-flags.conf";
".config/ghostty" = {
recursive = true;
source = "${configDir}/ghostty";
};
};
}

View file

@ -16,7 +16,8 @@
WLR_NO_HARDWARE_CURSORS = "1";
CLUTTER_BACKEND = "wayland";
WLR_RENDERER = "vulkan";
XCURSOR_SIZE = "32";
XCURSOR_THEME = "catppuccin-macchiato-lavender-cursors";
XCURSOR_SIZE = "24";
XDG_CURRENT_DESKTOP = "Hyprland";
XDG_SESSION_DESKTOP = "Hyprland";
XDG_SESSION_TYPE = "wayland";

View file

@ -4,7 +4,7 @@
enable = true;
cursorTheme = {
name = "Catppuccin-Macchiato-Lavender";
name = "catppuccin-macchiato-lavender-cursors";
package = pkgs.catppuccin-cursors.macchiatoLavender;
};

View file

@ -1,4 +1,4 @@
{ pkgs, inputs, ... }: {
{ pkgs, ... }: {
programs = {
neovim = {
enable = true;
@ -13,6 +13,14 @@
package = pkgs.vscode.fhs;
};
obs-studio = {
enable = true;
plugins = with pkgs.obs-studio-plugins; [
obs-backgroundremoval
obs-pipewire-audio-capture
];
};
firefox.profiles.danny.settings = {
# about:config
"toolkit.legacyUserProfileCustomizations.stylesheets" = true;

View file

@ -18,7 +18,6 @@ in
# envFile.source = ../config/nushell/env.nu;
# };
fish = {
enable = true;
interactiveShellInit = ''
@ -30,6 +29,16 @@ in
shellAliases = shellAlias;
};
bash = {
enable = true;
# Ghostty intergration in nix-shell
bashrcExtra = ''
if [ -n "''${GHOSTTY_RESOURCES_DIR}" ]; then
builtin source "''${GHOSTTY_RESOURCES_DIR}/shell-integration/bash/ghostty.bash"
fi
'';
};
carapace = {
enable = true;
enableFishIntegration = true;

View file

@ -3,18 +3,19 @@
# Nvidia only
let
offload = pkgs.writeShellScriptBin "offload" ''
#!/bin/bash
export __NV_PRIME_RENDER_OFFLOAD=1
export __NV_PRIME_RENDER_OFFLOAD_PROVIDER=NVIDIA-G0
export __GLX_VENDOR_LIBRARY_NAME=nvidia
export __VK_LAYER_NV_optimus=NVIDIA_only
exec "$@"
'';
#!/bin/bash
export __NV_PRIME_RENDER_OFFLOAD=1
export __NV_PRIME_RENDER_OFFLOAD_PROVIDER=NVIDIA-G0
export __GLX_VENDOR_LIBRARY_NAME=nvidia
export __VK_LAYER_NV_optimus=NVIDIA_only
exec "$@"
'';
in
{
environment.systemPackages = [ offload ];
environment.variables = {
NIXOS_OZONE_WL = "1";
ELECTRON_OZONE_PLATFORM_HINT = "auto";
GSETTINGS_SCHEMA_DIR = "${pkgs.gtk3}/share/gsettings-schemas/${pkgs.gtk3.name}/glib-2.0/schemas";
};
}

View file

@ -1,7 +1,11 @@
{ config, pkgs, ... }:
{ config, pkgs, inputs, ... }:
{
environment.systemPackages = with pkgs; [
environment.systemPackages = (with pkgs; [
# gtk theme
gtk3
gnome.adwaita-icon-theme
# Browser
firefox
@ -79,6 +83,8 @@
# Media
vlc
];
]) ++ ([
inputs.ghostty.packages.x86_64-linux.default
]);
}

View file

@ -17,7 +17,6 @@
localNetworkGameTransfers.openFirewall = true;
};
gnupg = {
agent = {
enable = true;
@ -75,6 +74,7 @@
'';
};
dconf.enable = true;
zsh.enable = true;
mtr.enable = true;
fish.enable = true;