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

Package project as a Nix flake #77

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

zDonik1
Copy link

@zDonik1 zDonik1 commented Oct 24, 2024

Adds a flake.nix file to package the project as a Nix flake.

The project can be built through nix by running nix build. Note: currently building the project does not work. See below.

Issues with merging

There is still an issue with actually building the package since tgt requires that there is a .tgt/config directory in Home. This is currently achieved in the build script, but Nix does not allow modifying any directories other than special directories relevant to the build process. As such generating/copying the config files should be moved to the app itself, and generation happen on first launch.

resolves: #76

@FedericoBruzzone FedericoBruzzone marked this pull request as ready for review October 24, 2024 20:03
@FedericoBruzzone
Copy link
Owner

Thank you very much!!!
I accidentally marked it as ready, if you want to put it back in draft

@FedericoBruzzone
Copy link
Owner

Anyway, I'm not currently a nix user but I understand the problem.
Can you extends this PR moving the creation from compile time to runtime?

@zDonik1
Copy link
Author

zDonik1 commented Oct 25, 2024

I am not much of a Rust developer and currenly have very limited time. I will definitely take a look at it when I am more free.

@FedericoBruzzone
Copy link
Owner

Great! If you need any help let me know.
Thanks again for the contribution

@zDonik1 zDonik1 marked this pull request as draft October 25, 2024 12:50
@DontEatOreo
Copy link
Contributor

Hey! I just wanted to drop by and say I'm also working a flake.nix

https://github.com/DontEatOreo/tgt/blob/f296bc84b1e8b0d20867d7c13b73e9aceee7eba4/flake.nix

My main improvements over the current flake are that:

  • Only ONE input source, which keeps the footprint minimal and flake.lock small
  • macOS Support (and Linux support ofc)
  • Using overrideAttrs to patch tdlib directly instead of using a separate nixpkgs input (this ties back to first point)
  • Patch up a source code that makes it impossible to run on Nix

What I haven't done yet:

  • Figure out how to place all the default TOML files from config/ into ~/.config/.tgt/config via Nix
  • How to deal with the fact that obviously users will want to use their own custom keybinds and should be able to pass their own keybinds that override the current ones

On the last point, one way to get around this would be to provide either or both NixOS modules and Home Manager modules, which will give us the abstraction to directly write to ~/.config

@DontEatOreo DontEatOreo mentioned this pull request Oct 28, 2024
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.

[feature]: add flake.nix to package project in Nix
3 participants