diff --git a/home/base/core.nix b/home/base/core.nix index 0c5e9b3a..d7c9fc1e 100644 --- a/home/base/core.nix +++ b/home/base/core.nix @@ -3,7 +3,7 @@ # paths it should manage. home = { inherit username; - homeDirectory = "/home/${username}"; + # This value determines the Home Manager release that your # configuration is compatible with. This helps avoid breakage diff --git a/home/darwin/core.nix b/home/darwin/core.nix index 8632eeea..5a4bea40 100644 --- a/home/darwin/core.nix +++ b/home/darwin/core.nix @@ -1,44 +1,3 @@ -{pkgs, ...}: { - ########################################################################## - # - # MacOS specific home configuration - # - ########################################################################## - programs.zsh = { - enable = true; - }; - - programs.ssh = { - enable = true; - - # all my ssh private key are generated by `ssh-keygen -t ed25519 -C "ryan@nickname"` - # the config's format: - # Host — given the pattern used to match against the host name given on the command line. - # HostName — specify nickname or abbreviation for host - # IdentityFile — the location of your SSH key authentication file for the account. - # format in details: - # https://www.ssh.com/academy/ssh/config - extraConfig = '' - # a private key that is used during authentication will be added to ssh-agent if it is running - AddKeysToAgent yes - - Host 192.168.* - # allow to securely use local SSH agent to authenticate on the remote machine. - # It has the same effect as adding cli option `ssh -A user@host` - ForwardAgent yes - # romantic holds my homelab~ - IdentityFile ~/.ssh/romantic - # Specifies that ssh should only use the identity file explicitly configured above - # required to prevent sending default identity files first. - IdentitiesOnly yes - - Host github.com - Hostname github.com - # github is controlled by gluttony~ - IdentityFile ~/.ssh/harmonica - # Specifies that ssh should only use the identity file explicitly configured above - # required to prevent sending default identity files first. - IdentitiesOnly yes - ''; - }; +{username, ...}: { + home.homeDirectory = "/Users/${username}"; } diff --git a/home/darwin/default.nix b/home/darwin/default.nix index 268ed41e..e0eb98ba 100644 --- a/home/darwin/default.nix +++ b/home/darwin/default.nix @@ -1,7 +1,8 @@ {mylib, ...}: { imports = (mylib.scanPaths ./.) - // [ + ++ [ + ../base/server ../base/desktop ../base/core.nix ]; diff --git a/home/darwin/shell.nix b/home/darwin/shell.nix index c47a304d..24759905 100644 --- a/home/darwin/shell.nix +++ b/home/darwin/shell.nix @@ -1,13 +1,53 @@ -_: { +{ # Homebrew's default install location: # /opt/homebrew for Apple Silicon # /usr/local for macOS Intel # The prefix /opt/homebrew was chosen to allow installations # in /opt/homebrew for Apple Silicon and /usr/local for Rosetta 2 to coexist and use bottles. - programs.bash.bashrcExtra = '' - export PATH="/opt/homebrew/bin:/usr/local/bin:$PATH" - ''; - programs.zsh.envExtra = '' - export PATH="/opt/homebrew/bin:/usr/local/bin:$PATH" - ''; + programs.bash = { + enable = true; + bashrcExtra = '' + export PATH="/opt/homebrew/bin:/usr/local/bin:$PATH" + ''; + }; + programs.zsh = { + enable = true; + envExtra = '' + export PATH="/opt/homebrew/bin:/usr/local/bin:$PATH" + ''; + }; + + programs.ssh = { + enable = true; + + # all my ssh private key are generated by `ssh-keygen -t ed25519 -C "ryan@nickname"` + # the config's format: + # Host — given the pattern used to match against the host name given on the command line. + # HostName — specify nickname or abbreviation for host + # IdentityFile — the location of your SSH key authentication file for the account. + # format in details: + # https://www.ssh.com/academy/ssh/config + extraConfig = '' + # a private key that is used during authentication will be added to ssh-agent if it is running + AddKeysToAgent yes + + Host 192.168.* + # allow to securely use local SSH agent to authenticate on the remote machine. + # It has the same effect as adding cli option `ssh -A user@host` + ForwardAgent yes + # romantic holds my homelab~ + IdentityFile ~/.ssh/romantic + # Specifies that ssh should only use the identity file explicitly configured above + # required to prevent sending default identity files first. + IdentitiesOnly yes + + Host github.com + Hostname github.com + # github is controlled by gluttony~ + IdentityFile ~/.ssh/harmonica + # Specifies that ssh should only use the identity file explicitly configured above + # required to prevent sending default identity files first. + IdentitiesOnly yes + ''; + }; } diff --git a/home/linux/base/shell.nix b/home/linux/base/shell.nix index 69cbf6b3..04bd35cb 100644 --- a/home/linux/base/shell.nix +++ b/home/linux/base/shell.nix @@ -1,8 +1,12 @@ -{config, ...}: let + +{config, username, ...}: let d = config.xdg.dataHome; c = config.xdg.configHome; cache = config.xdg.cacheHome; in rec { + + home.homeDirectory = "/home/${username}"; + # add environment variables systemd.user.sessionVariables = { # clean up ~