Improved zsh and migrate ssh

This commit is contained in:
Matthew Bessette 2024-07-25 22:34:05 -04:00
parent 1945dbbdda
commit af2c3219ce
7 changed files with 43 additions and 50 deletions

View File

@ -82,30 +82,22 @@
# Enable touchpad support (enabled default in most desktopManager).
# services.xserver.libinput.enable = true;
# Define a user account. Don't forget to set a password with passwd.
# users.users.mbessette = {
# isNormalUser = true;
# description = "Matthew Bessette";
# extraGroups = [ "networkmanager" "wheel" ];
# packages = with pkgs; [];
# };
###########
# MUTABLE #
###########
# Allow unfree packages
nixpkgs.config.allowUnfree = true;
nix.settings.experimental-features = [ "nix-command" "flakes" ];
home-manager = {
extraSpecialArgs = { inherit inputs; inherit system; };
backupFileExtension = "backup";
users.mbessette = import ./home.nix;
};
# Allow unfree packages
nixpkgs.config.allowUnfree = true;
nix.settings.experimental-features = [ "nix-command" "flakes" ];
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [
@ -127,6 +119,7 @@
############
programs.zsh.enable = true;
virtualisation.docker.enable = true;
############
# SERVICES #

View File

@ -1,14 +1,12 @@
{ config, pkgs, inputs, ... }:
let
agentPath = "~/.1password/agent.sock";
in
{
imports = [
../../home-manager-modules
];
firefox.enable = true;
ssh.enable = true;
vscode.enable = true;
zsh.enable = true;
@ -37,22 +35,7 @@ in
# '';
};
# Home Manager can also manage your environment variables through
# 'home.sessionVariables'. These will be explicitly sourced when using a
# shell provided by Home Manager. If you don't want to manage your shell
# through Home Manager then you have to manually source 'hm-session-vars.sh'
# located at either
#
# ~/.nix-profile/etc/profile.d/hm-session-vars.sh
#
# or
#
# ~/.local/state/nix/profiles/profile/etc/profile.d/hm-session-vars.sh
#
# or
#
# /etc/profiles/per-user/mbessette/etc/profile.d/hm-session-vars.sh
#
home.sessionVariables = {
EDITOR = "vim";
};
@ -65,17 +48,6 @@ in
userName = "Matthew Bessette";
};
programs.ssh = {
enable = true;
extraConfig = ''
Host *
IdentityAgent ${agentPath}
Host bromine
HostName 192.168.1.247
User mbessette
'';
};
nixpkgs = {
config.allowUnfreePredicate = pkg:
builtins.elem (pkgs.lib.getName pkg) [

View File

@ -80,6 +80,7 @@
############
programs.zsh.enable = true;
programs.earthly.enable = true;
############
# SERVICES #

View File

@ -1,6 +1,7 @@
{
imports = [
./firefox.nix
./ssh.nix
./vscode.nix
./zsh.nix
];

View File

@ -0,0 +1,23 @@
{ config, lib, ... }:
let
cfg = config.ssh;
agentPath = "~/.1password/agent.sock";
in
{
options = {
ssh.enable = lib.mkEnableOption "enable ssh module";
};
config.programs.ssh = lib.mkIf cfg.enable {
enable = true;
extraConfig = ''
Host *
IdentityAgent ${agentPath}
Host bromine
HostName 192.168.1.200
User mbessette
ForwardAgent yes
'';
};
}

View File

@ -10,10 +10,13 @@ in
config.programs.zsh = lib.mkIf cfg.enable {
enable = true;
# ohMyZsh.enable = true;
# ohMyZsh.theme = "robbyrussell";
# ohMyZsh.plugins = [
# "git"
# ];
autosuggestion.enable = true;
syntaxHighlighting.enable = true;
oh-my-zsh.enable = true;
oh-my-zsh.theme = "robbyrussell";
oh-my-zsh.plugins = [
"git"
"npm"
];
};
}

View File

@ -18,7 +18,7 @@ in
initialPassword = "12345";
description = "main user";
shell = pkgs.zsh;
extraGroups = [ "networkmanager" "wheel" "docker"];
extraGroups = [ "networkmanager" "wheel" "docker" ];
packages = with pkgs; [];
openssh.authorizedKeys.keys = [
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCxwgo35pdtk5dJKYBNLk723yvxmaJzN87KW3L2U82nY5HTYkMP6eoLN2S71RRN0deSE9//1xE3Pj1RXUates5Bq42csEa0s791VEC3zWdTlYeVaHbGgyRIOtNv6s5celwvqYZkMERbvbz/7cmTbOuQf5bdvopS7tofzj83s5iwOO8pmayavZ/xWSOfau07z0Sj2KuJSjqGkLtFD9P4o9BeNc3ZxghaMidZtpUNgSq/n06aph+dZOCLQpAQlQPIxqowGX/gQSailYId0SfAtuTesFvdgi9xkokia2erxv0RVbnblSZuucYoNdEm/sAX3bMxG9mLGxpyeIRfZjNynhzQh6jk4xLNsNszWVhmh49nrBADwmjXS6vO/QT8aaByKwJNmkPZxRMOquy18bZeEOl+Qya/Ui0g9diL3c6Mqmz4SwrWiROo70nFiInEMPAl/sXZSfpWsiFsAqqV2WyFKTNBzIM+XYE8wZf5h8thh8YuE3uGduR86u9HH7IU+fNCPR0="