From f7e19996cffd28fc08bdd371a6bbc427154cfca3 Mon Sep 17 00:00:00 2001 From: solidsnakedev Date: Wed, 22 Nov 2023 21:23:24 -0500 Subject: [PATCH] improve structure --- flake.nix | 25 +++++++------------ home-manager/{server => homeserver}/home.nix | 19 ++++++++++---- .../local-modules/neovim.nix | 0 {nixos => hosts/nixos}/configuration.nix | 0 .../nixos}/hardware-configuration.nix | 0 .../common-modules => modules}/bat.nix | 0 .../common-modules => modules}/direnv.nix | 0 .../common-modules => modules}/fish.nix | 0 .../common-modules => modules}/git.nix | 0 .../common-modules => modules}/tmux.nix | 0 10 files changed, 23 insertions(+), 21 deletions(-) rename home-manager/{server => homeserver}/home.nix (75%) rename home-manager/{server => homeserver}/local-modules/neovim.nix (100%) rename {nixos => hosts/nixos}/configuration.nix (100%) rename {nixos => hosts/nixos}/hardware-configuration.nix (100%) rename {home-manager/common-modules => modules}/bat.nix (100%) rename {home-manager/common-modules => modules}/direnv.nix (100%) rename {home-manager/common-modules => modules}/fish.nix (100%) rename {home-manager/common-modules => modules}/git.nix (100%) rename {home-manager/common-modules => modules}/tmux.nix (100%) diff --git a/flake.nix b/flake.nix index ff7b109..2802c3f 100644 --- a/flake.nix +++ b/flake.nix @@ -14,32 +14,25 @@ nixos = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; modules = [ + ./hosts/nixos/configuration.nix vscode-server.nixosModule - ({ config, pkgs, ... }: { - services.vscode-server.enable = true; - }) - ./nixos/configuration.nix - home-manager.nixosModules.home-manager - { - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; - home-manager.users.homeserver = import ./home-manager/server/home.nix; - - # Optionally, use home-manager.extraSpecialArgs to pass - # arguments to home.nix - } + ({ config, pkgs, ... }: { services.vscode-server.enable = true; }) ]; }; }; # Available through 'home-manager --flake .#your-username@your-hostname' homeConfigurations = { - # FIXME replace with your username@hostname + "homeserver@nixos" = home-manager.lib.homeManagerConfiguration { + modules = [ ./home-manager/homeserver/home.nix ]; + pkgs = nixpkgs.legacyPackages.x86_64-linux; + extraSpecialArgs = { inherit inputs; }; + }; + "jonathan" = home-manager.lib.homeManagerConfiguration { + modules = [ ./home-manager/mac/home.nix ]; pkgs = nixpkgs.legacyPackages.aarch64-darwin; # Home-manager requires 'pkgs' instance extraSpecialArgs = { inherit inputs; }; # Pass flake inputs to our config - # > Our main home-manager configuration file < - modules = [ ./home-manager/mac/home.nix ]; }; }; }; diff --git a/home-manager/server/home.nix b/home-manager/homeserver/home.nix similarity index 75% rename from home-manager/server/home.nix rename to home-manager/homeserver/home.nix index 22f3e35..a500121 100644 --- a/home-manager/server/home.nix +++ b/home-manager/homeserver/home.nix @@ -38,12 +38,21 @@ gnumake ]; + programs.starship = { + enable = true; + enableFishIntegration = true; + enableZshIntegration = false; + settings = { + command_timeout = 1000; + }; + }; + imports = [ - ./../common-modules/fish.nix - ./../common-modules/direnv.nix - ./../common-modules/git.nix - ./../common-modules/tmux.nix - ./../common-modules/bat.nix + ./../../modules/fish.nix + ./../../modules/direnv.nix + ./../../modules/git.nix + ./../../modules/tmux.nix + ./../../modules/bat.nix ./local-modules/neovim.nix ]; diff --git a/home-manager/server/local-modules/neovim.nix b/home-manager/homeserver/local-modules/neovim.nix similarity index 100% rename from home-manager/server/local-modules/neovim.nix rename to home-manager/homeserver/local-modules/neovim.nix diff --git a/nixos/configuration.nix b/hosts/nixos/configuration.nix similarity index 100% rename from nixos/configuration.nix rename to hosts/nixos/configuration.nix diff --git a/nixos/hardware-configuration.nix b/hosts/nixos/hardware-configuration.nix similarity index 100% rename from nixos/hardware-configuration.nix rename to hosts/nixos/hardware-configuration.nix diff --git a/home-manager/common-modules/bat.nix b/modules/bat.nix similarity index 100% rename from home-manager/common-modules/bat.nix rename to modules/bat.nix diff --git a/home-manager/common-modules/direnv.nix b/modules/direnv.nix similarity index 100% rename from home-manager/common-modules/direnv.nix rename to modules/direnv.nix diff --git a/home-manager/common-modules/fish.nix b/modules/fish.nix similarity index 100% rename from home-manager/common-modules/fish.nix rename to modules/fish.nix diff --git a/home-manager/common-modules/git.nix b/modules/git.nix similarity index 100% rename from home-manager/common-modules/git.nix rename to modules/git.nix diff --git a/home-manager/common-modules/tmux.nix b/modules/tmux.nix similarity index 100% rename from home-manager/common-modules/tmux.nix rename to modules/tmux.nix