From 4c8d03265a87ce76cc31fd36eb476d00efe7ef56 Mon Sep 17 00:00:00 2001 From: Aylur Date: Sat, 22 Jun 2024 02:32:03 +0200 Subject: init 0.1.0 --- flake.nix | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 flake.nix (limited to 'flake.nix') diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..ba7aa74 --- /dev/null +++ b/flake.nix @@ -0,0 +1,48 @@ +{ + description = "DBus proxy library for upower daemon"; + + 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 + ]; + + buildInputs = with pkgs; [ + glib + ]; + in { + packages.${system} = rec { + default = battery; + battery = pkgs.stdenv.mkDerivation { + inherit nativeBuildInputs buildInputs; + pname = "astal-battery"; + version = version; + src = ./.; + outputs = ["out" "dev"]; + }; + }; + + devShells.${system} = { + default = pkgs.mkShell { + inherit nativeBuildInputs buildInputs; + }; + battery = pkgs.mkShell { + inherit nativeBuildInputs; + buildInputs = buildInputs ++ [ + self.packages.${system}.default + pkgs.gjs + ]; + }; + }; + }; +} -- cgit v1.2.3