40 lines
1002 B
Nix
40 lines
1002 B
Nix
{ lib, config, pkgs, flakeRoot, home-manager, ... }:
|
|
|
|
let
|
|
programName = "wofi";
|
|
username = config.defaultUser or "henrov";
|
|
assetPath = "${flakeRoot}/assets/traveldroid/conf/${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;
|
|
};
|
|
};
|
|
}
|