nixos-configs/nixosModules/ags/v2/default.nix

67 lines
1.8 KiB
Nix
Raw Normal View History

self: {
lib,
pkgs,
...
}: {
2024-09-23 23:52:17 -04:00
config = let
inherit (lib) attrValues removeAttrs;
2024-09-23 23:52:17 -04:00
inherit (self.inputs) agsV2;
agsV2Packages = agsV2.packages.${pkgs.system};
astalLibs = attrValues (removeAttrs agsV2.inputs.astal.packages.${pkgs.system} ["docs" "gjs"]);
2024-09-23 23:52:17 -04:00
configDir = "/home/matt/.nix/nixosModules/ags/v2";
in {
home = {
packages = [
(pkgs.writeShellApplication {
name = "agsV2";
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-f0hbPvHTqeFM7mfmV+sN4EEuE0F91f5kjJ/EHy0oU+Y=";
"${configDir}/tsconfig.json".source = pkgs.writers.writeJSON "tsconfig.json" {
"$schema" = "https://json.schemastore.org/tsconfig";
"compilerOptions" = {
"experimentalDecorators" = true;
"strict" = true;
"target" = "ES2023";
"moduleResolution" = "Bundler";
"jsx" = "react-jsx";
"jsxImportSource" = "${agsV2Packages.gjs}/share/astal/gjs/gtk3";
"paths" = {
"astal" = ["${agsV2Packages.gjs}/share/astal/gjs"];
"astal/*" = ["${agsV2Packages.gjs}/share/astal/gjs/*"];
};
"skipLibCheck" = true;
"module" = "ES2022";
"lib" = ["ES2023"];
2024-09-23 23:52:17 -04:00
};
};
}
);
2024-09-23 23:52:17 -04:00
};
};
# For accurate stack trace
_file = ./default.nix;
}