mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-26 14:05:58 +01:00
commit
1c423ec997
6 changed files with 189 additions and 210 deletions
3
.github/workflows/ci.yaml
vendored
3
.github/workflows/ci.yaml
vendored
|
@ -1,6 +1,6 @@
|
||||||
name: Build Hyprland
|
name: Build Hyprland
|
||||||
|
|
||||||
on: [push, pull_request]
|
on: [push, pull_request, workflow_dispatch]
|
||||||
jobs:
|
jobs:
|
||||||
gcc:
|
gcc:
|
||||||
name: "Build Hyprland (Arch)"
|
name: "Build Hyprland (Arch)"
|
||||||
|
@ -44,4 +44,3 @@ jobs:
|
||||||
- name: Build Hyprland with LEGACY_RENDERER
|
- name: Build Hyprland with LEGACY_RENDERER
|
||||||
run: |
|
run: |
|
||||||
make legacyrenderer
|
make legacyrenderer
|
||||||
|
|
||||||
|
|
19
.github/workflows/nix-build.yaml
vendored
Normal file
19
.github/workflows/nix-build.yaml
vendored
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
name: Build Hyprland (Nix)
|
||||||
|
|
||||||
|
on: [push, pull_request, workflow_dispatch]
|
||||||
|
jobs:
|
||||||
|
nix:
|
||||||
|
name: "Build Hyprland (Nix)"
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Clone repository
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
- name: Install nix
|
||||||
|
uses: cachix/install-nix-action@v17
|
||||||
|
with:
|
||||||
|
install_url: https://releases.nixos.org/nix/nix-2.8.0/install
|
||||||
|
extra_nix_config: |
|
||||||
|
auto-optimise-store = true
|
||||||
|
experimental-features = nix-command flakes
|
||||||
|
- name: Build HyprLand with default settings
|
||||||
|
run: nix build --print-build-logs
|
76
default.nix
76
default.nix
|
@ -1,30 +1,55 @@
|
||||||
{ lib, stdenv, fetchFromGitHub, src, pkg-config, cmake, ninja, libdrm, libinput
|
{
|
||||||
, libxcb, libxkbcommon, mesa, mount, pango, wayland, wayland-protocols
|
lib,
|
||||||
, wayland-scanner, wlroots, xcbutilwm, xwayland, enableXWayland ? true }:
|
stdenv,
|
||||||
|
fetchFromGitHub,
|
||||||
stdenv.mkDerivation rec {
|
pkg-config,
|
||||||
|
cmake,
|
||||||
|
ninja,
|
||||||
|
libdrm,
|
||||||
|
libinput,
|
||||||
|
libxcb,
|
||||||
|
libxkbcommon,
|
||||||
|
mesa,
|
||||||
|
mount,
|
||||||
|
pango,
|
||||||
|
wayland,
|
||||||
|
wayland-protocols,
|
||||||
|
wayland-scanner,
|
||||||
|
wlroots,
|
||||||
|
xcbutilwm,
|
||||||
|
xwayland,
|
||||||
|
enableXWayland ? true,
|
||||||
|
version ? "git",
|
||||||
|
}:
|
||||||
|
stdenv.mkDerivation {
|
||||||
pname = "hyprland";
|
pname = "hyprland";
|
||||||
version = "git";
|
inherit version;
|
||||||
inherit src;
|
src = ./.;
|
||||||
|
|
||||||
nativeBuildInputs = [ cmake ninja pkg-config wayland ]
|
nativeBuildInputs = [
|
||||||
++ lib.optional enableXWayland xwayland;
|
cmake
|
||||||
|
ninja
|
||||||
|
pkg-config
|
||||||
|
];
|
||||||
|
|
||||||
buildInputs = [
|
buildInputs =
|
||||||
|
[
|
||||||
libdrm
|
libdrm
|
||||||
libinput
|
libinput
|
||||||
libxcb
|
libxcb
|
||||||
libxkbcommon
|
libxkbcommon
|
||||||
mesa
|
mesa
|
||||||
pango
|
pango
|
||||||
|
wayland
|
||||||
wayland-protocols
|
wayland-protocols
|
||||||
wayland-scanner
|
wayland-scanner
|
||||||
wlroots
|
(wlroots.override {inherit enableXWayland;})
|
||||||
(wlroots.override { inherit enableXWayland; })
|
|
||||||
xcbutilwm
|
xcbutilwm
|
||||||
];
|
]
|
||||||
|
++ lib.optional enableXWayland xwayland;
|
||||||
|
|
||||||
cmakeFlags = [ "-DCMAKE_BUILD_TYPE=Release" ]
|
cmakeFlags =
|
||||||
|
["-DCMAKE_BUILD_TYPE=Release"]
|
||||||
++ lib.optional (!enableXWayland) "-DNO_XWAYLAND=true";
|
++ lib.optional (!enableXWayland) "-DNO_XWAYLAND=true";
|
||||||
|
|
||||||
prePatch = ''
|
prePatch = ''
|
||||||
|
@ -38,25 +63,22 @@ stdenv.mkDerivation rec {
|
||||||
'';
|
'';
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
cd ../
|
pushd ..
|
||||||
mkdir -p $out/share/wayland-sessions
|
install -Dm644 ./example/hyprland.desktop -t $out/share/wayland-sessions
|
||||||
cp ./example/hyprland.desktop $out/share/wayland-sessions
|
install -Dm755 ./build/Hyprland -t $out/bin
|
||||||
mkdir -p $out/bin
|
install -Dm755 ./hyprctl/hyprctl -t $out/bin
|
||||||
cp ./build/Hyprland $out/bin
|
install -Dm644 ./assets/* -t $out/share/hyprland
|
||||||
cp ./hyprctl/hyprctl $out/bin
|
install -Dm644 ./example/hyprland.conf -t $out/share/hyprland
|
||||||
mkdir -p $out/share/hyprland
|
popd
|
||||||
cp ./assets/wall_2K.png $out/share/hyprland
|
|
||||||
cp ./assets/wall_4K.png $out/share/hyprland
|
|
||||||
cp ./assets/wall_8K.png $out/share/hyprland
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
passthru.providedSessions = [ "hyprland" ];
|
passthru.providedSessions = ["hyprland"];
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
homepage = "https://github.com/vaxerski/Hyprland";
|
homepage = "https://github.com/vaxerski/Hyprland";
|
||||||
description =
|
description = "A dynamic tiling Wayland compositor that doesn't sacrifice on its looks";
|
||||||
"A dynamic tiling Wayland compositor that doesn't sacrifice on its looks";
|
|
||||||
license = licenses.bsd3;
|
license = licenses.bsd3;
|
||||||
platforms = platforms.linux;
|
platforms = platforms.linux;
|
||||||
|
mainProgram = "Hyprland";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
139
flake.lock
139
flake.lock
|
@ -1,71 +1,5 @@
|
||||||
{
|
{
|
||||||
"nodes": {
|
"nodes": {
|
||||||
"cachix": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1652530570,
|
|
||||||
"narHash": "sha256-GWRrbUv9l1GSyBkj39s9AqNLX1l3rzVOwvnuG4WYM+E=",
|
|
||||||
"owner": "nixos",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"rev": "4c560cc7ee57e1fb28e6fd7bdacdf01f948f8a91",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "nixos",
|
|
||||||
"ref": "nixos-21.11",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"flake-compat": {
|
|
||||||
"flake": false,
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1650374568,
|
|
||||||
"narHash": "sha256-Z+s0J8/r907g149rllvwhb4pKi8Wam5ij0st8PwAh+E=",
|
|
||||||
"owner": "edolstra",
|
|
||||||
"repo": "flake-compat",
|
|
||||||
"rev": "b4a34015c698c7793d592d66adbab377907a2be8",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "edolstra",
|
|
||||||
"repo": "flake-compat",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"flake-utils": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1652557277,
|
|
||||||
"narHash": "sha256-jSes9DaIVMdmwBB78KkFUVrlDzawmD62vrUg0GS2500=",
|
|
||||||
"owner": "numtide",
|
|
||||||
"repo": "flake-utils",
|
|
||||||
"rev": "12806d31a381e7cd169a6bac35590e7b36dc5fe5",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "numtide",
|
|
||||||
"repo": "flake-utils",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"lib-aggregate": {
|
|
||||||
"inputs": {
|
|
||||||
"flake-utils": "flake-utils",
|
|
||||||
"nixpkgs-lib": "nixpkgs-lib"
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1652616584,
|
|
||||||
"narHash": "sha256-9Uc/k/t08QsJ8rl1n/cbT8L/JrCoDuE7TmsE+F1OiS8=",
|
|
||||||
"owner": "nix-community",
|
|
||||||
"repo": "lib-aggregate",
|
|
||||||
"rev": "81165c2e94b56afcb9486b82dc91d92dfb503a6b",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "nix-community",
|
|
||||||
"repo": "lib-aggregate",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1652659998,
|
"lastModified": 1652659998,
|
||||||
|
@ -77,58 +11,6 @@
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"ref": "nixpkgs-unstable",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nixpkgs-lib": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1652576347,
|
|
||||||
"narHash": "sha256-52Wu7hkcIRcS4UenSSrt01J2sAbbQ6YqxZIDpuEPL/c=",
|
|
||||||
"owner": "nix-community",
|
|
||||||
"repo": "nixpkgs.lib",
|
|
||||||
"rev": "bdf553800c9c34ed00641785b02038f67f44d671",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "nix-community",
|
|
||||||
"repo": "nixpkgs.lib",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nixpkgs-wayland": {
|
|
||||||
"inputs": {
|
|
||||||
"cachix": "cachix",
|
|
||||||
"flake-compat": "flake-compat",
|
|
||||||
"lib-aggregate": "lib-aggregate",
|
|
||||||
"nixpkgs": "nixpkgs_2"
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1652618007,
|
|
||||||
"narHash": "sha256-eOH21ElHKORg1kd8Z/qX9naZElAOpCt5fPq26AxMQSw=",
|
|
||||||
"owner": "nix-community",
|
|
||||||
"repo": "nixpkgs-wayland",
|
|
||||||
"rev": "4588213f577661d37a42c7b6bba04c138c02d78f",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "nix-community",
|
|
||||||
"repo": "nixpkgs-wayland",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nixpkgs_2": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1652467128,
|
|
||||||
"narHash": "sha256-1wuQ7QgPQ3tugYcoVMJ3pUzl4wVdBzKZr9qtJAgA4VI=",
|
|
||||||
"owner": "nixos",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"rev": "fb222e008681fce4608e94f2d1dfdf3d03a364c4",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "nixos",
|
|
||||||
"ref": "nixos-unstable",
|
"ref": "nixos-unstable",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
|
@ -137,27 +19,10 @@
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": "nixpkgs",
|
"nixpkgs": "nixpkgs",
|
||||||
"nixpkgs-wayland": "nixpkgs-wayland",
|
"wlroots": "wlroots"
|
||||||
"utils": "utils",
|
|
||||||
"wlroots-git": "wlroots-git"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"utils": {
|
"wlroots": {
|
||||||
"locked": {
|
|
||||||
"lastModified": 1652557277,
|
|
||||||
"narHash": "sha256-jSes9DaIVMdmwBB78KkFUVrlDzawmD62vrUg0GS2500=",
|
|
||||||
"owner": "numtide",
|
|
||||||
"repo": "flake-utils",
|
|
||||||
"rev": "12806d31a381e7cd169a6bac35590e7b36dc5fe5",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "numtide",
|
|
||||||
"repo": "flake-utils",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"wlroots-git": {
|
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"host": "gitlab.freedesktop.org",
|
"host": "gitlab.freedesktop.org",
|
||||||
|
|
72
flake.nix
72
flake.nix
|
@ -1,43 +1,55 @@
|
||||||
# Based on fortuneteller2k's (https://github.com/fortuneteller2k/nixpkgs-f2k) package repo
|
|
||||||
{
|
{
|
||||||
description =
|
description = "Hyprland is a dynamic tiling Wayland compositor that doesn't sacrifice on its looks";
|
||||||
"Hyprland is a dynamic tiling Wayland compositor that doesn't sacrifice on its looks.";
|
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-21.11";
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||||
utils.url = "github:numtide/flake-utils";
|
wlroots = {
|
||||||
nixpkgs-wayland.url = "github:nix-community/nixpkgs-wayland";
|
|
||||||
wlroots-git = {
|
|
||||||
url = "gitlab:wlroots/wlroots?host=gitlab.freedesktop.org";
|
url = "gitlab:wlroots/wlroots?host=gitlab.freedesktop.org";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { self, nixpkgs, utils, nixpkgs-wayland, wlroots-git }:
|
outputs = inputs @ {
|
||||||
{
|
self,
|
||||||
overlay = final: prev: {
|
nixpkgs,
|
||||||
hyprland = prev.callPackage self {
|
...
|
||||||
src = self;
|
}: let
|
||||||
wlroots = (nixpkgs-wayland.overlays.default final prev).wlroots.overrideAttrs (prev: rec {
|
inherit (nixpkgs) lib;
|
||||||
src = wlroots-git;
|
genSystems = lib.genAttrs [
|
||||||
|
"x86_64-linux"
|
||||||
|
];
|
||||||
|
pkgsFor = nixpkgs.legacyPackages;
|
||||||
|
# https://github.com/NixOS/rfcs/pull/107
|
||||||
|
mkVersion = longDate:
|
||||||
|
lib.concatStrings [
|
||||||
|
"0.pre"
|
||||||
|
"+date="
|
||||||
|
(lib.concatStringsSep "-" [
|
||||||
|
(__substring 0 4 longDate)
|
||||||
|
(__substring 4 2 longDate)
|
||||||
|
(__substring 6 2 longDate)
|
||||||
|
])
|
||||||
|
];
|
||||||
|
in {
|
||||||
|
packages = genSystems (system: {
|
||||||
|
wlroots = pkgsFor.${system}.wlroots.overrideAttrs (prev: {
|
||||||
|
version = mkVersion inputs.wlroots.lastModifiedDate;
|
||||||
|
src = inputs.wlroots;
|
||||||
});
|
});
|
||||||
|
default = pkgsFor.${system}.callPackage ./default.nix {
|
||||||
|
version = mkVersion self.lastModifiedDate;
|
||||||
|
inherit (self.packages.${system}) wlroots;
|
||||||
};
|
};
|
||||||
};
|
|
||||||
overlays.default = self.overlay;
|
|
||||||
} // utils.lib.eachSystem [ "aarch64-linux" "x86_64-linux" ] (system:
|
|
||||||
let pkgs = nixpkgs.legacyPackages.${system};
|
|
||||||
in rec {
|
|
||||||
packages = {
|
|
||||||
hyprland = pkgs.callPackage self {
|
|
||||||
src = self;
|
|
||||||
wlroots = nixpkgs-wayland.packages.${system}.wlroots.overrideAttrs (prev: rec {
|
|
||||||
src = wlroots-git;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
formatter = genSystems (system: pkgsFor.${system}.alejandra);
|
||||||
|
|
||||||
|
nixosModules.default = import ./module.nix self;
|
||||||
|
|
||||||
|
# Deprecated
|
||||||
|
overlays.default = _: prev: {
|
||||||
|
hyprland = self.packages.${prev.system}.default;
|
||||||
};
|
};
|
||||||
|
overlay = self.overlays.default;
|
||||||
};
|
};
|
||||||
defaultPackage = packages.hyprland;
|
|
||||||
apps.hyprland = utils.lib.mkApp { drv = packages.hyprland; };
|
|
||||||
defaultApp = apps.hyprland;
|
|
||||||
apps.default =
|
|
||||||
utils.lib.mkApp { drv = self.packages.${system}.hyprland; };
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
62
module.nix
Normal file
62
module.nix
Normal file
|
@ -0,0 +1,62 @@
|
||||||
|
# Copied from https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/programs/sway.nix
|
||||||
|
self: {
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
with lib; let
|
||||||
|
cfg = config.programs.hyprland;
|
||||||
|
in {
|
||||||
|
options.programs.hyprland = {
|
||||||
|
enable = mkEnableOption ''
|
||||||
|
Hyprland, the dynamic tiling Wayland compositor that doesn't sacrifice on its looks.
|
||||||
|
You can manually launch Hyprland by executing "exec Hyprland" on a TTY.
|
||||||
|
A configuration file will be generated in ~/.config/hypr/hyprland.conf.
|
||||||
|
See <link xlink:href="https://github.com/vaxerski/Hyprland/wiki" /> for
|
||||||
|
more information.
|
||||||
|
'';
|
||||||
|
|
||||||
|
package = mkOption {
|
||||||
|
type = types.package;
|
||||||
|
default = self.packages.${pkgs.system}.default;
|
||||||
|
defaultText = literalExpression "<Hyprland flake>.packages.<system>.default";
|
||||||
|
example = literalExpression "<Hyprland flake>.packages.<system>.default.override { }";
|
||||||
|
description = ''
|
||||||
|
Hyprland package to use.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
extraPackages = mkOption {
|
||||||
|
type = with types; listOf package;
|
||||||
|
default = with pkgs; [
|
||||||
|
kitty
|
||||||
|
wofi
|
||||||
|
swaybg
|
||||||
|
];
|
||||||
|
defaultText = literalExpression ''
|
||||||
|
with pkgs; [ kitty wofi swaybg ];
|
||||||
|
'';
|
||||||
|
example = literalExpression ''
|
||||||
|
with pkgs; [
|
||||||
|
alacritty wofi
|
||||||
|
]
|
||||||
|
'';
|
||||||
|
description = ''
|
||||||
|
Extra packages to be installed system wide.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
environment.systemPackages = [cfg.package] ++ cfg.extraPackages;
|
||||||
|
security.polkit.enable = true;
|
||||||
|
hardware.opengl.enable = mkDefault true;
|
||||||
|
fonts.enableDefaultFonts = mkDefault true;
|
||||||
|
programs.dconf.enable = mkDefault true;
|
||||||
|
services.xserver.displayManager.sessionPackages = [cfg.package];
|
||||||
|
programs.xwayland.enable = mkDefault true;
|
||||||
|
xdg.portal.enable = mkDefault true;
|
||||||
|
xdg.portal.extraPortals = [pkgs.xdg-desktop-portal-wlr];
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in a new issue