mirror of
https://github.com/nix-community/home-manager
synced 2024-11-26 21:19:45 +01:00
blanket: add module
This commit is contained in:
parent
c559542f0a
commit
cd88671199
6 changed files with 86 additions and 0 deletions
|
@ -1667,6 +1667,18 @@ in {
|
|||
- '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.
|
||||
'';
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -274,6 +274,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
|
||||
|
|
40
modules/services/blanket.nix
Normal file
40
modules/services/blanket.nix
Normal 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;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -224,6 +224,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
|
||||
|
|
31
tests/modules/services/blanket/basic-configuration.nix
Normal file
31
tests/modules/services/blanket/basic-configuration.nix
Normal 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
|
||||
''
|
||||
}
|
||||
'';
|
||||
}
|
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 a new issue