Add more complex user setup for eliribble

Includes fish functions and neovim via nix
This commit is contained in:
Eli Ribble 2025-07-16 13:37:35 -07:00
parent 0c8fea347a
commit c022445849
13 changed files with 153 additions and 20 deletions

View file

@ -0,0 +1,5 @@
function refresh_tmux_vars --on-event="fish_preexec"
if set -q TMUX
tmux showenv -s | string replace -rf '^((?:SSH|DISPLAY).*?)=(".*?"); export.*' 'set -gx $1 $2' | source
end
end

View file

@ -0,0 +1,9 @@
set indentexpr=
set noautoindent
set nocindent
set noexpandtab
set nosmartindent
set nosmarttab
set nu
set tabstop=4
filetype indent off

View file

@ -0,0 +1,9 @@
set indentexpr=
set noautoindent
set nocindent
set noexpandtab
set nosmartindent
set nosmarttab
set nu
set tabstop=4
filetype indent off

View file

@ -0,0 +1,2 @@
colorscheme koehler
set nu

View file

@ -35,9 +35,13 @@
modules = [
home-manager.nixosModules.home-manager
{
home-manager.extraSpecialArgs = { inherit configFiles; };
home-manager.sharedModules = [
nixvim.homeManagerModules.nixvim
./modules/home/nixvim.nix
];
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.eliribble = import ./home.nix;
}
./host/corp/configuration.nix
./modules
@ -66,6 +70,7 @@
};
};
}
./users
];
pkgs = import nixpkgs {
config = {

View file

@ -1,10 +0,0 @@
{ config, pkgs, ... }:
{
home.file.".config/nvim/after/ftplugin/html.vim".source = ./home/eliribble/config/nvim/after/ftplugin/html.vim;
home.file.".config/nvim/after/ftplugin/go.vim".source = ./home/eliribble/config/nvim/after/ftplugin/go.vim;
home.file.".config/tmux/tmux.conf".source = ./home/eliribble/config/tmux/tmux.conf;
home.homeDirectory = "/home/eliribble";
home.stateVersion = "24.11";
home.username = "eliribble";
}

View file

@ -115,15 +115,6 @@
extraGroups = [ "deploy" ];
isNormalUser = true;
};
users.users.eliribble = {
extraGroups = [ "wheel" ]; # Enable sudo for the user.
initialHashedPassword = "$y$j9T$XYOMZR8RZEiTnpaF8lsxv1$H7YbWDpzbnYXTLN0ZMhvtKOlSMy64P7C/RdLBaeaNf/";
isNormalUser = true;
openssh.authorizedKeys.keys = ["ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBvhtF6nRWlA6PVs71Eek7p0p2PxTd3P6ZEGFV2t75MB eliribble@nixos"];
};
users.users.root.openssh.authorizedKeys.keys = [
''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBvhtF6nRWlA6PVs71Eek7p0p2PxTd3P6ZEGFV2t75MB eliribble@nixos''
];
users.users.vikunja = {
group = "vikunja";
isNormalUser = false;

6
modules/home/default.nix Normal file
View file

@ -0,0 +1,6 @@
{
imports = [
./fish.nix
./neovim.nix
];
}

28
modules/home/fish.nix Normal file
View file

@ -0,0 +1,28 @@
{ config, lib, pkgs, configFiles, ... }:
with lib;
{
options.myModules.home.fish = {
enable = mkEnableOption "custom fish configuration";
user = mkOption {
type = types.str;
description = "Username for user-specific config";
};
};
config = mkIf config.myModules.home.fish.enable (
let
userConfigPath = "${configFiles}/users/${config.myModules.home.fish.user}/fish";
# Use user-specific config if it exists, otherwise fall back to shared
configPath = (configFiles + "/users/${config.myModules.home.fish.user}/fish");
in {
# Use the correct Home Manager option
home.file.".config/fish" = {
source = configPath;
recursive = true;
};
}
);
}

33
modules/home/neovim.nix Normal file
View file

@ -0,0 +1,33 @@
{ config, lib, pkgs, configFiles, ... }:
with lib;
{
options.myModules.home.neovim = {
enable = mkEnableOption "custom neovim configuration";
user = mkOption {
type = types.str;
description = "Username for user-specific config";
};
};
config = mkIf config.myModules.home.neovim.enable (
let
userConfigPath = "${configFiles}/users/${config.myModules.home.neovim.user}/nvim";
sharedConfigPath = "${configFiles}/shared/nvim";
# Use user-specific config if it exists, otherwise fall back to shared
configPath = if builtins.pathExists (configFiles + "/users/${config.myModules.home.neovim.user}/nvim")
then userConfigPath
else sharedConfigPath;
in {
programs.neovim.enable = true;
# Use the correct Home Manager option
home.file.".config/nvim" = {
source = configPath;
recursive = true;
};
}
);
}

18
modules/home/nixvim.nix Normal file
View file

@ -0,0 +1,18 @@
{
programs.nixvim = {
colorschemes.catppuccin.enable = true;
enable = true;
opts = {
number = true;
};
plugins.lsp = {
enable = true;
servers = {
# golang
gopls = {
enable = true;
};
};
};
};
}

5
users/default.nix Normal file
View file

@ -0,0 +1,5 @@
{
imports = [
./eliribble.nix
];
}

32
users/eliribble.nix Normal file
View file

@ -0,0 +1,32 @@
{ config, lib, pkgs, configFiles, ... }:
with lib;
{
home-manager.users.eliribble = { pkgs, ... }: {
imports = [ ../modules/home ];
myModules.home = {
fish = {
enable = true;
user = "eliribble";
};
#neovim = {
#enable = true;
#user = "eliribble";
#};
};
home.stateVersion = "25.05";
};
users.users.eliribble = {
extraGroups = [ "docker" "wheel" ];
isNormalUser = true;
initialHashedPassword = "$y$j9T$pXXR8iNU81XAghZWEXVrC/$Xp4nL6FrTAZ3DnJkcx.zi0q2SGk8KUz8YfejkAoWSE.";
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBvhtF6nRWlA6PVs71Eek7p0p2PxTd3P6ZEGFV2t75MB eliribble@nixos"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHL1SpT3KR8XeXtH19muncYVrKxWzWdWtJYNTwoJGTm3 eliribble@Elis-Mac-mini.local"
];
};
}