-
Notifications
You must be signed in to change notification settings - Fork 10
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
Help package leftwm-theme into Nix #16
Comments
Thank you for your patience in this, what all do we need for nixos? Unfortunately I haven't played around with nix too much, but will try to help. Why exactly do we need to patch Cargo.lock? Does this perhaps give any hints? |
I was working on this myself today, and came here to see if anyone else was struggling with it. I have an (almost) working derivation, but it seems to be failing at a test where it unwraps an Here's the derivation: { lib, sources, rustPlatform, fetchFromGitHub, pkg-config, openssl }:
rustPlatform.buildRustPackage rec {
pname = "leftwm-theme";
version = "556c8d46a7b743e30ac115dcab9047faf6f962ed";
src = fetchFromGitHub {
owner = "leftwm";
repo = "leftwm-theme";
rev = "556c8d46a7b743e30ac115dcab9047faf6f962ed";
fetchSubmodules = false;
sha256 = "sha256-PHRZviRSFl9696mDJxJwilP3YoM8rrWuDaAwl2/jvTM=";
};
cargoLock = {
lockFile = "${src}/Cargo.lock";
};
nativeBuildInputs = [ pkg-config ];
buildInputs = [ openssl ];
dontPatchELF = true;
meta = with lib; {
description = "Theming engine for LeftWM";
homepage = "https://github.com/leftwm/leftwm-theme";
license = licenses.bsd3;
platforms = platforms.linux;
};
} And here's the log for building this derivation:
I don't know what to make of it, I don't know Rust too well. @mautamu may know better. |
Hmm, what are the permissions on ~/.config/leftwm/ in this case? It appears that it's failing to create a themes.toml file there. If you apply this diff, does it work properly? diff --git a/src/models/config.rs b/src/models/config.rs
index 1c1b73c..3c1c59a 100644
--- a/src/models/config.rs
+++ b/src/models/config.rs
@@ -507,7 +507,7 @@ mod test {
#[test]
fn test_config_new() {
- let config1 = Config::new(None);
+ /*let config1 = Config::new(None);
assert!(config1.config_dir.is_none());
assert!(config1
.get_config_dir()
@@ -515,7 +515,7 @@ mod test {
.to_str()
.unwrap()
.ends_with("/.config/leftwm/"));
-
+ */
let config2 = Config::new(Some(PathBuf::from("/tmp/foo")));
assert!(config2.config_dir.is_some());
assert!(config2 |
I'm coming back to this issue quite late, sorry about that. I tried building with the latest rev, also with that patch, and ran into one single failed test,
After reading the test a bit, I saw this section of code, and I think I know what's going on: let mut config: Config = Config {
repos: vec![
Repo {
definitions_version: crate::models::config::CURRENT_DEFINITIONS_VERSION,
url: String::from(local_file_url.as_str()),
name: String::from("test-repo"),
themes: Vec::new(),
},
Repo {
definitions_version: crate::models::config::CURRENT_DEFINITIONS_VERSION,
url: String::from("https://raw.githubusercontent.com/leftwm/leftwm-community-themes/master/known.toml"),
name: String::from("community"),
themes: Vec::new(),
},
],
config_dir: Some(tmpdir.path().to_path_buf()),
}; While I don't know exactly what the URL parameter is, I do know that most Internet access during testing outside of the specialized builtin fetchers is forbidden by the Nix sandbox, and the test and building succeeds when the sandbox is disabled. If there's a way we can rewrite the test such that it doesn't require access to that raw.githubusercontent.com URL, then I can upstream it to |
Hi I am using NixOS, and I would love to see this program be packaged into Nix. This is the derivation that I am able to come up right now, yet it needs to patch to
Cargo.lock
and I am stuck right now.Hope someone can help with this:
The text was updated successfully, but these errors were encountered: