Allow disabling home-manager parts for server
This commit is contained in:
parent
7c9307a2cf
commit
6d0e03dbcf
15 changed files with 195 additions and 170 deletions
41
flake.nix
41
flake.nix
|
@ -68,6 +68,16 @@
|
|||
# Home manager
|
||||
home-manager.nixosModules.home-manager
|
||||
./home-manager
|
||||
{
|
||||
ty-home-manager-options = {
|
||||
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
|
||||
{
|
||||
ty-home-manager-options = {
|
||||
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,5 +1,15 @@
|
|||
{ inputs, system, secrets, ... }:
|
||||
{ inputs, system, secrets, lib, config, ... }:
|
||||
{
|
||||
options.ty-home-manager-options = {
|
||||
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";
|
||||
};
|
||||
|
||||
config = {
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.useUserPackages = true;
|
||||
home-manager.sharedModules = [
|
||||
|
@ -8,6 +18,7 @@
|
|||
];
|
||||
home-manager.extraSpecialArgs = {
|
||||
inherit inputs system secrets;
|
||||
inherit (config) ty-home-manager-options;
|
||||
};
|
||||
home-manager.backupFileExtension = "backup";
|
||||
|
||||
|
@ -16,4 +27,5 @@
|
|||
./home.nix
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
{ ... }:
|
||||
{ lib, config, ... }:
|
||||
{
|
||||
home.stateVersion = "24.05";
|
||||
home.username = "ty";
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{ ... }:
|
||||
{ lib, config, ... }:
|
||||
{
|
||||
imports = [
|
||||
./email.nix
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{ ... }:
|
||||
{ lib, ty-home-manager-options, ... }:
|
||||
{
|
||||
accounts.email.accounts = {
|
||||
accounts.email.accounts = lib.mkIf ty-home-manager-options.thunderbird.enable {
|
||||
PurelyMail = rec {
|
||||
realName = "Tyler Beckman";
|
||||
address = "ty@myriation.xyz";
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{ lib, secrets, ... }:
|
||||
{ lib, secrets, ty-home-manager-options, ... }:
|
||||
{
|
||||
programs.beets = {
|
||||
programs.beets = lib.mkIf ty-home-manager-options.beets.enable {
|
||||
enable = true;
|
||||
|
||||
settings = {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{ ... }:
|
||||
{ lib, ty-home-manager-options, ... }:
|
||||
{
|
||||
xdg.desktopEntries = {
|
||||
xdg.desktopEntries = lib.mkIf ty-home-manager-options.plasma.enable {
|
||||
# Override vesktop for matching icon in beautyline (make it generic discord icon)
|
||||
vesktop = {
|
||||
categories = [ "Network" "InstantMessaging" "Chat" ];
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{ pkgs, inputs, system, ... }:
|
||||
{ pkgs, inputs, system, lib, ty-home-manager-options, ... }:
|
||||
{
|
||||
programs.firefox = {
|
||||
programs.firefox = lib.mkIf ty-home-manager-options.firefox.enable {
|
||||
enable = true;
|
||||
policies = {
|
||||
ExtensionSettings = {
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
{ pkgs, config, ... }:
|
||||
{ pkgs, lib, config, ty-home-manager-options, ... }:
|
||||
{
|
||||
config = lib.mkIf ty-home-manager-options.plasma.enable {
|
||||
gtk = {
|
||||
enable = true;
|
||||
|
||||
|
@ -22,4 +23,5 @@
|
|||
|
||||
# Tell home-manager to force overwrite the gtk2 configuration as it keeps getting overwritten by something (likely plasma)
|
||||
home.file.${config.gtk.gtk2.configLocation}.force = true;
|
||||
};
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
{ pkgs, inputs, system, ... }:
|
||||
{ pkgs, inputs, system, ty-home-manager-options, ... }:
|
||||
{
|
||||
home.packages = (with pkgs; [
|
||||
# Documents
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{ pkgs, ... }:
|
||||
{ pkgs, lib, ty-home-manager-options, ... }:
|
||||
{
|
||||
programs.plasma = {
|
||||
programs.plasma = lib.mkIf ty-home-manager-options.plasma.enable {
|
||||
enable = true;
|
||||
|
||||
workspace = {
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
{ secrets, lib, ... }:
|
||||
{ secrets, lib, ty-home-manager-options, ... }:
|
||||
{
|
||||
config = lib.mkIf ty-home-manager-options.rescrobbled.enable {
|
||||
services.custom.rescrobbled = let s = secrets.programs.rescrobbled; in lib.mkIf s.enable {
|
||||
enable = true;
|
||||
|
||||
|
@ -18,4 +19,5 @@
|
|||
lastfm-secret = lib.mkIf (s.lastfm.key != null && s.lastfm.secret != null) s.lastfm.secret;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
{ pkgs, ... }:
|
||||
{ pkgs, lib, ty-home-manager-options, ... }:
|
||||
{
|
||||
programs.konsole = {
|
||||
programs.konsole = lib.mkIf ty-home-manager-options.plasma.enable {
|
||||
enable = true;
|
||||
defaultProfile = "Primary";
|
||||
profiles = {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{ pkgs, ... }:
|
||||
{ pkgs, lib, ty-home-manager-options, ... }:
|
||||
{
|
||||
programs.thunderbird = {
|
||||
programs.thunderbird = lib.mkIf ty-home-manager-options.thunderbird.enable {
|
||||
enable = true;
|
||||
package = pkgs.thunderbird-latest;
|
||||
profiles = {
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
{ pkgs, inputs, system, ... }:
|
||||
{ pkgs, inputs, system, lib, ty-home-manager-options, ... }:
|
||||
{
|
||||
programs.vscode = let vscode-package = pkgs.vscodium; in {
|
||||
programs.vscode = lib.mkIf ty-home-manager-options.vscode.enable (
|
||||
let vscode-package = pkgs.vscodium; in {
|
||||
enable = true;
|
||||
package = vscode-package;
|
||||
|
||||
|
@ -96,5 +97,6 @@
|
|||
"C/C++ Include Guard.Comment Style" = "Line";
|
||||
"C/C++ Include Guard.Macro Type" = "Filename";
|
||||
};
|
||||
};
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue