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
+194
-80
No files matched your search
@@ -7,8 +7,7 @@
|
||||
|
||||
programs.noctalia.enable = true;
|
||||
|
||||
home-manager.sharedModules = [
|
||||
({ lib, config, ... }: {
|
||||
home-manager.users.grey = lib.mkIf (config.features.nixos.home-manager.enable) ({ lib, config, ... }: {
|
||||
home.activation = {
|
||||
symlinkNoctaliaState = lib.hm.dag.entryAfter ["writeBoundary"] (config.helpers.mkSymlinkActivationScript {
|
||||
target = ".local/state/noctalia/settings.toml";
|
||||
@@ -24,8 +23,7 @@
|
||||
|
||||
xdg.configFile."noctalia/settings.toml".source = "${self}/dotfiles/${config.info.hostName}/noctalia/settings.toml";
|
||||
xdg.configFile."noctalia/plugins".source = "${self}/dotfiles/${config.info.hostName}/noctalia/plugins";
|
||||
})
|
||||
];
|
||||
});
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -37,14 +37,12 @@
|
||||
));
|
||||
};
|
||||
|
||||
home-manager.sharedModules = [
|
||||
({ lib, config, ... }: {
|
||||
home-manager.users.grey = lib.mkIf (config.features.nixos.home-manager.enable) ({ lib, config, ... }: {
|
||||
home.activation.symlinkNiriConfig = lib.hm.dag.entryAfter ["writeBoundary"] (config.helpers.mkSymlinkActivationScript {
|
||||
target = ".config/niri/config.kdl";
|
||||
source = "dotfiles/${config.info.hostName}/niri.kdl";
|
||||
});
|
||||
})
|
||||
];
|
||||
});
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,4 +1,20 @@
|
||||
{ inputs, self, ... }: {
|
||||
flake.nixosModules.global = { pkgs, lib, config, ... }: {
|
||||
options.features.applications.cli.fastfetch.enable = lib.mkEnableOption "fastfetch";
|
||||
|
||||
config = let
|
||||
mkIfElse = with lib; p: yes: no:
|
||||
mkMerge [
|
||||
(mkIf p yes)
|
||||
(mkIf (!p) no)
|
||||
];
|
||||
in lib.mkIf (config.features.applications.cli.fastfetch.enable) (mkIfElse (config.features.nixos.home-manager.enable) {
|
||||
home-manager.users.grey.features.applications.cli.fastfetch.enable = lib.mkDefault true;
|
||||
} {
|
||||
environment.systemPackages = [ pkgs.fastfetch ];
|
||||
});
|
||||
};
|
||||
|
||||
flake.homeModules.global = { pkgs, lib, config, ... }: {
|
||||
options.features.applications.cli.fastfetch.enable = lib.mkEnableOption "fastfetch";
|
||||
|
||||
|
||||
@@ -8,11 +8,7 @@
|
||||
(mkIf (!p) no)
|
||||
];
|
||||
in lib.mkIf (config.features.applications.gui.equibop.enable) (mkIfElse (config.features.nixos.home-manager.enable) {
|
||||
home-manager.sharedModules = [
|
||||
{
|
||||
features.applications.gui.equibop.enable = lib.mkDefault true;
|
||||
}
|
||||
];
|
||||
home-manager.users.grey.features.applications.gui.equibop.enable = lib.mkDefault true;
|
||||
} {
|
||||
environment.systemPackages = [ pkgs.equibop ];
|
||||
});
|
||||
|
||||
@@ -1,10 +1,17 @@
|
||||
{ inputs, self, ... }: {
|
||||
flake.nixosModules.graphics = { pkgs, lib, config, ... }: {
|
||||
home-manager.sharedModules = lib.mkIf (config.features.nixos.stylix.enable) [
|
||||
({ config, lib, ... }: {
|
||||
stylix.targets.floorp.profileNames = lib.mkIf (config.features.applications.gui.floorp.enable) [ "default" ];
|
||||
})
|
||||
options.features.applications.gui.floorp.enable = lib.mkEnableOption "floorp";
|
||||
|
||||
config = let
|
||||
mkIfElse = with lib; p: yes: no: mkMerge [
|
||||
(mkIf p yes)
|
||||
(mkIf (!p) no)
|
||||
];
|
||||
in lib.mkIf (config.features.applications.gui.floorp.enable) (mkIfElse (config.features.nixos.home-manager.enable) {
|
||||
home-manager.users.grey.features.applications.gui.floorp.enable = lib.mkDefault true;
|
||||
} {
|
||||
environment.systemPackages = [ pkgs.floorp-bin ];
|
||||
});
|
||||
};
|
||||
|
||||
flake.homeModules.graphics = { pkgs, lib, config, ... }: {
|
||||
|
||||
@@ -1,13 +1,5 @@
|
||||
{ inputs, self, ... }: {
|
||||
flake.nixosModules.graphics = { pkgs, config, lib, ... }: {
|
||||
options.features.applications.gui = {
|
||||
fluxer.enable = lib.mkEnableOption "fluxer";
|
||||
fluxer-canary.enable = lib.mkEnableOption "fluxer-canary";
|
||||
};
|
||||
|
||||
config = {
|
||||
environment.systemPackages = (if config.features.applications.gui.fluxer.enable then [
|
||||
(pkgs.callPackage ({ appimageTools, fetchurl, lib, pkgs, ... }:
|
||||
{ inputs, self, lib, ... }: let
|
||||
fluxer-package = { appimageTools, fetchurl, lib, pkgs, ... }:
|
||||
let
|
||||
pname = "fluxer";
|
||||
version = "0.0.8";
|
||||
@@ -38,9 +30,8 @@
|
||||
maintainers = [ ];
|
||||
platforms = [ "x86_64-linux" ];
|
||||
};
|
||||
}) {})
|
||||
] else []) ++ (if config.features.applications.gui.fluxer-canary.enable then [
|
||||
(pkgs.callPackage ({ appimageTools, fetchurl, lib, pkgs, ... }:
|
||||
};
|
||||
fluxer-canary-package = { appimageTools, fetchurl, lib, pkgs, ... }:
|
||||
let
|
||||
pname = "fluxer-canary";
|
||||
version = "2026.827.132039";
|
||||
@@ -71,8 +62,48 @@
|
||||
maintainers = [ ];
|
||||
platforms = [ "x86_64-linux" ];
|
||||
};
|
||||
}) {})
|
||||
] else []);
|
||||
};
|
||||
mkIfElse = with lib; p: yes: no:
|
||||
mkMerge [
|
||||
(mkIf p yes)
|
||||
(mkIf (!p) no)
|
||||
];
|
||||
in {
|
||||
flake.nixosModules.graphics = { pkgs, config, lib, ... }: {
|
||||
options.features.applications.gui = {
|
||||
fluxer.enable = lib.mkEnableOption "fluxer";
|
||||
fluxer-canary.enable = lib.mkEnableOption "fluxer-canary";
|
||||
};
|
||||
|
||||
config = lib.mkIf (config.features.applications.gui.fluxer.enable) (mkIfElse (config.features.nixos.home-manager.enable) {
|
||||
home-manager.users.grey.features.applications.gui.fluxer.enable = lib.mkDefault true;
|
||||
} {
|
||||
environment.systemPackages = [
|
||||
(pkgs.callPackage (fluxer-package) {})
|
||||
];
|
||||
}) // lib.mkIf (config.features.applications.gui.fluxer-canary.enable) (mkIfElse (config.features.nixos.home-manager.enable) {
|
||||
home-manager.users.grey.features.applications.gui.fluxer-canary.enable = lib.mkDefault true;
|
||||
} {
|
||||
environment.systemPackages = [
|
||||
(pkgs.callPackage (fluxer-canary-package) {})
|
||||
];
|
||||
});
|
||||
};
|
||||
|
||||
flake.homeModules.graphics = { pkgs, config, lib, ... }: {
|
||||
options.features.applications.gui = {
|
||||
fluxer.enable = lib.mkEnableOption "fluxer";
|
||||
fluxer-canary.enable = lib.mkEnableOption "fluxer-canary";
|
||||
};
|
||||
|
||||
config = lib.mkIf (config.features.applications.gui.fluxer.enable) {
|
||||
home.packages = [
|
||||
(pkgs.callPackage (fluxer-package) {})
|
||||
];
|
||||
} // lib.mkIf (config.features.applications.gui.fluxer-canary.enable) {
|
||||
home.packages = [
|
||||
(pkgs.callPackage (fluxer-canary-package) {})
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -8,11 +8,7 @@
|
||||
(mkIf (!p) no)
|
||||
];
|
||||
in lib.mkIf (config.features.applications.gui.kitty.enable) (mkIfElse (config.features.nixos.home-manager.enable) {
|
||||
home-manager.sharedModules = [
|
||||
{
|
||||
features.applications.gui.kitty.enable = lib.mkDefault true;
|
||||
}
|
||||
];
|
||||
home-manager.users.grey.features.applications.gui.kitty.enable = lib.mkDefault true;
|
||||
} {
|
||||
environment.systemPackages = [ pkgs.kitty ];
|
||||
});
|
||||
|
||||
@@ -17,11 +17,9 @@
|
||||
terminal = "kitty";
|
||||
};
|
||||
|
||||
home-manager.sharedModules = [
|
||||
{
|
||||
home-manager.users.grey = lib.mkIf (config.features.nixos.home-manager.enable) {
|
||||
features.applications.gui.nautilus.enable = true;
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -29,6 +27,8 @@
|
||||
options.features.applications.gui.nautilus.enable = lib.mkEnableOption "nautilus";
|
||||
|
||||
config = lib.mkIf (config.features.applications.gui.nautilus.enable) {
|
||||
home.packages = lib.mkIf (config.info.isStandalone) [ pkgs.nautilus ];
|
||||
|
||||
gtk.gtk3.bookmarks = [
|
||||
"file://${config.info.rootPath} NixOS"
|
||||
"file:///home/grey/Downloads Downloads"
|
||||
|
||||
@@ -1,4 +1,23 @@
|
||||
{ inputs, self, ... }: {
|
||||
flake.nixosModules.graphics = { pkgs, config, lib, ... }: {
|
||||
options.features.applications.gui.remmina.enable = lib.mkEnableOption "remmina";
|
||||
|
||||
config = let
|
||||
mkIfElse = with lib; p: yes: no:
|
||||
mkMerge [
|
||||
(mkIf p yes)
|
||||
(mkIf (!p) no)
|
||||
];
|
||||
in lib.mkIf (config.features.applications.gui.remmina.enable) (mkIfElse (config.features.nixos.home-manager.enable) {
|
||||
home-manager.users.grey.features.applications.gui.remmina.enable = lib.mkDefault true;
|
||||
} {
|
||||
environment.systemPackages = with pkgs; [
|
||||
remmina
|
||||
freerdp
|
||||
];
|
||||
});
|
||||
};
|
||||
|
||||
flake.homeModules.graphics = { pkgs, config, lib, ... }: {
|
||||
options.features.applications.gui.remmina.enable = lib.mkEnableOption "remmina";
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -2,22 +2,23 @@
|
||||
flake.nixosModules.graphics = { config, pkgs, lib, ... }: {
|
||||
options.features.applications.gui.vscode.enable = lib.mkEnableOption "vscode";
|
||||
|
||||
config = {
|
||||
environment.systemPackages = [ pkgs.vscode ];
|
||||
|
||||
home-manager.sharedModules = lib.mkIf (config.features.applications.gui.vscode.enable) [
|
||||
{
|
||||
features.applications.gui.vscode.enable = lib.mkDefault true;
|
||||
}
|
||||
config = let
|
||||
mkIfElse = with lib; p: yes: no: mkMerge [
|
||||
(mkIf p yes)
|
||||
(mkIf (!p) no)
|
||||
];
|
||||
};
|
||||
in lib.mkIf (config.features.applications.gui.vscode.enable) (mkIfElse (config.features.nixos.home-manager.enable) {
|
||||
home-manager.users.grey.features.applications.gui.vscode.enable = lib.mkDefault true;
|
||||
} {
|
||||
environment.systemPackages = [ pkgs.vscode ];
|
||||
});
|
||||
};
|
||||
|
||||
flake.homeModules.graphics = { config, pkgs, lib, ... }: {
|
||||
options.features.applications.gui.vscode.enable = lib.mkEnableOption "vscode";
|
||||
|
||||
config = lib.mkIf (config.features.applications.gui.vscode.enable) {
|
||||
home.packages = lib.mkIf (config.info.isStandalone) [ pkgs.vscode ];
|
||||
home.packages = [ pkgs.vscode ];
|
||||
|
||||
home.activation = {
|
||||
linkVsCodeConfigSettings = lib.hm.dag.entryAfter ["writeBoundary"] (config.helpers.mkSymlinkActivationScript {
|
||||
|
||||
@@ -15,6 +15,14 @@
|
||||
useUserPackages = true;
|
||||
backupFileExtension = "bak";
|
||||
users.grey = self.homeModules.${config.info.hostName};
|
||||
sharedModules = [
|
||||
{ features.nixos.stylix.enable = lib.mkDefault config.features.nixos.stylix.enable; }
|
||||
( lib.mkIf (config.features.nixos.stylix.enable)
|
||||
( if (config.features.applications.gui.floorp.enable) then {
|
||||
stylix.targets.floorp.profileNames = [ "default" ];
|
||||
} else {})
|
||||
)
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -6,10 +6,19 @@
|
||||
|
||||
options.features.nixos.stylix.enable = lib.mkEnableOption "stylix";
|
||||
|
||||
config = lib.mkIf (config.features.nixos.stylix.enable) {
|
||||
config = let
|
||||
mkIfElse = with lib; p: yes: no: mkMerge [
|
||||
(mkIf p yes)
|
||||
(mkIf (!p) no)
|
||||
];
|
||||
in lib.mkIf (config.features.nixos.stylix.enable) {
|
||||
stylix.enable = true;
|
||||
stylix.image = builtins.path { path = "${self}/modules/hosts/${config.info.hostName}/wallpaper.jpg"; };
|
||||
stylix.polarity = "dark";
|
||||
};
|
||||
};
|
||||
|
||||
flake.homeModules.graphics = { pkgs, lib, config, ... }: {
|
||||
options.features.nixos.stylix.enable = lib.mkEnableOption "stylix";
|
||||
};
|
||||
}
|
||||
@@ -10,12 +10,10 @@
|
||||
users.defaultUserShell = pkgs.zsh;
|
||||
users.users."grey".shell = pkgs.zsh;
|
||||
|
||||
home-manager.sharedModules = [
|
||||
{
|
||||
features.shells.zsh.enable = true;
|
||||
features.shells.zsh.antidote.enable = lib.mkIf (config.features.shells.zsh.antidote.enable) true;
|
||||
}
|
||||
];
|
||||
home-manager.users.grey = lib.mkIf (config.features.nixos.home-manager.enable) {
|
||||
features.shells.zsh.enable = lib.mkDefault true;
|
||||
features.shells.zsh.antidote.enable = lib.mkDefault config.features.shells.zsh.antidote.enable;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -82,10 +82,9 @@
|
||||
powerOnBoot = false;
|
||||
};
|
||||
|
||||
home-manager.sharedModules = [
|
||||
({ config, ... }: {
|
||||
info.isStandalone = false;
|
||||
})
|
||||
];
|
||||
home-manager.users.grey = lib.mkIf (config.features.nixos.home-manager.enable) {
|
||||
info.isStandalone = lib.mkDefault false;
|
||||
# home.stateVersion = lib.mkDefault config.info.stateVersion;
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -28,6 +28,27 @@
|
||||
lib.attrsets.attrByPath (lib.strings.splitString "." strPath) null set;
|
||||
readOnly = true;
|
||||
};
|
||||
|
||||
homeManagerInheritEnableOptionElse = lib.mkOption {
|
||||
# type = lib.types.functionTo lib.types.attrs;
|
||||
default = optionName: systemAttrs: let
|
||||
mkIfElse = with lib; p: yes: no: mkMerge [
|
||||
(mkIf p yes)
|
||||
(mkIf (!p) no)
|
||||
];
|
||||
|
||||
attrByStrPath = strPath: set:
|
||||
lib.attrsets.attrByPath (lib.strings.splitString "." strPath) null set;
|
||||
|
||||
setAttrByStrPath = strPath: value:
|
||||
lib.attrsets.setAttrByPath (lib.strings.splitString "." strPath) value;
|
||||
in builtins.trace "hi" lib.mkIf (attrByStrPath optionName config) (mkIfElse (config.features.nixos.home-manager.enable) {
|
||||
home-manager.sharedModules = [
|
||||
({ lib, ... }: (setAttrByStrPath optionName (lib.mkDefault true)))
|
||||
];
|
||||
} (systemAttrs));
|
||||
readOnly = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -36,6 +36,16 @@
|
||||
kitty.enable = true;
|
||||
vscode.enable = true;
|
||||
equibop.enable = true;
|
||||
floorp.enable = true;
|
||||
remmina.enable = true;
|
||||
spotify = {
|
||||
enable = true;
|
||||
spicetify.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
cli = {
|
||||
fastfetch.enable = true;
|
||||
};
|
||||
|
||||
extraPackages = with pkgs; [
|
||||
@@ -93,19 +103,6 @@
|
||||
|
||||
features = {
|
||||
applications = {
|
||||
cli = {
|
||||
fastfetch.enable = true;
|
||||
};
|
||||
|
||||
gui = {
|
||||
floorp.enable = true;
|
||||
remmina.enable = true;
|
||||
spotify = {
|
||||
enable = true;
|
||||
spicetify.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
extraPackages = with pkgs; [
|
||||
obsidian
|
||||
thunderbird
|
||||
|
||||
Reference in new issue
Block a user