From 53329b8d1c4d4b6ec327255c3ce98bb66226d8d1 Mon Sep 17 00:00:00 2001 From: Martin Berg Alstad Date: Thu, 22 May 2025 20:10:48 +0200 Subject: [PATCH] :recycle: [shared] Moved Hm configs to shared base --- hosts/pi4/home-manager/default.nix | 32 ++-------------- shared/base/home-manager/default.nix | 11 +++++- .../base/home-manager/development/default.nix | 6 +++ .../home-manager/development/git.nix | 4 +- .../home-manager/development/helix.nix | 0 shared/{desktop => base}/home-manager/gpg.nix | 0 shared/base/home-manager/home-manager.nix | 20 ++++++++++ .../home-manager/shell/btop.nix | 0 shared/base/home-manager/shell/default.nix | 10 +++++ .../home-manager/shell/eza.nix | 0 .../home-manager/shell/fastfetch.nix | 0 .../home-manager/shell/fish.nix | 0 .../home-manager/shell/fzf.nix | 0 .../home-manager/shell/zoxide.nix | 0 shared/desktop/home-manager/default.nix | 37 ++++--------------- .../home-manager/development/default.nix | 2 - shared/desktop/home-manager/shell/default.nix | 6 --- 17 files changed, 60 insertions(+), 68 deletions(-) create mode 100644 shared/base/home-manager/development/default.nix rename shared/{desktop => base}/home-manager/development/git.nix (90%) rename shared/{desktop => base}/home-manager/development/helix.nix (100%) rename shared/{desktop => base}/home-manager/gpg.nix (100%) create mode 100644 shared/base/home-manager/home-manager.nix rename shared/{desktop => base}/home-manager/shell/btop.nix (100%) create mode 100644 shared/base/home-manager/shell/default.nix rename shared/{desktop => base}/home-manager/shell/eza.nix (100%) rename shared/{desktop => base}/home-manager/shell/fastfetch.nix (100%) rename shared/{desktop => base}/home-manager/shell/fish.nix (100%) rename shared/{desktop => base}/home-manager/shell/fzf.nix (100%) rename shared/{desktop => base}/home-manager/shell/zoxide.nix (100%) diff --git a/hosts/pi4/home-manager/default.nix b/hosts/pi4/home-manager/default.nix index 47866a7..6975653 100644 --- a/hosts/pi4/home-manager/default.nix +++ b/hosts/pi4/home-manager/default.nix @@ -1,33 +1,9 @@ -{ - lib, - inputs, - outputs, - systemConfig, - ... -}: +{ lib, ... }: { - imports = [ - inputs.catppuccin.homeModules.catppuccin - (lib.custom.relativeToRoot "shared/desktop/home-manager/development/git.nix") - (lib.custom.relativeToRoot "shared/desktop/home-manager/development/helix.nix") - (lib.custom.relativeToRoot "shared/desktop/home-manager/shell/btop.nix") - (lib.custom.relativeToRoot "shared/desktop/home-manager/shell/eza.nix") - (lib.custom.relativeToRoot "shared/desktop/home-manager/shell/fastfetch.nix") - (lib.custom.relativeToRoot "shared/desktop/home-manager/shell/fish.nix") - (lib.custom.relativeToRoot "shared/desktop/home-manager/shell/zoxide.nix") - (lib.custom.relativeToRoot "shared/desktop/home-manager/gpg.nix") + imports = with lib.custom; [ + (relativeToBase "home-manager") ]; - home.stateVersion = systemConfig.version; - - # Adds pkgs.unstable in order to fetch packages from unstable repositories - nixpkgs.overlays = [ outputs.overlays.unstable-packages ]; - - programs = { - git.signing.key = "E3FA0E995C0D0E5E"; - # Let Home Manager install and manage itself. - home-manager.enable = true; - }; - + programs.git.signing.key = "E3FA0E995C0D0E5E"; } diff --git a/shared/base/home-manager/default.nix b/shared/base/home-manager/default.nix index cd6e3f1..d62174d 100644 --- a/shared/base/home-manager/default.nix +++ b/shared/base/home-manager/default.nix @@ -1,3 +1,12 @@ +{ inputs, ... }: + { - imports = [ ./ssh.nix ]; + imports = [ + inputs.catppuccin.homeModules.catppuccin + ./development + ./shell + ./gpg.nix + ./home-manager.nix + ./ssh.nix + ]; } diff --git a/shared/base/home-manager/development/default.nix b/shared/base/home-manager/development/default.nix new file mode 100644 index 0000000..2c416c4 --- /dev/null +++ b/shared/base/home-manager/development/default.nix @@ -0,0 +1,6 @@ +{ + imports = [ + ./git.nix + ./helix.nix + ]; +} diff --git a/shared/desktop/home-manager/development/git.nix b/shared/base/home-manager/development/git.nix similarity index 90% rename from shared/desktop/home-manager/development/git.nix rename to shared/base/home-manager/development/git.nix index 94eafd9..789ae13 100644 --- a/shared/desktop/home-manager/development/git.nix +++ b/shared/base/home-manager/development/git.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: +{ pkgs, common, ... }: { home.packages = with pkgs; [ @@ -14,7 +14,7 @@ enable = true; package = package; userName = "Martin Berg Alstad"; - userEmail = "git@martials.no"; + userEmail = "git@${common.domain}"; aliases = { amend = "commit --amend"; diff --git a/shared/desktop/home-manager/development/helix.nix b/shared/base/home-manager/development/helix.nix similarity index 100% rename from shared/desktop/home-manager/development/helix.nix rename to shared/base/home-manager/development/helix.nix diff --git a/shared/desktop/home-manager/gpg.nix b/shared/base/home-manager/gpg.nix similarity index 100% rename from shared/desktop/home-manager/gpg.nix rename to shared/base/home-manager/gpg.nix diff --git a/shared/base/home-manager/home-manager.nix b/shared/base/home-manager/home-manager.nix new file mode 100644 index 0000000..80264ae --- /dev/null +++ b/shared/base/home-manager/home-manager.nix @@ -0,0 +1,20 @@ +{ + outputs, + systemConfig, + common, + ... +}: + +{ + home = { + username = systemConfig.username; + homeDirectory = common.dir.home; + stateVersion = systemConfig.version; + }; + + # Adds pkgs.unstable in order to fetch packages from unstable repositories + nixpkgs.overlays = [ outputs.overlays.unstable-packages ]; + + # Let Home Manager install and manage itself. + programs.home-manager.enable = true; +} diff --git a/shared/desktop/home-manager/shell/btop.nix b/shared/base/home-manager/shell/btop.nix similarity index 100% rename from shared/desktop/home-manager/shell/btop.nix rename to shared/base/home-manager/shell/btop.nix diff --git a/shared/base/home-manager/shell/default.nix b/shared/base/home-manager/shell/default.nix new file mode 100644 index 0000000..5c11bdc --- /dev/null +++ b/shared/base/home-manager/shell/default.nix @@ -0,0 +1,10 @@ +{ + imports = [ + ./btop.nix + ./eza.nix + ./fastfetch.nix + ./fish.nix + ./fzf.nix + ./zoxide.nix + ]; +} diff --git a/shared/desktop/home-manager/shell/eza.nix b/shared/base/home-manager/shell/eza.nix similarity index 100% rename from shared/desktop/home-manager/shell/eza.nix rename to shared/base/home-manager/shell/eza.nix diff --git a/shared/desktop/home-manager/shell/fastfetch.nix b/shared/base/home-manager/shell/fastfetch.nix similarity index 100% rename from shared/desktop/home-manager/shell/fastfetch.nix rename to shared/base/home-manager/shell/fastfetch.nix diff --git a/shared/desktop/home-manager/shell/fish.nix b/shared/base/home-manager/shell/fish.nix similarity index 100% rename from shared/desktop/home-manager/shell/fish.nix rename to shared/base/home-manager/shell/fish.nix diff --git a/shared/desktop/home-manager/shell/fzf.nix b/shared/base/home-manager/shell/fzf.nix similarity index 100% rename from shared/desktop/home-manager/shell/fzf.nix rename to shared/base/home-manager/shell/fzf.nix diff --git a/shared/desktop/home-manager/shell/zoxide.nix b/shared/base/home-manager/shell/zoxide.nix similarity index 100% rename from shared/desktop/home-manager/shell/zoxide.nix rename to shared/base/home-manager/shell/zoxide.nix diff --git a/shared/desktop/home-manager/default.nix b/shared/desktop/home-manager/default.nix index 8377e87..74ec40c 100644 --- a/shared/desktop/home-manager/default.nix +++ b/shared/desktop/home-manager/default.nix @@ -1,9 +1,6 @@ { - inputs, - outputs, lib, common, - systemConfig, ... }: let @@ -12,41 +9,23 @@ in { imports = [ (lib.custom.relativeToBase "home-manager") - inputs.catppuccin.homeModules.catppuccin + ./development + ./hyprland + ./media + ./rofi + ./shell + ./zen ./cursors.nix ./default-applications.nix - ./development ./freetube.nix ./gtk.nix - ./gpg.nix ./kitty.nix - ./media ./nextcloud.nix - ./rofi - ./hyprland - ./shell ./sioyek.nix ./spicetify.nix - ./zen ]; - home = { - username = systemConfig.username; - homeDirectory = dir.home; - - sessionVariables = { - XDG_PICTURES_DIR = dir.pictures; # Define the default dir for pictures - }; - - # You can update Home Manager without changing this value. See - # the Home Manager release notes for a list of state version - # changes in each release. - stateVersion = systemConfig.version; + home.sessionVariables = { + XDG_PICTURES_DIR = dir.pictures; # Define the default dir for pictures }; - - # Adds pkgs.unstable in order to fetch packages from unstable repositories - nixpkgs.overlays = [ outputs.overlays.unstable-packages ]; - - # Let Home Manager install and manage itself. - programs.home-manager.enable = true; } diff --git a/shared/desktop/home-manager/development/default.nix b/shared/desktop/home-manager/development/default.nix index 9481377..fa43e85 100644 --- a/shared/desktop/home-manager/development/default.nix +++ b/shared/desktop/home-manager/development/default.nix @@ -1,7 +1,5 @@ { imports = [ - ./git.nix - ./helix.nix ./zed.nix ]; # TODO set Wayland vmOptions in Jetbrains products, Requires current installed version in path diff --git a/shared/desktop/home-manager/shell/default.nix b/shared/desktop/home-manager/shell/default.nix index 6e97753..854b9a9 100644 --- a/shared/desktop/home-manager/shell/default.nix +++ b/shared/desktop/home-manager/shell/default.nix @@ -1,12 +1,6 @@ { imports = [ - ./btop.nix ./cava - ./eza.nix - ./fastfetch.nix - ./fish.nix - ./fzf.nix ./yazi - ./zoxide.nix ]; }