29 lines
708 B
Nix
29 lines
708 B
Nix
{ lib, pkgs, ... }:
|
|
|
|
let
|
|
# Relative path to assets
|
|
wofiAssets = ../../../assets/system/conf/wofi;
|
|
wofiFiles = builtins.readDir wofiAssets;
|
|
|
|
# Map filenames to source paths
|
|
wofiConfs = lib.genAttrs (builtins.attrNames wofiFiles) (name: {
|
|
src = "${wofiAssets}/${name}";
|
|
});
|
|
in
|
|
{
|
|
# Provide a module option to enable Wofi
|
|
options.enableWofi =
|
|
lib.mkEnableOption "Enable Wofi terminal launcher";
|
|
|
|
# Only apply config if enabled
|
|
config = lib.mkIf (lib.getOption "enableWofi") {
|
|
# Install Wofi system-wide
|
|
environment.systemPackages = [
|
|
pkgs.wofi
|
|
];
|
|
|
|
# Copy config files to a standard location in /etc/xdg
|
|
environment.etc."xdg/wofi".source = wofiAssets;
|
|
};
|
|
}
|