Allow disabling home-manager parts for server
This commit is contained in:
parent
7c9307a2cf
commit
2695859bc8
5 changed files with 49 additions and 33 deletions
41
flake.nix
41
flake.nix
|
@ -68,6 +68,16 @@
|
|||
# Home manager
|
||||
home-manager.nixosModules.home-manager
|
||||
./home-manager
|
||||
{
|
||||
hmOptions = {
|
||||
plasma.enable = true;
|
||||
beets.enable = true;
|
||||
firefox.enable = true;
|
||||
thunderbird.enable = true;
|
||||
rescrobbled.enable = true;
|
||||
vscode.enable = true;
|
||||
};
|
||||
}
|
||||
];
|
||||
|
||||
specialArgs = {
|
||||
|
@ -84,28 +94,25 @@
|
|||
# Better command-not-found
|
||||
nix-index-database.nixosModules.nix-index
|
||||
{ programs.nix-index-database.comma.enable = true; }
|
||||
|
||||
# Home manager
|
||||
home-manager.nixosModules.home-manager
|
||||
./home-manager
|
||||
{
|
||||
hmOptions = {
|
||||
plasma.enable = false;
|
||||
beets.enable = false;
|
||||
firefox.enable = false;
|
||||
thunderbird.enable = false;
|
||||
rescrobbled.enable = false;
|
||||
vscode.enable = false;
|
||||
};
|
||||
}
|
||||
];
|
||||
|
||||
specialArgs = {
|
||||
inherit inputs system secrets;
|
||||
};
|
||||
};
|
||||
|
||||
# Add home manager configuration compatibility to the main flake
|
||||
homeConfigurations."ty" = home-manager.lib.homeManagerConfiguration {
|
||||
inherit pkgs;
|
||||
|
||||
# Specify your home configuration modules here, for example,
|
||||
# the path to your home.nix.
|
||||
modules = [
|
||||
plasma-manager.homeManagerModules.plasma-manager
|
||||
./home-manager/custom-modules
|
||||
./home-manager/home.nix
|
||||
];
|
||||
|
||||
extraSpecialArgs = {
|
||||
inherit inputs system secrets;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,10 +1,10 @@
|
|||
{ inputs, system, secrets, ... }:
|
||||
{ inputs, system, secrets, lib, config, ... }:
|
||||
{
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.useUserPackages = true;
|
||||
home-manager.sharedModules = [
|
||||
inputs.plasma-manager.homeManagerModules.plasma-manager
|
||||
./custom-modules
|
||||
(lib.mkIf config.hmOptions.plasma.enable inputs.plasma-manager.homeManagerModules.plasma-manager)
|
||||
(lib.mkIf config.hmOptions.beets.enable ./custom-modules)
|
||||
];
|
||||
home-manager.extraSpecialArgs = {
|
||||
inherit inputs system secrets;
|
||||
|
|
|
@ -1,22 +1,31 @@
|
|||
{ ... }:
|
||||
{ lib, config, ... }:
|
||||
{
|
||||
home.stateVersion = "24.05";
|
||||
home.username = "ty";
|
||||
home.homeDirectory = "/home/ty";
|
||||
|
||||
options.hmOptions = {
|
||||
plasma.enable = lib.mkEnableOption "plasma configuration";
|
||||
firefox.enable = lib.mkEnableOption "firefox configuration";
|
||||
thunderbird.enable = lib.mkEnableOption "thunderbird configuration";
|
||||
vscode.enable = lib.mkEnableOption "vscode configuration";
|
||||
beets.enable = lib.mkEnableOption "beets configuration";
|
||||
rescrobbled.enable = lib.mkEnableOption "rescrobbled configuration";
|
||||
};
|
||||
|
||||
imports = [
|
||||
./modules/packages.nix
|
||||
./modules/plasma.nix
|
||||
(lib.mkIf config.hmOptions.plasma.enable ./modules/plasma.nix)
|
||||
./modules/vcs
|
||||
./modules/firefox.nix
|
||||
./modules/thunderbird.nix
|
||||
(lib.mkIf config.hmOptions.firefox.enable ./modules/firefox.nix)
|
||||
(lib.mkIf config.hmOptions.thunderbird.enable ./modules/thunderbird.nix)
|
||||
./modules/accounts
|
||||
./modules/gpg.nix
|
||||
./modules/shell
|
||||
./modules/vscode.nix
|
||||
./modules/desktop.nix
|
||||
./modules/gtk.nix
|
||||
./modules/beets.nix
|
||||
./modules/rescrobbled.nix
|
||||
(lib.mkIf config.hmOptions.vscode.enable ./modules/vscode.nix)
|
||||
(lib.mkIf config.hmOptions.plasma.enable ./modules/desktop.nix)
|
||||
(lib.mkIf config.hmOptions.plasma.enable ./modules/gtk.nix)
|
||||
(lib.mkIf config.hmOptions.beets.enable ./modules/beets.nix)
|
||||
(lib.mkIf config.hmOptions.rescrobbled.enable ./modules/rescrobbled.nix)
|
||||
];
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
{ ... }:
|
||||
{ lib, config, ... }:
|
||||
{
|
||||
imports = [
|
||||
./email.nix
|
||||
(lib.mkIf config.hmOptions.thunderbird.enable ./email.nix)
|
||||
./ssh.nix
|
||||
];
|
||||
}
|
|
@ -1,9 +1,9 @@
|
|||
{ ... }:
|
||||
{ lib, config, ... }:
|
||||
{
|
||||
imports = [
|
||||
./btop.nix
|
||||
./direnv.nix
|
||||
./konsole.nix
|
||||
(lib.mkIf config.hmOptions.plasma.enable ./konsole.nix)
|
||||
./starship.nix
|
||||
./zsh.nix
|
||||
];
|
||||
|
|
Loading…
Reference in a new issue