Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

alacritty: Use TOML template for recent versions #219

Merged
merged 1 commit into from
Jan 17, 2024
Merged

alacritty: Use TOML template for recent versions #219

merged 1 commit into from
Jan 17, 2024

Conversation

xokdvium
Copy link
Contributor

Since version 0.13.0 alacritty has switched to TOML config file format. For backwards compatibility this patch implements conditional template format depending on the package version.

Closes #214

Since version 0.13.0 alacritty has switched to TOML config
file format. For backwards compatibility this patch implements conditional
template format depending on the package version.

Closes #214
@xokdvium
Copy link
Contributor Author

This change is quite straightforward. I've tested it locally with alacritty from 23.11 and unstable channels. Here are excerpts from the logs for pre-0.13.0 and 0.13.1:

[0.000093080s] [INFO ] [alacritty] Welcome to Alacritty
[0.000241849s] [INFO ] [alacritty] Version 0.12.3
[0.000260309s] [INFO ] [alacritty] Running on X11
[0.001466456s] [INFO ] [alacritty] Configuration files loaded from:
                                     "/home/xokdvium/.config/alacritty/alacritty.yml"
                                     "/nix/store/v2zmj4v3bs38nbsa79d3psfvqi7d4rc4-catppuccin-frappe/base16-catppuccin-frappe.yml"
[0.000002650s] [INFO ] [alacritty] Welcome to Alacritty
[0.000105449s] [INFO ] [alacritty] Version 0.13.1
[0.000116919s] [INFO ] [alacritty] Running on X11
[0.000765008s] [INFO ] [alacritty] Configuration files loaded from:
                                     "/home/xokdvium/.config/alacritty/alacritty.toml"
                                     "/nix/store/1jz574knkp4fn88m53mi5y01zb7is1pj-catppuccin-frappe/base16-catppuccin-frappe.toml"

Copy link
Owner

@danth danth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. I like the backwards compatibility :)

@danth danth merged commit 2d59480 into danth:master Jan 17, 2024
@xokdvium xokdvium deleted the dev/bump-base16-alacritty branch January 17, 2024 15:27
@trueNAHO
Copy link
Collaborator

Looks good to me. I like the backwards compatibility :)

To reduce maintainence cost should we only support the latest package version, similar to how Home Manager does it:

Generally speaking we only support the version of a package that is in the targeted Nixpkgs channel.

(Source: nix-community/home-manager#4426 (comment))

@xokdvium
Copy link
Contributor Author

That was my initial thought, but that would make it impossible for stylix to be used against 23.11 atm.
I opted to include this workaround for now since there's no nixos-23.11 channel. There's an issue open #217, which should probably get some love. I do agree that this needs to be dropped at master

@trueNAHO
Copy link
Collaborator

I opted to include this workaround for now since there's no nixos-23.11 channel.

Does the nixos-*.* channel matter considering that the nixpkgs input follows nixpkgs-unstable:

nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";

@xokdvium
Copy link
Contributor Author

Well, even if stylix uses unstable for it's own instance of nixpkgs that does not mean it's unreasonable for the user to use the latest stable. In that case stylix should produce valid configs. The optimal solution is to just take a resonable commit and fork a stable branch that should be used in such cases.

I think my original point is kind of moot right now since there's a 23.11 branch, so this should be addressed there. Feel free to remove this W/A on master

@xokdvium
Copy link
Contributor Author

Anyway, I've found an instance in home-manager where the exact thing happened to zellij: c03d1e75a1e5e10384e2836cdd6537a4e94be89a. So on the second thought maybe this is fine as is

@danth
Copy link
Owner

danth commented Jan 23, 2024

Perhaps we should have a general policy written down somewhere for which versions need to be backwards compatible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

alacritty: Deprecated warnings since YAML config is deprecated
3 participants