mirror of
https://github.com/nix-community/home-manager
synced 2024-06-13 10:13:39 +02:00
blanket: add module
This commit is contained in:
parent
fdaaf543ba
commit
59775a0230
|
@ -67,6 +67,12 @@
|
|||
github = "danjujan";
|
||||
githubId = 44864658;
|
||||
};
|
||||
daru-san = {
|
||||
name = "Daru";
|
||||
email = "zadarumaka@proton.me";
|
||||
github = "Daru-san";
|
||||
githubId = 135046711;
|
||||
};
|
||||
d-dervishi = {
|
||||
email = "david.dervishi@epfl.ch";
|
||||
github = "d-dervishi";
|
||||
|
|
|
@ -1595,6 +1595,17 @@ in {
|
|||
when idle or active. See https://github.com/hyprwm/hypridle for more.
|
||||
'';
|
||||
}
|
||||
{
|
||||
time = "2024-05-05T16:07:00+00:00";
|
||||
condition = hostPlatform.isLinux;
|
||||
message = ''
|
||||
A new module is available: 'services.blanket'.
|
||||
|
||||
Blanket is a program you can use to improve your focus and increase
|
||||
your productivity by listening to different sounds. See
|
||||
https://github.com/rafaelmardojai/blanket for more.
|
||||
'';
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -270,6 +270,7 @@ let
|
|||
./services/barrier.nix
|
||||
./services/batsignal.nix
|
||||
./services/betterlockscreen.nix
|
||||
./services/blanket.nix
|
||||
./services/blueman-applet.nix
|
||||
./services/borgmatic.nix
|
||||
./services/cachix-agent.nix
|
||||
|
|
41
modules/services/blanket.nix
Normal file
41
modules/services/blanket.nix
Normal file
|
@ -0,0 +1,41 @@
|
|||
{pkgs, lib, config, ... }:
|
||||
|
||||
let
|
||||
cfg = config.services.blanket;
|
||||
|
||||
inherit (lib) mkIf mkEnableOption mkPackageOption hm platforms maintainers;
|
||||
in
|
||||
{
|
||||
meta.maintainers = [ maintainers.daru-san ];
|
||||
|
||||
options = {
|
||||
enable = mkEnableOption "Enable the blanket service";
|
||||
|
||||
package = mkPackageOption pkgs "blanket" { };
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
assertions = [
|
||||
(hm.assertions.assertPlatform "services.blanket" pkgs platforms.linux)
|
||||
];
|
||||
|
||||
home.packages = [ cfg.package ];
|
||||
|
||||
systemd.user.services.blanket = {
|
||||
Unit = {
|
||||
Description = "Blanket daemon";
|
||||
Requires = [ "dbus.service" ];
|
||||
After = [ "graphical-session-pre.target" ];
|
||||
PartOf = [ "graphical-session.target" "pipewire.service" ];
|
||||
};
|
||||
|
||||
Install.WantedBy = [ "graphical-session.target" ];
|
||||
|
||||
Service = {
|
||||
ExecStart = "${cfg.package}/bin/blanket --gapplication-service";
|
||||
Restart = "on-failure";
|
||||
RestartSec = 5;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -220,6 +220,7 @@ in import nmtSrc {
|
|||
./modules/services/activitywatch
|
||||
./modules/services/avizo
|
||||
./modules/services/barrier
|
||||
./modules/services/blanket
|
||||
./modules/services/borgmatic
|
||||
./modules/services/cachix-agent
|
||||
./modules/services/cliphist
|
||||
|
|
15
tests/modules/services/blanket/basic-configuration.nix
Normal file
15
tests/modules/services/blanket/basic-configuration.nix
Normal file
|
@ -0,0 +1,15 @@
|
|||
{ ... }:
|
||||
|
||||
{
|
||||
services.blanket = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
test.stubs.blanket = { };
|
||||
|
||||
nmt.script = ''
|
||||
clientServiceFile=home-files/.config/systemd/user/blanket.service
|
||||
|
||||
assertFileExists $clientServiceFile
|
||||
'';
|
||||
}
|
1
tests/modules/services/blanket/default.nix
Normal file
1
tests/modules/services/blanket/default.nix
Normal file
|
@ -0,0 +1 @@
|
|||
{blanket-basic-configuration = ./basic-configuration.nix;}
|
Loading…
Reference in New Issue
Block a user