mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-04-30 12:19:11 +00:00
nixos/xdg/autostart-entries: init
This commit is contained in:
parent
9b68b70c92
commit
45228e6dea
@ -15,6 +15,7 @@
|
||||
./services/wezterm-mux-server.nix
|
||||
./services/vouch-proxy.nix
|
||||
./services/yt-dlp.nix
|
||||
./xdg/autostart-entries.nix
|
||||
./xdg/mime-desktop-specific.nix
|
||||
./virtualisation/oci-containers
|
||||
];
|
||||
|
40
modules/nixos/xdg/autostart-entries.nix
Normal file
40
modules/nixos/xdg/autostart-entries.nix
Normal file
@ -0,0 +1,40 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
cfg = config.xdg.autostart;
|
||||
|
||||
xdgDesktopEntrySubmodule = { name, ... }: {
|
||||
freeformType = with lib.types; attrsOf anything;
|
||||
};
|
||||
in
|
||||
{
|
||||
options.xdg.autostart.entries = lib.mkOption {
|
||||
type = with lib.types; attrsOf (submodule xdgDesktopEntrySubmodule);
|
||||
default = { };
|
||||
description = ''
|
||||
A set of XDG autostart entries to be exported to the environment.
|
||||
'';
|
||||
example = lib.literalExpression ''
|
||||
{
|
||||
kando = {
|
||||
name = "kando";
|
||||
desktopName = "Kando";
|
||||
exec = lib.getExe pkgs.kando;
|
||||
icon = "kando";
|
||||
genericName = "Pie Menu";
|
||||
};
|
||||
}
|
||||
'';
|
||||
};
|
||||
|
||||
config = lib.mkIf (cfg.entries != { }) {
|
||||
environment.systemPackages =
|
||||
let
|
||||
mkXDGAutostartFile = _: v:
|
||||
pkgs.makeDesktopItem (v // {
|
||||
destination = "/etc/xdg/autostart";
|
||||
});
|
||||
in
|
||||
lib.mapAttrsToList mkXDGAutostartFile cfg.entries;
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue
Block a user