Add nix support (#9)

add nix support via a flake.
Flake tested and builds successfully.
This commit is contained in:
Edvin Källström 2023-02-26 19:59:26 +01:00 committed by GitHub
parent d8eae96e50
commit 8238182edb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 95 additions and 0 deletions

1
.gitignore vendored
View file

@ -2,3 +2,4 @@
.cache
build
compile_commands.json
result

View file

@ -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.

43
flake.lock Normal file
View file

@ -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
}

49
flake.nix Normal file
View file

@ -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
];
};
}
);
}