Compare commits

...

2 Commits

Author SHA1 Message Date
63fe9b4ac9 cleanup by gurjaka 2025-11-19 20:52:22 +01:00
828491a083 cleanup patch; thanks gurjaka! 2025-11-19 20:51:56 +01:00
6 changed files with 257 additions and 67 deletions

187
gurjaka.patch Normal file
View File

@@ -0,0 +1,187 @@
diff --git a/nixos/configuration.nix b/nixos/configuration.nix
index 1b30ea0..1cd7cd6 100644
--- a/nixos/configuration.nix
+++ b/nixos/configuration.nix
@@ -1,23 +1,25 @@
-{ config, pkgs, ... }:
-
-{
- imports =
- [ # Include the results of the hardware scan.
- ./hardware-configuration.nix
- ./modules/users/users.nix
- ];
+{pkgs, ...}: {
+ imports = [
+ # Include the results of the hardware scan.
+ ./hardware-configuration.nix
+ ./modules/users/users.nix
+ ];
# Bootloader.
- boot.loader.grub.enable = true;
- boot.loader.grub.device = "/dev/vda";
- boot.loader.grub.useOSProber = true;
+ boot.loader.grub = {
+ enable = true;
+ device = "/dev/vda";
+ useOSProber = true;
+ };
# Use latest kernel.
boot.kernelPackages = pkgs.linuxPackages_latest;
# Networking
- networking.hostName = "testVM"; # Define your hostname.
- networking.networkmanager.enable = true;
+ networking = {
+ hostName = "testVM"; # Define your hostname.
+ networkmanager.enable = true;
+ };
# Set your time zone.
time.timeZone = "Europe/Berlin";
@@ -46,14 +48,6 @@
# Configure console keymap
console.keyMap = "de";
- # Define a user account. Don't forget to set a password with passwd.
- # users.users.cerberus = {
- # isNormalUser = true;
- # description = "cerberus";
- # extraGroups = [ "networkmanager" "wheel" ];
- # packages = with pkgs; [];
- # };
-
# Allow unfree packages
nixpkgs.config.allowUnfree = true;
@@ -84,5 +78,4 @@
# networking.firewall.enable = false;
system.stateVersion = "25.05"; # Did you read the comment?
-
}
diff --git a/nixos/modules/users/packages.nix b/nixos/modules/users/packages.nix
index 36da781..49e267f 100644
--- a/nixos/modules/users/packages.nix
+++ b/nixos/modules/users/packages.nix
@@ -1,12 +1,10 @@
-{config, pkgs, ...}:
-
-{
+{pkgs, ...}: {
users.users.users.packages = with pkgs; [
- btop
- ncdu
- tmux
- curl
- bat
- nethogs
- ]
+ btop
+ ncdu
+ tmux
+ curl
+ bat
+ nethogs
+ ];
}
diff --git a/nixos/modules/users/users.nix b/nixos/modules/users/users.nix
index d35d777..7f3f395 100644
--- a/nixos/modules/users/users.nix
+++ b/nixos/modules/users/users.nix
@@ -1,14 +1,16 @@
-{config, pkgs, ...}:
-
-{
+{pkgs, ...}: let
+ user = "cerberus";
+in {
imports = [
- ./zsh.nix
+ (import ./zsh.nix {inherit pkgs user;})
+ ./zoxide.nix
];
+
# Define user account and dont forget to set a password with 'passwd'
- users.users.cerberus = {
- isNormalUser = true;
+ users.users."${user}" = {
+ isNormalUser = true;
description = "cerberus";
- extraGroups = [ "networkmanager" "wheel" ];
+ extraGroups = ["networkmanager" "wheel"];
shell = pkgs.zsh;
};
}
diff --git a/nixos/modules/users/zsh.nix b/nixos/modules/users/zsh.nix
index 2dd2f98..aa5638e 100644
--- a/nixos/modules/users/zsh.nix
+++ b/nixos/modules/users/zsh.nix
@@ -1,36 +1,37 @@
-{config, pkgs, ...}:
-
{
- users.users.cerberus.packages = with pkgs; [
- zoxide
- fzf
+ pkgs,
+ user,
+ ...
+}: {
+ users.users.${user}.packages = with pkgs; [
+ fzf
];
+
# ZSH configuration
programs.zsh = {
- enable = true;
- enableCompletion = true;
- autosuggestions.enable = true;
- syntaxHighlighting.enable = true;
- histSize = 10000;
- histFile = "$HOME/.zsh_history";
- setOptions = [
- "HIST_IGNORE_ALL_DUPS"
- "APPEND_HISTORY"
- "SHARE_HISTORY"
- "HIST_IGNORE_SPACE"
- "EXTENDED_GLOB"
- "CORRECT"
- ];
- shellInit = ''
- eval "$(zoxide init zsh)"
- eval "$(fzf --zsh)"
- '';
- };
+ enable = true;
+ enableCompletion = true;
+ autosuggestions.enable = true;
+ syntaxHighlighting.enable = true;
+ histSize = 10000;
+ histFile = "$HOME/.zsh_history";
+ setOptions = [
+ "HIST_IGNORE_ALL_DUPS"
+ "APPEND_HISTORY"
+ "SHARE_HISTORY"
+ "HIST_IGNORE_SPACE"
+ "EXTENDED_GLOB"
+ "CORRECT"
+ ];
+ shellInit = ''
+ eval "$(fzf --zsh)"
+ '';
+ };
# Setting aliases
environment.shellAliases = {
- ls = "ls -l --color --hyperlink=auto";
- # ".." = "cd ..";
- # "..." = "cd ../.."
- };
+ ls = "ls -l --color --hyperlink=auto";
+ # ".." = "cd ..";
+ # "..." = "cd ../.."
+ };
}

View File

@@ -1,23 +1,25 @@
{ config, pkgs, ... }: {pkgs, ...}: {
imports = [
{ # Include the results of the hardware scan.
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix ./hardware-configuration.nix
./modules/users/users.nix ./modules/users/users.nix
]; ];
# Bootloader. # Bootloader.
boot.loader.grub.enable = true; boot.loader.grub = {
boot.loader.grub.device = "/dev/vda"; enable = true;
boot.loader.grub.useOSProber = true; device = "/dev/vda";
useOSProber = true;
};
# Use latest kernel. # Use latest kernel.
boot.kernelPackages = pkgs.linuxPackages_latest; boot.kernelPackages = pkgs.linuxPackages_latest;
# Networking # Networking
networking.hostName = "testVM"; # Define your hostname. networking = {
networking.networkmanager.enable = true; hostName = "testVM"; # Define your hostname.
networkmanager.enable = true;
};
# Set your time zone. # Set your time zone.
time.timeZone = "Europe/Berlin"; time.timeZone = "Europe/Berlin";
@@ -46,14 +48,6 @@
# Configure console keymap # Configure console keymap
console.keyMap = "de"; console.keyMap = "de";
# Define a user account. Don't forget to set a password with passwd.
# users.users.cerberus = {
# isNormalUser = true;
# description = "cerberus";
# extraGroups = [ "networkmanager" "wheel" ];
# packages = with pkgs; [];
# };
# Allow unfree packages # Allow unfree packages
nixpkgs.config.allowUnfree = true; nixpkgs.config.allowUnfree = true;
@@ -84,5 +78,4 @@
# networking.firewall.enable = false; # networking.firewall.enable = false;
system.stateVersion = "25.05"; # Did you read the comment? system.stateVersion = "25.05"; # Did you read the comment?
} }

View File

@@ -1,6 +1,4 @@
{config, pkgs, ...}: {pkgs, ...}: {
{
users.users.users.packages = with pkgs; [ users.users.users.packages = with pkgs; [
btop btop
ncdu ncdu
@@ -8,5 +6,5 @@
curl curl
bat bat
nethogs nethogs
] ];
} }

View File

@@ -1,14 +1,16 @@
{config, pkgs, ...}: {pkgs, ...}: let
user = "cerberus";
{ in {
imports = [ imports = [
./zsh.nix (import ./zsh.nix {inherit pkgs user;})
./zoxide.nix
]; ];
# Define user account and dont forget to set a password with 'passwd' # Define user account and dont forget to set a password with 'passwd'
users.users.cerberus = { users.users."${user}" = {
isNormalUser = true; isNormalUser = true;
description = "cerberus"; description = "cerberus";
extraGroups = [ "networkmanager" "wheel" ]; extraGroups = ["networkmanager" "wheel"];
shell = pkgs.zsh; shell = pkgs.zsh;
}; };
} }

View File

@@ -0,0 +1,9 @@
{
pkgs,
...
}: {
programs.zoxide = {
enable = true;
enableZshIntegration = true;
};
}

View File

@@ -1,10 +1,12 @@
{config, pkgs, ...}:
{ {
users.users.cerberus.packages = with pkgs; [ pkgs,
zoxide user,
...
}: {
users.users.${user}.packages = with pkgs; [
fzf fzf
]; ];
# ZSH configuration # ZSH configuration
programs.zsh = { programs.zsh = {
enable = true; enable = true;
@@ -22,15 +24,14 @@
"CORRECT" "CORRECT"
]; ];
shellInit = '' shellInit = ''
eval "$(zoxide init zsh)"
eval "$(fzf --zsh)" eval "$(fzf --zsh)"
alias ..="cd .."
alias ...="cd ../.."
''; '';
}; };
# Setting aliases # Setting aliases
environment.shellAliases = { environment.shellAliases = {
ls = "ls -l --color --hyperlink=auto"; ls = "ls -l --color --hyperlink=auto";
# ".." = "cd ..";
# "..." = "cd ../.."
}; };
} }