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

[Feature Request]: home-manager module #2879

Open
2 tasks done
Lalit64 opened this issue Jan 17, 2025 · 8 comments
Open
2 tasks done

[Feature Request]: home-manager module #2879

Lalit64 opened this issue Jan 17, 2025 · 8 comments

Comments

@Lalit64
Copy link

Lalit64 commented Jan 17, 2025

Preflight Checklist

  • I use the latest version of YouTube Music (Application).
  • I have searched the issue tracker for a feature request that matches the one I want to file, without success.

Problem Description

Hey, has anyone considered a home-manager module

Proposed Solution

create a home-manager module that allows one to configure the plugins and the settings, and also options

Alternatives Considered

none

Additional Information

none

@ArjixWasTaken
Copy link
Contributor

Could you provide relevant documentation?

@Lalit64
Copy link
Author

Lalit64 commented Jan 17, 2025

@h-banii
Copy link
Contributor

h-banii commented Jan 18, 2025

It's possible to configure youtube-music's config.json file using home manager, but since the nix store is read-only, youtube-music can't write to config.json anymore (it uses it to store some values).

Error: EROFS: read-only file system, open '/nix/store/16y98k58vn7qpy9yqq49y6rm7ymcg90a-hm_YouTubeMusicconfig.json.tmp-7148096567a96831'
    at openSync (node:fs:573:18)
    at func (node:electron/js2c/node_init:2:2559)
    at p (/nix/store/70l884lf1qcix8j456ygnxlhyn41y3hk-youtube-music-v3.7.1/share/lib/youtube-music/resources/app.asar/dist/main/index.js:157:24681)
    at writeFileSync (/nix/store/70l884lf1qcix8j456ygnxlhyn41y3hk-youtube-music-v3.7.1/share/lib/youtube-music/resources/app.asar/dist/main/index.js:157:29679)
    at ElectronStore._write (/nix/store/70l884lf1qcix8j456ygnxlhyn41y3hk-youtube-music-v3.7.1/share/lib/youtube-music/resources/app.asar/dist/main/index.js:165:8300)
    at ElectronStore.set store [as store] (/nix/store/70l884lf1qcix8j456ygnxlhyn41y3hk-youtube-music-v3.7.1/share/lib/youtube-music/resources/app.asar/dist/main/index.js:165:6850)
    at ElectronStore.set (/nix/store/70l884lf1qcix8j456ygnxlhyn41y3hk-youtube-music-v3.7.1/share/lib/youtube-music/resources/app.asar/dist/main/index.js:165:5562)
    at Object.set (/nix/store/70l884lf1qcix8j456ygnxlhyn41y3hk-youtube-music-v3.7.1/share/lib/youtube-music/resources/app.asar/dist/main/index.js:165:24914)
    at handleData (/nix/store/70l884lf1qcix8j456ygnxlhyn41y3hk-youtube-music-v3.7.1/share/lib/youtube-music/resources/app.asar/dist/main/index.js:165:26147)
    at /nix/store/70l884lf1qcix8j456ygnxlhyn41y3hk-youtube-music-v3.7.1/share/lib/youtube-music/resources/app.asar/dist/main/index.js:165:27818 {
  errno: -30,
  code: 'EROFS',
  syscall: 'open',
  path: '/nix/store/16y98k58vn7qpy9yqq49y6rm7ymcg90a-hm_YouTubeMusicconfig.json.tmp-7148096567a96831'
}

So it's somewhat doable, but I think it would be better to not touch config.json. It would be nice to have separate my-config.json files managed by the user, or home manager in this case, and a way to select/import it. Something similar to #1384

Here's a basic hm module https://github.com/h-banii/youtube-music-nix
(I didn't implement all plugins though, just a few for testing)
edit: I finished implementing all the options, I haven't tested all of them, but they should probably work

@Lalit64
Copy link
Author

Lalit64 commented Jan 18, 2025

@h-banii I think the point of nix is for the system to be declarative so why would youtube-music need to write to the config.json?

edit: can we talk on discord?

@ArjixWasTaken
Copy link
Contributor

@Lalit64 we are writing to the config.json for various reasons, one of them is config migration from an older version to a newer version.

@ArjixWasTaken
Copy link
Contributor

Another reason is, if you have the setting to continue where you left off, it saves the current url to the config, an immutable config would render this useless

@ArjixWasTaken
Copy link
Contributor

ArjixWasTaken commented Jan 18, 2025

It would be better to have a user-config, like an override, using a secondary file managed by nix, just like how @h-banii proposed

@Lalit64
Copy link
Author

Lalit64 commented Jan 18, 2025

@ArjixWasTaken Ok, I understand

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

No branches or pull requests

3 participants