87 lines
2 KiB
Nix
87 lines
2 KiB
Nix
{ system, inputs, impurity, lib, config, pkgs, ... }: let
|
|
inherit (inputs) hyprland hyprsunset hyprpicker hyprland-hy3 quickshell;
|
|
|
|
exe = hyprland.packages.${system}.default.overrideAttrs (final: prev: {
|
|
dontStrip = true;
|
|
});
|
|
|
|
# I blame home manager
|
|
wrapper = pkgs.callPackage ({ ... }: pkgs.writeShellScriptBin "hyprland" ''
|
|
${builtins.readFile ./session.sh}
|
|
${config.hyprland-session.prerun}
|
|
${lib.getExe exe} $@
|
|
'') {};
|
|
in {
|
|
imports = [ hyprland.nixosModules.default ];
|
|
|
|
options.hyprland-session = with lib; {
|
|
prerun = mkOption {
|
|
type = types.separatedString "\n";
|
|
default = "";
|
|
};
|
|
|
|
extraConfig = mkOption {
|
|
type = types.separatedString "\n";
|
|
default = "";
|
|
};
|
|
|
|
# same as above but no impurity so the greeter works
|
|
extraConfigStatic = 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=" ];
|
|
};
|
|
|
|
xdg.portal = {
|
|
enable = true;
|
|
|
|
extraPortals = with pkgs; [
|
|
kdePackages.xdg-desktop-portal-kde
|
|
];
|
|
|
|
config.common.default = [
|
|
"hyprland"
|
|
"kde"
|
|
];
|
|
};
|
|
|
|
home-manager.users.${config.main-user} = {
|
|
imports = [ hyprland.homeManagerModules.default ];
|
|
|
|
home.packages = with pkgs; [
|
|
wrapper
|
|
|
|
# environment programs
|
|
wl-clipboard
|
|
grim
|
|
slurp
|
|
playerctl
|
|
wl-screenrec
|
|
|
|
hyprsunset.packages.${system}.default
|
|
hyprpicker.packages.${system}.default
|
|
];
|
|
|
|
wayland.windowManager.hyprland = {
|
|
enable = true;
|
|
|
|
package = wrapper;
|
|
plugins = [ hyprland-hy3.packages.${system}.default ];
|
|
|
|
extraConfig = ''
|
|
source = ${impurity.link ./hyprland.conf}
|
|
${config.hyprland-session.extraConfig}
|
|
'';
|
|
};
|
|
};
|
|
};
|
|
}
|