From 48024a6bae76d399a93236911265363d23f01d73 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 9 Sep 2023 15:11:49 +0200 Subject: [PATCH] home submodule --- my/default.nix | 6 +---- my/gnome.nix | 4 ++-- my/home/default.nix | 25 +++++++++++++++++++ my/{home-ronja.nix => home/ronja.nix} | 7 +++--- my/{home-vinzenz.nix => home/vinzenz.nix} | 7 +++--- my/kde.nix | 29 ++++++++++++----------- vinzenz-lpt.nix | 2 +- vinzenz-pc3.nix | 2 +- 8 files changed, 51 insertions(+), 31 deletions(-) create mode 100644 my/home/default.nix rename my/{home-ronja.nix => home/ronja.nix} (95%) rename my/{home-vinzenz.nix => home/vinzenz.nix} (97%) diff --git a/my/default.nix b/my/default.nix index 444be5a..952b919 100644 --- a/my/default.nix +++ b/my/default.nix @@ -9,13 +9,9 @@ with lib; let cfg = config.my; in { imports = [ + ./home/default.nix ./gnome.nix - ./home-vinzenz.nix - ./home-ronja.nix ./kde.nix - - # enable home manager - (modulesPath + "/installer/scan/not-detected.nix") ]; diff --git a/my/gnome.nix b/my/gnome.nix index 2f505c6..3044b0d 100644 --- a/my/gnome.nix +++ b/my/gnome.nix @@ -54,8 +54,8 @@ in { ]; home-manager.users = { - vinzenz = lib.mkIf config.my.users.vinzenz.enable applyGnomeUserSettings; - ronja = lib.mkIf config.my.users.ronja.enable applyGnomeUserSettings; + vinzenz = lib.mkIf config.my.home.vinzenz.enable applyGnomeUserSettings; + ronja = lib.mkIf config.my.home.ronja.enable applyGnomeUserSettings; }; }; } diff --git a/my/home/default.nix b/my/home/default.nix new file mode 100644 index 0000000..d32d8a7 --- /dev/null +++ b/my/home/default.nix @@ -0,0 +1,25 @@ +{ + config, + pkgs, + lib, + ... +}: +with lib; let + cfg = config.my.home; +in { + imports = [ + ./vinzenz.nix + ./ronja.nix + # enable home manager + + ]; + + options.my.home = { + enable = lib.mkEnableOption "my home management"; + }; + + config = lib.mkIf cfg.enable { + home-manager.useUserPackages = true; + home-manager.useGlobalPkgs = true; + }; +} diff --git a/my/home-ronja.nix b/my/home/ronja.nix similarity index 95% rename from my/home-ronja.nix rename to my/home/ronja.nix index c8cf4a2..0b11bea 100644 --- a/my/home-ronja.nix +++ b/my/home/ronja.nix @@ -5,9 +5,9 @@ ... }: with lib; let - cfg = config.my.users.ronja; + cfg = config.my.home.ronja; in { - options.my.users.ronja = { + options.my.home.ronja = { enable = lib.mkEnableOption "user ronja"; }; @@ -21,8 +21,7 @@ in { }; # home manager - home-manager.useUserPackages = true; - home-manager.useGlobalPkgs = true; + my.home.enable = true; home-manager.users.ronja = { config, pkgs, diff --git a/my/home-vinzenz.nix b/my/home/vinzenz.nix similarity index 97% rename from my/home-vinzenz.nix rename to my/home/vinzenz.nix index 21a70b7..7846eee 100644 --- a/my/home-vinzenz.nix +++ b/my/home/vinzenz.nix @@ -4,9 +4,9 @@ lib, ... }: let - cfg = config.my.users.vinzenz; + cfg = config.my.home.vinzenz; in { - options.my.users.vinzenz = { + options.my.home.vinzenz = { enable = lib.mkEnableOption "user vinzenz"; }; @@ -20,8 +20,7 @@ in { }; # home manager - home-manager.useUserPackages = true; - home-manager.useGlobalPkgs = true; + my.home.enable = true; home-manager.users.vinzenz = { config, pkgs, diff --git a/my/kde.nix b/my/kde.nix index e874c50..87b0835 100644 --- a/my/kde.nix +++ b/my/kde.nix @@ -5,6 +5,18 @@ ... }: let cfg = config.my.kde; + + applyKdeUserSettings = { + home = { + packages = with pkgs; [ + ]; + }; + + services.kdeconnect = { + enable = true; + indicator = true; + }; + }; in { options.my.kde = { enable = lib.mkEnableOption "KDE desktop"; @@ -40,20 +52,9 @@ in { partition-manager.enable = true; }; - home-manager.users.vinzenz = { - config, - pkgs, - ... - }: { - home = { - packages = with pkgs; [ - ]; - }; - - services.kdeconnect = { - enable = true; - indicator = true; - }; + home-manager.users = { + vinzenz = lib.mkIf config.my.home.vinzenz.enable applyKdeUserSettings; + ronja = lib.mkIf config.my.home.ronja.enable applyKdeUserSettings; }; }; } diff --git a/vinzenz-lpt.nix b/vinzenz-lpt.nix index 2b2da57..39c3068 100644 --- a/vinzenz-lpt.nix +++ b/vinzenz-lpt.nix @@ -10,7 +10,7 @@ networking.hostName = "vinzenz-lpt"; my.gnome.enable = true; - my.users.vinzenz.enable = true; + my.home.vinzenz.enable = true; services.flatpak.enable = true; diff --git a/vinzenz-pc3.nix b/vinzenz-pc3.nix index 2b961db..d2a35d2 100644 --- a/vinzenz-pc3.nix +++ b/vinzenz-pc3.nix @@ -10,7 +10,7 @@ networking.hostName = "vinzenz-pc3"; my.kde.enable = true; - my.users = { + my.home = { vinzenz.enable = true; ronja.enable = true; };