2024-09-24 16:19:56 -04:00
|
|
|
self: {
|
|
|
|
lib,
|
2024-10-22 00:14:39 -04:00
|
|
|
osConfig,
|
2024-09-24 16:19:56 -04:00
|
|
|
pkgs,
|
|
|
|
...
|
|
|
|
}: {
|
2024-09-23 23:52:17 -04:00
|
|
|
config = let
|
2024-10-22 00:14:39 -04:00
|
|
|
inherit (lib) attrValues boolToString removeAttrs;
|
2024-09-24 16:19:56 -04:00
|
|
|
|
2024-10-22 00:14:39 -04:00
|
|
|
inherit (osConfig.vars) hostName;
|
|
|
|
cfgDesktop = osConfig.roles.desktop;
|
|
|
|
|
|
|
|
inherit (self.inputs) agsV2 gtk-session-lock;
|
|
|
|
|
|
|
|
gtkSessionLock = gtk-session-lock.packages.${pkgs.system}.default;
|
2024-09-23 23:52:17 -04:00
|
|
|
|
|
|
|
agsV2Packages = agsV2.packages.${pkgs.system};
|
2024-10-22 00:14:39 -04:00
|
|
|
astalLibs = attrValues (removeAttrs agsV2.inputs.astal.packages.${pkgs.system} ["docs" "gjs"]) ++ [gtkSessionLock];
|
|
|
|
agsFull = agsV2Packages.ags.override {extraPackages = astalLibs;};
|
2024-09-23 23:52:17 -04:00
|
|
|
configDir = "/home/matt/.nix/nixosModules/ags/v2";
|
|
|
|
in {
|
|
|
|
home = {
|
|
|
|
packages = [
|
|
|
|
(pkgs.writeShellApplication {
|
|
|
|
name = "agsV2";
|
|
|
|
text = ''
|
2024-10-22 00:14:39 -04:00
|
|
|
export CONF="wim"
|
|
|
|
exec ${agsFull}/bin/ags --config ${configDir} "$@"
|
|
|
|
'';
|
|
|
|
})
|
|
|
|
(pkgs.writeShellApplication {
|
|
|
|
name = "agsConf";
|
|
|
|
text = ''
|
|
|
|
export CONF="$1"
|
|
|
|
exec ${agsFull}/bin/ags --config ${configDir}
|
2024-09-23 23:52:17 -04:00
|
|
|
'';
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2024-09-24 16:19:56 -04:00
|
|
|
file = let
|
|
|
|
inherit
|
|
|
|
(import "${self}/lib" {inherit pkgs self;})
|
|
|
|
buildNodeModules
|
|
|
|
buildNodeTypes
|
|
|
|
;
|
|
|
|
in (
|
|
|
|
(buildNodeTypes {
|
|
|
|
pname = "agsV2";
|
|
|
|
configPath = "${configDir}/@girs";
|
|
|
|
packages = astalLibs;
|
|
|
|
})
|
|
|
|
// {
|
|
|
|
"${configDir}/node_modules".source =
|
2024-10-28 14:45:10 -04:00
|
|
|
buildNodeModules ./. "sha256-pK9S6qUjTIL0JDegYJlHSY5XEpLFKfA98MfZ59Q3IL4=";
|
2024-09-24 16:19:56 -04:00
|
|
|
|
|
|
|
"${configDir}/tsconfig.json".source = pkgs.writers.writeJSON "tsconfig.json" {
|
|
|
|
"$schema" = "https://json.schemastore.org/tsconfig";
|
|
|
|
"compilerOptions" = {
|
2024-10-15 20:01:20 -04:00
|
|
|
"experimentalDecorators" = true;
|
2024-09-24 16:19:56 -04:00
|
|
|
"strict" = true;
|
2024-10-15 20:01:20 -04:00
|
|
|
"target" = "ES2023";
|
2024-09-24 16:19:56 -04:00
|
|
|
"moduleResolution" = "Bundler";
|
|
|
|
"jsx" = "react-jsx";
|
2024-10-15 20:01:20 -04:00
|
|
|
"jsxImportSource" = "${agsV2Packages.gjs}/share/astal/gjs/gtk3";
|
2024-09-24 16:19:56 -04:00
|
|
|
"paths" = {
|
2024-10-15 20:01:20 -04:00
|
|
|
"astal" = ["${agsV2Packages.gjs}/share/astal/gjs"];
|
|
|
|
"astal/*" = ["${agsV2Packages.gjs}/share/astal/gjs/*"];
|
2024-09-24 16:19:56 -04:00
|
|
|
};
|
2024-10-15 20:01:20 -04:00
|
|
|
"skipLibCheck" = true;
|
|
|
|
"module" = "ES2022";
|
|
|
|
"lib" = ["ES2023"];
|
2024-09-23 23:52:17 -04:00
|
|
|
};
|
|
|
|
};
|
2024-10-22 00:14:39 -04:00
|
|
|
|
|
|
|
"${configDir}/widgets/lockscreen/vars.ts".text =
|
|
|
|
# javascript
|
|
|
|
''
|
|
|
|
export default {
|
|
|
|
mainMonitor: '${cfgDesktop.mainMonitor}',
|
|
|
|
dupeLockscreen: ${boolToString cfgDesktop.displayManager.duplicateScreen},
|
|
|
|
hasFprintd: ${boolToString (hostName == "wim")},
|
|
|
|
};
|
|
|
|
'';
|
2024-09-24 16:19:56 -04:00
|
|
|
}
|
|
|
|
);
|
2024-09-23 23:52:17 -04:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
# For accurate stack trace
|
|
|
|
_file = ./default.nix;
|
|
|
|
}
|