I’m trying to start kanshi via systemd as per the docs but when I start the service, I receive the following error: Failed to start kanshi.service: Unit sway-session.target not found.
Sway is not running via systemd, I assume the kanshi systemd service file is looking for a sway service that started before starting kanshi
. My attempt to get around this was to set the service wantedBy
/after
lists to []
but it didn’t help.
Kanshi is being configured using Home Manager.
What am I doing wrong?
Also should kanshi_config_file
be replaced by something? I’m not sure how to reference the config file being created by Home Manager.
Thanks!
# /etx/nixos/configuration.nix
# kanshi systemd service
systemd.user.services.kanshi = {
enable = true;
description = "kanshi daemon";
wantedBy = [];
after = [];
serviceConfig = {
Type = "simple";
ExecStart = ''${pkgs.kanshi}/bin/kanshi -c kanshi_config_file'';
};
};
# /etc/nixos/home_manager.nix
{ config, pkgs, ... }:
let
home-manager = builtins.fetchTarball "https://github.com/nix-community/home-manager/archive/release-22.11.tar.gz";
in
{
imports = [
(import "${home-manager}/nixos")
];
home-manager.users.frigidcode = {
/* The home.stateVersion option does not have a default and must be set */
home.stateVersion = "22.11";
home.packages = with pkgs; [
firefox
thunderbird
element-desktop
signal-desktop
tdesktop # telegram
slack
];
services.kanshi = {
# eDP-1 is the laptop screen
# DP-2 is the docked monitor
enable = true;
profiles = {
docked = {
outputs = [
{
criteria = "DP-2";
status = "enable";
position = "0,0";
}
{
criteria = "eDP-1";
status = "disable";
}
];
};
undocked = {
outputs = [
{
criteria = "eDP-1";
status = "enable";
position = "0,0";
}
];
};
};
};
# end kanshi
programs.zsh = {
enable = true;
enableAutosuggestions = true;
enableSyntaxHighlighting = true;
dirHashes = {
docs = "$HOME/Documents";
vids = "$HOME/Videos";
dl = "$HOME/Downloads";
le = "$HOME/repos/lolo_gifts";
};
oh-my-zsh = {
enable = true;
plugins = [
"git"
"sudo"
];
theme = "robbyrussell";
};
};
# end zsh
};
}