mirror of
https://github.com/nix-community/home-manager.git
synced 2026-01-11 17:39:37 +08:00
pueue: deduplicate platform-dependent files
This commit is contained in:
committed by
Austin Horstman
parent
a1a11393d9
commit
f7b2bdf042
@@ -7,6 +7,8 @@
|
||||
let
|
||||
cfg = config.services.pueue;
|
||||
yamlFormat = pkgs.formats.yaml { };
|
||||
configDir =
|
||||
if pkgs.stdenv.hostPlatform.isDarwin then "Library/Application Support" else config.xdg.configHome;
|
||||
configFile = yamlFormat.generate "pueue.yaml" ({ shared = { }; } // cfg.settings);
|
||||
pueuedBin = "${cfg.package}/bin/pueued";
|
||||
in
|
||||
@@ -38,7 +40,7 @@ in
|
||||
config = lib.mkIf cfg.enable {
|
||||
home.packages = lib.mkIf (cfg.package != null) [ cfg.package ];
|
||||
|
||||
xdg.configFile."pueue/pueue.yml" = lib.mkIf pkgs.stdenv.isLinux { source = configFile; };
|
||||
home.file."${configDir}/pueue/pueue.yml".source = configFile;
|
||||
|
||||
systemd.user = lib.mkIf (cfg.package != null) {
|
||||
services.pueued = {
|
||||
@@ -55,12 +57,6 @@ in
|
||||
};
|
||||
};
|
||||
|
||||
# This is the default configuration file location for pueue on
|
||||
# darwin (https://github.com/Nukesor/pueue/wiki/Configuration)
|
||||
home.file."Library/Application Support/pueue/pueue.yml" = lib.mkIf pkgs.stdenv.isDarwin {
|
||||
source = configFile;
|
||||
};
|
||||
|
||||
launchd.agents.pueued = lib.mkIf (cfg.package != null) {
|
||||
enable = true;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user