From 8238182edb0c63a2e134812418bfe949c98d4451 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edvin=20K=C3=A4llstr=C3=B6m?= <84442052+Eken-beep@users.noreply.github.com> Date: Sun, 26 Feb 2023 19:59:26 +0100 Subject: [PATCH] Add nix support (#9) add nix support via a flake. Flake tested and builds successfully. --- .gitignore | 1 + README.md | 2 ++ flake.lock | 43 +++++++++++++++++++++++++++++++++++++++++++ flake.nix | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 95 insertions(+) create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/.gitignore b/.gitignore index 2f8902a..2cdeb0a 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ .cache build compile_commands.json +result diff --git a/README.md b/README.md index 061b6fc..9a87fae 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,8 @@ My personal blazingly fast and efficient status bar + widgets, in case anyone fi ``` ninja -C build && sudo ninja -C build install ``` +## Nix +You can install the nix flake in a number of ways, either through your system/home flake or simply running nix build to get the binary directly. ## Building and installation (AUR) For Arch systems, gBar can be found on the AUR. diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..c668193 --- /dev/null +++ b/flake.lock @@ -0,0 +1,43 @@ +{ + "nodes": { + "flake-utils": { + "locked": { + "lastModified": 1676283394, + "narHash": "sha256-XX2f9c3iySLCw54rJ/CZs+ZK6IQy7GXNY4nSOyu2QG4=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "3db36a8b464d0c4532ba1c7dda728f4576d6d073", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1677262115, + "narHash": "sha256-DPkHiJw2QnKYAzQXBlwelwghxbcD5oigK2kLPHMpMQ8=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "806075be2bdde71895359ed18cb530c4d323e6f6", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..dffe100 --- /dev/null +++ b/flake.nix @@ -0,0 +1,49 @@ +{ + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = { self, nixpkgs, flake-utils, ... }: flake-utils.lib.eachSystem ["x86_64-linux"] (system: + let + pkgs = import nixpkgs { + inherit system; + }; + + gbar = (with pkgs; stdenv.mkDerivation { + + name = "gbar"; + + src = ./.; + + nativeBuildInputs = [ + pkg-config + meson + cmake + ninja + ]; + buildInputs = [ + wayland + bluez + gtk3 + gtk-layer-shell + libpulseaudio + ]; + + + }); + in rec { + defaultApp = flake-utils.lib.mkApp { + drv = defaultPackage; + }; + defaultPackage = gbar; + devShell = pkgs.mkShell { + buildInputs = [ + gbar + ]; + }; + } + + ); +} +