mirror of
https://github.com/nix-community/home-manager.git
synced 2025-12-06 17:11:03 +01:00
treewide: null package support (#6582)
Can generate the config without installing application through home-manager. Helpful when a package is broken (or not provided) on a specific platform through nixpkgs and needs to be installed through other means but you still can benefit from the declarative configuration.
This commit is contained in:
parent
6c2b79403e
commit
d2c014e1c7
83 changed files with 269 additions and 222 deletions
|
|
@ -8,7 +8,7 @@ in {
|
|||
options.services.clipse = {
|
||||
enable = lib.mkEnableOption "Enable clipse clipboard manager";
|
||||
|
||||
package = lib.mkPackageOption pkgs "clipse" { };
|
||||
package = lib.mkPackageOption pkgs "clipse" { nullable = true; };
|
||||
|
||||
systemdTarget = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
|
|
@ -130,7 +130,7 @@ in {
|
|||
lib.platforms.linux)
|
||||
];
|
||||
|
||||
home.packages = [ cfg.package ];
|
||||
home.packages = lib.mkIf (cfg.package != null) [ cfg.package ];
|
||||
|
||||
xdg.configFile."clipse/config.json".source =
|
||||
jsonFormat.generate "settings" {
|
||||
|
|
@ -147,20 +147,21 @@ in {
|
|||
xdg.configFile."clipse/custom_theme.json".source =
|
||||
jsonFormat.generate "theme" cfg.theme;
|
||||
|
||||
systemd.user.services.clipse = lib.mkIf pkgs.stdenv.isLinux {
|
||||
Unit = {
|
||||
Description = "Clipse listener";
|
||||
PartOf = [ "graphical-session.target" ];
|
||||
After = [ "graphical-session.target" ];
|
||||
};
|
||||
systemd.user.services.clipse =
|
||||
lib.mkIf (pkgs.stdenv.isLinux && (cfg.package != null)) {
|
||||
Unit = {
|
||||
Description = "Clipse listener";
|
||||
PartOf = [ "graphical-session.target" ];
|
||||
After = [ "graphical-session.target" ];
|
||||
};
|
||||
|
||||
Service = {
|
||||
Type = "oneshot";
|
||||
RemainAfterExit = true;
|
||||
ExecStart = "${cfg.package}/bin/clipse -listen";
|
||||
};
|
||||
Service = {
|
||||
Type = "oneshot";
|
||||
RemainAfterExit = true;
|
||||
ExecStart = "${cfg.package}/bin/clipse -listen";
|
||||
};
|
||||
|
||||
Install = { WantedBy = [ cfg.systemdTarget ]; };
|
||||
};
|
||||
Install = { WantedBy = [ cfg.systemdTarget ]; };
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue