summaryrefslogtreecommitdiff
path: root/pkgs/astal/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/astal/default.nix')
-rw-r--r--pkgs/astal/default.nix84
1 files changed, 51 insertions, 33 deletions
diff --git a/pkgs/astal/default.nix b/pkgs/astal/default.nix
index a7e86fe..fb320ee 100644
--- a/pkgs/astal/default.nix
+++ b/pkgs/astal/default.nix
@@ -3,41 +3,59 @@
inputs,
system,
options,
- runCommand,
- dart-sass,
...
}: let
+ runCommand = pkgs.runCommand;
+ dart-sass = pkgs.dart-sass;
+
apkgs = inputs.astal.packages.${system};
scss = "${dart-sass}/bin/sass";
theme = import ./theme.nix {inherit options;};
-in
- inputs.astal.lib.mkLuaPackage {
- pkgs =
- pkgs
- // {
- # use luajit
- lua = pkgs.luajit;
- };
- src = runCommand "src" {} ''
- mkdir -p $out
- cp -r ${./src}/{*.lua,widget} $out/
- cp -r ${./src}/style/* .
- echo '${theme}' > theme.scss
- cat theme.scss style.scss widget/* > main.scss
- ${scss} main.scss $out/main.css
- '';
- name = "astal";
- extraPackages =
- (with apkgs; [
- battery
- hyprland
- mpris
- network
- notifd
- tray
- wireplumber
- ])
- ++ (with pkgs; [
- networkmanager
- ]);
- }
+
+ mkAstal = file:
+ inputs.astal.lib.mkLuaPackage {
+ pkgs =
+ pkgs
+ // {
+ # use luajit
+ lua = pkgs.luajit;
+ };
+ src = runCommand "src" {} ''
+ mkdir -p $out
+ cp -r ${./src}/{*.lua,widget} $out/
+ cp $out/${file}.lua $out/init.lua
+ cp -r ${./src}/style/* .
+ echo '${theme}' > theme.scss
+ cat theme.scss style.scss widget/* > main.scss
+ ${scss} main.scss $out/main.css
+ '';
+ name = "astal-${file}";
+ extraPackages =
+ (with apkgs; [
+ apps
+ battery
+ hyprland
+ mpris
+ network
+ notifd
+ tray
+ wireplumber
+ ])
+ ++ (with pkgs; [
+ networkmanager
+ ]);
+ };
+
+ mkAstalWrapper = file: let
+ pkg = mkAstal file;
+ in
+ pkgs.writeShellApplication {
+ name = "astal-${file}";
+ text = ''
+ ${pkg}/bin/astal-${file}
+ '';
+ };
+in {
+ shell = mkAstalWrapper "shell";
+ launcher = mkAstalWrapper "launcher";
+}