fix: darwin

This commit is contained in:
Ryan Yin
2023-12-24 00:54:31 +08:00
parent 1e9dc4df4b
commit 73a746cebd
5 changed files with 57 additions and 53 deletions
+1 -1
View File
@@ -3,7 +3,7 @@
# paths it should manage. # paths it should manage.
home = { home = {
inherit username; inherit username;
homeDirectory = "/home/${username}";
# This value determines the Home Manager release that your # This value determines the Home Manager release that your
# configuration is compatible with. This helps avoid breakage # configuration is compatible with. This helps avoid breakage
+2 -43
View File
@@ -1,44 +1,3 @@
{pkgs, ...}: { {username, ...}: {
########################################################################## home.homeDirectory = "/Users/${username}";
#
# 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
'';
};
} }
+2 -1
View File
@@ -1,7 +1,8 @@
{mylib, ...}: { {mylib, ...}: {
imports = imports =
(mylib.scanPaths ./.) (mylib.scanPaths ./.)
// [ ++ [
../base/server
../base/desktop ../base/desktop
../base/core.nix ../base/core.nix
]; ];
+47 -7
View File
@@ -1,13 +1,53 @@
_: { {
# Homebrew's default install location: # Homebrew's default install location:
# /opt/homebrew for Apple Silicon # /opt/homebrew for Apple Silicon
# /usr/local for macOS Intel # /usr/local for macOS Intel
# The prefix /opt/homebrew was chosen to allow installations # 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. # in /opt/homebrew for Apple Silicon and /usr/local for Rosetta 2 to coexist and use bottles.
programs.bash.bashrcExtra = '' programs.bash = {
export PATH="/opt/homebrew/bin:/usr/local/bin:$PATH" enable = true;
''; bashrcExtra = ''
programs.zsh.envExtra = '' export PATH="/opt/homebrew/bin:/usr/local/bin:$PATH"
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
'';
};
} }
+5 -1
View File
@@ -1,8 +1,12 @@
{config, ...}: let
{config, username, ...}: let
d = config.xdg.dataHome; d = config.xdg.dataHome;
c = config.xdg.configHome; c = config.xdg.configHome;
cache = config.xdg.cacheHome; cache = config.xdg.cacheHome;
in rec { in rec {
home.homeDirectory = "/home/${username}";
# add environment variables # add environment variables
systemd.user.sessionVariables = { systemd.user.sessionVariables = {
# clean up ~ # clean up ~