File tree Expand file tree Collapse file tree 5 files changed +53
-2
lines changed
tests/modules/programs/ghostty Expand file tree Collapse file tree 5 files changed +53
-2
lines changed Original file line number Diff line number Diff line change 1+ { config , pkgs , ... } :
2+ {
3+ time = "2025-11-03T21:56:50+00:00" ;
4+ condition = config . programs . ghostty . enable && pkgs . stdenv . hostPlatform . isLinux ;
5+ message = ''
6+ Ghostty: now enables the user systemd service by default.
7+
8+ Running Ghostty via these systemd units is the recommended way to run
9+ Ghostty. The two most important benefits provided by Ghostty's systemd
10+ integrations are: instantaneous launching and centralized logging.
11+
12+ See https://ghostty.org/docs/linux/systemd for all details
13+ '' ;
14+ }
Original file line number Diff line number Diff line change 114114 defaultText = lib . literalMD "`true` if programs.ghostty.package is not null" ;
115115 } ;
116116
117+ systemd = lib . mkOption {
118+ type = lib . types . submodule {
119+ options = {
120+ enable = lib . mkEnableOption "the Ghostty systemd user service" // {
121+ default = pkgs . stdenv . hostPlatform . isLinux ;
122+ } ;
123+ } ;
124+ } ;
125+ default = { } ;
126+ defaultText = lib . literalMD "`true` on Linux, `false` otherwise" ;
127+ description = ''
128+ Configuration for Ghostty's systemd integration.
129+ This enables additional speed and features.
130+
131+ See <https://ghostty.org/docs/linux/systemd> for more information.
132+ '' ;
133+ } ;
134+
117135 enableBashIntegration = mkShellIntegrationOption (
118136 lib . hm . shell . mkBashIntegrationOption { inherit config ; }
119137 ) ;
195213 } ;
196214 } )
197215
216+ ( lib . mkIf ( cfg . systemd . enable && pkgs . stdenv . hostPlatform . isLinux ) {
217+ assertions = [
218+ {
219+ assertion = cfg . systemd . enable -> cfg . package != null ;
220+ message = "programs.ghostty.systemd.enable cannot be true when programs.ghostty.package is null" ;
221+ }
222+ ] ;
223+ xdg . configFile . "systemd/user/app-com.mitchellh.ghostty.service" . source =
224+ "${ cfg . package } /share/systemd/user/app-com.mitchellh.ghostty.service" ;
225+ dbus . packages = [ cfg . package ] ;
226+ } )
227+
198228 ( lib . mkIf cfg . enableBashIntegration {
199229 # Make order 101 to be placed exactly after bash completions, as Ghostty
200230 # documentation suggests sourcing the script as soon as possible
Original file line number Diff line number Diff line change 1+ { realPkgs , ... } :
12{
3+ nixpkgs . overlays = [ ( _ : _ : { inherit ( realPkgs ) ghostty ; } ) ] ;
4+
25 programs . ghostty . enable = true ;
36
47 nmt . script = ''
Original file line number Diff line number Diff line change 1- { config , ... } :
1+ { realPkgs , ... } :
22{
3+ nixpkgs . overlays = [ ( _ : _ : { inherit ( realPkgs ) ghostty ; } ) ] ;
4+
35 programs . ghostty = {
46 enable = true ;
5- package = config . lib . test . mkStubPackage { } ;
7+ package = realPkgs . ghostty ;
68
79 settings = {
810 theme = "catppuccin-mocha" ;
Original file line number Diff line number Diff line change 1+ { realPkgs , ... } :
12{
3+ nixpkgs . overlays = [ ( _ : _ : { inherit ( realPkgs ) ghostty ; } ) ] ;
24 programs . ghostty = {
35 enable = true ;
46
You can’t perform that action at this time.
0 commit comments