mirror of
https://github.com/nix-community/home-manager.git
synced 2025-03-31 04:04:32 +00:00
waylogout: remove with lib
This commit is contained in:
parent
185cb98492
commit
2f40f936a4
1 changed files with 8 additions and 11 deletions
|
@ -1,13 +1,10 @@
|
|||
{ pkgs, config, lib, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let cfg = config.programs.waylogout;
|
||||
in {
|
||||
meta.maintainers = [ hm.maintainers.noodlez ];
|
||||
meta.maintainers = [ lib.hm.maintainers.noodlez ];
|
||||
|
||||
options.programs.waylogout = {
|
||||
enable = mkOption {
|
||||
enable = lib.mkOption {
|
||||
default = false;
|
||||
type = lib.types.bool;
|
||||
example = true;
|
||||
|
@ -16,10 +13,10 @@ in {
|
|||
'';
|
||||
};
|
||||
|
||||
package = mkPackageOption pkgs "waylogout" { };
|
||||
package = lib.mkPackageOption pkgs "waylogout" { };
|
||||
|
||||
settings = mkOption {
|
||||
type = with types; attrsOf (oneOf [ bool float int str ]);
|
||||
settings = lib.mkOption {
|
||||
type = with lib.types; attrsOf (oneOf [ bool float int str ]);
|
||||
default = { };
|
||||
description = ''
|
||||
Default arguments to {command}`waylogout`. An empty set
|
||||
|
@ -36,7 +33,7 @@ in {
|
|||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
config = lib.mkIf cfg.enable {
|
||||
assertions = [
|
||||
(lib.hm.assertions.assertPlatform "programs.waylogout" pkgs
|
||||
lib.platforms.linux)
|
||||
|
@ -44,8 +41,8 @@ in {
|
|||
|
||||
home.packages = [ cfg.package ];
|
||||
|
||||
xdg.configFile."waylogout/config" = mkIf (cfg.settings != { }) {
|
||||
text = concatStrings (mapAttrsToList (n: v:
|
||||
xdg.configFile."waylogout/config" = lib.mkIf (cfg.settings != { }) {
|
||||
text = lib.concatStrings (lib.mapAttrsToList (n: v:
|
||||
if v == false then
|
||||
""
|
||||
else
|
||||
|
|
Loading…
Add table
Reference in a new issue