nix: add xdph to nixos module

This commit is contained in:
Mihai Fufezan 2022-12-04 21:29:12 +02:00
parent 9e4e98acfb
commit 49bb42d2de
No known key found for this signature in database
GPG Key ID: 5899325F2F120900
3 changed files with 49 additions and 5 deletions

View File

@ -1,5 +1,21 @@
{ {
"nodes": { "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": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1670064435, "lastModified": 1670064435,
@ -19,7 +35,8 @@
"root": { "root": {
"inputs": { "inputs": {
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs",
"wlroots": "wlroots" "wlroots": "wlroots",
"xdph": "xdph"
} }
}, },
"wlroots": { "wlroots": {
@ -39,6 +56,27 @@
"repo": "wlroots", "repo": "wlroots",
"type": "gitlab" "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", "root": "root",

View File

@ -7,6 +7,11 @@
url = "gitlab:wlroots/wlroots?host=gitlab.freedesktop.org"; url = "gitlab:wlroots/wlroots?host=gitlab.freedesktop.org";
flake = false; flake = false;
}; };
xdph = {
url = "github:hyprwm/xdg-desktop-portal-hyprland";
inputs.nixpkgs.follows = "nixpkgs";
};
}; };
outputs = inputs @ { outputs = inputs @ {
@ -92,7 +97,7 @@
formatter = genSystems (system: pkgsFor.${system}.alejandra); 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; 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 # Copied from https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/programs/sway.nix
self: { inputs: {
config, config,
lib, lib,
pkgs, pkgs,
@ -23,7 +23,7 @@ in {
package = mkOption { package = mkOption {
type = types.nullOr types.package; 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"; defaultText = literalExpression "<Hyprland flake>.packages.<system>.default";
example = literalExpression "<Hyprland flake>.packages.<system>.default.override { }"; example = literalExpression "<Hyprland flake>.packages.<system>.default.override { }";
description = '' description = ''
@ -60,7 +60,8 @@ in {
services.xserver.displayManager.sessionPackages = lib.optional (cfg.package != null) cfg.package; services.xserver.displayManager.sessionPackages = lib.optional (cfg.package != null) cfg.package;
xdg.portal = { xdg.portal = {
enable = mkDefault true; enable = mkDefault true;
extraPortals = [pkgs.xdg-desktop-portal-wlr]; # xdg-desktop-portal-hyprland
extraPortals = [inputs.xdph.packages.${pkgs.system}.default];
}; };
}; };
} }