From d69c9c2a10936c0c843281d7db26fc0c793fe87d Mon Sep 17 00:00:00 2001 From: GitButler Date: Sat, 2 Nov 2024 16:29:56 +0100 Subject: [PATCH] GitButler Integration Commit This is an integration commit for the virtual branches that GitButler is tracking. Due to GitButler managing multiple virtual branches, you cannot switch back and forth between git branches and virtual branches easily. If you switch to another branch, GitButler will need to be reinitialized. If you commit on this branch, GitButler will throw it away. Here are the branches that are currently applied: - factorio-latest (refs/gitbutler/factorio-latest) - flake.lock - flake.nix - modules/nixos/archetypes/gaming/default.nix - hyprpanel (refs/gitbutler/hyprpanel) branch head: acde84ab10891f923177d3dde85b826296a1b4bc - modules/nixos/desktop/addons/hyprpanel/options.json - modules/nixos/desktop/addons/hyprpanel/default.nix - modules/nixos/desktop/addons/hypridle/default.nix - fix hyprland nvidia issue (refs/gitbutler/fix-hyprland-nvidia-issue) branch head: 5158f2a21e773e01f3d4f296db87517bf167c7b7 For more information about what we're doing here, check out our docs: https://docs.gitbutler.com/features/virtual-branches/integration-branch --- .../nixos/desktop/addons/hypridle/default.nix | 5 +- .../desktop/addons/hyprpanel/default.nix | 60 +++++++++++++++++++ .../desktop/addons/hyprpanel/options.json | 2 +- .../system/hardware/gpu/nvidia/default.nix | 9 +++ 4 files changed, 73 insertions(+), 3 deletions(-) create mode 100644 modules/nixos/desktop/addons/hyprpanel/default.nix diff --git a/modules/nixos/desktop/addons/hypridle/default.nix b/modules/nixos/desktop/addons/hypridle/default.nix index 2f2e99c..260fddb 100644 --- a/modules/nixos/desktop/addons/hypridle/default.nix +++ b/modules/nixos/desktop/addons/hypridle/default.nix @@ -23,14 +23,15 @@ in settings = { general = { after_sleep_cmd = "hyprctl dispatch dpms on"; + before_sleep_cmd = "loginctl lock-session"; ignore_dbus_inhibit = false; - lock_cmd = "hyprlock"; + lock_cmd = "pidof hyprlock || hyprlock"; }; listener = [ { timeout = 900; - on-timeout = "hyprlock"; + on-timeout = "loginctl lock-session"; } { timeout = 1200; diff --git a/modules/nixos/desktop/addons/hyprpanel/default.nix b/modules/nixos/desktop/addons/hyprpanel/default.nix new file mode 100644 index 0000000..664624a --- /dev/null +++ b/modules/nixos/desktop/addons/hyprpanel/default.nix @@ -0,0 +1,60 @@ +{ + config, + lib, + namespace, + pkgs, + ... +}: +let + inherit (lib) + mkIf + mkEnableOption + mkMerge + mkOption + literalExpression + ; + + cfg = config.${namespace}.desktop.addons.hyprpanel; + + settingsFormat = pkgs.formats.json { }; + settings = { + bar = { + layouts = { + "0" = { + left = [ + "workspaces" + ]; + middle = [ + "windowtitle" + ]; + }; + }; + }; + }; +in +{ + options.${namespace}.desktop.addons.hyprpanel = { + enable = mkEnableOption "Enable HyprIdle"; + extraSettings = mkOption { + default = { }; + inherit (settingsFormat) type; + description = '' + Additional Options to pass to hyprpanel + ''; + example = literalExpression '' + { + + } + ''; + }; + }; + + config = mkIf cfg.enable { + ${namespace}.home.file = { + ".cache/ags/options_test.json".source = settingsFormat.generate "options.json" mkMerge [ + settings + cfg.extraSettings + ]; + }; + }; +} diff --git a/modules/nixos/desktop/addons/hyprpanel/options.json b/modules/nixos/desktop/addons/hyprpanel/options.json index 448ecab..f93f95c 100644 --- a/modules/nixos/desktop/addons/hyprpanel/options.json +++ b/modules/nixos/desktop/addons/hyprpanel/options.json @@ -456,4 +456,4 @@ "bar.windowtitle.title_map": [], "bar.windowtitle.truncation": false, "bar.workspaces.hideUnoccupied": true -} \ No newline at end of file +} diff --git a/modules/nixos/system/hardware/gpu/nvidia/default.nix b/modules/nixos/system/hardware/gpu/nvidia/default.nix index d2c4e74..5074f6d 100644 --- a/modules/nixos/system/hardware/gpu/nvidia/default.nix +++ b/modules/nixos/system/hardware/gpu/nvidia/default.nix @@ -32,5 +32,14 @@ in }; services.xserver.videoDrivers = [ "nvidia" ]; + + boot.kernelParams = [ + "nvidia_drm.fbdev=1" + + # TODO: remove after https://github.com/NVIDIA/open-gpu-kernel-modules/pull/692 + # and similar are merged and build in nixpkgs-unstable. + # WARNING: this disables tty output and thus hides boot logs. + "initcall_blacklist=simpledrm_platform_driver_init" + ]; }; }