From f5191640f57e92759bd8d40283dd288cadf96e24 Mon Sep 17 00:00:00 2001 From: Katherina Walshe-Grey Date: Thu, 29 Aug 2024 17:55:30 +0100 Subject: [PATCH] home-manager: move all config together, allow for multiple users --- common/default.nix | 1 + common/home-manager.nix | 18 ++++++++++++++++++ common/users/qenya.nix | 8 -------- flake.nix | 5 ----- home/{ => qenya}/cli.nix | 0 home/{ => qenya}/dconf/appearance.nix | 0 home/{ => qenya}/dconf/background-image.jpg | Bin home/{ => qenya}/dconf/default.nix | 0 home/{ => qenya}/dconf/keyboard.nix | 0 home/{ => qenya}/default.nix | 0 home/{ => qenya}/git.nix | 0 home/{ => qenya}/tmux.nix | 0 home/{ => qenya}/vscode.nix | 0 home/{ => qenya}/zsh.nix | 0 14 files changed, 19 insertions(+), 13 deletions(-) create mode 100644 common/home-manager.nix rename home/{ => qenya}/cli.nix (100%) rename home/{ => qenya}/dconf/appearance.nix (100%) rename home/{ => qenya}/dconf/background-image.jpg (100%) rename home/{ => qenya}/dconf/default.nix (100%) rename home/{ => qenya}/dconf/keyboard.nix (100%) rename home/{ => qenya}/default.nix (100%) rename home/{ => qenya}/git.nix (100%) rename home/{ => qenya}/tmux.nix (100%) rename home/{ => qenya}/vscode.nix (100%) rename home/{ => qenya}/zsh.nix (100%) diff --git a/common/default.nix b/common/default.nix index 6465876..2430901 100644 --- a/common/default.nix +++ b/common/default.nix @@ -3,6 +3,7 @@ ./sysadmin ./users ./environment.nix + ./home-manager.nix ./nginx.nix ./openssh.nix ./security.nix diff --git a/common/home-manager.nix b/common/home-manager.nix new file mode 100644 index 0000000..6740dbc --- /dev/null +++ b/common/home-manager.nix @@ -0,0 +1,18 @@ +{ config, lib, pkgs, ... }: + +{ + home-manager = { + useUserPackages = true; + useGlobalPkgs = true; + + users = { + qenya = { config, lib, pkgs, osConfig, ... }: { + home.homeDirectory = osConfig.users.users.qenya.home; + + imports = [ + ../home/qenya + ]; + }; + }; + }; +} diff --git a/common/users/qenya.nix b/common/users/qenya.nix index 00f35af..14b0458 100644 --- a/common/users/qenya.nix +++ b/common/users/qenya.nix @@ -14,12 +14,4 @@ in { openssh.authorizedKeys.keys = keys.users.qenya; uid = 1001; }; - - home-manager.users.qenya = { config, lib, pkgs, osConfig, ... }: { - home.homeDirectory = osConfig.users.users.qenya.home; - - imports = [ - ../../home - ]; - }; } diff --git a/flake.nix b/flake.nix index c86693f..68f65da 100644 --- a/flake.nix +++ b/flake.nix @@ -47,11 +47,6 @@ overlays = [ nur.overlay ]; }; - home-manager = { - useUserPackages = true; - useGlobalPkgs = true; - }; - imports = [ home-manager.nixosModules.home-manager nur.nixosModules.nur diff --git a/home/cli.nix b/home/qenya/cli.nix similarity index 100% rename from home/cli.nix rename to home/qenya/cli.nix diff --git a/home/dconf/appearance.nix b/home/qenya/dconf/appearance.nix similarity index 100% rename from home/dconf/appearance.nix rename to home/qenya/dconf/appearance.nix diff --git a/home/dconf/background-image.jpg b/home/qenya/dconf/background-image.jpg similarity index 100% rename from home/dconf/background-image.jpg rename to home/qenya/dconf/background-image.jpg diff --git a/home/dconf/default.nix b/home/qenya/dconf/default.nix similarity index 100% rename from home/dconf/default.nix rename to home/qenya/dconf/default.nix diff --git a/home/dconf/keyboard.nix b/home/qenya/dconf/keyboard.nix similarity index 100% rename from home/dconf/keyboard.nix rename to home/qenya/dconf/keyboard.nix diff --git a/home/default.nix b/home/qenya/default.nix similarity index 100% rename from home/default.nix rename to home/qenya/default.nix diff --git a/home/git.nix b/home/qenya/git.nix similarity index 100% rename from home/git.nix rename to home/qenya/git.nix diff --git a/home/tmux.nix b/home/qenya/tmux.nix similarity index 100% rename from home/tmux.nix rename to home/qenya/tmux.nix diff --git a/home/vscode.nix b/home/qenya/vscode.nix similarity index 100% rename from home/vscode.nix rename to home/qenya/vscode.nix diff --git a/home/zsh.nix b/home/qenya/zsh.nix similarity index 100% rename from home/zsh.nix rename to home/qenya/zsh.nix