Working on reshuffling
This commit is contained in:
@@ -1,18 +1,22 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
{ lib, ... }:
|
||||
|
||||
let
|
||||
wofiAssets = ../../../assets/system/conf/wofi;
|
||||
wofiFiles = builtins.readDir wofiAssets;
|
||||
|
||||
# Generate attribute set of files
|
||||
wofiConfs = lib.genAttrs (builtins.attrNames wofiFiles) (name: {
|
||||
src = "${wofiAssets}/${name}";
|
||||
});
|
||||
in
|
||||
{
|
||||
# Option to enable Wofi
|
||||
options.enableWofi = lib.mkEnableOption "Enable Wofi terminal launcher";
|
||||
|
||||
# Config applied when module is evaluated
|
||||
config = {
|
||||
# Add Wofi to systemPackages if enabled
|
||||
environment.systemPackages = lib.mkIf (config.enableWofi) [ pkgs.wofi ];
|
||||
|
||||
# Install wofi config files
|
||||
environment.etc."xdg/wofi".source = lib.mkIf (config.enableWofi) wofiAssets;
|
||||
# Config applied when module is enabled
|
||||
config = lib.mkIf (config.enableWofi) {
|
||||
# Symbolic references to configuration files
|
||||
environment.etc."xdg/wofi".source = wofiAssets;
|
||||
environment.etc."xdg/wofi".files = wofiConfs;
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user