-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathflake.nix
48 lines (46 loc) · 1.66 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
{
description = "Synchronizes the clipboard across multiple X11 and wayland instances running on the same machine";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
};
outputs =
{ self, nixpkgs }:
let
supportedSystems = [ "x86_64-linux" ];
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
pkgsFor = nixpkgs.legacyPackages;
in
{
formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixfmt-rfc-style;
packages = forAllSystems (system: {
default = pkgsFor.${system}.callPackage ./. { };
});
nixosModules.default =
# For illustration, probably want to break this definition out to a separate file
{
config,
pkgs,
lib,
...
}:
{
options = {
services.clipboard-sync.enable = lib.mkEnableOption "clipboard-sync";
};
config = lib.mkIf config.services.clipboard-sync.enable {
systemd.user.services.clipboard-sync = {
description = "Synchronize clipboards across all displays";
documentation = [ "https://github.com/dnut/clipboard-sync/" ];
wantedBy = [ "graphical-session.target" ];
after = [ "graphical-session.target" ];
partOf = [ "graphical-session.target" ];
requisite = [ "graphical-session.target" ];
serviceConfig.ExecStart = "/usr/bin/env ${
self.packages.${pkgs.system}.default
}/bin/clipboard-sync --hide-timestamp --log-level debug";
serviceConfig.Restart = "on-failure";
};
};
};
};
}