From 57d59a9deaf597dd9f2c13bca621819b8797291b Mon Sep 17 00:00:00 2001 From: John Lancaster <32917998+jsl12@users.noreply.github.com> Date: Mon, 30 Jun 2025 22:45:04 -0500 Subject: [PATCH] options --- flake.nix | 3 +-- git.nix | 7 +++++-- home.nix | 36 +++++++++++++++++++++++++++++++++++- options.nix | 12 ++++++++++++ shell.nix | 18 ------------------ 5 files changed, 53 insertions(+), 23 deletions(-) delete mode 100644 shell.nix diff --git a/flake.nix b/flake.nix index bf62f77..00161e1 100644 --- a/flake.nix +++ b/flake.nix @@ -16,12 +16,11 @@ lib = pkgs.lib; in { - homeManagerModules.default = { config, pkgs, ... }: { + homeManagerModules.default = { ... }: { imports = [ ./options.nix ./home.nix ./git.nix - ./shell.nix ]; }; }; diff --git a/git.nix b/git.nix index 95259b0..b962748 100644 --- a/git.nix +++ b/git.nix @@ -3,12 +3,15 @@ programs.git = lib.mkMerge [ { enable = true; - extraConfig.credential.helper = "store --file ~/.git-credentials"; + extraConfig = { + credential.helper = "store --file ~/.git-credentials"; + init.defaultBranch = "main"; + push.autoSetupRemote = true; + }; } (lib.mkIf (config.profile == "personal") { userName = "John Lancaster"; userEmail = "32917998+jsl12@users.noreply.github.com"; - }) (lib.mkIf (config.profile == "work") { userName = "John Lancaster"; diff --git a/home.nix b/home.nix index b8225c0..7a09716 100644 --- a/home.nix +++ b/home.nix @@ -86,5 +86,39 @@ # Let Home Manager install and manage itself. programs.home-manager.enable = true; - # programs.ssh.enable = true; + programs.zsh = lib.mkIf config.shell { + enable = true; + enableCompletion = true; + autosuggestion.enable = true; + syntaxHighlighting.enable = true; + oh-my-zsh = { + enable = true; + theme = "risto"; + plugins = [ + "sudo" + "dotenv" + "git" + "ssh" + "ssh-agent" + ]; + }; + shellAliases.ls = "${pkgs.eza}/bin/eza -lgos type --no-time"; + }; + + programs.ssh = lib.mkIf config.ssh { + enable = true; + extraConfig = '' + SetEnv TERM="xterm-256color" + ''; + matchBlocks = lib.mkIf (config.profile == "personal") { + "panoptes" = { + hostname = "192.168.1.107"; + user = "panoptes"; + }; + "pve5070" = { + hostname = "192.168.1.130"; + user = "root"; + }; + }; + }; } diff --git a/options.nix b/options.nix index 7a90622..a8e1eae 100644 --- a/options.nix +++ b/options.nix @@ -11,4 +11,16 @@ default = "personal"; description = "Profile type for the Home Manager configuration."; }; + + options.shell = lib.mkOption { + type = lib.types.bool; + default = true; + description = "Whether to enable all the zsh stuff"; + }; + + options.ssh = lib.mkOption { + type = lib.types.bool; + default = true; + description = "Whether to enable SSH configuration"; + }; } diff --git a/shell.nix b/shell.nix deleted file mode 100644 index df858c4..0000000 --- a/shell.nix +++ /dev/null @@ -1,18 +0,0 @@ -{ lib, pkgs, ... }: -{ - home.shell.enableZshIntegration = true; - programs.zsh = { - enable = true; - oh-my-zsh = { - enable = true; - theme = "risto"; - plugins = [ - "sudo" - "dotenv" - "git" - "ssh" - "ssh-agent" - ]; - }; - shellAliases.ls = "${pkgs.eza}/bin/eza -lgos type --no-time"; -}; \ No newline at end of file