summaryrefslogtreecommitdiff
path: root/examples/gtk4/simple-bar/py/flake.nix
blob: 4002826807fe23563fdae40a710c8063d0460242 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
{
  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
    astal = {
      url = "github:aylur/astal";
      inputs.nixpkgs.follows = "nixpkgs";
    };
  };

  outputs = {
    self,
    nixpkgs,
    astal,
  }: let
    system = "x86_64-linux";
    pkgs = nixpkgs.legacyPackages.${system};

    python = pkgs.python3.withPackages (ps: [
      ps.pygobject3
    ]);

    nativeBuildInputs = with pkgs; [
      meson
      ninja
      pkg-config
      gobject-introspection
      wrapGAppsHook4
      blueprint-compiler
      dart-sass
    ];

    astalPackages = with astal.packages.${system}; [
      io
      astal4
      battery
      wireplumber
      network
      mpris
      powerprofiles
      tray
      bluetooth
    ];
  in {
    packages.${system}.default = pkgs.stdenv.mkDerivation {
      name = "simple-bar";
      src = ./.;
      inherit nativeBuildInputs;
      buildInputs = astalPackages ++ [python];
    };

    devShells.${system}.default = pkgs.mkShell {
      packages = nativeBuildInputs ++ astalPackages ++ [python];
    };
  };
}