mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-02 16:25:59 +01:00
Merge pull request #144 from fufexan/main
Fix Nix build and add updater
This commit is contained in:
commit
feb0499597
6 changed files with 32 additions and 12 deletions
7
.github/workflows/nix-update.yaml
vendored
7
.github/workflows/nix-update.yaml
vendored
|
@ -1,9 +1,6 @@
|
|||
name: "Nix: update lockfile"
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 0 */14 * *'
|
||||
workflow_dispatch:
|
||||
on: [push, workflow_dispatch]
|
||||
|
||||
jobs:
|
||||
update:
|
||||
|
@ -19,7 +16,7 @@ jobs:
|
|||
auto-optimise-store = true
|
||||
experimental-features = nix-command flakes
|
||||
- name: Update lockfile
|
||||
run: nix flake update
|
||||
run: nix/update-inputs.sh
|
||||
- uses: stefanzweifel/git-auto-commit-action@v4
|
||||
with:
|
||||
commit_message: "[gha] bump flake inputs"
|
||||
|
|
|
@ -26,11 +26,11 @@
|
|||
"flake": false,
|
||||
"locked": {
|
||||
"host": "gitlab.freedesktop.org",
|
||||
"lastModified": 1654018490,
|
||||
"narHash": "sha256-6c/2lVXpr1qL/NAiaEwFO7kiTOMc6UJjYXtxDHifBwk=",
|
||||
"lastModified": 1653658290,
|
||||
"narHash": "sha256-zZaona39DOZNL93A1KG3zAi8vDttJBirxacq24hWCn4=",
|
||||
"owner": "wlroots",
|
||||
"repo": "wlroots",
|
||||
"rev": "ec328ca8cc82f5cac657141e31a81a590759150d",
|
||||
"rev": "75d31509db8c28e8379fe9570118ef8c82284581",
|
||||
"type": "gitlab"
|
||||
},
|
||||
"original": {
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
version = mkVersion inputs.wlroots.lastModifiedDate;
|
||||
src = inputs.wlroots;
|
||||
});
|
||||
default = pkgsFor.${system}.callPackage ./default.nix {
|
||||
default = pkgsFor.${system}.callPackage ./nix/default.nix {
|
||||
version = mkVersion self.lastModifiedDate;
|
||||
inherit (self.packages.${system}) wlroots;
|
||||
};
|
||||
|
@ -44,7 +44,7 @@
|
|||
|
||||
formatter = genSystems (system: pkgsFor.${system}.alejandra);
|
||||
|
||||
nixosModules.default = import ./module.nix self;
|
||||
nixosModules.default = import ./nix/module.nix self;
|
||||
|
||||
# Deprecated
|
||||
overlays.default = _: prev: {
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
stdenv.mkDerivation {
|
||||
pname = "hyprland";
|
||||
inherit version;
|
||||
src = ./.;
|
||||
src = ../.;
|
||||
|
||||
nativeBuildInputs = [
|
||||
cmake
|
||||
|
@ -52,8 +52,12 @@ stdenv.mkDerivation {
|
|||
["-DCMAKE_BUILD_TYPE=Release"]
|
||||
++ lib.optional (!enableXWayland) "-DNO_XWAYLAND=true";
|
||||
|
||||
# enables building with nix-supplied wlroots instead of submodule
|
||||
prePatch = ''
|
||||
make config
|
||||
sed -Ei 's/"\.\.\/wlroots\/include\/([a-zA-Z0-9./_-]+)"/<\1>/g' src/includes.hpp
|
||||
'';
|
||||
postPatch = ''
|
||||
make protocols
|
||||
'';
|
||||
|
||||
postBuild = ''
|
19
nix/update-inputs.sh
Executable file
19
nix/update-inputs.sh
Executable file
|
@ -0,0 +1,19 @@
|
|||
#!/usr/bin/env -S nix shell nixpkgs#gawk nixpkgs#git nixpkgs#moreutils nixpkgs#jq -c bash
|
||||
|
||||
# get wlroots revision from submodule
|
||||
SUB_REV=$(git submodule status | awk '{ print substr($1,2)}')
|
||||
# and from lockfile
|
||||
CRT_REV=$(jq < flake.lock '.nodes.wlroots.locked.rev' -r)
|
||||
|
||||
if [ $SUB_REV != $CRT_REV ]; then
|
||||
# update nixpkgs to latest version
|
||||
nix flake lock --update-input nixpkgs
|
||||
|
||||
# update wlroots to submodule revision
|
||||
nix flake lock --override-input wlroots "gitlab:wlroots/wlroots/$SUB_REV?host=gitlab.freedesktop.org"
|
||||
|
||||
# remove "dirty" mark from lockfile
|
||||
jq < flake.lock 'del(.nodes.wlroots.original.rev)' | sponge flake.lock
|
||||
else
|
||||
echo "wlroots is up to date!"
|
||||
fi
|
Loading…
Reference in a new issue