AGS/flake.nix
2024-11-21 22:45:00 +07:00

81 lines
2 KiB
Nix

{
description = "My Awesome Desktop Shell";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
ags = {
url = "github:aylur/ags";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
{ nixpkgs, ags, ... }:
let
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
layout =
pkgs.writeText "layout.kdl"
# kdl
''
layout {
pane {
pane name="command"
pane command="bash" {
name "ags"
args "-c" "wgo -file=.ts -file=.tsx -xfile=.d.ts -file=.scss ags run ./app.ts"
}
}
}
'';
devRunScript = pkgs.writeShellScriptBin "dev-run" ''
zellij --layout ${layout} attach --create ags
'';
devStopScript = pkgs.writeShellScriptBin "dev-stop" ''
killall gjs || true
zellij delete-session --force ags || true
'';
agsPkg = ags.packages.${system};
in
{
packages.${system} = {
default = ags.lib.bundle {
inherit pkgs;
src = ./.;
name = "my-shell";
entry = "app.ts";
# additional libraries and executables to add to gjs' runtime
extraPackages = [
agsPkg.hyprland
# ags.packages.${system}.battery
# pkgs.fzf
];
};
};
devShells.${system} = {
default = pkgs.mkShell {
buildInputs = [
devRunScript
devStopScript
pkgs.zellij
pkgs.typescript
pkgs.wgo
# includes all Astal libraries
# ags.packages.${system}.agsFull
# includes astal3 astal4 astal-io by default
(ags.packages.${system}.default.override {
extraPackages = [
agsPkg.hyprland
# cherry pick packages
];
})
];
};
};
};
}