From 20389d4f53c9dcde345f8151b32061609d9c0776 Mon Sep 17 00:00:00 2001 From: Tyrel Souza Date: Mon, 2 Jan 2023 11:56:47 -0500 Subject: [PATCH] aww yeah imports --- hosts/_common/home.nix | 24 +++++++++++ hosts/_common/homepkgs.nix | 73 -------------------------------- hosts/_common/programs.nix | 32 ++++++++++++++ hosts/_common/xdg.nix | 14 ++++++ hosts/ts-tl-mbp/home-manager.nix | 18 +++----- 5 files changed, 77 insertions(+), 84 deletions(-) create mode 100644 hosts/_common/home.nix delete mode 100644 hosts/_common/homepkgs.nix create mode 100644 hosts/_common/programs.nix create mode 100644 hosts/_common/xdg.nix diff --git a/hosts/_common/home.nix b/hosts/_common/home.nix new file mode 100644 index 0000000..7db5f7d --- /dev/null +++ b/hosts/_common/home.nix @@ -0,0 +1,24 @@ +{ pkgs, ... }: +{ + home.stateVersion = "22.05"; + home.sessionVariables = { + XDG_CONFIG_HOME = "/Users/tyrel/.config"; + PAGER = "less -R"; + EDITOR = "nvim"; + }; + home.packages = with pkgs; [ + bat + ctags + exa + fzf + ripgrep + wget + ]; + + home.file = { + ".tmux.conf" = { + source = ../../home/tmux.conf; + recursive = true; + }; + }; +} diff --git a/hosts/_common/homepkgs.nix b/hosts/_common/homepkgs.nix deleted file mode 100644 index beed1c9..0000000 --- a/hosts/_common/homepkgs.nix +++ /dev/null @@ -1,73 +0,0 @@ -{ pkgs, ... }: -{ - home.stateVersion = "22.05"; - home.sessionVariables = { - PAGER = "less -R"; - EDITOR = "nvim"; - }; - - home.packages = with pkgs; [ - bat - ctags - exa - fzf - ripgrep - wget - ]; - - programs.tmux = { - enable = true; - }; - home.file = { - ".tmux.conf" = { - source = ../../home/tmux.conf; - recursive = true; - }; - }; - - programs.git = { - enable = true; - includes = [ - { path = "~/code/tyrel.dev/dotfiles/home/gitconfig"; } - ]; - aliases = { - ap = "add -p"; - }; - extraConfig = { - pull.ff = "only"; - }; - }; - - programs.neovim = { - enable = true; - }; - programs.fish = { - enable = true; - }; - - - - programs.htop = { - enable = true; - }; - #xdg.configFile = { - # "htop" = { - # source = ../../home/config/htop; - # recursive = true; - # }; - #}; - - - - # XDG CONFIGS - xdg.configFile = { - "nvim" = { - source = ../../home/config/nvim; - recursive = true; - }; - "fish" = { - source = ../../home/config/fish; - recursive = true; - }; - }; -} diff --git a/hosts/_common/programs.nix b/hosts/_common/programs.nix new file mode 100644 index 0000000..62ad1e4 --- /dev/null +++ b/hosts/_common/programs.nix @@ -0,0 +1,32 @@ +{ pkgs, ... }: +{ + programs.home-manager.enable = true; + programs.tmux = { + enable = true; + }; + + programs.git = { + enable = true; + includes = [ + { path = "~/code/tyrel.dev/dotfiles/home/gitconfig"; } + ]; + aliases = { + ap = "add -p"; + }; + extraConfig = { + pull.ff = "only"; + }; + }; + + programs.neovim = { + enable = true; + }; + programs.fish = { + enable = true; + }; + + + programs.htop = { + enable = true; + }; +} diff --git a/hosts/_common/xdg.nix b/hosts/_common/xdg.nix new file mode 100644 index 0000000..d730ea5 --- /dev/null +++ b/hosts/_common/xdg.nix @@ -0,0 +1,14 @@ +{ pkgs, ... }: +{ + xdg.configFile = { + "nvim" = { + source = ../../home/config/nvim; + recursive = true; + }; + "fish" = { + source = ../../home/config/fish; + recursive = true; + }; + }; + +} diff --git a/hosts/ts-tl-mbp/home-manager.nix b/hosts/ts-tl-mbp/home-manager.nix index 3b97c5f..d5231ec 100644 --- a/hosts/ts-tl-mbp/home-manager.nix +++ b/hosts/ts-tl-mbp/home-manager.nix @@ -3,21 +3,17 @@ home-manager.useGlobalPkgs = true; home-manager.useUserPackages = true; home-manager.users.tyrel = { pkgs, ... }: { - programs.home-manager.enable = true; - home.stateVersion = "22.05"; - home.sessionVariables = { - XDG_CONFIG_HOME = "/Users/tyrel/.config"; - }; - - # Load Common Packages - common = pkgs.callPackage ../_common/homepkgs.nix {}; + # Common Imports + imports = [ + ../_common/home.nix + ../_common/programs.nix + ../_common/xdg.nix + ]; # XDG CONFIGS - xdg.configFile = { - "karabiner" = { + xdg.configFile."karabiner" = { source = ../../home/config/karabiner; recursive = true; - }; }; }; # -- HomeManager