Add flake

This commit is contained in:
2024-07-08 16:58:34 +07:00
parent faf40c60dc
commit 013175591d
2 changed files with 81 additions and 0 deletions

27
flake.lock generated Normal file
View File

@@ -0,0 +1,27 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1720031269,
"narHash": "sha256-rwz8NJZV+387rnWpTYcXaRNvzUSnnF9aHONoJIYmiUQ=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "9f4128e00b0ae8ec65918efeba59db998750ead6",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

54
flake.nix Normal file
View File

@@ -0,0 +1,54 @@
{
description = "Library and cli tool for querying river";
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
outputs = {
self,
nixpkgs,
}: let
version = builtins.replaceStrings ["\n"] [""] (builtins.readFile ./version);
system = "x86_64-linux";
pkgs = import nixpkgs {inherit system;};
nativeBuildInputs = with pkgs; [
gobject-introspection
meson
pkg-config
ninja
vala
wayland
];
buildInputs = with pkgs; [
glib
json-glib
];
in {
packages.${system} = rec {
default = river;
river = pkgs.stdenv.mkDerivation {
inherit nativeBuildInputs buildInputs;
pname = "astal-river";
version = version;
src = ./.;
outputs = ["out" "dev"];
};
};
devShells.${system} = {
default = pkgs.mkShell {
inherit nativeBuildInputs buildInputs;
};
river = pkgs.mkShell {
inherit nativeBuildInputs;
buildInputs =
buildInputs
++ [
pkgs.gjs
self.packages.${system}.default
];
};
};
};
}