Browse Source

Get home-manager configurations working

main
GRMrGecko 4 months ago
parent
commit
6ce8b4264e
  1. 1
      dotfiles
  2. 1
      flake.nix
  3. 2
      install.sh
  4. 8
      modules/home/profiles/desktop.nix
  5. 7
      modules/home/profiles/gaming-pc.nix
  6. 49
      modules/home/zsh.nix
  7. 4
      modules/nixos/common.nix
  8. 3
      modules/nixos/desktop.nix
  9. 1
      modules/nixos/users.nix
  10. 2
      rebuild.sh
  11. 2
      update.sh
  12. 7
      users/main-user.nix
  13. 23
      users/root.nix

1
dotfiles

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

1
flake.nix

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

2
install.sh

@ -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

8
modules/home/profiles/desktop.nix

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

7
modules/home/profiles/gaming-pc.nix

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

49
modules/home/zsh.nix

@ -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
'';
};
}

4
modules/nixos/common.nix

@ -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";

3
modules/nixos/desktop.nix

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

1
modules/nixos/users.nix

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

2
rebuild.sh

@ -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

2
update.sh

@ -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

7
users/main-user.nix

@ -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

@ -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";
}
Loading…
Cancel
Save