Update from joey@joey-laptop: Switch to home-manager standalone + flake (no nixos module)

This commit is contained in:
Joey Hafner 2024-09-16 13:45:18 -07:00
parent bdd3302979
commit aa394f3e8b
4 changed files with 218 additions and 39 deletions

View File

@ -37,16 +37,14 @@
inputs.hyprland.nixosModules.default
inputs.stylix.nixosModules.stylix
inputs.nix-flatpak.nixosModules.nix-flatpak
inputs.home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.backupFileExtension = "bak";
home-manager.users.joey = import ./nixos/home.nix;
home-manager.extraSpecialArgs = { inherit pkgs-unstable; };
}
];
};
homeConfigurations = {
joey = home-manager.lib.homeManagerConfiguration {
inherit pkgs, pkgs-unstable;
modules = [ ./home-manager/joey.nix ];
};
};
};
};
}

View File

@ -5,19 +5,19 @@
home.homeDirectory = "/home/joey";
home.stateVersion = "24.05";
home.packages = with pkgs; [
fastfetch
tree
bat
btop
wl-clipboard
fd
eza
flatpak
fzf-git-sh
tmux
vesktop
base16-schemes
nixd
fastfetch
tree
bat
btop
wl-clipboard
fd
eza
flatpak
fzf-git-sh
tmux
vesktop
base16-schemes
nixd
];
# Programs
@ -63,7 +63,7 @@
"--no-user"
];
};
## vim
programs.vim = {
enable = true;
@ -85,7 +85,7 @@
set wildmode=list:longest
'';
};
## OBS-Studio
programs.obs-studio = {
enable = true;
@ -105,7 +105,7 @@
changeDirWidgetCommand = "fd --type=d --hidden --strip-cwd-prefix --exclude .git .";
enableZshIntegration = true;
};
## Git
programs.git = {
enable = true;
@ -119,7 +119,7 @@
side-by-side = true;
};
};
## Zsh
programs.zsh = {
enable = true;
@ -134,8 +134,10 @@
ls = "eza";
fetch = "fastfetch";
neofetch = "fetch";
hmu = "home-manager switch --flake ~/Jafner.net/nix";
nu = "sudo nixos-rebuild switch --flake ~/Jafner.net/nix";
ngls = "nix-env --profile /nix/var/nix/profiles/system --list-generations";
ngclean = "nix-collect-garbage --delete-old";
ngcleanboot = "/run/current-system/bin/switch-to-configuration boot";
};
history = {
share = true;
@ -158,13 +160,12 @@
bindkey '^I^I' autosuggest-accept # Tab, Tab
bindkey '^[' autosuggest-clear # Esc
_fzf_compgen_path() {
fd --hidden --exclude .git . "$1"
fd --hidden --exclude .git . "$1"
}
_fzf_compgen_dir() {
fd --hidden --exclude .git . "$1"
fd --hidden --exclude .git . "$1"
}
'';
'';
};
## Home-manager
@ -172,3 +173,4 @@
enable = true;
};
}

View File

@ -13,15 +13,6 @@
./locale.nix
];
# Configure user joey
programs.zsh.enable = true;
users.users.joey.shell = pkgs.zsh;
users.users.joey = {
isNormalUser = true;
description = "joey";
extraGroups = [ "networkmanager" "wheel" ];
};
# DO NOT CHANGE
system.stateVersion = "24.05";
}

188
nix/nixos/joey.nix Normal file
View File

@ -0,0 +1,188 @@
{ config, pkgs, pkgs-unstable, ... }:
{
# Configure user joey
programs.zsh.enable = true;
users.users.joey.shell = pkgs.zsh;
users.users.joey = {
isNormalUser = true;
description = "joey";
extraGroups = [ "networkmanager" "wheel" ];
};
home-manager.useUserPackages = true;
home-manager.useGlobalPkgs = true;
home-manager.users.joey = { ... }: {
home.username = "joey";
home.homeDirectory = "/home/joey";
home.stateVersion = "24.05";
home.packages = with pkgs; [
fastfetch
tree
bat
btop
wl-clipboard
fd
eza
flatpak
fzf-git-sh
tmux
vesktop
base16-schemes
nixd
];
# Programs
## Hyprland
wayland.windowManager.hyprland = {
enable = true;
package = pkgs.hyprland;
plugins = [];
settings = {
};
};
## VSCodium
programs.vscode = {
enable = true;
package = pkgs.vscodium;
extensions = with pkgs.vscode-extensions; [
jnoortheen.nix-ide
continue.continue
];
userSettings = {
"nix.serverPath" = "nixd";
"nix.enableLanguageServer" = true;
};
};
## Kitty
programs.kitty = {
enable = true;
theme = "Gruvbox Material Dark Medium";
};
## eza
programs.eza = {
enable = true;
enableZshIntegration = true;
git = true;
extraOptions = [
"--color=always"
"--long"
"--icons=always"
"--no-time"
"--no-user"
];
};
## vim
programs.vim = {
enable = true;
defaultEditor = true;
settings = {
copyindent = true;
relativenumber = true;
expandtab = true;
tabstop = 2;
};
extraConfig = ''
set nocompatible
filetype on
filetype plugin on
filetype indent on
syntax on
set cursorline
set wildmenu
set wildmode=list:longest
'';
};
## OBS-Studio
programs.obs-studio = {
enable = true;
plugins = with pkgs.obs-studio-plugins; [
obs-vaapi
obs-vkcapture
input-overlay
];
};
## fzf
programs.fzf = {
enable = true;
package = pkgs-unstable.fzf;
defaultCommand = "fd --hidden --strip-cwd-prefix --exclude .git";
fileWidgetCommand = "$FZF_DEFAULT_COMMAND";
changeDirWidgetCommand = "fd --type=d --hidden --strip-cwd-prefix --exclude .git .";
enableZshIntegration = true;
};
## Git
programs.git = {
enable = true;
userName = "Joey Hafner";
userEmail = "joey@jafner.net";
extraConfig = {
core.sshCommand = "ssh -i /home/joey/.ssh/joey@joey-laptop";
};
delta.enable = true;
delta.options = {
side-by-side = true;
};
};
## Zsh
programs.zsh = {
enable = true;
dotDir = ".config/zsh";
enableCompletion = true;
autosuggestion.enable = true;
syntaxHighlighting.enable = true;
initExtraFirst = "source ${pkgs.fzf-git-sh}/share/fzf-git-sh/fzf-git.sh";
shellAliases = {
cat = "bat";
fd = "fd -Lu";
ls = "eza";
fetch = "fastfetch";
neofetch = "fetch";
nu = "sudo nixos-rebuild switch --flake ~/Jafner.net/nix";
ngls = "nix-env --profile /nix/var/nix/profiles/system --list-generations";
ngclean = "nix-collect-garbage --delete-old";
ngcleanboot = "/run/current-system/bin/switch-to-configuration boot";
};
history = {
share = true;
save = 10000;
size = 10000;
expireDuplicatesFirst = false;
extended = false;
ignoreAllDups = false;
ignoreDups = true;
};
initExtra = ''
bindkey -e
bindkey '^[[1;5A' history-search-backward # Ctrl+Up-arrow
bindkey '^[[1;5B' history-search-forward # Ctrl+Down-arrow
bindkey '^[[1;5D' backward-word # Ctrl+Left-arrow
bindkey '^[[1;5C' forward-word # Ctrl+Right-arrow
bindkey '^[[H' beginning-of-line # Home
bindkey '^[[F' end-of-line # End
bindkey '^[w' kill-region # Delete
bindkey '^I^I' autosuggest-accept # Tab, Tab
bindkey '^[' autosuggest-clear # Esc
_fzf_compgen_path() {
fd --hidden --exclude .git . "$1"
}
_fzf_compgen_dir() {
fd --hidden --exclude .git . "$1"
}
'';
};
## Home-manager
programs.home-manager = {
enable = true;
};
};
}