Skip to content

Commit

Permalink
ags: use buildNpmPackage to install deps
Browse files Browse the repository at this point in the history
thanks to `@wroclaw` and `@mr_headroom` on Discord for helping me out on this
  • Loading branch information
brckd committed Jul 1, 2024
1 parent 391184f commit 76336db
Show file tree
Hide file tree
Showing 4 changed files with 325 additions and 11 deletions.
Binary file removed modules/home/ags/bun.lockb
Binary file not shown.
17 changes: 7 additions & 10 deletions modules/home/ags/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,23 @@ with lib; let
in {
config = mkIf cfg.enable {
programs.ags = {
configDir = pkgs.stdenv.mkDerivation {
configDir = pkgs.buildNpmPackage {
name = "ags-dots";
src = ./.;
npmDepsHash = "sha256-0Phl7IrrKSd8j4yQ3nefJ4xT/QgrvDnlN68G7bDHCfE=";

nativeBuildInputs = with pkgs; [bun sass];
buildPhase = ''
# Copy assets
nativeBuildInputs = with pkgs; [bun];
postPatch = ''
# Copy asset
cp ${nixos-symbolic} ./assets/nixos-symbolic.svg
# Build bun files
bun install || true
bun comp || true
'';

installPhase = ''
mkdir -p $out
cp -r config.js style.css assets $out || true
cp -r config.js assets $out
'';
};
};
home.packages = with pkgs; [bun sass];
home.packages = with pkgs; [bun prefetch-npm-deps];
};
}
316 changes: 316 additions & 0 deletions modules/home/ags/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion modules/home/ags/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "@bricked/ags-dots",
"version": "0.1.0",
"module": "src/index.ts",
"devDependencies": {
"@types/bun": "latest",
Expand All @@ -10,7 +11,7 @@
},
"scripts": {
"postinstall": "rm types; ln -s $HOME/.local/share/com.github.Aylur.ags/types types",
"comp": "bun scripts/build.ts",
"build": "bun scripts/build.ts",
"watch": "bun scripts/watch.ts",
"start": "bun scripts/start.ts",
"dev": "bun scripts/dev.ts"
Expand Down

0 comments on commit 76336db

Please sign in to comment.