Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
khaneliman committed Jan 28, 2025
1 parent 1bdd475 commit 6f06a1a
Show file tree
Hide file tree
Showing 8 changed files with 202 additions and 28 deletions.
13 changes: 5 additions & 8 deletions modules/home/programs/graphical/wms/hyprland/default.nix
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
{
config,
inputs,
lib,
pkgs,
system,
namespace,
...
}:
let
inherit (lib) mkIf mkEnableOption getExe;
inherit (lib.${namespace}) enabled;
inherit (inputs) hyprland;

cfg = config.${namespace}.programs.graphical.wms.hyprland;

Expand Down Expand Up @@ -57,6 +54,9 @@ in
# NOTE: xdph requirement
grim
slurp
hyprsunset
# TODO: package
pkgs.khanelinix.hyprsysteminfo
];

sessionVariables =
Expand Down Expand Up @@ -139,11 +139,7 @@ in
${cfg.appendConfig}
'';

package =
if cfg.enableDebug then
hyprland.packages.${system}.hyprland-debug
else
hyprland.packages.${system}.hyprland;
package = if cfg.enableDebug then pkgs.hyprland.override { debug = true; } else pkgs.hyprland;

settings = {
exec = [ "${getExe pkgs.libnotify} --icon ~/.face -u normal \"Hello $(whoami)\"" ];
Expand All @@ -156,6 +152,7 @@ in
"${systemctl} --user stop hyprland-session.target"
"${systemctl} --user reset-failed"
"${systemctl} --user start hyprland-session.target"
"${systemctl} --user start hyprpolkitagent"
];

variables = [
Expand Down
21 changes: 21 additions & 0 deletions modules/nixos/programs/graphical/addons/uwsm/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
config,
lib,
namespace,
...
}:
let
inherit (lib) mkIf;
inherit (lib.${namespace}) mkBoolOpt;

cfg = config.${namespace}.programs.graphical.addons.uwsm;
in
{
options.${namespace}.programs.graphical.addons.uwsm = {
enable = mkBoolOpt false "Whether or not to enable uwsm";
};

config = mkIf cfg.enable {
programs.uwsm.enable = true;
};
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
{
config,
inputs,
lib,
pkgs,
system,
namespace,
...
}:
Expand Down
7 changes: 2 additions & 5 deletions modules/nixos/programs/graphical/wms/hyprland/default.nix
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
{
config,
inputs,
lib,
pkgs,
system,
namespace,
...
}:
Expand All @@ -15,15 +13,14 @@ let
types
;
inherit (lib.${namespace}) mkBoolOpt mkOpt enabled;
inherit (inputs) hyprland;

cfg = config.${namespace}.programs.graphical.wms.hyprland;

programs = makeBinPath (
with pkgs;
[
# TODO: make sure this references same package as home-manager
hyprland.packages.${system}.hyprland
pkgs.hyprland
coreutils
config.services.power-profiles-daemon.package
systemd
Expand Down Expand Up @@ -140,6 +137,6 @@ in
};
};

services.displayManager.sessionPackages = [ hyprland.packages.${system}.hyprland ];
services.displayManager.sessionPackages = [ pkgs.hyprland ];
};
}
37 changes: 24 additions & 13 deletions modules/nixos/security/polkit/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,14 @@ in
};

config = lib.mkIf cfg.enable {
environment.systemPackages = with pkgs; [ libsForQt5.polkit-kde-agent ];
environment.systemPackages =
with pkgs;
lib.optionals (!config.${namespace}.programs.graphical.wms.hyprland.enable) [
libsForQt5.polkit-kde-agent
]
++ lib.optionals (config.${namespace}.programs.graphical.wms.hyprland.enable) [
pkgs.khanelinix.hyprpolkitagent
];

security.polkit = {
enable = true;
Expand All @@ -31,18 +38,22 @@ in
};

systemd = {
user.services.polkit-kde-authentication-agent-1 = {
after = [ "graphical-session.target" ];
description = "polkit-kde-authentication-agent-1";
wantedBy = [ "graphical-session.target" ];
wants = [ "graphical-session.target" ];
serviceConfig = {
Type = "simple";
ExecStart = "${pkgs.polkit-kde-agent}/libexec/polkit-kde-authentication-agent-1";
Restart = "on-failure";
RestartSec = 1;
TimeoutStopSec = 10;
};
user.services = {
polkit-kde-authentication-agent-1 =
lib.mkIf (!config.${namespace}.programs.graphical.wms.hyprland.enable)
{
after = [ "graphical-session.target" ];
description = "polkit-kde-authentication-agent-1";
wantedBy = [ "graphical-session.target" ];
wants = [ "graphical-session.target" ];
serviceConfig = {
Type = "simple";
ExecStart = "${pkgs.polkit-kde-agent}/libexec/polkit-kde-authentication-agent-1";
Restart = "on-failure";
RestartSec = 1;
TimeoutStopSec = 10;
};
};
};
};
};
Expand Down
48 changes: 48 additions & 0 deletions packages/hyprland-qt-support/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
lib,
stdenv,
fetchFromGitHub,
cmake,
ninja,
qt6,
pkg-config,
hyprlang,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "hyprland-qt-support";
version = "0.1.0";

src = fetchFromGitHub {
owner = "hyprwm";
repo = "hyprland-qt-support";
tag = "v${finalAttrs.version}";
hash = "sha256-+uZovj+X0a28172y0o0BvgGXyZLpKPbG03sVlCiSrWc=";
};

nativeBuildInputs = [
cmake
ninja
pkg-config
qt6.wrapQtAppsHook
];

buildInputs = [
qt6.qtbase
qt6.qtdeclarative
qt6.qtsvg
qt6.qtwayland
hyprlang
];

cmakeFlags = [
(lib.cmakeFeature "INSTALL_QML_PREFIX" qt6.qtbase.qtQmlPrefix)
];

meta = {
description = "hyprland-qt-support";
homepage = "https://github.com/hyprwm/hyprland-qt-support";
license = lib.licenses.bsd3;
platforms = lib.platforms.linux;
maintainers = lib.teams.hyprland.members;
};
})
49 changes: 49 additions & 0 deletions packages/hyprpolkitagent/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
lib,
stdenv,
cmake,
pkg-config,
fetchFromGitHub,
hyprland-qt-support,
hyprutils,
kdePackages,
polkit,
qt6,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "hyprpolkitagent";
version = "0.1.2";

src = fetchFromGitHub {
owner = "hyprwm";
repo = "hyprpolkitagent";
tag = "v${finalAttrs.version}";
hash = "sha256-K1nSPFlh5VBWNagcaZ/157gfifAXTH8lzeyfYt/UEX8=";
};

nativeBuildInputs = [
cmake
pkg-config
qt6.wrapQtAppsHook
];

buildInputs = [
hyprland-qt-support
hyprutils
kdePackages.kirigami-addons
kdePackages.polkit-qt-1
polkit
qt6.qtbase
qt6.qtsvg
qt6.qtwayland
];

meta = {
description = "Polkit authentication agent written in QT/QML";
homepage = "https://github.com/hyprwm/hyprpolkitagent";
license = lib.licenses.bsd3;
maintainers = lib.teams.hyprland.members;
mainProgram = "hyprpolkitagent";
platforms = lib.platforms.linux;
};
})
53 changes: 53 additions & 0 deletions packages/hyprsysteminfo/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
lib,
stdenv,
fetchFromGitHub,
cmake,
qt6,
pkg-config,
hyprutils,
pciutils,
hyprland-qt-support,
}:
let
inherit (lib.strings) makeBinPath;
in
stdenv.mkDerivation (finalAttrs: {
pname = "hyprsysteminfo";
version = "0.1.3";

src = fetchFromGitHub {
owner = "hyprwm";
repo = "hyprsysteminfo";
tag = "v${finalAttrs.version}";
hash = "sha256-KDxT9B+1SATWiZdUBAQvZu17vk3xmyXcw2Zy56bdWbY=";
};

nativeBuildInputs = [
cmake
pkg-config
qt6.wrapQtAppsHook
];

buildInputs = [
qt6.qtbase
qt6.qtdeclarative
qt6.qtsvg
qt6.qtwayland
hyprutils
hyprland-qt-support
];

preFixup = ''
qtWrapperArgs+=(--prefix PATH : "${makeBinPath [ pciutils ]}")
'';

meta = {
description = "A tiny qt6/qml application to display information about the running system";
homepage = "https://github.com/hyprwm/hyprsysteminfo";
license = lib.licenses.bsd3;
maintainers = lib.teams.hyprland.members;
mainProgram = "hyprsysteminfo";
platforms = lib.platforms.linux;
};
})

0 comments on commit 6f06a1a

Please sign in to comment.