Get home-manager configurations working

This commit is contained in:
GRMrGecko 2024-05-16 00:13:09 -05:00
parent 3b8a6567b2
commit 6ce8b4264e
13 changed files with 106 additions and 4 deletions

1
dotfiles Submodule

@ -0,0 +1 @@
Subproject commit 3c006855689bcaeb401e2b52c979ce4c57cd8fd5

View File

@ -76,6 +76,7 @@
homeConfigurations = {
${settings.user.name} = mkHome ./users/main-user.nix;
"root" = mkHome ./users/root.nix;
};
};
}

View File

@ -11,7 +11,7 @@ if [[ -n $nixHostOverride ]]; then
fi
# Confirm host configuration is available; If not, we should not continue.
if ! grep -q "nixosConfigurations.$host" flake.nix; then
if ! grep -q "nixosConfigurations.$host " flake.nix; then
host="default"
fi

View File

@ -0,0 +1,8 @@
{pkgs, settings, ...}:
{
home.file = {
".config/mpv".source = ../../../dotfiles/.config/mpv;
".config/polybar".source = ../../../dotfiles/.config/polybar;
};
}

View File

@ -0,0 +1,7 @@
{pkgs, settings, ...}:
{
imports = [
./desktop.nix
];
}

View File

@ -1,8 +1,57 @@
{pkgs, settings, ...}:
{
home.file = {
".config/zsh/plugins/zsh-autosuggestions".source = "${pkgs.zsh-autosuggestions}/share/zsh-autosuggestions";
".config/zsh/plugins/fast-syntax-highlighting".source = "${pkgs.zsh-fast-syntax-highlighting}/share/zsh/site-functions";
".config/zsh/plugins/nix-zsh-completions".source = "${pkgs.nix-zsh-completions}/share/zsh/plugins/nix";
".config/zsh/plugins/pure".source = "${pkgs.pure-prompt}/share/zsh/site-functions";
".config/zsh/functions".source = ../../dotfiles/.config/zsh/functions;
".config/zsh/keybinds.zsh".source = ../../dotfiles/.config/zsh/keybinds.zsh;
};
programs.zsh = {
enable = true;
dotDir = ".config/zsh";
envExtra = ''
export EDITOR="vim"
export TERMINAL="konsole"
export TERM="konsole"
export BROWSER="firefox"
export VIDEO="mpv"
export OPENER="xdg-open"
'';
initExtra = ''
# Set emacs key binding.
bindkey -e
# Import functions.
source "$ZDOTDIR/functions"
# Set custom key bindings.
zsh_add_config keybinds.zsh
# Configure pure-prompt.
export PURE_PROMPT_SYMBOL="$"
if [ "$USER" = "root" ]; then
export PURE_PROMPT_SYMBOL="#"
fi
export PROMPT_PURE_SSH_CONNECTION=YES
zsh_fpath_plugin sindresorhus/pure
autoload -U promptinit; promptinit
zstyle :prompt:pure:user color cyan
zstyle :prompt:pure:host color white
zstyle ':prompt:pure:prompt:*' color white
prompt pure
# Add extra plugins.
zsh_add_plugin zdharma-continuum/fast-syntax-highlighting
ZSH_AUTOSUGGEST_STRATEGY=(history completion)
zsh_add_plugin zsh-users/zsh-autosuggestions
# Show off the system.
${pkgs.fastfetch}/bin/fastfetch
'';
};
}

View File

@ -91,6 +91,10 @@
# Nix Package Auto Cleanup
nix = {
settings.auto-optimise-store = true;
optimise = {
automatic = true;
dates = [ "03:45" ];
};
gc = {
automatic = true;
dates = "weekly";

View File

@ -67,6 +67,9 @@
vlc
kdePackages.k3b
# Desktop
polybar
# Software defined radio
gqrx
];

View File

@ -45,6 +45,7 @@
};
users = {
${settings.user.name} = import ../../users/main-user.nix;
"root" = import ../../users/root.nix;
};
};
}

View File

@ -11,7 +11,7 @@ if [[ -n $nixHostOverride ]]; then
fi
# Confirm host configuration is available; If not, we should not continue.
if ! grep -q "nixosConfigurations.$host" flake.nix; then
if ! grep -q "nixosConfigurations.$host " flake.nix; then
host="default"
fi

View File

@ -11,7 +11,7 @@ if [[ -n $nixHostOverride ]]; then
fi
# Confirm host configuration is available; If not, we should not continue.
if ! grep -q "nixosConfigurations.$host" flake.nix; then
if ! grep -q "nixosConfigurations.$host " flake.nix; then
host="default"
fi

View File

@ -4,7 +4,12 @@
imports = [
../modules/home/git.nix
../modules/home/zsh.nix
];
] ++ (if (builtins.pathExists ../modules/home/profiles/${settings.profile}.nix)
then
[ ../modules/home/profiles/${settings.profile}.nix ]
else
[]
);
home.username = settings.user.name;
home.homeDirectory = "/home/${settings.user.name}";

23
users/root.nix Normal file
View File

@ -0,0 +1,23 @@
{pkgs, settings, ...}:
{
imports = [
../modules/home/zsh.nix
];
home.username = "root";
home.homeDirectory = "/root";
# Let Home Manager install and manage itself.
programs.home-manager.enable = true;
# This value determines the Home Manager release that your
# configuration is compatible with. This helps avoid breakage
# when a new Home Manager release introduces backwards
# incompatible changes.
#
# You can update Home Manager without changing this value. See
# the Home Manager release notes for a list of state version
# changes in each release.
home.stateVersion = "23.11";
}