Files
nixos/Droidnix/generated/modules/traveldroid/apps/wofi.nix
T
2026-03-26 18:36:52 +00:00

40 lines
996 B
Nix

{ lib, config, pkgs, flakeRoot, home-manager, ... }:
let
programName = "wofi";
username = config.defaultUser or "henrov";
assetPath = "${flakeRoot}/generated/.config/${programName}";
# Read all files in the asset directory if it exists
assetFiles =
if builtins.pathExists assetPath then
builtins.attrNames (builtins.readDir assetPath)
else
[];
# Convert files to Home Manager xdg config entries
wofiFiles = lib.genAttrs assetFiles (f: {
name =
if f == "wofi.conf" then ".config/wofi/config"
else if f == "theming.css" then ".config/wofi/style.css"
else ".config/wofi/${f}";
value = { source = "${assetPath}/${f}"; };
});
in
{
# Install Wofi via system packages
environment.systemPackages = [
pkgs.wofi
];
# Home Manager configuration
_module.args.hmUsers = {
${username} = {
home.packages = [ pkgs.wofi ];
# Deploy all files to ~/.config/wofi/
home.file = lib.mkMerge wofiFiles;
};
};
}