-
-
Notifications
You must be signed in to change notification settings - Fork 66
Open
Description
In order to use swhkd package on nixOs:
- requires Fix permission groups #325
- I've added a
packagesoutput to theflake.nixfile andycandy-dev@8a15e7a
not as clean as it could have been but it works. - above flake provides two packages, I had to use
swhkd-no-rfkillas of [fix] remove rfkill switch support #254 conversation - otherwise running swhkd nuked my wifi. - followed directions Latest changes to make swhkd work in Arch terminal #285 (comment) , which references Improve The Security Model #270 for
setuidon myconfiguration.nix
{ config, lib, pkgs, inputs, ... }:
let
swhkdPkg = inputs.swhkd.packages.x86_64-linux.swhkd-no-rfkill;
in
{
security.wrappers.swhkd = {
owner = "root";
group = "root";
setuid = true;
source = "${swhkdPkg}/bin/swhkd";
};
} - setup userspace
systemdwith home-manager
{ config, lib, pkgs, inputs, ... }:
let
username = config.home.username;
swhkdPkg = inputs.swhkd.packages.x86_64-linux.swhkd-no-rfkill;
swhks-launcher = pkgs.writeShellScript "swhks-launcher" ''
${pkgs.killall}/bin/killall swhks swhkd 2>/dev/null || true
${swhkdPkg}/bin/swhks &
sleep 0.5
/run/wrappers/bin/swhkd -c /home/${username}/.config/swhkd/swhkdrc
'';
in
{
xdg.configFile."swhkd/swhkdrc".source = config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/nixos-dots/home/swhkd/swhkdrc";
systemd.user.services.swhkd = {
Unit.Description = "Simple Wayland HotKey Server";
Unit.After = [ "graphical-session.target" ];
Service = {
ExecStart = "${swhks-launcher}";
ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID";
Restart = "on-failure";
KillMode = "mixed";
};
Install.WantedBy = [ "graphical-session.target" ];
};
}Metadata
Metadata
Assignees
Labels
No labels