all application options will adapt to environment
when used either with nixos (no home-manager) or home-manager standalone, `features.applications.<name>.enable` options still perform some functionality, rather than assuming a full nixos + home-manager setup like before
This commit is contained in:
17 files changed
+265
-151
No files matched your search
@@ -1,4 +1,26 @@
|
||||
{ inputs, self, ... }: {
|
||||
flake.nixosModules.graphics = { pkgs, config, lib, ... }: {
|
||||
options.features.applications.gui.spotify = {
|
||||
enable = lib.mkEnableOption "spotify";
|
||||
spicetify.enable = lib.mkEnableOption "spicetify";
|
||||
};
|
||||
|
||||
config = let
|
||||
mkIfElse = with lib; p: yes: no:
|
||||
mkMerge [
|
||||
(mkIf p yes)
|
||||
(mkIf (!p) no)
|
||||
];
|
||||
in lib.mkIf (config.features.applications.gui.spotify.enable) (mkIfElse (config.features.nixos.home-manager.enable) {
|
||||
home-manager.users.grey.features.applications.gui.spotify = {
|
||||
enable = lib.mkDefault true;
|
||||
spicetify.enable = lib.mkDefault config.features.applications.gui.spotify.spicetify.enable;
|
||||
};
|
||||
} {
|
||||
environment.systemPackages = [ pkgs.spotify ];
|
||||
});
|
||||
};
|
||||
|
||||
flake.homeModules.graphics = { pkgs, config, lib, ... }: {
|
||||
options.features.applications.gui.spotify = {
|
||||
enable = lib.mkEnableOption "spotify";
|
||||
@@ -9,15 +31,13 @@
|
||||
inputs.spicetify.homeManagerModules.default
|
||||
];
|
||||
|
||||
config = {
|
||||
home.packages = lib.mkIf (with config.features.applications.gui.spotify; enable && !spicetify.enable) (with pkgs; [
|
||||
spotify
|
||||
]);
|
||||
config = lib.mkIf (config.features.applications.gui.spotify.enable) {
|
||||
home.packages = lib.mkIf (!config.features.applications.gui.spotify.spicetify.enable) [ pkgs.spotify ];
|
||||
|
||||
programs.spicetify =
|
||||
let
|
||||
spicePkgs = inputs.spicetify.legacyPackages.${pkgs.stdenv.hostPlatform.system};
|
||||
in lib.mkIf (with config.features.applications.gui.spotify; enable && spicetify.enable) {
|
||||
in lib.mkIf (config.features.applications.gui.spotify.spicetify.enable) {
|
||||
enable = true;
|
||||
enabledExtensions = with spicePkgs.extensions; [
|
||||
hidePodcasts
|
||||
|
||||
Reference in new issue
Block a user