consistency w/ hypr* packages

This commit is contained in:
Jill 2024-03-17 13:26:33 +03:00
parent cc9ee95110
commit 9a5f7fbec3
6 changed files with 117 additions and 15 deletions

View File

@ -422,6 +422,24 @@
"type": "github"
}
},
"hyprlang_5": {
"inputs": {
"nixpkgs": "nixpkgs_6"
},
"locked": {
"lastModified": 1704230242,
"narHash": "sha256-S8DM+frECqmAdaUb3y5n3RjY73ajZcL5rnmx5YO+CkY=",
"owner": "hyprwm",
"repo": "hyprlang",
"rev": "db5e1399b90d5a339330bdd49c5bca6fe58d6f60",
"type": "github"
},
"original": {
"owner": "hyprwm",
"repo": "hyprlang",
"type": "github"
}
},
"hyprlock": {
"inputs": {
"hyprlang": "hyprlang_4",
@ -442,6 +460,25 @@
"type": "github"
}
},
"hyprpaper": {
"inputs": {
"hyprlang": "hyprlang_5",
"nixpkgs": "nixpkgs_7"
},
"locked": {
"lastModified": 1710275050,
"narHash": "sha256-MMwlYYdPSkLEnvltef9liIBpoqUtilxuGiJE231prag=",
"owner": "hyprwm",
"repo": "hyprpaper",
"rev": "f57d991e3a73bcc447dc4b87e1689132295c7076",
"type": "github"
},
"original": {
"owner": "hyprwm",
"repo": "hyprpaper",
"type": "github"
}
},
"nix-colors": {
"inputs": {
"base16-schemes": "base16-schemes",
@ -590,6 +627,38 @@
}
},
"nixpkgs_6": {
"locked": {
"lastModified": 1702645756,
"narHash": "sha256-qKI6OR3TYJYQB3Q8mAZ+DG4o/BR9ptcv9UnRV2hzljc=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "40c3c94c241286dd2243ea34d3aef8a488f9e4d0",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_7": {
"locked": {
"lastModified": 1703637592,
"narHash": "sha256-8MXjxU0RfFfzl57Zy3OfXCITS0qWDNLzlBAdwxGZwfY=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "cfc3698c31b1fb9cdcf10f36c9643460264d0ca8",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_8": {
"locked": {
"lastModified": 1710162809,
"narHash": "sha256-i2R2bcnQp+85de67yjgZVvJhd6rRnJbSYNpGmB6Leb8=",
@ -614,8 +683,9 @@
"hyprland": "hyprland",
"hyprland-catppuccin": "hyprland-catppuccin",
"hyprlock": "hyprlock",
"hyprpaper": "hyprpaper",
"nix-colors": "nix-colors",
"nixpkgs": "nixpkgs_6",
"nixpkgs": "nixpkgs_8",
"nixpkgs-unstable": "nixpkgs-unstable",
"waybar-catppuccin": "waybar-catppuccin"
}

View File

@ -18,6 +18,7 @@
hyprland.url = "github:hyprwm/Hyprland";
hyprlock.url = "github:hyprwm/hyprlock";
hypridle.url = "github:hyprwm/hypridle";
hyprpaper.url = "github:hyprwm/hyprpaper";
waybar-catppuccin.url = "github:catppuccin/waybar";
waybar-catppuccin.flake = false;

View File

@ -1,4 +1,4 @@
{ lib, config, pkgs, ... }:
{ lib, config, pkgs, system, inputs, ... }:
with lib;
let
@ -6,16 +6,24 @@ let
in {
options.modules.desktop.hypridle = {
enable = mkEnableOption "Enable hypridle, Hyprland's idle daemon";
package = mkOption {
type = types.package;
default = inputs.hypridle.packages.${system}.hypridle;
example = "pkgs.hypridle";
};
};
config = mkIf cfg.enable {
hm.services.hypridle = {
enable = true;
package = cfg.package;
lockCmd = "${lib.getExe config.hm.programs.hyprlock.package}";
lockCmd = "${lib.getExe config.modules.desktop.hyprlock.package}";
unlockCmd = "pkill -USR1 hyprlock";
listeners = [
listeners = let
hyprctl = "${config.modules.desktop.hyprland.package}/bin/hyprctl";
in [
{
timeout = 60 * 1; # 1 min
onTimeout = "${lib.getExe pkgs.brightnessctl} -s set 20";
@ -23,8 +31,8 @@ in {
}
{
timeout = 90; # 1.5 min
onTimeout = "hyprctl dispatch dpms off"; # turn off screen
onResume = "hyprctl dispatch dpms on"; # turn it back on
onTimeout = "${hyprctl} dispatch dpms off"; # turn off screen
onResume = "${hyprctl} dispatch dpms on"; # turn it back on
}
{
timeout = 60 * 2; # 2 min

View File

@ -3,19 +3,28 @@
with lib;
let
cfg = config.modules.desktop.hyprland;
hyprpkgs = inputs.hyprland.packages.${system};
in {
options.modules.desktop.hyprland = {
enable = mkEnableOption "Enable Hyprland, a dynamic tiling Wayland compositor based on wlroots that doesn't sacrifice on its looks";
allowTearing = mkEnableOption "Enable tearing, reduces latency in games but unsupported on some GPUs";
package = mkOption {
type = types.package;
default = hyprpkgs.hyprland;
example = "pkgs.hyprland";
};
portalPackage = mkOption {
type = types.package;
default = hyprpkgs.xdg-desktop-portal-hyprland;
example = "pkgs.xdg-desktop-portal-hyprland";
};
};
config = let
hyprpkgs = inputs.hyprland.packages.${system};
in mkIf cfg.enable {
services.xserver.displayManager.sessionPackages = [ hyprpkgs.hyprland ];
config = mkIf cfg.enable {
services.xserver.displayManager.sessionPackages = [ cfg.package ];
xdg.portal = {
enable = true;
extraPortals = [ pkgs.xdg-desktop-portal-gtk hyprpkgs.xdg-desktop-portal-hyprland ];
extraPortals = [ pkgs.xdg-desktop-portal-gtk cfg.portalPackage ];
config = {
common = {
default = [ "hyprland" "gtk" ];
@ -30,7 +39,7 @@ in {
hm.wayland.windowManager.hyprland = {
enable = true;
xwayland.enable = true;
package = hyprpkgs.hyprland;
package = cfg.package;
settings = {
source = [];

View File

@ -1,4 +1,4 @@
{ lib, config, pkgs, ... }:
{ lib, config, inputs, system, ... }:
with lib;
let
@ -6,12 +6,21 @@ let
in {
options.modules.desktop.hyprlock = {
enable = mkEnableOption "Enable hyprlock, a simple, yet fast, multi-threaded and GPU-accelerated screen lock for hyprland";
package = mkOption {
type = types.package;
default = inputs.hyprlock.packages.${system}.hyprlock;
example = "pkgs.hyprlock";
};
};
config = mkIf cfg.enable {
security.pam.services.hyprlock.text = "auth include login";
powerManagement.resumeCommands = ''
${cfg.package}
'';
hm.programs.hyprlock = with config.colorScheme.colors; {
enable = true;
package = cfg.package;
general = {
hide_cursor = false;
no_fade_in = true;

View File

@ -1,4 +1,4 @@
{ lib, config, pkgs, ... }:
{ lib, config, inputs, system, ... }:
with lib;
let
@ -6,10 +6,15 @@ let
in {
options.modules.desktop.hyprpaper = {
enable = mkEnableOption "Enable Hyprpaper, a blazing fast wayland wallpaper utility";
package = mkOption {
type = types.package;
default = inputs.hyprpaper.packages.${system}.hyprpaper;
example = "pkgs.hyprpaper";
};
};
config = mkIf cfg.enable {
hm.wayland.windowManager.hyprland.settings.exec-once = [ "${lib.getExe pkgs.hyprpaper}" ];
hm.wayland.windowManager.hyprland.settings.exec-once = [ "${lib.getExe cfg.package}" ];
hm.xdg.configFile."hypr/hyprpaper.conf" = let
img = ../../assets/wallpaper.png;
in {