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

@ -83,29 +83,21 @@
# Enable touchpad support (enabled default in most desktopManager). # Enable touchpad support (enabled default in most desktopManager).
# services.xserver.libinput.enable = true; # 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 # # MUTABLE #
########### ###########
# Allow unfree packages
nixpkgs.config.allowUnfree = true;
nix.settings.experimental-features = [ "nix-command" "flakes" ];
home-manager = { home-manager = {
extraSpecialArgs = { inherit inputs; inherit system; }; extraSpecialArgs = { inherit inputs; inherit system; };
backupFileExtension = "backup"; backupFileExtension = "backup";
users.mbessette = import ./home.nix; 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: # List packages installed in system profile. To search, run:
# $ nix search wget # $ nix search wget
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
@ -127,6 +119,7 @@
############ ############
programs.zsh.enable = true; programs.zsh.enable = true;
virtualisation.docker.enable = true;
############ ############
# SERVICES # # SERVICES #

View File

@ -1,14 +1,12 @@
{ config, pkgs, inputs, ... }: { config, pkgs, inputs, ... }:
let
agentPath = "~/.1password/agent.sock";
in
{ {
imports = [ imports = [
../../home-manager-modules ../../home-manager-modules
]; ];
firefox.enable = true; firefox.enable = true;
ssh.enable = true;
vscode.enable = true; vscode.enable = true;
zsh.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 = { home.sessionVariables = {
EDITOR = "vim"; EDITOR = "vim";
}; };
@ -65,17 +48,6 @@ in
userName = "Matthew Bessette"; userName = "Matthew Bessette";
}; };
programs.ssh = {
enable = true;
extraConfig = ''
Host *
IdentityAgent ${agentPath}
Host bromine
HostName 192.168.1.247
User mbessette
'';
};
nixpkgs = { nixpkgs = {
config.allowUnfreePredicate = pkg: config.allowUnfreePredicate = pkg:
builtins.elem (pkgs.lib.getName pkg) [ builtins.elem (pkgs.lib.getName pkg) [

View File

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

View File

@ -1,6 +1,7 @@
{ {
imports = [ imports = [
./firefox.nix ./firefox.nix
./ssh.nix
./vscode.nix ./vscode.nix
./zsh.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 { config.programs.zsh = lib.mkIf cfg.enable {
enable = true; enable = true;
# ohMyZsh.enable = true; autosuggestion.enable = true;
# ohMyZsh.theme = "robbyrussell"; syntaxHighlighting.enable = true;
# ohMyZsh.plugins = [ oh-my-zsh.enable = true;
# "git" oh-my-zsh.theme = "robbyrussell";
# ]; oh-my-zsh.plugins = [
"git"
"npm"
];
}; };
} }