Hyprland module
This commit is contained in:
parent
30184feda2
commit
2f1b04728d
8 changed files with 436 additions and 19 deletions
54
modules/hyprland/default.nix
Normal file
54
modules/hyprland/default.nix
Normal file
|
@ -0,0 +1,54 @@
|
|||
{ system, inputs, impurity, lib, config, pkgs, ... }: let
|
||||
inherit (inputs) hyprland hyprpaper hyprland-hy3;
|
||||
|
||||
wrapper = pkgs.writeShellScriptBin "hyprland" ''
|
||||
${config.hyprland-session.prerun}
|
||||
${hyprland.packages.${system}.default}/bin/Hyprland $@
|
||||
'';
|
||||
in {
|
||||
imports = [ hyprland.nixosModules.default ];
|
||||
|
||||
options.hyprland-session = with lib; {
|
||||
prerun = mkOption {
|
||||
type = types.separatedString "\n";
|
||||
default = "";
|
||||
};
|
||||
|
||||
extraConfig = mkOption {
|
||||
type = types.separatedString "\n";
|
||||
default = "";
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
programs.hyprland.enable = true;
|
||||
|
||||
nix.settings = {
|
||||
substituters = [ "https://hyprland.cachix.org" ];
|
||||
trusted-public-keys = [ "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" ];
|
||||
};
|
||||
|
||||
home-manager.users.${config.main-user} = {
|
||||
imports = [ hyprland.homeManagerModules.default ];
|
||||
home.packages = [ wrapper ];
|
||||
|
||||
wayland.windowManager.hyprland = {
|
||||
enable = true;
|
||||
|
||||
package = wrapper;
|
||||
plugins = [ hyprland-hy3.packages.${system}.default ];
|
||||
|
||||
extraConfig = ''
|
||||
exec-once = ${hyprpaper.packages.${system}.default}/bin/hyprpaper
|
||||
source = ${impurity.link ./hyprland.conf}
|
||||
${config.hyprland-session.extraConfig}
|
||||
'';
|
||||
};
|
||||
|
||||
xdg.configFile."hypr/hyprpaper.conf".text = ''
|
||||
preload = ${./wallpaper.png}
|
||||
wallpaper = ,${./wallpaper.png}
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue