NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.51k stars 13.69k forks source link

Package request: (Pop!_OS) COSMIC Epoch Desktop Environment #199563

Closed KiaraGrouwstra closed 7 months ago

KiaraGrouwstra commented 1 year ago

Project description COSMIC is a Rust-based desktop environment by System76 created for their distro Pop!_OS, consisting of a set of packages.

Metadata

note there has been an earlier effort over at #144411, though that PR was abandoned. that PR erroneously stated it corresponded to request #92769, though that request had a smaller scope, that has since been addressed.

eliasboegel commented 1 year ago

My understanding is that this is the over-arching repo for the coming "from scratch" COSMIC DE: https://github.com/pop-os/cosmic-epoch

wsx-udscbt commented 1 year ago

Hi, I just turned every components in https://github.com/pop-os/cosmic-epoch into flakes (see for example https://github.com/pop-os/cosmic-comp/pull/53) and hopefully this can be a first step in integrating the new COSMIC environment. Currently all the components are Rust projects and hence I use crane in the flakes to package them. I'm not sure if this adheres to the Rust packaging practices in nixpkgs, but maybe can be used as a starting point. Also, much more work needs to be done on combining all the packaged components and nicely integrating the entire COSMIC environment into NixOS (a NixOS module or home-manager module?)

I am pretty new to all of those, and it would be great if someone more experienced can help with this effort. Thank you!

colemickens commented 1 year ago

I was going to open an issue on cosmic-epoch, but might as well comment here.

Have you looked into this more, @wsx-udscbt ? I have an idea, but not enough time:

I haven't looked at the individual components, but if the individual components do a decent job of installing systemd units, the modules could wind up being fairly simple.

wsx-udscbt commented 1 year ago

I haven't got much progress yet, but thanks for the ideas! Currently for individual components only the binary is built, and there are systemd unit files and desktop icons in the upstream repos that are not yet copied to the output. As you suggested, the immediate next step is to also package those artifacts together into each components.

soloturn commented 1 year ago

@wsx-udscbt would you mind putting nix files in nix repositories, instead of upstream? there are one million linux flavours, and putting the files in upstream repositories is a maintenance nightmare. one example: cosmic epoch does not require meson any more. the nix files still refer to meson as nobody knows how to deal with nix files, and you as well have no time to maintain them.

wsx-udscbt commented 1 year ago

@wsx-udscbt would you mind putting nix files in nix repositories, instead of upstream?

Having the nix flakes upstream not only helps with packaging, but also helps with setting up a quick development environment for Nix users to hack on the project. The cosmic-comp repo also has a CI running with the Nix flakes. Additionally, I believe the way I packaged cosmic (by using crane) is not the preferred way for Rust packages in nixpkgs, and moving them directly here may get rejected.

cosmic epoch does not require meson any more. the nix files still refer to meson as nobody knows how to deal with nix files, and you as well have no time to maintain them.

Thanks for pointing out the issue, and I do notice some changes in the build process of cosmic epoch sub-repos leading to unsuccessful builds. But I think the best way to address this is to fix the Nix flakes upstream, and setup CI in more repos to monitor the build status better. Admittedly I don't have much time around, but I'll try to address this in the future.

MtFBella109 commented 1 year ago

I tried to install it to, but I failed by the cosmic-applibrary. It complains everytime about that the environment Variable isn't set and I don't know how to fix that and second I sea that in NixOS Packages there is a Package with the Name rPackages.COSMIC_67, But I don't know which package this is, if it is the cosmic-epoch or the cosmic package or the old cosmic-desktop I don't know

byrongibson commented 1 year ago

I tried to install it to, but I failed by the cosmic-applibrary. It complains everytime about that the environment Variable isn't set and I don't know how to fix that and second I sea that in NixOS Packages there is a Package with the Name rPackages.COSMIC_67, But I don't know which package this is, if it is the cosmic-epoch or the cosmic package or the old cosmic-desktop I don't know

rPackages are for the R statistical programming language, not related to the Cosmic desktop.

MtFBella109 commented 1 year ago

I tried to build the cosmic-settings package. But everytime I get the following Error: error: builder for '/nix/store/c3bzrzvxqpkdr4mgasqn6ngwpfzdswhg-cargo-package-0.0.1.drv' failed with exit code 101; last 10 log lines:

--> app/src/app.rs:13:45 13 event::wayland::{self, WindowEvent, WindowState}, ^^^^^^^^^^^ no WindowState in event::wayland

= help: consider importing this variant instead: crate::Message::WindowState

For more information about this error, try rustc --explain E0432. error: could not compile cosmic-settings (bin "cosmic-settings") due to previous error For full logs, run 'nix log /nix/store/c3bzrzvxqpkdr4mgasqn6ngwpfzdswhg-cargo-package-0.0.1.drv'.

And this is the flake.nix I used: https://pastebin.com/62xfL0xW. I'm not exactly sure if it's an Error with the flake or really an Error with Rust

nyabinary commented 1 year ago

Is there any progress whatsoever on this, COSMIC is getting more mature.

MtFBella109 commented 1 year ago

I think it‘s not in the repos of Nix, but if you look on the cosmic-epoch repo and then look into every git submodule you can see in all of it a flake.nix, so you can actually install everything with the flakes, the last time I tested to install it the Installation worked completely

lobre commented 1 year ago

This is a good news, however, I am not sure how feasible this is, but it would be handy to have cosmic packaged in Nixos the same way as other desktop environments.

MtFBella109 commented 1 year ago

Yeah I guess that cosmic epoch get in the Nix packages, when it is stable and not in a Alpha, but with the flakes it is possible to install it, which is very good

alyssais commented 1 year ago

https://github.com/NixOS/nixpkgs/pull/251365

MtFBella109 commented 10 months ago

cosmic-comp doesn't start for me at all, If I try to run it from tty, It can't read a few Configs, it is "xbg-config", "input-default", "input-touchpad" & "input-device", it says for all 4 of them, no such file or directory

MtFBella109 commented 10 months ago

Okay, forgot to execute it with sudo, but If I do that, I get the following Error: 2023-11-12T16:18:56.898673Z ERROR panic: thread 'main' panicked at 'calledResult::unwrap()on anErrvalue: RuntimeDirNotSet': src/main.rs:96 0: <backtrace::capture::Backtrace as core::default::Default>::default 1: log_panics::Config::install_panic_hook::{{closure}} 2: std::panicking::rust_panic_with_hook 3: std::panicking::begin_panic_handler::{{closure}} 4: std::sys_common::backtrace::__rust_end_short_backtrace 5: rust_begin_unwind 6: core::panicking::panic_fmt 7: core::result::unwrap_failed 8: cosmic_comp::main 9: std::sys_common::backtrace::__rust_begin_short_backtrace 10: main 11: __libc_start_call_main 12: __libc_start_main_impl 13: _start

wash2 commented 10 months ago

Okay, forgot to execute it with sudo, but If I do that, I get the following Error: 2023-11-12T16:18:56.898673Z ERROR panic: thread 'main' panicked at 'called Result::unwrap()on anErr value: RuntimeDirNotSet': src/main.rs:96 0: ::default 1: log_panics::Config::install_panic_hook::{{closure}} 2: std::panicking::rust_panic_with_hook 3: std::panicking::begin_panic_handler::{{closure}} 4: std::sys_common::backtrace::rust_end_short_backtrace 5: rust_begin_unwind 6: core::panicking::panic_fmt 7: core::result::unwrap_failed 8: cosmic_comp::main 9: std::sys_common::backtrace::__rust_begin_short_backtrace 10: main 11: libc_start_call_main 12: __libc_start_main_impl 13: _start

Maybe try setting XDG_RUNTIME_DIR. That is where cosmic-comp is going to put the wayland-1 socket for clients to connect.

ahoneybun commented 7 months ago

I feel like we can close this PR for this one?:

https://github.com/NixOS/nixpkgs/issues/259641