wm-helpers: make it a valid flake package, add app

This commit is contained in:
NullBite 2024-02-07 10:10:48 +01:00
parent 082fb3dcc1
commit 402aced75d
Signed by: nullbite
GPG Key ID: 6C4D545385D4925A
4 changed files with 19 additions and 4 deletions

View File

@ -144,6 +144,8 @@
nixosModules = (import ./modules/nixos) moduleInputs; nixosModules = (import ./modules/nixos) moduleInputs;
homeManagerModules = (import ./modules/home-manager) moduleInputs; homeManagerModules = (import ./modules/home-manager) moduleInputs;
packages = eachSystem (system: import ./pkgs { inherit nixpkgs system; }); packages = eachSystem (system: import ./pkgs { inherit nixpkgs system; });
apps = eachSystem (system: import ./pkgs/apps.nix
{ inherit (self.outputs) packages; inherit system; });
nixosConfigurations = { nixosConfigurations = {
slab = mkSystem { slab = mkSystem {

View File

@ -18,8 +18,8 @@ let
in in
if hasAttr key keyNames then keyNames."${key}" else key; if hasAttr key keyNames then keyNames."${key}" else key;
inherit (outputs.packages.${pkgs.system}.wm-helpers) keysetting; inherit (outputs.packages.${pkgs.system}) wm-helpers;
keysetting = "${wm-helpers}/bin/keysetting";
in in
{ {
# FIXME this is temporary just to get it working, need to make wm-common an # FIXME this is temporary just to get it working, need to make wm-common an

9
pkgs/apps.nix Normal file
View File

@ -0,0 +1,9 @@
{ packages, system, ... }:
let _packages = packages; in
let
packages = _packages.${system};
mkApp = program: { type = "app"; inherit program; };
in
{
keysetting = mkApp "${packages.wm-helpers}/bin/keysetting";
}

View File

@ -1,6 +1,6 @@
{ pkgs, ...}: { pkgs, ...}:
{ let
keysetting = pkgs.writeShellScript "keysetting" '' keysetting = pkgs.writeShellScriptBin "keysetting" ''
wpctl=${pkgs.wireplumber}/bin/wpctl wpctl=${pkgs.wireplumber}/bin/wpctl
notify_send=${pkgs.libnotify}/bin/notify-send notify_send=${pkgs.libnotify}/bin/notify-send
brightnessctl=${pkgs.brightnessctl}/bin/brightnessctl brightnessctl=${pkgs.brightnessctl}/bin/brightnessctl
@ -34,4 +34,8 @@
mondown) setbright 5%-;; mondown) setbright 5%-;;
esac esac
''; '';
in
pkgs.symlinkJoin {
name = "wm-helpers";
paths = keysetting;
} }