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=
|
||||
This sets up the zsh in the terminal
|
||||
#+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, ... }:
|
||||
|
||||
let
|
||||
#################################
|
||||
# User config
|
||||
#################################
|
||||
username = config.defaultUser or "henrov";
|
||||
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
|
||||
{
|
||||
#################################
|
||||
# Install Zsh, Oh My Zsh, Starship and syntax highlighting system-wide
|
||||
# Packages
|
||||
#################################
|
||||
environment.systemPackages = with pkgs; [
|
||||
zsh
|
||||
@@ -919,39 +958,51 @@ in
|
||||
];
|
||||
|
||||
#################################
|
||||
# Set Zsh to use ~/.config/zsh as its config directory
|
||||
# Zsh config location
|
||||
#################################
|
||||
environment.etc."zshenv".text = ''
|
||||
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 = ''
|
||||
export ZSH=${pkgs.oh-my-zsh}/share/oh-my-zsh
|
||||
ZSH_THEME=""
|
||||
plugins=(git sudo extract colored-man-pages command-not-found history docker kubectl)
|
||||
|
||||
source $ZSH/oh-my-zsh.sh
|
||||
|
||||
# Load optional per-user generated zshrc if it exists
|
||||
[ -f "${generatedZsh}" ] && source "${generatedZsh}"
|
||||
|
||||
# Initialize Starship prompt
|
||||
# Init starship FIRST (prompt)
|
||||
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
|
||||
'';
|
||||
|
||||
#################################
|
||||
# Set Zsh as default login shell for the user via Home Manager
|
||||
# Home Manager integration
|
||||
#################################
|
||||
home-manager.users = {
|
||||
${username} = {
|
||||
programs.zsh.enable = true;
|
||||
home.file.".config/zsh/.zshrc".source = generatedZsh;
|
||||
};
|
||||
home-manager.users.${username} = {
|
||||
programs.zsh.enable = true;
|
||||
home.file.".config/zsh/.zshrc".source = generatedZsh;
|
||||
};
|
||||
}
|
||||
#+END_SRC
|
||||
@@ -1360,9 +1411,9 @@ in
|
||||
|
||||
* 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
|
||||
#+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,... }:
|
||||
|
||||
let
|
||||
@@ -1408,6 +1459,10 @@ in
|
||||
environment.shellInit = ''
|
||||
source /etc/profile
|
||||
'';
|
||||
|
||||
interactiveShellInit = ''
|
||||
source /etc/profile.d/99-alias-functions.sh
|
||||
'';
|
||||
}
|
||||
#+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. ---
|
||||
{ lib, config, pkgs, flakeRoot, ... }:
|
||||
|
||||
let
|
||||
#################################
|
||||
# User config
|
||||
#################################
|
||||
username = config.defaultUser or "henrov";
|
||||
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
|
||||
{
|
||||
#################################
|
||||
# Install Zsh, Oh My Zsh, Starship and syntax highlighting system-wide
|
||||
# Packages
|
||||
#################################
|
||||
environment.systemPackages = with pkgs; [
|
||||
zsh
|
||||
@@ -17,38 +56,50 @@ in
|
||||
];
|
||||
|
||||
#################################
|
||||
# Set Zsh to use ~/.config/zsh as its config directory
|
||||
# Zsh config location
|
||||
#################################
|
||||
environment.etc."zshenv".text = ''
|
||||
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 = ''
|
||||
export ZSH=${pkgs.oh-my-zsh}/share/oh-my-zsh
|
||||
ZSH_THEME=""
|
||||
plugins=(git sudo extract colored-man-pages command-not-found history docker kubectl)
|
||||
|
||||
source $ZSH/oh-my-zsh.sh
|
||||
|
||||
# Load optional per-user generated zshrc if it exists
|
||||
[ -f "${generatedZsh}" ] && source "${generatedZsh}"
|
||||
|
||||
# Initialize Starship prompt
|
||||
# Init starship FIRST (prompt)
|
||||
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
|
||||
'';
|
||||
|
||||
#################################
|
||||
# Set Zsh as default login shell for the user via Home Manager
|
||||
# Home Manager integration
|
||||
#################################
|
||||
home-manager.users = {
|
||||
${username} = {
|
||||
programs.zsh.enable = true;
|
||||
home.file.".config/zsh/.zshrc".source = generatedZsh;
|
||||
};
|
||||
home-manager.users.${username} = {
|
||||
programs.zsh.enable = true;
|
||||
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