mirror of
https://codeberg.org/icewind/shortcutd.git
synced 2026-06-03 17:24:08 +02:00
module fix
This commit is contained in:
parent
90a30ef175
commit
6ab675c3d0
3 changed files with 15 additions and 11 deletions
|
|
@ -20,6 +20,10 @@
|
||||||
"x86_64-unknown-linux-musl"
|
"x86_64-unknown-linux-musl"
|
||||||
];
|
];
|
||||||
|
|
||||||
|
overlays = {
|
||||||
|
default = import ./nix/overlay.nix;
|
||||||
|
};
|
||||||
|
|
||||||
nixosModules = {outputs, ...}: {
|
nixosModules = {outputs, ...}: {
|
||||||
default = {
|
default = {
|
||||||
pkgs,
|
pkgs,
|
||||||
|
|
|
||||||
|
|
@ -16,10 +16,15 @@ in {
|
||||||
example = "INFO";
|
example = "INFO";
|
||||||
description = "log level";
|
description = "log level";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
package = mkOption {
|
||||||
|
type = types.package;
|
||||||
|
description = "package to use";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
services.dbus.packages = [self.packages.${pkgs.system}.default];
|
services.dbus.packages = [cfg.package];
|
||||||
|
|
||||||
users.users.shortcutd = {
|
users.users.shortcutd = {
|
||||||
isSystemUser = true;
|
isSystemUser = true;
|
||||||
|
|
@ -34,12 +39,10 @@ in {
|
||||||
RUST_LOG = cfg.log;
|
RUST_LOG = cfg.log;
|
||||||
};
|
};
|
||||||
|
|
||||||
serviceConfig = let
|
serviceConfig = {
|
||||||
pkg = self.packages.${pkgs.system}.default;
|
|
||||||
in {
|
|
||||||
User = "shortcutd";
|
User = "shortcutd";
|
||||||
Restart = "on-failure";
|
Restart = "on-failure";
|
||||||
ExecStart = "${pkg}/bin/shortcutd";
|
ExecStart = getExe cfg.package;
|
||||||
PrivateTmp = true;
|
PrivateTmp = true;
|
||||||
ProtectSystem = "strict";
|
ProtectSystem = "strict";
|
||||||
ProtectHome = true;
|
ProtectHome = true;
|
||||||
|
|
|
||||||
|
|
@ -11,17 +11,14 @@ in
|
||||||
|
|
||||||
src = sourceByRegex ../server ["Cargo.*" "(src)(/.*)?"];
|
src = sourceByRegex ../server ["Cargo.*" "(src)(/.*)?"];
|
||||||
|
|
||||||
postPatch = ''
|
|
||||||
cp ${../Cargo.lock} Cargo.lock
|
|
||||||
chmod 0755 Cargo.lock
|
|
||||||
'';
|
|
||||||
|
|
||||||
postInstall = ''
|
postInstall = ''
|
||||||
mkdir -p $out/etc/dbus-1/system.d/
|
mkdir -p $out/etc/dbus-1/system.d/
|
||||||
cp ${../nixos-nl.icewind.shortcutd.conf} $out/etc/dbus-1/system.d/nl.icewind.shortcutd.conf
|
cp ${../nixos-nl.icewind.shortcutd.conf} $out/etc/dbus-1/system.d/nl.icewind.shortcutd.conf
|
||||||
'';
|
'';
|
||||||
|
|
||||||
cargoLock = {
|
cargoLock = {
|
||||||
lockFile = ../Cargo.lock;
|
lockFile = ../server/Cargo.lock;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
meta.mainProgram = "shortcutd";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue