Skip to content
This repository has been archived by the owner on Oct 18, 2024. It is now read-only.

Commit

Permalink
flake: add new build dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
mardukpill committed Aug 26, 2024
1 parent 17f82d6 commit 4d3cff2
Showing 1 changed file with 33 additions and 20 deletions.
53 changes: 33 additions & 20 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,32 @@
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
};

outputs = inputs @ {
self,
nixpkgs,
flake-utils,
}:
outputs =
inputs@{
self,
nixpkgs,
flake-utils,
}:
flake-utils.lib.eachDefaultSystem (
system: let
system:
let
pkgs = nixpkgs.legacyPackages.${system};
name = "razer-laptop-control";
in {
in
{
packages.default = pkgs.rustPlatform.buildRustPackage {
pname = name;
version = "0.2.0";

nativeBuildInputs = with pkgs; [pkg-config];
buildInputs = with pkgs; [dbus.dev hidapi systemd];
nativeBuildInputs = with pkgs; [ pkg-config ];
buildInputs = with pkgs; [
dbus.dev
hidapi
systemd
glib
pango
gtk3
];

src = ./razer_control_gui;

Expand All @@ -43,15 +53,18 @@
}
)
// {
nixosModules.default = {
config,
lib,
pkgs,
...
}:
with lib; let
nixosModules.default =
{
config,
lib,
pkgs,
...
}:
with lib;
let
cfg = config.services.razer-laptop-control;
in {
in
{
options.services.razer-laptop-control = {
enable = mkEnableOption "Enables razer-laptop-control";
package = mkOption {
Expand All @@ -62,8 +75,8 @@

config = mkIf cfg.enable {
services.upower.enable = true;
environment.systemPackages = [cfg.package];
services.udev.packages = [cfg.package];
environment.systemPackages = [ cfg.package ];
services.udev.packages = [ cfg.package ];

systemd.user.services."razerdaemon" = {
description = "Razer laptop control daemon";
Expand All @@ -72,7 +85,7 @@
ExecStartPre = "${pkgs.coreutils}/bin/mkdir -p %h/.local/share/razercontrol";
ExecStart = "${cfg.package}/libexec/daemon";
};
wantedBy = ["default.target"];
wantedBy = [ "default.target" ];
};
};
};
Expand Down

0 comments on commit 4d3cff2

Please sign in to comment.