nix: add xdph to nixos module

This commit is contained in:
Mihai Fufezan 2022-12-04 21:29:12 +02:00 committed by Mihai Fufezan
parent 9e4e98acfb
commit f71f04db9e
3 changed files with 49 additions and 5 deletions

View file

@ -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",

View file

@ -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;
};

View file

@ -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 "<Hyprland flake>.packages.<system>.default";
example = literalExpression "<Hyprland flake>.packages.<system>.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];
};
};
}