feat(servers): setup home manager.
This commit is contained in:
parent
fd482cd146
commit
58c9fc74b1
4 changed files with 139 additions and 36 deletions
19
flake.nix
19
flake.nix
|
@ -172,57 +172,72 @@
|
|||
|
||||
nixosConfigurations = {
|
||||
heimdall = nixpkgs.lib.nixosSystem {
|
||||
specialArgs = {inherit inputs;};
|
||||
system = "x86_64-linux";
|
||||
modules = [
|
||||
disko.nixosModules.disko
|
||||
agenix.nixosModules.default
|
||||
home-manager.nixosModules.home-manager
|
||||
./hosts/heimdall/configuration.nix
|
||||
./modules/servers/general
|
||||
./modules/servers/heimdall
|
||||
./modules/servers/home-manager
|
||||
];
|
||||
};
|
||||
|
||||
loki = nixpkgs.lib.nixosSystem {
|
||||
specialArgs = {inherit inputs;};
|
||||
system = "x86_64-linux";
|
||||
modules = [
|
||||
disko.nixosModules.disko
|
||||
agenix.nixosModules.default
|
||||
home-manager.nixosModules.home-manager
|
||||
./hosts/loki/configuration.nix
|
||||
./modules/servers/general
|
||||
./modules/servers/loki
|
||||
./modules/servers/home-manager
|
||||
];
|
||||
};
|
||||
|
||||
baldur = nixpkgs.lib.nixosSystem {
|
||||
specialArgs = {inherit inputs;};
|
||||
system = "aarch64-linux";
|
||||
modules = [
|
||||
disko.nixosModules.disko
|
||||
agenix.nixosModules.default
|
||||
home-manager.nixosModules.home-manager
|
||||
./hosts/baldur/configuration.nix
|
||||
./modules/servers/general
|
||||
./modules/servers/baldur
|
||||
./modules/servers/home-manager
|
||||
];
|
||||
};
|
||||
|
||||
bragi = nixpkgs.lib.nixosSystem {
|
||||
specialArgs = {inherit inputs;};
|
||||
system = "aarch64-linux";
|
||||
modules = [
|
||||
disko.nixosModules.disko
|
||||
agenix.nixosModules.default
|
||||
home-manager.nixosModules.home-manager
|
||||
./hosts/bragi/configuration.nix
|
||||
./modules/servers/general
|
||||
./modules/servers/bragi
|
||||
./modules/servers/home-manager
|
||||
];
|
||||
};
|
||||
|
||||
thor = nixpkgs.lib.nixosSystem {
|
||||
specialArgs = {inherit inputs;};
|
||||
system = "aarch64-linux";
|
||||
modules = [
|
||||
disko.nixosModules.disko
|
||||
agenix.nixosModules.default
|
||||
home-manager.nixosModules.home-manager
|
||||
./hosts/thor/configuration.nix
|
||||
./modules/servers/general
|
||||
./modules/servers/thor
|
||||
./modules/servers/home-manager
|
||||
];
|
||||
};
|
||||
|
||||
|
@ -232,9 +247,11 @@
|
|||
modules = [
|
||||
disko.nixosModules.disko
|
||||
agenix.nixosModules.default
|
||||
home-manager.nixosModules.home-manager
|
||||
./hosts/odin/configuration.nix
|
||||
./modules/servers/general
|
||||
./modules/servers/odin
|
||||
./modules/servers/home-manager
|
||||
];
|
||||
};
|
||||
|
||||
|
@ -244,9 +261,11 @@
|
|||
modules = [
|
||||
disko.nixosModules.disko
|
||||
agenix.nixosModules.default
|
||||
home-manager.nixosModules.home-manager
|
||||
./hosts/freyja/configuration.nix
|
||||
./modules/servers/general
|
||||
./modules/servers/freyja
|
||||
./modules/servers/home-manager
|
||||
];
|
||||
};
|
||||
|
||||
|
|
|
@ -3,40 +3,5 @@
|
|||
shell = pkgs.zsh;
|
||||
};
|
||||
|
||||
programs.zsh = {
|
||||
enable = true;
|
||||
enableCompletion = true;
|
||||
autosuggestions.enable = true;
|
||||
# historySubstringSearch.enable = true;
|
||||
|
||||
shellAliases = {
|
||||
# General aliases
|
||||
grep = "grep --color=auto";
|
||||
cp = "cp -iv";
|
||||
rm = "rm -iv";
|
||||
mkd = "mkdir -pv";
|
||||
less = "less -R";
|
||||
df = "df -h -x devtmpfs -x tmpfs -x usbfs -x loop";
|
||||
free = "free -mht";
|
||||
# nnn on crack
|
||||
nnn = ''LC_COLLATE="C" nnn -xeaiH'';
|
||||
# Buku powerup
|
||||
b = "buku -p";
|
||||
# fzf shenanigans
|
||||
vif = ''nvim $(fzf --preview="bat --color=always {}")'';
|
||||
};
|
||||
|
||||
# antidote = {
|
||||
# enable = true;
|
||||
# plugins = [
|
||||
# "zap-zsh/supercharge"
|
||||
# "zap-zsh/completions"
|
||||
# "zap-zsh/vim"
|
||||
# "chivalryq/git-alias"
|
||||
# "zdharma-continuum/fast-syntax-highlighting"
|
||||
# "zsh-users/zsh-history-substring-search"
|
||||
# "MichaelAquilina/zsh-you-should-use"
|
||||
# ];
|
||||
# };
|
||||
};
|
||||
programs.zsh.enable = true;
|
||||
}
|
||||
|
|
10
modules/servers/home-manager/default.nix
Normal file
10
modules/servers/home-manager/default.nix
Normal file
|
@ -0,0 +1,10 @@
|
|||
{inputs, ...}: {
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.extraSpecialArgs = {inherit inputs;};
|
||||
home-manager.backupFileExtension = "backup";
|
||||
home-manager.users.root = {
|
||||
imports = [
|
||||
./home.nix
|
||||
];
|
||||
};
|
||||
}
|
109
modules/servers/home-manager/home.nix
Normal file
109
modules/servers/home-manager/home.nix
Normal file
|
@ -0,0 +1,109 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
# basic info
|
||||
home.username = "root";
|
||||
home.homeDirectory = "/root";
|
||||
|
||||
# Setup zsh
|
||||
programs.zsh = {
|
||||
enable = true;
|
||||
enableCompletion = true;
|
||||
autosuggestion.enable = true;
|
||||
historySubstringSearch.enable = true;
|
||||
|
||||
dotDir = "${config.home.homeDirectory}/.config/zsh";
|
||||
|
||||
shellAliases = {
|
||||
# General aliases
|
||||
cp = "cp -iv";
|
||||
rm = "rm -iv";
|
||||
mkd = "mkdir -pv";
|
||||
less = "less -R";
|
||||
df = "df -h -x devtmpfs -x tmpfs -x usbfs -x loop";
|
||||
free = "free -mht";
|
||||
};
|
||||
|
||||
antidote = {
|
||||
enable = true;
|
||||
plugins = [
|
||||
"zap-zsh/supercharge"
|
||||
"zap-zsh/completions"
|
||||
"zap-zsh/vim"
|
||||
"chivalryq/git-alias"
|
||||
"zdharma-continuum/fast-syntax-highlighting"
|
||||
"zsh-users/zsh-history-substring-search"
|
||||
"MichaelAquilina/zsh-you-should-use"
|
||||
];
|
||||
};
|
||||
|
||||
initContent = ''
|
||||
${pkgs.nerdfetch}/bin/nerdfetch
|
||||
# VI Mode escape timeout fix
|
||||
export KEYTIMEOUT=1
|
||||
|
||||
# Substring search settings
|
||||
export HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND="bg=blue,fg=black,bold"
|
||||
export HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_NOT_FOUND='bg=red,fg=black,bold'
|
||||
bindkey -M vicmd 'k' history-substring-search-up
|
||||
bindkey -M vicmd 'j' history-substring-search-down
|
||||
'';
|
||||
};
|
||||
|
||||
home.packages = with pkgs; [
|
||||
unzip
|
||||
p7zip
|
||||
aria2
|
||||
];
|
||||
|
||||
# Install fzf
|
||||
programs.fzf = {
|
||||
enable = true;
|
||||
enableZshIntegration = true;
|
||||
defaultCommand = "fd --type f";
|
||||
};
|
||||
|
||||
# Install starship
|
||||
programs.starship = {
|
||||
enable = true;
|
||||
enableZshIntegration = true;
|
||||
settings = {
|
||||
add_newline = false;
|
||||
};
|
||||
};
|
||||
|
||||
# Install zoxide
|
||||
programs.zoxide = {
|
||||
enable = true;
|
||||
enableZshIntegration = true;
|
||||
};
|
||||
|
||||
# Install eza
|
||||
programs.eza = {
|
||||
enable = true;
|
||||
enableZshIntegration = true;
|
||||
git = true;
|
||||
icons = "always";
|
||||
};
|
||||
|
||||
# Install tealdeer
|
||||
programs.tealdeer.enable = true;
|
||||
|
||||
# Install fd
|
||||
programs.fd = {
|
||||
enable = true;
|
||||
hidden = true;
|
||||
ignores = ["~/Documents/Share" ".git"];
|
||||
};
|
||||
|
||||
# Install btop
|
||||
programs.btop.enable = true;
|
||||
|
||||
# Let home manager install and manage itself
|
||||
programs.home-manager.enable = true;
|
||||
|
||||
# DO NOT CHANGE
|
||||
home.stateVersion = "24.11"; # Please read the comment before changing.
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue