From f71f04db9e13950af4a97ae6c8cd31311f8cb6bd Mon Sep 17 00:00:00 2001 From: Mihai Fufezan Date: Sun, 4 Dec 2022 21:29:12 +0200 Subject: [PATCH] nix: add xdph to nixos module --- flake.lock | 40 +++++++++++++++++++++++++++++++++++++++- flake.nix | 7 ++++++- nix/module.nix | 7 ++++--- 3 files changed, 49 insertions(+), 5 deletions(-) diff --git a/flake.lock b/flake.lock index 61593048..572c561e 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,21 @@ { "nodes": { + "hyprland-protocols": { + "flake": false, + "locked": { + "lastModified": 1670185345, + "narHash": "sha256-hxWGqlPecqEsE6nOHDV29KFBKePbY2Ipeac6lrChMKY=", + "owner": "hyprwm", + "repo": "hyprland-protocols", + "rev": "4623a404c091e64743ba310199bb380ec52f1936", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprland-protocols", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1670064435, @@ -19,7 +35,8 @@ "root": { "inputs": { "nixpkgs": "nixpkgs", - "wlroots": "wlroots" + "wlroots": "wlroots", + "xdph": "xdph" } }, "wlroots": { @@ -39,6 +56,27 @@ "repo": "wlroots", "type": "gitlab" } + }, + "xdph": { + "inputs": { + "hyprland-protocols": "hyprland-protocols", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1670202338, + "narHash": "sha256-StTfshdAoSxO+t0wRbq1I3YESLFIQWFjGJse5ICV8rk=", + "owner": "hyprwm", + "repo": "xdg-desktop-portal-hyprland", + "rev": "af840a9e0947a79a37a95a9f62062653721e43fa", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "xdg-desktop-portal-hyprland", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 6e44eece..bb097d6a 100644 --- a/flake.nix +++ b/flake.nix @@ -7,6 +7,11 @@ url = "gitlab:wlroots/wlroots?host=gitlab.freedesktop.org"; flake = false; }; + + xdph = { + url = "github:hyprwm/xdg-desktop-portal-hyprland"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; outputs = inputs @ { @@ -92,7 +97,7 @@ formatter = genSystems (system: pkgsFor.${system}.alejandra); - nixosModules.default = import ./nix/module.nix self; + nixosModules.default = import ./nix/module.nix inputs; homeManagerModules.default = import ./nix/hm-module.nix self; }; diff --git a/nix/module.nix b/nix/module.nix index 8d822b0c..55c667a9 100644 --- a/nix/module.nix +++ b/nix/module.nix @@ -1,5 +1,5 @@ # Copied from https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/programs/sway.nix -self: { +inputs: { config, lib, pkgs, @@ -23,7 +23,7 @@ in { package = mkOption { type = types.nullOr types.package; - default = self.packages.${pkgs.system}.default; + default = inputs.self.packages.${pkgs.system}.default; defaultText = literalExpression ".packages..default"; example = literalExpression ".packages..default.override { }"; description = '' @@ -60,7 +60,8 @@ in { services.xserver.displayManager.sessionPackages = lib.optional (cfg.package != null) cfg.package; xdg.portal = { enable = mkDefault true; - extraPortals = [pkgs.xdg-desktop-portal-wlr]; + # xdg-desktop-portal-hyprland + extraPortals = [inputs.xdph.packages.${pkgs.system}.default]; }; }; }