Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Sep 7, 2025. It is now read-only.

Add NixOS module#12

Open
tomodachi94 wants to merge 1 commit into
CC-YouCube:main from
tomodachi94:nixos
Open

Add NixOS module #12
tomodachi94 wants to merge 1 commit into
CC-YouCube:main from
tomodachi94:nixos

Conversation

@tomodachi94

@tomodachi94 tomodachi94 commented Aug 6, 2023
edited
Loading

Copy link
Copy Markdown
Contributor

Description

Adds NixOS support.

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Syntax is valid; checked with nix flake show.

Test Configuration:

Please delete options that are not relevant.

  • Python: Python 3.10
  • Nixpkgs channel: nixpkgs-unstable and release-23.05 both work, but nixpkgs-unstable is more up-to-date, so we use that.

Checklist

  • My code follows the style guidelines of this project (all lints have passed)
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation: See Add NixOS docs cc-youcube.github.io#3
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

Commandcracker commented Aug 26, 2023
edited
Loading

Copy link
Copy Markdown
Member

Took me a while but there seams to be a small issue

[red@nixos:~/youcube-server]$ nix run
error: unable to execute '/nix/store/ykwxgqxqpnzrjkfz4x64fa7hihccz0vk-youcube-20230806/bin/youcube': No such file or directory

Screenshot_20230826_184002

Copy link
Copy Markdown
Member

I changed makeWrapper ${pkgs.python3}/bin/python3 $out/bin/youcube-server \ to makeWrapper ${pkgs.python3}/bin/python3 $out/bin/youcube \ as a quick workaround but now i encountered another issue. The server needs to be able to write the media files to some place. If it is needed to change the path, I could make an env var out of it.

Exception in thread Thread-1 (run_with_thread_save_asyncio_event_with_return_value):
Traceback (most recent call last):
 File "/nix/store/jhflvwr40xbb0xr6jx4311icp9cym1fp-python3-3.10.12/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
 self.run()
 File "/nix/store/jhflvwr40xbb0xr6jx4311icp9cym1fp-python3-3.10.12/lib/python3.10/threading.py", line 953, in run
 self._target(*self._args, **self._kwargs)
 File "/nix/store/wd42gdpjrb5s5iwyn5axxc628aasfwkj-youcube-20230806/lib/python3.10/site-packages/youcube/yc_magic.py", line 44, in run_with_thread_save_asyncio_event_with_return_value
 result = func(*args)
 File "/nix/store/wd42gdpjrb5s5iwyn5axxc628aasfwkj-youcube-20230806/lib/python3.10/site-packages/youcube/yc_download.py", line 240, in download
 create_data_folder_if_not_present()
 File "/nix/store/wd42gdpjrb5s5iwyn5axxc628aasfwkj-youcube-20230806/lib/python3.10/site-packages/youcube/yc_utils.py", line 87, in create_data_folder_if_not_present
 mkdir(DATA_FOLDER)
OSError: [Errno 30] Read-only file system: '/nix/store/wd42gdpjrb5s5iwyn5axxc628aasfwkj-youcube-20230806/lib/python3.10/site-packages/youcube/data'

tomodachi94 commented Aug 26, 2023
edited
Loading

Copy link
Copy Markdown
Contributor Author

I changed makeWrapper ${pkgs.python3}/bin/python3 $out/bin/youcube-server \ to makeWrapper ${pkgs.python3}/bin/python3 $out/bin/youcube \ as a quick workaround but now i encountered another issue.

This could be fixed by changing the package's pname or setting the meta.mainProgram variable.

The server needs to be able to write the media files to some place. If it is needed to change the path, I could make an env var out of it.

Normally, data should get written out to /var on POSIX-compliant systems. I think an environment variable would be good, but we may want to consider changing the default as well.

Copy link
Copy Markdown
Member

Normally, data should get written out to /var on POSIX-compliant systems. I think an environment variable would be good, but we may want to consider changing the default as well.

I will make an env var out of it. I was thinking about making the default a temp folder as the data folder is currently only used as a media cache and Using something like /var/lib/youcube would need a windows counter part.

I changed makeWrapper ${pkgs.python3}/bin/python3 $out/bin/youcube-server \ to makeWrapper ${pkgs.python3}/bin/python3 $out/bin/youcube \ as a quick workaround but now i encountered another issue.

Could you fix it ? as you have more experience with nix :)

Copy link
Copy Markdown
Contributor Author

I was thinking about making the default a temp folder as the data folder is currently only used as a media cache and Using something like /var/lib/youcube would need a windows counter part.

Good idea, I didn't know it was all temporary data :)

Commandcracker reacted with thumbs up emoji

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /