From 2f245c4f6ebece51f90f0bcd9fb1ce350c7d61f7 Mon Sep 17 00:00:00 2001 From: Anton Plotnikov Date: Wed, 18 May 2022 15:02:54 +0300 Subject: [PATCH] Add NIX flake package --- README.md | 35 +++++++++++++++++++++++++++++++++++ flake.lock | 42 ++++++++++++++++++++++++++++++++++++++++++ flake.nix | 25 +++++++++++++++++++++++++ 3 files changed, 102 insertions(+) create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/README.md b/README.md index c1fe6d1..071e893 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,18 @@ # activate-linux for Wayland + The "Activate Windows" watermark ported to Linux with Gtk Layer Shell # Linux ## Dependencies + This project depends on: + - `gtk-3.0` (on some distros also `libgtk-3-dev`) - `gtk-layer-shell` and any [supported wayland compositor](https://github.com/wmww/gtk-layer-shell#supported-desktops) ## Building + ``` make ``` @@ -20,3 +24,34 @@ make This project is in the AUR under [activate-linux-wayland-git](https://aur.archlinux.org/packages/activate-linux-wayland-git) Install it using your favorite AUR helper. + +### NixOS + +#### NixOS installation with Flakes + +Just import flake and use `defaultPackage`. + +```nix +{ + ........ + inputs.activate-linux = { + url = "github:Kljunas2/activate-linux"; + inputs.nixpkgs.follows = "nixpkgs"; # not mandatory but recommended + }; + ........ + + outputs = { self, nixpkgs, activate-linux }: { + ........ + modules = [ + ({ self, ... }: { + environment.systemPackages = with pkgs; [ + ........ + activate-linux.defaultPackage.xf86_64-linux + ........ + ]; + }) + ]; + }; + }; +} +``` diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..c61119d --- /dev/null +++ b/flake.lock @@ -0,0 +1,42 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1652875358, + "narHash": "sha256-mIUPX/wMS6ASa1AshLPOvKj8HvjwK4rnlLiaJBUOhRc=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "51c998bdd9f0d6e809cf31acb95cccb627075004", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs", + "utils": "utils" + } + }, + "utils": { + "locked": { + "lastModified": 1652776076, + "narHash": "sha256-gzTw/v1vj4dOVbpBSJX4J0DwUR6LIyXo7/SuuTJp1kM=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "04c1b180862888302ddfb2e3ad9eaa63afc60cf8", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..5398b40 --- /dev/null +++ b/flake.nix @@ -0,0 +1,25 @@ +{ + description = "Activate Linux watermark for wayland"; + + inputs.utils.url = "github:numtide/flake-utils"; + inputs.nixpkgs.url = "github:NixOS/nixpkgs"; + + outputs = { self, nixpkgs, utils }: + utils.lib.eachSystem [ "x86_64-linux" "aarch64-linux" ] (system: + let pkgs = nixpkgs.legacyPackages.${system}; + in { + packages.activate-linux = pkgs.stdenv.mkDerivation { + pname = "activate-linux"; + version = "0.0.1"; + src = ./.; + nativeBuildInputs = with pkgs; [ pkg-config ]; + buildInputs = with pkgs; [ gtk3 gtk-layer-shell ]; + installPhase = '' + mkdir -p $out/bin + cp bin/activate-linux $out/bin/activate-linux + ''; + }; + + defaultPackage = self.packages.${system}.activate-linux; + }); +}