From e12da9e59b8cf30869ef85bda114bf06b35778f5 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Tue, 31 Dec 2024 01:12:57 +0000 Subject: [PATCH] Test ghostty --- flake.lock | 19 +++++++++- flake.nix | 1 + nix/home/opdavies/hosts/lemp11.nix | 1 + nix/hosts/lemp11/default.nix | 2 +- .../home-manager/features/desktop/default.nix | 1 + .../home-manager/features/desktop/ghostty.nix | 36 +++++++++++++++++++ 6 files changed, 58 insertions(+), 2 deletions(-) create mode 100644 nix/modules/home-manager/features/desktop/ghostty.nix diff --git a/flake.lock b/flake.lock index 8ab88f2..2e8a50a 100644 --- a/flake.lock +++ b/flake.lock @@ -208,6 +208,22 @@ "type": "github" } }, + "nixpkgs-master": { + "locked": { + "lastModified": 1735606615, + "narHash": "sha256-j2QeXLGlydjd6gDSyHasBJ0OoPXFDSYgd0KbyVCnE3w=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "c49743669a58a01d5978bf5cab134d2ae717696c", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "master", + "repo": "nixpkgs", + "type": "github" + } + }, "nixpkgs_2": { "locked": { "lastModified": 1733384649, @@ -248,7 +264,8 @@ "nixos-hardware": "nixos-hardware", "nixos-wsl": "nixos-wsl", "nixpkgs": "nixpkgs_3", - "nixpkgs-2405": "nixpkgs-2405" + "nixpkgs-2405": "nixpkgs-2405", + "nixpkgs-master": "nixpkgs-master" } }, "systems": { diff --git a/flake.nix b/flake.nix index 9fbd0f9..24044c9 100644 --- a/flake.nix +++ b/flake.nix @@ -14,6 +14,7 @@ nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; nixpkgs-2405.url = "github:nixos/nixpkgs/nixos-24.05"; + nixpkgs-master.url = "github:nixos/nixpkgs/master"; nixos-wsl.url = "github:nix-community/NixOS-WSL/main"; }; diff --git a/nix/home/opdavies/hosts/lemp11.nix b/nix/home/opdavies/hosts/lemp11.nix index c253023..a0e3faf 100644 --- a/nix/home/opdavies/hosts/lemp11.nix +++ b/nix/home/opdavies/hosts/lemp11.nix @@ -12,6 +12,7 @@ discord.enable = true; espanso.enable = true; flameshot.enable = true; + ghostty.enable = true; gtk.enable = true; slack.enable = true; diff --git a/nix/hosts/lemp11/default.nix b/nix/hosts/lemp11/default.nix index 22c1660..7120f66 100644 --- a/nix/hosts/lemp11/default.nix +++ b/nix/hosts/lemp11/default.nix @@ -1,4 +1,4 @@ -{ inputs, ... }: +{ ... }: { features = { diff --git a/nix/modules/home-manager/features/desktop/default.nix b/nix/modules/home-manager/features/desktop/default.nix index 243d22d..b354511 100644 --- a/nix/modules/home-manager/features/desktop/default.nix +++ b/nix/modules/home-manager/features/desktop/default.nix @@ -5,6 +5,7 @@ ./discord.nix ./espanso.nix ./flameshot.nix + ./ghostty.nix ./gtk.nix ./media ./slack.nix diff --git a/nix/modules/home-manager/features/desktop/ghostty.nix b/nix/modules/home-manager/features/desktop/ghostty.nix new file mode 100644 index 0000000..8be5e99 --- /dev/null +++ b/nix/modules/home-manager/features/desktop/ghostty.nix @@ -0,0 +1,36 @@ +{ + config, + inputs, + lib, + system, + ... +}: + +with lib; + +let + cfg = config.features.desktop.ghostty; + + pkgs-master = inputs.nixpkgs-master.legacyPackages.${system}; +in +{ + options.features.desktop.ghostty.enable = mkEnableOption "Enable ghostty"; + + config = mkIf cfg.enable { + home.packages = [ pkgs-master.ghostty ]; + + xdg.configFile."ghostty/config".text = '' + background = #000000 + + # Disable ligatures. + font-feature = -calt + font-feature = -liga + font-feature = -dlig + + window-decoration = false + + window-padding-x = 10 + window-padding-y = 10 + ''; + }; +}