-
Notifications
You must be signed in to change notification settings - Fork 1
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 for nix #10
Comments
I've never used the nix package manager nor NixOS, so I've got 0 experience packaging for nix. If anyone does I'll be happy to accept any PRs but otherwise I don't think this will be a priority. |
I'll give it a try, @TheAlexDev23 could you provide the Cargo.lock with releases? |
@mark-boute yeah sorry, I don't know why I had it excluded from vcs |
Alright, I got stuck at setting up the systemctl service as it is not available. Leaving my attempt here for someone else to use: { lib,
libadwaita,
# yad
dbus,
pkg-config,
atk,
xdotool,
gtk3,
gtk4,
webkitgtk_4_1,
fetchFromGitHub,
rustPlatform,
zsh
}:
rustPlatform.buildRustPackage rec {
pname = "power-options-gtk";
version = "591afd6f49ce79cfb5d2d2d1d43e10e64bf44a86";
# use commit that added Cargo.lock instead of release
src = fetchFromGitHub {
owner = "TheAlexDev23";
repo = "power-options";
rev = version;
hash = "sha256-gXSJej3Bl2ZnMl3vlSwaknR1yhlaEsRlGctR8abd+GY=";
};
cargoHash = "sha256-QCFtj+zcNJ5AvGq3tpi0BqUSjvDo8o/HA4Bs/3VrTZY=";
buildInputs = [
libadwaita
# yad
dbus
xdotool
atk
gtk3
gtk4
webkitgtk_4_1
];
nativeBuildInputs = [
zsh
pkg-config
];
cargoInstallHook = ''
mkdir -p $out/bin
cp target/release/power-daemon-mgr $out/bin/
cp target/release/frontend-gtk $out/bin/power-options-gtk
cp icon.png $out/share/icons/power-options.png
cp install/power-options-gtk.desktop $out/share/applications/
'';
meta = {
description = "A gtk frontend for Power Options, a blazingly fast power management solution.";
homepage = "https://github.com/TheAlexDev23/power-options";
license = lib.licenses.mit;
};
}```
Only the `power-daemon-mgr` seems to be available in `/run/current-system/sw/bin/power-daemon-mgr` |
@mark-boute The installation process requires the call to Take a look at the AUR PKGBUILD, https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=power-options-daemon. Tell me if this is not suitable for nix, and if I should think on alternative installation methods. |
I figured and tried to run this imperatively. Where does it write to? |
The
It will generate the following files relative to
Is this what you were asking? |
Right, thanks. I am currently looking into this again. giving one root for those files may not work in Nix, see: https://discourse.nixos.org/t/after-the-derivation-is-built-what-happens-to-files-in-out/24711 |
I managed to build it with the following (they need to be added with git, committing is not needed). About the systemd services, maybe this will help you: default.nix { pkgs ? import <nixpkgs> { } }:
let manifest = (pkgs.lib.importTOML ./crates/power-daemon/Cargo.toml).package;
in
pkgs.rustPlatform.buildRustPackage {
pname = manifest.name;
version = manifest.version;
cargoLock.lockFile = ./Cargo.lock;
src = pkgs.lib.cleanSource ./.;
nativeBuildInputs = with pkgs; [
pkg-config
];
buildInputs = with pkgs; [
libadwaita
graphene
glib
gtk3
gtk4
webkitgtk_4_1
xdotool
];
} flake.nix {
description = "All-In-One blazingly fast Linux GUI Application for simple and advanced power
management on any device";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
};
outputs = { nixpkgs, ... }:
let
supportedSystems = [ "x86_64-linux" ];
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
pkgsFor = nixpkgs.legacyPackages;
in {
packages = forAllSystems (system: {
default = pkgsFor.${system}.callPackage ./. {};
});
};
} |
No description provided.
The text was updated successfully, but these errors were encountered: