nixos-configs/nixosModules/ags/v2/default.nix
matt1432 62dc1214e9
All checks were successful
Discord / discord commits (push) Has been skipped
feat(agsv2): add node_modules and types with nix
2024-09-24 16:19:56 -04:00

68 lines
1.9 KiB
Nix

self: {
lib,
pkgs,
...
}: {
config = let
inherit (lib) attrValues removeAttrs;
inherit (self.inputs) agsV2;
agsV2Packages = agsV2.packages.${pkgs.system};
astalLibs = attrValues (removeAttrs agsV2.inputs.astal.packages.${pkgs.system} ["docs"]);
configDir = "/home/matt/.nix/nixosModules/ags/v2";
in {
home = {
packages = [
(pkgs.writeShellApplication {
name = "agsV2";
runtimeInputs = [];
text = ''
exec ${agsV2Packages.agsFull}/bin/ags --config ${configDir} "$@"
'';
})
];
file = let
inherit
(import "${self}/lib" {inherit pkgs self;})
buildNodeModules
buildNodeTypes
;
in (
(buildNodeTypes {
pname = "agsV2";
configPath = "${configDir}/@girs";
packages = astalLibs;
})
// {
"${configDir}/node_modules".source =
buildNodeModules ./. "sha256-WjCfS8iEw5Mjor/sQ2t+i0Q1pqVpSDEDbbgrKwK+3cg=";
"${configDir}/tsconfig.json".source = pkgs.writers.writeJSON "tsconfig.json" {
"$schema" = "https://json.schemastore.org/tsconfig";
"compilerOptions" = {
"target" = "ES2023";
"module" = "ES2022";
"lib" = ["ES2023"];
"strict" = true;
"moduleResolution" = "Bundler";
"skipLibCheck" = true;
"checkJs" = true;
"allowJs" = true;
"jsx" = "react-jsx";
"jsxImportSource" = "${agsV2Packages.astal}/share/astal/gjs/src/jsx";
"paths" = {
"astal" = ["${agsV2Packages.astal}/share/astal/gjs"];
"astal/*" = ["${agsV2Packages.astal}/share/astal/gjs/src/*"];
};
};
};
}
);
};
};
# For accurate stack trace
_file = ./default.nix;
}