From 98378d30780bb22293a2012e99fe77d3cea56c21 Mon Sep 17 00:00:00 2001 From: Jimbo Date: Fri, 10 Jan 2025 14:38:04 -0500 Subject: [PATCH] Move from home.file to xdg.configFile where applicable --- .../home/programs/gui/mangohud/default.nix | 38 ++- modules/home/programs/gui/pcmanfm/default.nix | 10 +- modules/home/programs/gui/rofi/default.nix | 254 +++++++++--------- .../programs/terminal/fastfetch/default.nix | 2 +- .../terminal/fastfetch/small/default.nix | 6 +- modules/home/services/easyeffects/default.nix | 4 +- modules/home/wms/niri/default.nix | 2 +- .../disks/impermanence/main/default.nix | 2 +- 8 files changed, 157 insertions(+), 161 deletions(-) diff --git a/modules/home/programs/gui/mangohud/default.nix b/modules/home/programs/gui/mangohud/default.nix index 7ae9f2e..1196adc 100644 --- a/modules/home/programs/gui/mangohud/default.nix +++ b/modules/home/programs/gui/mangohud/default.nix @@ -2,25 +2,23 @@ { config = lib.mkIf config.home.desktop.enable { programs.mangohud.enable = true; - home.file = { - # These options exist in Nixlang, but the order is not respected. - ".config/MangoHud/MangoHud.conf".text = '' - table_columns=2 - frametime=0 - legacy_layout=0 - font_scale=0.80 - background_alpha=0.25 - - fps - fps_color_change - ram - vram - cpu_stats - cpu_load_change - gpu_stats - gpu_load_change - frame_timing - ''; - }; + # These options exist in Nixlang, but the order is not respected. + xdg.configFile."MangoHud/MangoHud.conf".text = '' + table_columns=2 + frametime=0 + legacy_layout=0 + font_scale=0.80 + background_alpha=0.25 + + fps + fps_color_change + ram + vram + cpu_stats + cpu_load_change + gpu_stats + gpu_load_change + frame_timing + ''; }; } diff --git a/modules/home/programs/gui/pcmanfm/default.nix b/modules/home/programs/gui/pcmanfm/default.nix index 3aa8dfc..6463a7c 100644 --- a/modules/home/programs/gui/pcmanfm/default.nix +++ b/modules/home/programs/gui/pcmanfm/default.nix @@ -1,12 +1,12 @@ { pkgs, config, lib, ... }: { - home = lib.mkIf config.home.desktop.enable { - packages = with pkgs; [ + config = lib.mkIf config.home.desktop.enable { + home.packages = with pkgs; [ pcmanfm file-roller ]; - file = { - ".config/pcmanfm/default/pcmanfm.conf".text = '' + xdg.configFile = { + "pcmanfm/default/pcmanfm.conf".text = '' [config] bm_open_method=0 @@ -35,7 +35,7 @@ pathbar_mode_buttons=0 ''; - ".config/libfm/libfm.conf".text = '' + "libfm/libfm.conf".text = '' [config] single_click=0 use_trash=1 diff --git a/modules/home/programs/gui/rofi/default.nix b/modules/home/programs/gui/rofi/default.nix index ce35f0a..e326692 100644 --- a/modules/home/programs/gui/rofi/default.nix +++ b/modules/home/programs/gui/rofi/default.nix @@ -1,133 +1,135 @@ -{ pkgs, config, ... }: +{ pkgs, config, lib, ... }: { imports = [ ./scripts ]; - programs.rofi = { - enable = config.home.desktop.enable; - package = pkgs.rofi-wayland; - terminal = "foot"; - font = "${config.look.fonts.main} 14"; - theme = let - inherit (config.lib.formats.rasi) mkLiteral; - in { - "*" = { - lightbg = mkLiteral "#EEE8D5"; - lightfg = mkLiteral "#586875"; - blue = mkLiteral "#268BD2"; - red = mkLiteral "#DC322F"; - background-color = mkLiteral "#00000000"; - separatorcolor = mkLiteral "#00000000"; - normal-foreground = mkLiteral "#${config.look.colors.text}"; - normal-background = mkLiteral "#${config.look.colors.dark}1A"; - urgent-foreground = mkLiteral "#${config.look.colors.urgent}"; - active-foreground = mkLiteral "#${config.look.colors.split}"; - selected-active-foreground = mkLiteral "#${config.look.colors.prime}"; - background = mkLiteral "#${config.look.colors.dark}D9"; - bordercolor = mkLiteral "#${config.look.colors.prime}"; - selected-normal-foreground = mkLiteral "#FFFFFF"; - selected-normal-background = mkLiteral "#${config.look.colors.prime}80"; - border-color = mkLiteral "#${config.look.colors.prime}"; - urgent-background = mkLiteral "#${config.look.colors.accent}26"; - active-background = mkLiteral "#${config.look.colors.accent}26"; - selected-active-background = mkLiteral "#${config.look.colors.split}54"; - }; - "#window" = { - background-color = mkLiteral "@background"; - width = 500; - border = mkLiteral "${config.look.border.string}"; - padding = 5; - }; - "#message" = { - border = mkLiteral "1px dash 0px 0px"; - border-color = mkLiteral "@separatorcolor"; - padding = 1; - }; - "#textbox" = { - text-color = mkLiteral "@normal-foreground"; - }; - "#listview" = { - fixed-height = 0; - border-color = mkLiteral "@separatorcolor"; - scrollbar = mkLiteral "false"; - columns = 2; - }; - "#element" = { - border = 0; - padding = 1; - }; - "#element-text" = { - background-color = mkLiteral "inherit"; - text-color = mkLiteral "inherit"; - }; - "#element.normal.normal" = { - text-color = mkLiteral "@normal-foreground"; - }; - "#element.normal.urgent" = { - text-color = mkLiteral "@urgent-foreground"; - }; - "#element.normal.active" = { - background-color = mkLiteral "@active-background"; - text-color = mkLiteral "@active-foreground"; - }; - "#element.selected.normal" = { - background-color = mkLiteral "@selected-normal-background"; - text-color = mkLiteral "@selected-normal-foreground"; - }; - "#element.selected.urgent" = { - background-color = mkLiteral "@urgent-background"; - text-color = mkLiteral "@urgent-foreground"; - }; - "#element.selected.active" = { - background-color = mkLiteral "@selected-active-background"; - text-color = mkLiteral "@selected-active-foreground"; - }; - "#element.alternate.normal" = { - text-color = mkLiteral "@normal-foreground"; - }; - "#element.alternate.urgent" = { - text-color = mkLiteral "@urgent-foreground"; - }; - "#element.alternate.active" = { - background-color = mkLiteral "@active-background"; - text-color = mkLiteral "@active-foreground"; - }; - "#mode-switcher" = { - border = mkLiteral "2px dash 0px 0px"; - border-color = mkLiteral "@separatorcolor"; - }; - "#button.selected" = { - background-color = mkLiteral "@selected-normal-background"; - text-color = mkLiteral "@selected-normal-foreground"; - }; - "#case-indicator" = { - spacing = mkLiteral "0"; - text-color = mkLiteral "@normal-foreground"; - }; - "#entry" = { - spacing = 0; - text-color = mkLiteral "@normal-foreground"; - }; - "#prompt" = { - spacing = 0; - text-color = mkLiteral "@normal-foreground"; - }; - "#inputbar" = { - spacing = 0; - text-color = mkLiteral "@normal-foreground"; - padding = 1; - children = map mkLiteral [ "prompt" "textbox-prompt-colon" "entry"]; - }; - "#textbox-prompt-colon" = { - expand = false; - str = ":"; - margin = mkLiteral "0px 0.3em 0em 0em"; - text-color = mkLiteral "@normal-foreground"; + config = lib.mkIf config.home.desktop.enable { + programs.rofi = { + enable = true; + package = pkgs.rofi-wayland; + terminal = "foot"; + font = "${config.look.fonts.main} 14"; + theme = let + inherit (config.lib.formats.rasi) mkLiteral; + in { + "*" = { + lightbg = mkLiteral "#EEE8D5"; + lightfg = mkLiteral "#586875"; + blue = mkLiteral "#268BD2"; + red = mkLiteral "#DC322F"; + background-color = mkLiteral "#00000000"; + separatorcolor = mkLiteral "#00000000"; + normal-foreground = mkLiteral "#${config.look.colors.text}"; + normal-background = mkLiteral "#${config.look.colors.dark}1A"; + urgent-foreground = mkLiteral "#${config.look.colors.urgent}"; + active-foreground = mkLiteral "#${config.look.colors.split}"; + selected-active-foreground = mkLiteral "#${config.look.colors.prime}"; + background = mkLiteral "#${config.look.colors.dark}D9"; + bordercolor = mkLiteral "#${config.look.colors.prime}"; + selected-normal-foreground = mkLiteral "#FFFFFF"; + selected-normal-background = mkLiteral "#${config.look.colors.prime}80"; + border-color = mkLiteral "#${config.look.colors.prime}"; + urgent-background = mkLiteral "#${config.look.colors.accent}26"; + active-background = mkLiteral "#${config.look.colors.accent}26"; + selected-active-background = mkLiteral "#${config.look.colors.split}54"; + }; + "#window" = { + background-color = mkLiteral "@background"; + width = 500; + border = mkLiteral "${config.look.border.string}"; + padding = 5; + }; + "#message" = { + border = mkLiteral "1px dash 0px 0px"; + border-color = mkLiteral "@separatorcolor"; + padding = 1; + }; + "#textbox" = { + text-color = mkLiteral "@normal-foreground"; + }; + "#listview" = { + fixed-height = 0; + border-color = mkLiteral "@separatorcolor"; + scrollbar = mkLiteral "false"; + columns = 2; + }; + "#element" = { + border = 0; + padding = 1; + }; + "#element-text" = { + background-color = mkLiteral "inherit"; + text-color = mkLiteral "inherit"; + }; + "#element.normal.normal" = { + text-color = mkLiteral "@normal-foreground"; + }; + "#element.normal.urgent" = { + text-color = mkLiteral "@urgent-foreground"; + }; + "#element.normal.active" = { + background-color = mkLiteral "@active-background"; + text-color = mkLiteral "@active-foreground"; + }; + "#element.selected.normal" = { + background-color = mkLiteral "@selected-normal-background"; + text-color = mkLiteral "@selected-normal-foreground"; + }; + "#element.selected.urgent" = { + background-color = mkLiteral "@urgent-background"; + text-color = mkLiteral "@urgent-foreground"; + }; + "#element.selected.active" = { + background-color = mkLiteral "@selected-active-background"; + text-color = mkLiteral "@selected-active-foreground"; + }; + "#element.alternate.normal" = { + text-color = mkLiteral "@normal-foreground"; + }; + "#element.alternate.urgent" = { + text-color = mkLiteral "@urgent-foreground"; + }; + "#element.alternate.active" = { + background-color = mkLiteral "@active-background"; + text-color = mkLiteral "@active-foreground"; + }; + "#mode-switcher" = { + border = mkLiteral "2px dash 0px 0px"; + border-color = mkLiteral "@separatorcolor"; + }; + "#button.selected" = { + background-color = mkLiteral "@selected-normal-background"; + text-color = mkLiteral "@selected-normal-foreground"; + }; + "#case-indicator" = { + spacing = mkLiteral "0"; + text-color = mkLiteral "@normal-foreground"; + }; + "#entry" = { + spacing = 0; + text-color = mkLiteral "@normal-foreground"; + }; + "#prompt" = { + spacing = 0; + text-color = mkLiteral "@normal-foreground"; + }; + "#inputbar" = { + spacing = 0; + text-color = mkLiteral "@normal-foreground"; + padding = 1; + children = map mkLiteral [ "prompt" "textbox-prompt-colon" "entry"]; + }; + "#textbox-prompt-colon" = { + expand = false; + str = ":"; + margin = mkLiteral "0px 0.3em 0em 0em"; + text-color = mkLiteral "@normal-foreground"; + }; }; }; - }; - home.packages = with pkgs; [ - bemoji - rofi-bluetooth - ]; + home.packages = with pkgs; [ + bemoji + rofi-bluetooth + ]; + }; } diff --git a/modules/home/programs/terminal/fastfetch/default.nix b/modules/home/programs/terminal/fastfetch/default.nix index dd7417e..b44f625 100644 --- a/modules/home/programs/terminal/fastfetch/default.nix +++ b/modules/home/programs/terminal/fastfetch/default.nix @@ -3,5 +3,5 @@ imports = [ ./small ]; programs.fastfetch.enable = true; - home.file.".config/fastfetch/config.jsonc".source = ./config.jsonc; + xdg.configFile."fastfetch/config.jsonc".source = ./config.jsonc; } diff --git a/modules/home/programs/terminal/fastfetch/small/default.nix b/modules/home/programs/terminal/fastfetch/small/default.nix index 4f729d4..d48f134 100644 --- a/modules/home/programs/terminal/fastfetch/small/default.nix +++ b/modules/home/programs/terminal/fastfetch/small/default.nix @@ -1,7 +1,5 @@ { pkgs, ... }: { - home = { - packages = with pkgs; [ (pkgs.writeScriptBin "pfetch" "fastfetch --config ~/.config/fastfetch/small.jsonc") ]; - file.".config/fastfetch/small.jsonc".source = ./small.jsonc; - }; + home.packages = with pkgs; [ (pkgs.writeScriptBin "pfetch" "fastfetch --config ~/.config/fastfetch/small.jsonc") ]; + xdg.configFile."fastfetch/small.jsonc".source = ./small.jsonc; } diff --git a/modules/home/services/easyeffects/default.nix b/modules/home/services/easyeffects/default.nix index 777ac25..0a82d8d 100644 --- a/modules/home/services/easyeffects/default.nix +++ b/modules/home/services/easyeffects/default.nix @@ -5,8 +5,6 @@ enable = true; preset = "headphones"; }; - home.file = { - ".config/easyeffects/output/headphones.json".source = ./headphones.json; - }; + xdg.configFile."easyeffects/output/headphones.json".source = ./headphones.json; }; } diff --git a/modules/home/wms/niri/default.nix b/modules/home/wms/niri/default.nix index 965bfa5..5c47e43 100644 --- a/modules/home/wms/niri/default.nix +++ b/modules/home/wms/niri/default.nix @@ -14,7 +14,7 @@ default = {}; }; - config.home.file.".config/niri/config.kdl".text = '' + config.xdg.configFile."niri/config.kdl".text = '' ${builtins.readFile config.home.niri.settings.autostart} ${builtins.readFile config.home.niri.settings.hotkeys} ${builtins.readFile config.home.niri.settings.inputs} diff --git a/modules/system/devices/disks/impermanence/main/default.nix b/modules/system/devices/disks/impermanence/main/default.nix index d45985c..1d95e3f 100644 --- a/modules/system/devices/disks/impermanence/main/default.nix +++ b/modules/system/devices/disks/impermanence/main/default.nix @@ -22,7 +22,7 @@ ".config/heroic" ".config/obs-studio" - ".local/share/mpd" + ".local/share/mpd" ".local/share/nvim/undo" ".local/share/fractal" ".local/share/PrismLauncher"