From 952e7331ab51ff708c3be568d550eaf06e537dff Mon Sep 17 00:00:00 2001 From: Aylur Date: Wed, 3 Jul 2024 15:56:48 +0200 Subject: init 0.1.0 --- flake.nix | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 flake.nix (limited to 'flake.nix') diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..9c2c68b --- /dev/null +++ b/flake.nix @@ -0,0 +1,53 @@ +{ + description = "Library and cli to control upowerd powerprofiles"; + + 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 + json-glib + ]; + in { + packages.${system} = rec { + default = power-profiles; + power-profiles = pkgs.stdenv.mkDerivation { + inherit nativeBuildInputs buildInputs; + pname = "astal-power-profiles"; + version = version; + src = ./.; + outputs = ["out" "dev"]; + }; + }; + + devShells.${system} = { + default = pkgs.mkShell { + inherit nativeBuildInputs buildInputs; + }; + power-profiles = pkgs.mkShell { + inherit nativeBuildInputs; + buildInputs = + buildInputs + ++ [ + self.packages.${system}.default + pkgs.gjs + ]; + }; + }; + }; +} -- cgit v1.2.3