diff --git a/hosts/common/configs/user/console/kubernetes/default.nix b/hosts/common/configs/user/console/kubernetes/default.nix index 8dccb35..e543ba7 100644 --- a/hosts/common/configs/user/console/kubernetes/default.nix +++ b/hosts/common/configs/user/console/kubernetes/default.nix @@ -70,6 +70,6 @@ }; }; - theme.template."${home}/.config/k9s/skins/matugen.yaml".source = ./theme.yaml; + theme.template.".config/k9s/skins/matugen.yaml".source = ./theme.yaml; }; } diff --git a/hosts/common/configs/user/gui/astal/default.nix b/hosts/common/configs/user/gui/astal/default.nix index 6eaa2ee..0a54f42 100644 --- a/hosts/common/configs/user/gui/astal/default.nix +++ b/hosts/common/configs/user/gui/astal/default.nix @@ -36,7 +36,7 @@ in ]; }; - theme.template."${home}/.config/astal/theme.sass".source = ./theme.sass; + theme.template.".config/astal/theme.sass".source = ./theme.sass; systemd.user = { targets.tray.Unit = { diff --git a/hosts/common/configs/user/gui/btop/default.nix b/hosts/common/configs/user/gui/btop/default.nix index 3edc4ef..ab81f86 100644 --- a/hosts/common/configs/user/gui/btop/default.nix +++ b/hosts/common/configs/user/gui/btop/default.nix @@ -13,7 +13,7 @@ programs.btop.settings.color_theme = "matugen"; theme = { - template."${home}/.config/btop/themes/matugen.theme".source = ./theme.theme; + template.".config/btop/themes/matugen.theme".source = ./theme.theme; reloadExtraConfig = "${ lib.meta.getExe ( diff --git a/hosts/common/configs/user/gui/discord/default.nix b/hosts/common/configs/user/gui/discord/default.nix index fc7e2a4..45d0b82 100644 --- a/hosts/common/configs/user/gui/discord/default.nix +++ b/hosts/common/configs/user/gui/discord/default.nix @@ -51,6 +51,6 @@ enabledThemes = [ "matugen.theme.css" ]; }; - theme.template."${home}/.config/vesktop/themes/matugen.theme.css".source = ./theme.css; + theme.template.".config/vesktop/themes/matugen.theme.css".source = ./theme.css; }; } diff --git a/hosts/common/configs/user/gui/firefox/default.nix b/hosts/common/configs/user/gui/firefox/default.nix index 1a1a8d7..6a243a8 100644 --- a/hosts/common/configs/user/gui/firefox/default.nix +++ b/hosts/common/configs/user/gui/firefox/default.nix @@ -24,7 +24,7 @@ in policies = { AutofillAddressEnabled = false; AutofillCreditCardEnabled = false; - DefaultDownloadDirectory = "$HOME/Downloads"; + DefaultDownloadDirectory = "${home}/Downloads"; DisableFirefoxStudies = true; DisablePocket = true; DisableSetDesktopBackground = true; @@ -126,9 +126,5 @@ in ] (_: "firefox.desktop"); home.sessionVariables.DEFAULT_BROWSER = lib.meta.getExe hmConfig.programs.firefox.finalPackage; - - wayland.windowManager.hyprland.settings.bind = [ - "$mod, b, exec, ${lib.meta.getExe hmConfig.programs.firefox.finalPackage}" - ]; }; } diff --git a/hosts/common/configs/user/gui/gtk/default.nix b/hosts/common/configs/user/gui/gtk/default.nix index c1437de..15fa49a 100644 --- a/hosts/common/configs/user/gui/gtk/default.nix +++ b/hosts/common/configs/user/gui/gtk/default.nix @@ -53,8 +53,8 @@ in }; theme.template = { - "${home}/.config/gtk-3.0/theme.css".source = ./theme.css; - "${home}/.config/gtk-4.0/theme.css".source = ./theme.css; + ".config/gtk-3.0/theme.css".source = ./theme.css; + ".config/gtk-4.0/theme.css".source = ./theme.css; }; theme.initExtraConfig = "${ diff --git a/hosts/common/configs/user/gui/hyprland/default.nix b/hosts/common/configs/user/gui/hyprland/default.nix index f86c2f8..4de0132 100644 --- a/hosts/common/configs/user/gui/hyprland/default.nix +++ b/hosts/common/configs/user/gui/hyprland/default.nix @@ -163,7 +163,7 @@ ''; theme = { - template."${home}/.config/hypr/theme.conf".source = ./theme.conf; + template.".config/hypr/theme.conf".source = ./theme.conf; reloadExtraConfig = "${ lib.meta.getExe ( diff --git a/hosts/common/configs/user/gui/kitty/default.nix b/hosts/common/configs/user/gui/kitty/default.nix index 3b99015..436f10e 100644 --- a/hosts/common/configs/user/gui/kitty/default.nix +++ b/hosts/common/configs/user/gui/kitty/default.nix @@ -31,7 +31,7 @@ in }; theme = { - template."${home}/.config/kitty/theme.conf".source = ./theme.conf; + template.".config/kitty/theme.conf".source = ./theme.conf; reloadExtraConfig = "${ lib.meta.getExe ( diff --git a/hosts/common/configs/user/gui/obsidian/default.nix b/hosts/common/configs/user/gui/obsidian/default.nix index 4ae13d3..1f64c3c 100644 --- a/hosts/common/configs/user/gui/obsidian/default.nix +++ b/hosts/common/configs/user/gui/obsidian/default.nix @@ -606,12 +606,10 @@ in theme.template = lib.attrsets.mapAttrs' ( _: vault: lib.attrsets.nameValuePair - "${home}/${vault.target}/.obsidian/plugins/obsidian-style-settings/data.json" + "${vault.target}/.obsidian/plugins/obsidian-style-settings/data.json" { source = ./theme.json; } ) hmConfig.programs.obsidian.vaults; sops.secrets."google/geocoding".sopsFile = ../../../../../../secrets/personal/secrets.yaml; - - wayland.windowManager.hyprland.settings.bind = [ "$mod, o, exec, ${pkgs.obsidian}/bin/obsidian" ]; }; } diff --git a/hosts/common/configs/user/gui/qt/default.nix b/hosts/common/configs/user/gui/qt/default.nix index 9e0f178..95648d2 100644 --- a/hosts/common/configs/user/gui/qt/default.nix +++ b/hosts/common/configs/user/gui/qt/default.nix @@ -26,9 +26,9 @@ theme.template = { # https://github.com/GabePoel/KvLibadwaita/blob/main/src/KvLibadwaita/KvLibadwaita.kvconfig - "${home}/.config/Kvantum/KvAdwQt/KvAdwQt.kvconfig".source = ./KvAdwQt/KvAdwQt.kvconfig; + ".config/Kvantum/KvAdwQt/KvAdwQt.kvconfig".source = ./KvAdwQt/KvAdwQt.kvconfig; # https://github.com/GabePoel/KvLibadwaita/blob/main/src/KvLibadwaita/KvLibadwaita.svg - "${home}/.config/Kvantum/KvAdwQt/KvAdwQt.svg".source = ./KvAdwQt/KvAdwQt.svg; + ".config/Kvantum/KvAdwQt/KvAdwQt.svg".source = ./KvAdwQt/KvAdwQt.svg; }; xdg.configFile = diff --git a/hosts/common/configs/user/gui/spicetify/default.nix b/hosts/common/configs/user/gui/spicetify/default.nix index 698b642..e66623c 100644 --- a/hosts/common/configs/user/gui/spicetify/default.nix +++ b/hosts/common/configs/user/gui/spicetify/default.nix @@ -86,6 +86,6 @@ in }; }; - theme.template."${home}/.config/spotify/theme.css".source = ./theme.css; + theme.template.".config/spotify/theme.css".source = ./theme.css; }; } diff --git a/hosts/common/configs/user/gui/theme/default.nix b/hosts/common/configs/user/gui/theme/default.nix index a1bcf61..490a2dc 100644 --- a/hosts/common/configs/user/gui/theme/default.nix +++ b/hosts/common/configs/user/gui/theme/default.nix @@ -17,7 +17,7 @@ in environment.persistence."/persist"."${home}/.config/theme" = { }; home-manager.users.${user} = { - imports = [ ./options.nix ]; + imports = [ (import ./options.nix { inherit user home; }) ]; theme.enable = true; diff --git a/hosts/common/configs/user/gui/theme/options.nix b/hosts/common/configs/user/gui/theme/options.nix index 858402e..74a4809 100644 --- a/hosts/common/configs/user/gui/theme/options.nix +++ b/hosts/common/configs/user/gui/theme/options.nix @@ -1,3 +1,7 @@ +{ + user ? throw "user argument is required", + home ? throw "home argument is required", +}: { config, inputs, @@ -94,17 +98,11 @@ in { options = { source = mkOption { - type = nullOr path; + type = path; description = "Path of the source file or directory."; default = null; }; - text = mkOption { - type = nullOr str; - description = "Text of the file."; - default = null; - }; - target = mkOption { type = str; defaultText = literalExpression "name"; @@ -497,8 +495,8 @@ in }; templates = builtins.mapAttrs (name: template: { - input_path = template.source or (pkgs.writeText name template.text); - output_path = template.target; + input_path = template.source; + output_path = "${home}/${template.target}"; }) cfg.template; } ); diff --git a/hosts/common/configs/user/gui/vscode/default.nix b/hosts/common/configs/user/gui/vscode/default.nix index 9dc3cbc..5743fea 100644 --- a/hosts/common/configs/user/gui/vscode/default.nix +++ b/hosts/common/configs/user/gui/vscode/default.nix @@ -102,7 +102,5 @@ in crash-reporter-id = "00000000-0000-0000-0000-000000000000"; password-store = "basic"; }; - - wayland.windowManager.hyprland.settings.bind = [ "$mod, e, exec, ${lib.meta.getExe pkgs.vscode}" ]; }; } diff --git a/hosts/common/configs/user/gui/vscode/langs/rust/default.nix b/hosts/common/configs/user/gui/vscode/langs/rust/default.nix index b5f5e7e..0873fd1 100644 --- a/hosts/common/configs/user/gui/vscode/langs/rust/default.nix +++ b/hosts/common/configs/user/gui/vscode/langs/rust/default.nix @@ -7,5 +7,6 @@ lib.mkIf config.programs.vscode.languages.python.enable { programs.vscode.profiles.default.extensions = with pkgs.vscode-extensions; [ rust-lang.rust-analyzer + a5huynh.vscode-ron ]; } diff --git a/hosts/eirene/hardware/default.nix b/hosts/eirene/hardware/default.nix index 1906650..a88b29c 100644 --- a/hosts/eirene/hardware/default.nix +++ b/hosts/eirene/hardware/default.nix @@ -71,7 +71,6 @@ xserver.videoDrivers = [ "nvidia" ]; fstrim.enable = true; tlp.settings.DISK_DEVICES = lib.mkDefault "nvme0n1 nvme1n1"; - logind.lidSwitch = "ignore"; }; programs.gamescope.env = { diff --git a/hosts/himalia/hardware/asusd.ron b/hosts/himalia/hardware/asusd.ron new file mode 100644 index 0000000..2f4be8f --- /dev/null +++ b/hosts/himalia/hardware/asusd.ron @@ -0,0 +1,18 @@ +( + charge_control_end_threshold: 60, + disable_nvidia_powerd_on_battery: true, + ac_command: "", + bat_command: "", + platform_profile_linked_epp: true, + platform_profile_on_battery: Quiet, + change_platform_profile_on_battery: true, + platform_profile_on_ac: Quiet, + change_platform_profile_on_ac: true, + profile_quiet_epp: Power, + profile_balanced_epp: BalancePower, + profile_custom_epp: Performance, + profile_performance_epp: Performance, + ac_profile_tunings: {}, + dc_profile_tunings: {}, + armoury_settings: {}, +) diff --git a/hosts/himalia/hardware/default.nix b/hosts/himalia/hardware/default.nix index 2e8a850..bc731dc 100644 --- a/hosts/himalia/hardware/default.nix +++ b/hosts/himalia/hardware/default.nix @@ -74,14 +74,25 @@ xserver.videoDrivers = [ "nvidia" ]; fstrim.enable = true; tlp.settings.DISK_DEVICES = lib.mkDefault "nvme0n1 nvme1n1"; - logind.lidSwitch = "ignore"; + asusd = { enable = true; - enableUserService = true; + # FIXME: https://gitlab.com/asus-linux/asusctl/-/issues/532 + # enableUserService = true; + asusdConfig.source = ./asusd.ron; + }; + + supergfxd = { + enable = true; + settings = { + vfio_enable = true; + no_logind = true; + }; }; - supergfxd.enable = true; }; + environment.persistence."/persist"."/etc/asusd/aura_19b6.ron" = { }; + programs.gamescope.env = { __NV_PRIME_RENDER_OFFLOAD = "1"; __VK_LAYER_NV_optimus = "NVIDIA_only"; @@ -93,6 +104,23 @@ wayland.windowManager.hyprland.settings.env = [ "AQ_DRM_DEVICES,/dev/dri/card0:/dev/dri/card1" ]; + + theme = { + template.".config/asusctl/keyboard".source = + pkgs.writeText ".config/asusctl/keyboard" "{{colors.primary_container.default.hex_stripped}}"; + + initExtraConfig = "${ + lib.meta.getExe ( + pkgs.writeShellApplication { + name = "theme-asusctl"; + runtimeInputs = with pkgs; [ asusctl ]; + text = '' + asusctl aura static -c "$(<"$HOME/.config/asusctl/keyboard")" + ''; + } + ) + } &"; + }; } ]; }