Refactor DMS configuration and introduce home-manager integration
- Simplified `default.nix` by removing legacy home-manager settings and delegating them to a new `_private/hm.nix` module for better organization. - Added a new script `dms-restart-once.sh` to handle service restarts and cache management for DMS plugins. - Updated the DMS configuration to streamline the integration of third-party plugins and improve overall modularity.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
{ inputs, ... }: {
|
||||
{ ... }: {
|
||||
flake.nixosModules.desktopShellDmsOptions = { lib, ... }: {
|
||||
options.chiasson.desktop.shells.dms = {
|
||||
enableGpuTemp = lib.mkOption {
|
||||
@@ -45,29 +45,5 @@
|
||||
};
|
||||
};
|
||||
|
||||
flake.homeManagerModules.desktopShellDms = {
|
||||
lib,
|
||||
osConfig ? { },
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = lib.attrByPath [ "chiasson" "desktop" "shells" "dms" ] { } osConfig;
|
||||
selectedShell = lib.attrByPath [ "chiasson" "desktop" "shell" ] null osConfig;
|
||||
dmsEnabled = selectedShell == "dms";
|
||||
hostName = lib.attrByPath [ "networking" "hostName" ] "nixos" osConfig;
|
||||
rebuildCommand =
|
||||
if (cfg.rebuildCommand or null) != null then
|
||||
cfg.rebuildCommand
|
||||
else
|
||||
[ "sudo" "nixos-rebuild" "switch" "--flake" ".#${hostName}" ];
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
./home-manager/default.nix
|
||||
];
|
||||
|
||||
config = lib.mkIf dmsEnabled {
|
||||
programs.nix-monitor.rebuildCommand = rebuildCommand;
|
||||
};
|
||||
};
|
||||
flake.homeManagerModules.desktopShellDms = import ./_private/hm.nix;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user