module fix

This commit is contained in:
Robin Appelman 2025-06-09 18:58:46 +02:00
commit 6ab675c3d0
3 changed files with 15 additions and 11 deletions

View file

@ -20,6 +20,10 @@
"x86_64-unknown-linux-musl"
];
overlays = {
default = import ./nix/overlay.nix;
};
nixosModules = {outputs, ...}: {
default = {
pkgs,

View file

@ -16,10 +16,15 @@ in {
example = "INFO";
description = "log level";
};
package = mkOption {
type = types.package;
description = "package to use";
};
};
config = mkIf cfg.enable {
services.dbus.packages = [self.packages.${pkgs.system}.default];
services.dbus.packages = [cfg.package];
users.users.shortcutd = {
isSystemUser = true;
@ -34,12 +39,10 @@ in {
RUST_LOG = cfg.log;
};
serviceConfig = let
pkg = self.packages.${pkgs.system}.default;
in {
serviceConfig = {
User = "shortcutd";
Restart = "on-failure";
ExecStart = "${pkg}/bin/shortcutd";
ExecStart = getExe cfg.package;
PrivateTmp = true;
ProtectSystem = "strict";
ProtectHome = true;

View file

@ -11,17 +11,14 @@ in
src = sourceByRegex ../server ["Cargo.*" "(src)(/.*)?"];
postPatch = ''
cp ${../Cargo.lock} Cargo.lock
chmod 0755 Cargo.lock
'';
postInstall = ''
mkdir -p $out/etc/dbus-1/system.d/
cp ${../nixos-nl.icewind.shortcutd.conf} $out/etc/dbus-1/system.d/nl.icewind.shortcutd.conf
'';
cargoLock = {
lockFile = ../Cargo.lock;
lockFile = ../server/Cargo.lock;
};
meta.mainProgram = "shortcutd";
}