migrate options
This commit is contained in:
parent
794ceb3123
commit
a15e3f134a
2 changed files with 20 additions and 23 deletions
|
|
@ -164,7 +164,23 @@
|
|||
};
|
||||
|
||||
wakeup-ymir.enable = lib.mkEnableOption "wakeup-ymir";
|
||||
wakeup-music-player.enable = lib.mkEnableOption "wakeup-music-player";
|
||||
|
||||
wakeup-music-player = {
|
||||
enable = lib.mkEnableOption "wakeup-music-player";
|
||||
|
||||
musicFile = lib.mkOption {
|
||||
type = lib.types.path;
|
||||
default = "/home/osbm/Music/wakeup.mp3";
|
||||
description = "Path to the music file to play on wakeup";
|
||||
};
|
||||
|
||||
user = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "osbm";
|
||||
description = "User to run the music player as";
|
||||
};
|
||||
};
|
||||
|
||||
system-logger = {
|
||||
enable = lib.mkEnableOption "system-logger";
|
||||
|
||||
|
|
|
|||
|
|
@ -15,26 +15,7 @@ let
|
|||
};
|
||||
in
|
||||
{
|
||||
options.services.wakeup-music-player = {
|
||||
enable = lib.mkEnableOption {
|
||||
description = "Enable Wakeup Music Player";
|
||||
default = config.osbmModules.services.wakeup-music-player.enable or false;
|
||||
};
|
||||
|
||||
musicFile = lib.mkOption {
|
||||
type = lib.types.path;
|
||||
default = "/home/osbm/Music/wakeup.mp3";
|
||||
description = "Path to the music file to play on wakeup";
|
||||
};
|
||||
|
||||
user = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "osbm";
|
||||
description = "User to run the music player as";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf config.services.wakeup-music-player.enable {
|
||||
config = lib.mkIf config.osbmModules.services.wakeup-music-player.enable {
|
||||
systemd.services.wakeup-music-player = {
|
||||
description = "Play Wakeup Music";
|
||||
after = [
|
||||
|
|
@ -44,8 +25,8 @@ in
|
|||
wantedBy = [ "multi-user.target" ];
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
ExecStart = "${lib.getExe wakeup-music-player} ${config.services.wakeup-music-player.musicFile} ${config.services.wakeup-music-player.user}";
|
||||
User = config.services.wakeup-music-player.user;
|
||||
ExecStart = "${lib.getExe wakeup-music-player} ${config.osbmModules.services.wakeup-music-player.musicFile} ${config.osbmModules.services.wakeup-music-player.user}";
|
||||
User = config.osbmModules.services.wakeup-music-player.user;
|
||||
Environment = [
|
||||
"XDG_RUNTIME_DIR=/run/user/1000"
|
||||
"PULSE_RUNTIME_PATH=/run/user/1000/pulse"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue