summaryrefslogtreecommitdiff
path: root/flake.nix
diff options
context:
space:
mode:
authorAylur <[email protected]>2024-07-03 15:56:48 +0200
committerAylur <[email protected]>2024-07-03 15:56:48 +0200
commit952e7331ab51ff708c3be568d550eaf06e537dff (patch)
tree1f853e453dc5b6deb7c9750521c4b2505259d8ce /flake.nix
init 0.1.0
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix53
1 files changed, 53 insertions, 0 deletions
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
+ ];
+ };
+ };
+ };
+}