Regenerated
This commit is contained in:
+423
-368
File diff suppressed because it is too large
Load Diff
+72
-17
@@ -901,15 +901,54 @@ in
|
|||||||
** =generated/modules/traveldroid/apps/zsh.nix=
|
** =generated/modules/traveldroid/apps/zsh.nix=
|
||||||
This sets up the zsh in the terminal
|
This sets up the zsh in the terminal
|
||||||
#+BEGIN_SRC nix :tangle generated/modules/traveldroid/apps/zsh.nix :noweb yes :mkdirp yes :eval never
|
#+BEGIN_SRC nix :tangle generated/modules/traveldroid/apps/zsh.nix :noweb yes :mkdirp yes :eval never
|
||||||
# --- This file has been auto-generated. For permanent changes alter the appropriate block in the README.org. ---
|
|
||||||
{ lib, config, pkgs, flakeRoot, ... }:
|
{ lib, config, pkgs, flakeRoot, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
|
#################################
|
||||||
|
# User config
|
||||||
|
#################################
|
||||||
username = config.defaultUser or "henrov";
|
username = config.defaultUser or "henrov";
|
||||||
generatedZsh = "${flakeRoot}/generated/.config/zsh/.zshrc";
|
generatedZsh = "${flakeRoot}/generated/.config/zsh/.zshrc";
|
||||||
|
|
||||||
|
#################################
|
||||||
|
# Alias parsing
|
||||||
|
#################################
|
||||||
|
aliasFile = "${flakeRoot}/generated/assets/aliases.conf";
|
||||||
|
content = builtins.readFile aliasFile;
|
||||||
|
|
||||||
|
lines =
|
||||||
|
lib.filter (l: l != "")
|
||||||
|
(map (l:
|
||||||
|
let
|
||||||
|
noComment = builtins.head (lib.splitString "#" l);
|
||||||
|
in lib.trim noComment
|
||||||
|
) (lib.splitString "\n" content));
|
||||||
|
|
||||||
|
parseLine = line:
|
||||||
|
let
|
||||||
|
parts = lib.splitString "=" line;
|
||||||
|
in
|
||||||
|
if lib.length parts < 2 then null else {
|
||||||
|
name = lib.trim (lib.head parts);
|
||||||
|
value = lib.trim (lib.concatStringsSep "=" (lib.tail parts));
|
||||||
|
};
|
||||||
|
|
||||||
|
parsed =
|
||||||
|
lib.filter (x: x != null)
|
||||||
|
(map parseLine lines);
|
||||||
|
|
||||||
|
functions =
|
||||||
|
lib.concatStringsSep "\n"
|
||||||
|
(map (x: ''
|
||||||
|
${x.name}() {
|
||||||
|
${x.value} "$@"
|
||||||
|
}
|
||||||
|
'') parsed);
|
||||||
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
#################################
|
#################################
|
||||||
# Install Zsh, Oh My Zsh, Starship and syntax highlighting system-wide
|
# Packages
|
||||||
#################################
|
#################################
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
zsh
|
zsh
|
||||||
@@ -919,39 +958,51 @@ in
|
|||||||
];
|
];
|
||||||
|
|
||||||
#################################
|
#################################
|
||||||
# Set Zsh to use ~/.config/zsh as its config directory
|
# Zsh config location
|
||||||
#################################
|
#################################
|
||||||
environment.etc."zshenv".text = ''
|
environment.etc."zshenv".text = ''
|
||||||
export ZDOTDIR=$HOME/.config/zsh
|
export ZDOTDIR=$HOME/.config/zsh
|
||||||
'';
|
'';
|
||||||
|
|
||||||
#################################
|
#################################
|
||||||
# Deploy global zshrc for all users
|
# Generated alias functions (system-wide)
|
||||||
|
#################################
|
||||||
|
environment.etc."profile.d/99-alias-functions.sh".text = ''
|
||||||
|
# system-wide functions generated from aliases.conf
|
||||||
|
${functions}
|
||||||
|
'';
|
||||||
|
|
||||||
|
#################################
|
||||||
|
# Global zshrc
|
||||||
#################################
|
#################################
|
||||||
environment.etc."zshrc".text = ''
|
environment.etc."zshrc".text = ''
|
||||||
export ZSH=${pkgs.oh-my-zsh}/share/oh-my-zsh
|
export ZSH=${pkgs.oh-my-zsh}/share/oh-my-zsh
|
||||||
ZSH_THEME=""
|
ZSH_THEME=""
|
||||||
plugins=(git sudo extract colored-man-pages command-not-found history docker kubectl)
|
plugins=(git sudo extract colored-man-pages command-not-found history docker kubectl)
|
||||||
|
|
||||||
source $ZSH/oh-my-zsh.sh
|
source $ZSH/oh-my-zsh.sh
|
||||||
|
|
||||||
# Load optional per-user generated zshrc if it exists
|
# Init starship FIRST (prompt)
|
||||||
[ -f "${generatedZsh}" ] && source "${generatedZsh}"
|
|
||||||
|
|
||||||
# Initialize Starship prompt
|
|
||||||
eval "$(starship init zsh)"
|
eval "$(starship init zsh)"
|
||||||
|
|
||||||
# Syntax highlighting — must be sourced last
|
# Load alias functions
|
||||||
|
if [ -f /etc/profile.d/99-alias-functions.sh ]; then
|
||||||
|
source /etc/profile.d/99-alias-functions.sh
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Load optional generated user config
|
||||||
|
[ -f "${generatedZsh}" ] && source "${generatedZsh}"
|
||||||
|
|
||||||
|
# Syntax highlighting MUST be last
|
||||||
source ${pkgs.zsh-syntax-highlighting}/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
|
source ${pkgs.zsh-syntax-highlighting}/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
|
||||||
'';
|
'';
|
||||||
|
|
||||||
#################################
|
#################################
|
||||||
# Set Zsh as default login shell for the user via Home Manager
|
# Home Manager integration
|
||||||
#################################
|
#################################
|
||||||
home-manager.users = {
|
home-manager.users.${username} = {
|
||||||
${username} = {
|
programs.zsh.enable = true;
|
||||||
programs.zsh.enable = true;
|
home.file.".config/zsh/.zshrc".source = generatedZsh;
|
||||||
home.file.".config/zsh/.zshrc".source = generatedZsh;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
@@ -1360,9 +1411,9 @@ in
|
|||||||
|
|
||||||
* generated/modules/traveldroid/system
|
* generated/modules/traveldroid/system
|
||||||
|
|
||||||
** =generated/modules/traveldroid/system/aliases.nix=
|
** =generated/parked/modules/traveldroid/system/aliases.nix=
|
||||||
This file makes aliases in ./generated/assets/aliases.conf system-wide available
|
This file makes aliases in ./generated/assets/aliases.conf system-wide available
|
||||||
#+BEGIN_SRC nix :tangle generated/modules/traveldroid/system/aliases.nix :noweb yes :mkdirp yes :eval never
|
#+BEGIN_SRC nix :tangle generated/parked/modules/traveldroid/system/aliases.nix :noweb yes :mkdirp yes :eval never
|
||||||
{ lib, pkgs, flakeRoot,... }:
|
{ lib, pkgs, flakeRoot,... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
@@ -1408,6 +1459,10 @@ in
|
|||||||
environment.shellInit = ''
|
environment.shellInit = ''
|
||||||
source /etc/profile
|
source /etc/profile
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
interactiveShellInit = ''
|
||||||
|
source /etc/profile.d/99-alias-functions.sh
|
||||||
|
'';
|
||||||
}
|
}
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,52 @@
|
|||||||
# --- This file has been auto-generated. For permanent changes alter the appropriate block in the README.org. ---
|
# --- This file has been auto-generated. For permanent changes alter the appropriate block in the README.org. ---
|
||||||
# --- This file has been auto-generated. For permanent changes alter the appropriate block in the README.org. ---
|
|
||||||
{ lib, config, pkgs, flakeRoot, ... }:
|
{ lib, config, pkgs, flakeRoot, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
|
#################################
|
||||||
|
# User config
|
||||||
|
#################################
|
||||||
username = config.defaultUser or "henrov";
|
username = config.defaultUser or "henrov";
|
||||||
generatedZsh = "${flakeRoot}/generated/.config/zsh/.zshrc";
|
generatedZsh = "${flakeRoot}/generated/.config/zsh/.zshrc";
|
||||||
|
|
||||||
|
#################################
|
||||||
|
# Alias parsing
|
||||||
|
#################################
|
||||||
|
aliasFile = "${flakeRoot}/generated/assets/aliases.conf";
|
||||||
|
content = builtins.readFile aliasFile;
|
||||||
|
|
||||||
|
lines =
|
||||||
|
lib.filter (l: l != "")
|
||||||
|
(map (l:
|
||||||
|
let
|
||||||
|
noComment = builtins.head (lib.splitString "#" l);
|
||||||
|
in lib.trim noComment
|
||||||
|
) (lib.splitString "\n" content));
|
||||||
|
|
||||||
|
parseLine = line:
|
||||||
|
let
|
||||||
|
parts = lib.splitString "=" line;
|
||||||
|
in
|
||||||
|
if lib.length parts < 2 then null else {
|
||||||
|
name = lib.trim (lib.head parts);
|
||||||
|
value = lib.trim (lib.concatStringsSep "=" (lib.tail parts));
|
||||||
|
};
|
||||||
|
|
||||||
|
parsed =
|
||||||
|
lib.filter (x: x != null)
|
||||||
|
(map parseLine lines);
|
||||||
|
|
||||||
|
functions =
|
||||||
|
lib.concatStringsSep "\n"
|
||||||
|
(map (x: ''
|
||||||
|
${x.name}() {
|
||||||
|
${x.value} "$@"
|
||||||
|
}
|
||||||
|
'') parsed);
|
||||||
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
#################################
|
#################################
|
||||||
# Install Zsh, Oh My Zsh, Starship and syntax highlighting system-wide
|
# Packages
|
||||||
#################################
|
#################################
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
zsh
|
zsh
|
||||||
@@ -17,38 +56,50 @@ in
|
|||||||
];
|
];
|
||||||
|
|
||||||
#################################
|
#################################
|
||||||
# Set Zsh to use ~/.config/zsh as its config directory
|
# Zsh config location
|
||||||
#################################
|
#################################
|
||||||
environment.etc."zshenv".text = ''
|
environment.etc."zshenv".text = ''
|
||||||
export ZDOTDIR=$HOME/.config/zsh
|
export ZDOTDIR=$HOME/.config/zsh
|
||||||
'';
|
'';
|
||||||
|
|
||||||
#################################
|
#################################
|
||||||
# Deploy global zshrc for all users
|
# Generated alias functions (system-wide)
|
||||||
|
#################################
|
||||||
|
environment.etc."profile.d/99-alias-functions.sh".text = ''
|
||||||
|
# system-wide functions generated from aliases.conf
|
||||||
|
${functions}
|
||||||
|
'';
|
||||||
|
|
||||||
|
#################################
|
||||||
|
# Global zshrc
|
||||||
#################################
|
#################################
|
||||||
environment.etc."zshrc".text = ''
|
environment.etc."zshrc".text = ''
|
||||||
export ZSH=${pkgs.oh-my-zsh}/share/oh-my-zsh
|
export ZSH=${pkgs.oh-my-zsh}/share/oh-my-zsh
|
||||||
ZSH_THEME=""
|
ZSH_THEME=""
|
||||||
plugins=(git sudo extract colored-man-pages command-not-found history docker kubectl)
|
plugins=(git sudo extract colored-man-pages command-not-found history docker kubectl)
|
||||||
|
|
||||||
source $ZSH/oh-my-zsh.sh
|
source $ZSH/oh-my-zsh.sh
|
||||||
|
|
||||||
# Load optional per-user generated zshrc if it exists
|
# Init starship FIRST (prompt)
|
||||||
[ -f "${generatedZsh}" ] && source "${generatedZsh}"
|
|
||||||
|
|
||||||
# Initialize Starship prompt
|
|
||||||
eval "$(starship init zsh)"
|
eval "$(starship init zsh)"
|
||||||
|
|
||||||
# Syntax highlighting — must be sourced last
|
# Load alias functions
|
||||||
|
if [ -f /etc/profile.d/99-alias-functions.sh ]; then
|
||||||
|
source /etc/profile.d/99-alias-functions.sh
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Load optional generated user config
|
||||||
|
[ -f "${generatedZsh}" ] && source "${generatedZsh}"
|
||||||
|
|
||||||
|
# Syntax highlighting MUST be last
|
||||||
source ${pkgs.zsh-syntax-highlighting}/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
|
source ${pkgs.zsh-syntax-highlighting}/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
|
||||||
'';
|
'';
|
||||||
|
|
||||||
#################################
|
#################################
|
||||||
# Set Zsh as default login shell for the user via Home Manager
|
# Home Manager integration
|
||||||
#################################
|
#################################
|
||||||
home-manager.users = {
|
home-manager.users.${username} = {
|
||||||
${username} = {
|
programs.zsh.enable = true;
|
||||||
programs.zsh.enable = true;
|
home.file.".config/zsh/.zshrc".source = generatedZsh;
|
||||||
home.file.".config/zsh/.zshrc".source = generatedZsh;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,51 @@
|
|||||||
|
# --- This file has been auto-generated. For permanent changes alter the appropriate block in the README.org. ---
|
||||||
|
{ lib, pkgs, flakeRoot,... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
aliasFile = "${flakeRoot}/generated/assets/aliases.conf";
|
||||||
|
|
||||||
|
content = builtins.readFile aliasFile;
|
||||||
|
|
||||||
|
lines =
|
||||||
|
lib.filter (l: l != "")
|
||||||
|
(map (l:
|
||||||
|
let
|
||||||
|
noComment = builtins.head (lib.splitString "#" l);
|
||||||
|
in lib.trim noComment
|
||||||
|
) (lib.splitString "\n" content));
|
||||||
|
|
||||||
|
parseLine = line:
|
||||||
|
let
|
||||||
|
parts = lib.splitString "=" line;
|
||||||
|
in
|
||||||
|
if lib.length parts < 2 then null else {
|
||||||
|
name = lib.head parts;
|
||||||
|
value = lib.concatStringsSep "=" (lib.tail parts);
|
||||||
|
};
|
||||||
|
|
||||||
|
parsed =
|
||||||
|
lib.filter (x: x != null)
|
||||||
|
(map parseLine lines);
|
||||||
|
|
||||||
|
functions =
|
||||||
|
lib.concatStringsSep "\n"
|
||||||
|
(map (x: ''
|
||||||
|
${x.name}() {
|
||||||
|
${x.value} "$@"
|
||||||
|
}
|
||||||
|
'') parsed);
|
||||||
|
|
||||||
|
in
|
||||||
|
{
|
||||||
|
environment.etc."profile.d/99-alias-functions.sh".text = ''
|
||||||
|
# system-wide functions generated from aliases.conf
|
||||||
|
${functions}
|
||||||
|
'';
|
||||||
|
environment.shellInit = ''
|
||||||
|
source /etc/profile
|
||||||
|
'';
|
||||||
|
|
||||||
|
interactiveShellInit = ''
|
||||||
|
source /etc/profile.d/99-alias-functions.sh
|
||||||
|
'';
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user