1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-23 11:39:46 +01:00

blanket: add module

This commit is contained in:
daru 2024-05-08 06:16:09 +02:00 committed by Robert Helgesson
parent c559542f0a
commit cd88671199
No known key found for this signature in database
GPG key ID: 96E745BD17AA17ED
6 changed files with 86 additions and 0 deletions

View file

@ -1667,6 +1667,18 @@ in {
- 'nix.channels' - 'nix.channels'
''; '';
} }
{
time = "2024-06-22T05:49:48+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

@ -274,6 +274,7 @@ let
./services/barrier.nix ./services/barrier.nix
./services/batsignal.nix ./services/batsignal.nix
./services/betterlockscreen.nix ./services/betterlockscreen.nix
./services/blanket.nix
./services/blueman-applet.nix ./services/blueman-applet.nix
./services/borgmatic.nix ./services/borgmatic.nix
./services/cachix-agent.nix ./services/cachix-agent.nix

View file

@ -0,0 +1,40 @@
{ pkgs, lib, config, ... }:
let
cfg = config.services.blanket;
inherit (lib) mkIf mkEnableOption mkPackageOption hm platforms;
in {
meta.maintainers = [ lib.maintainers.daru-san ];
options.services.blanket = {
enable = mkEnableOption "blanket";
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

@ -224,6 +224,7 @@ in import nmtSrc {
./modules/services/activitywatch ./modules/services/activitywatch
./modules/services/avizo ./modules/services/avizo
./modules/services/barrier ./modules/services/barrier
./modules/services/blanket
./modules/services/borgmatic ./modules/services/borgmatic
./modules/services/cachix-agent ./modules/services/cachix-agent
./modules/services/cliphist ./modules/services/cliphist

View file

@ -0,0 +1,31 @@
{ ... }:
{
services.blanket = { enable = true; };
test.stubs.blanket = { };
nmt.script = ''
clientServiceFile=home-files/.config/systemd/user/blanket.service
assertFileExists $clientServiceFile
assertFileContent $clientServiceFile ${
builtins.toFile "expected.service" ''
[Install]
WantedBy=graphical-session.target
[Service]
ExecStart=@blanket@/bin/blanket --gapplication-service
Restart=on-failure
RestartSec=5
[Unit]
After=graphical-session-pre.target
Description=Blanket daemon
PartOf=graphical-session.target
PartOf=pipewire.service
Requires=dbus.service
''
}
'';
}

View file

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