1
0
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:
daru 2024-05-05 16:16:21 +02:00
parent fdaaf543ba
commit 59775a0230
7 changed files with 76 additions and 0 deletions

View File

@ -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";

View File

@ -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.
'';
}
];
};
}

View File

@ -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

View 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;
};
};
};
}

View File

@ -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

View File

@ -0,0 +1,15 @@
{ ... }:
{
services.blanket = {
enable = true;
};
test.stubs.blanket = { };
nmt.script = ''
clientServiceFile=home-files/.config/systemd/user/blanket.service
assertFileExists $clientServiceFile
'';
}

View File

@ -0,0 +1 @@
{blanket-basic-configuration = ./basic-configuration.nix;}