-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #37 from QuarterHeaven/master
add nix flake support
- Loading branch information
Showing
5 changed files
with
98 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
# compiled files and executables | ||
/target/ | ||
/result | ||
|
||
# distributable packages | ||
/dist/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
pkgs ? import <nixpkgs> { }, | ||
}: | ||
pkgs.rustPlatform.buildRustPackage rec { | ||
buildInputs = with pkgs; [ xorg.libxcb ]; | ||
|
||
pname = "clipboard-sync"; | ||
version = "0.2.0"; | ||
cargoLock.lockFile = ./Cargo.lock; | ||
src = ./.; | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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"; | ||
}; | ||
}; | ||
}; | ||
}; | ||
} |