From 693768ee37098dbebb38c86e27044f2faa38348d Mon Sep 17 00:00:00 2001 From: azahi Date: Sun, 10 Nov 2024 01:08:38 +0300 Subject: 2024-11-10 --- modules/common/xdg.nix | 43 +++++++++++++++++++++---------------------- 1 file changed, 21 insertions(+), 22 deletions(-) (limited to 'modules/common/xdg.nix') diff --git a/modules/common/xdg.nix b/modules/common/xdg.nix index 0b807b7..df7d624 100644 --- a/modules/common/xdg.nix +++ b/modules/common/xdg.nix @@ -4,7 +4,6 @@ this, ... }: -with lib; let cfg = config.nixfiles.modules.common.xdg; in @@ -20,44 +19,44 @@ in ]; in [ - (mkAliasOptionModule [ + (lib.mkAliasOptionModule [ "dirs" "cache" ] (withBase "cacheHome")) - (mkAliasOptionModule [ + (lib.mkAliasOptionModule [ "dirs" "config" ] (withBase "configHome")) - (mkAliasOptionModule [ + (lib.mkAliasOptionModule [ "dirs" "data" ] (withBase "dataHome")) - (mkAliasOptionModule [ + (lib.mkAliasOptionModule [ "dirs" "state" ] (withBase "stateHome")) - (mkAliasOptionModule [ "userDirs" ] (withBase "userDirs")) + (lib.mkAliasOptionModule [ "userDirs" ] (withBase "userDirs")) ]; options.nixfiles.modules.common.xdg = { - cacheHome = mkOption { - type = types.str; + cacheHome = lib.mkOption { + type = lib.types.str; default = "${config.hm.home.homeDirectory}/.cache"; }; - configHome = mkOption { - type = types.str; + configHome = lib.mkOption { + type = lib.types.str; default = "${config.hm.home.homeDirectory}/.config"; }; - dataHome = mkOption { - type = types.str; + dataHome = lib.mkOption { + type = lib.types.str; default = "${config.hm.home.homeDirectory}/.local/share"; }; - stateHome = mkOption { - type = types.str; + stateHome = lib.mkOption { + type = lib.types.str; default = "${config.hm.home.homeDirectory}/.local/state"; }; - userDirs = mkOption { - type = types.attrs; + userDirs = lib.mkOption { + type = lib.types.attrs; default = let inherit (config.my) home; @@ -76,9 +75,9 @@ in videos = tmp; }; }; - defaultApplications = mkOption { + defaultApplications = lib.mkOption { description = "Default applications."; - type = with types; attrsOf (listOf str); + type = with lib.types; attrsOf (listOf str); default = { }; }; }; @@ -89,7 +88,7 @@ in sounds.enable = this.isHeadful; }; - hm.xdg = mkMerge [ + hm.xdg = lib.mkMerge [ (with cfg; { enable = true; @@ -99,11 +98,11 @@ in inherit stateHome; inherit userDirs; }) - (mkIf this.isHeadful { + (lib.mkIf this.isHeadful { mimeApps = { enable = true; - defaultApplications = mkMerge ( - mapAttrsToList (n: v: genAttrs v (_: [ "${n}.desktop" ])) cfg.defaultApplications + defaultApplications = lib.mkMerge ( + lib.mapAttrsToList (n: v: lib.genAttrs v (_: [ "${n}.desktop" ])) cfg.defaultApplications ); }; }) -- cgit 1.4.1