Regenerated
This commit is contained in:
+421
-404
File diff suppressed because it is too large
Load Diff
+66
-50
@@ -137,41 +137,48 @@ com.todoist.Todoist
|
||||
|
||||
** =generated/assets/aliases.conf=
|
||||
This is a list of additional apps to install
|
||||
#+BEGIN_SRC toml :tangle generated/assets/aliases.conf :noweb yes :mkdirp yes :eval never
|
||||
alias ll='ls -lah'
|
||||
alias gs='git status'
|
||||
alias ga='git add'
|
||||
alias gc='git commit'
|
||||
alias gp='git push'
|
||||
alias gcp='git add . && git commit && git push'
|
||||
#+BEGIN_SRC conf :tangle generated/assets/aliases.conf :noweb yes :mkdirp yes :eval never
|
||||
#File & navigation
|
||||
ll=ls -lah
|
||||
cd=z
|
||||
blog=cd ~/Repos/blog && ls -lah
|
||||
|
||||
alias cd='z'
|
||||
# Git shortcuts
|
||||
gs=git status
|
||||
ga=git add
|
||||
gc=git commit
|
||||
gp=git push
|
||||
gcp=git add . && git commit && git push
|
||||
cd=z
|
||||
|
||||
alias nps='xdg-open https://search.nixos.org'
|
||||
alias hvnx='cd ~/Repos/nixos/henrovnix_ok'
|
||||
alias emt='hvnx && emacs README.org --batch -f org-babel-tangle && emacs -Q --batch README.org -f org-html-export-to-html'
|
||||
alias nxs='hvnx && sudo nixos-rebuild switch --flake .#traveldroid'
|
||||
alias nxt='hvnx && sudo nixos-rebuild test --flake .#traveldroid'
|
||||
alias nxv='hvnx && sudo nixos-rebuild build-vm --flake .#traveldroid && "$(ls -1 ./result/bin/run-*-vm | head -n 1)"'
|
||||
#Nix commands
|
||||
nps=xdg-open https://search.nixos.org
|
||||
hvnx=cd ~/Repos/nixos/henrovnix_ok
|
||||
emt=cd ~/Repos/nixos/henrovnix_ok && emacs README.org --batch -f org-babel-tangle && emacs -Q --batch README.org -f org-html-export-to-html
|
||||
nxs=cd ~/Repos/nixos/henrovnix_ok && sudo nixos-rebuild switch --flake .#traveldroid
|
||||
nxt=cd ~/Repos/nixos/henrovnix_ok && sudo nixos-rebuild test --flake .#traveldroid
|
||||
nxv=cd ~/Repos/nixos/henrovnix_ok && sudo nixos-rebuild build-vm --flake .#traveldroid && $(ls -1 ./result/bin/run-*-vm | head -n 1)
|
||||
|
||||
alias please='sudo'
|
||||
alias pls='sudo'
|
||||
alias rb='sudo reboot'
|
||||
alias po='sudo poweroff'
|
||||
#system commands
|
||||
please=sudo
|
||||
pls=sudo
|
||||
rb=sudo reboot
|
||||
po=sudo poweroff
|
||||
|
||||
alias fpl='flatpak list'
|
||||
alias fps='flatpak search'
|
||||
alias fpi='flatpak install'
|
||||
alias fpr='flatpak run'
|
||||
#flatpak commands
|
||||
fpl=flatpak list
|
||||
fps=flatpak search
|
||||
fpi=flatpak install
|
||||
fpr=flatpak run
|
||||
|
||||
alias nxc='ssh henrov@nextcloud.data-pro.nu'
|
||||
#ssh commands
|
||||
nxc=ssh henrov@nextcloud.data-pro.nu
|
||||
|
||||
alias vs='code'
|
||||
alias blog='cd ~/Repos/blog && ll'
|
||||
alias keys='hyprctl binds'
|
||||
#app shortcuts
|
||||
vs=code
|
||||
keys=hyprctl binds
|
||||
#+END_SRC
|
||||
|
||||
|
||||
* The Actual Code :code:
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: the-actual-code
|
||||
@@ -1356,42 +1363,51 @@ in
|
||||
** =generated/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
|
||||
{ lib, flakeRoot,... }:
|
||||
{ lib, pkgs, flakeRoot,... }:
|
||||
|
||||
let
|
||||
aliasFile = "${flakeRoot}/generated/assets/aliases.conf";
|
||||
|
||||
# Read file
|
||||
content = builtins.readFile aliasFile;
|
||||
|
||||
# Split into lines
|
||||
lines = lib.splitString "\n" content;
|
||||
lines =
|
||||
lib.filter (l: l != "")
|
||||
(map (l:
|
||||
let
|
||||
noComment = builtins.head (lib.splitString "#" l);
|
||||
in lib.trim noComment
|
||||
) (lib.splitString "\n" content));
|
||||
|
||||
# Parse "alias name='value'"
|
||||
parseAlias = line:
|
||||
parseLine = line:
|
||||
let
|
||||
match = builtins.match "alias ([^=]+)='(.*)'" line;
|
||||
parts = lib.splitString "=" line;
|
||||
in
|
||||
if match == null then null else {
|
||||
name = builtins.elemAt match 0;
|
||||
value = builtins.elemAt match 1;
|
||||
if lib.length parts < 2 then null else {
|
||||
name = lib.head parts;
|
||||
value = lib.concatStringsSep "=" (lib.tail parts);
|
||||
};
|
||||
|
||||
# Convert to attrset
|
||||
aliases =
|
||||
builtins.listToAttrs (
|
||||
lib.filter (x: x != null)
|
||||
(map (line:
|
||||
let parsed = parseAlias line;
|
||||
in if parsed == null then null else {
|
||||
name = parsed.name;
|
||||
value = parsed.value;
|
||||
}
|
||||
) lines)
|
||||
);
|
||||
parsed =
|
||||
lib.filter (x: x != null)
|
||||
(map parseLine lines);
|
||||
|
||||
functions =
|
||||
lib.concatStringsSep "\n"
|
||||
(map (x: ''
|
||||
${x.name}() {
|
||||
${x.value} "$@"
|
||||
}
|
||||
'') parsed);
|
||||
|
||||
in
|
||||
{
|
||||
environment.shellAliases = aliases;
|
||||
environment.etc."profile.d/99-alias-functions.sh".text = ''
|
||||
# system-wide functions generated from aliases.conf
|
||||
${functions}
|
||||
'';
|
||||
environment.shellInit = ''
|
||||
source /etc/profile
|
||||
'';
|
||||
}
|
||||
#+END_SRC
|
||||
|
||||
|
||||
@@ -1,32 +1,40 @@
|
||||
# --- This file has been auto-generated. For permanent changes alter the appropriate block in the README.org. ---
|
||||
alias ll='ls -lah'
|
||||
alias gs='git status'
|
||||
alias ga='git add'
|
||||
alias gc='git commit'
|
||||
alias gp='git push'
|
||||
alias gcp='git add . && git commit && git push'
|
||||
#File & navigation
|
||||
ll=ls -lah
|
||||
cd=z
|
||||
blog=cd ~/Repos/blog && ls -lah
|
||||
|
||||
alias cd='z'
|
||||
# Git shortcuts
|
||||
gs=git status
|
||||
ga=git add
|
||||
gc=git commit
|
||||
gp=git push
|
||||
gcp=git add . && git commit && git push
|
||||
cd=z
|
||||
|
||||
alias nps='xdg-open https://search.nixos.org'
|
||||
alias hvnx='cd ~/Repos/nixos/henrovnix_ok'
|
||||
alias emt='hvnx && emacs README.org --batch -f org-babel-tangle && emacs -Q --batch README.org -f org-html-export-to-html'
|
||||
alias nxs='hvnx && sudo nixos-rebuild switch --flake .#traveldroid'
|
||||
alias nxt='hvnx && sudo nixos-rebuild test --flake .#traveldroid'
|
||||
alias nxv='hvnx && sudo nixos-rebuild build-vm --flake .#traveldroid && "$(ls -1 ./result/bin/run-*-vm | head -n 1)"'
|
||||
#Nix commands
|
||||
nps=xdg-open https://search.nixos.org
|
||||
hvnx=cd ~/Repos/nixos/henrovnix_ok
|
||||
emt=cd ~/Repos/nixos/henrovnix_ok && emacs README.org --batch -f org-babel-tangle && emacs -Q --batch README.org -f org-html-export-to-html
|
||||
nxs=cd ~/Repos/nixos/henrovnix_ok && sudo nixos-rebuild switch --flake .#traveldroid
|
||||
nxt=cd ~/Repos/nixos/henrovnix_ok && sudo nixos-rebuild test --flake .#traveldroid
|
||||
nxv=cd ~/Repos/nixos/henrovnix_ok && sudo nixos-rebuild build-vm --flake .#traveldroid && $(ls -1 ./result/bin/run-*-vm | head -n 1)
|
||||
|
||||
alias please='sudo'
|
||||
alias pls='sudo'
|
||||
alias rb='sudo reboot'
|
||||
alias po='sudo poweroff'
|
||||
#system commands
|
||||
please=sudo
|
||||
pls=sudo
|
||||
rb=sudo reboot
|
||||
po=sudo poweroff
|
||||
|
||||
alias fpl='flatpak list'
|
||||
alias fps='flatpak search'
|
||||
alias fpi='flatpak install'
|
||||
alias fpr='flatpak run'
|
||||
#flatpak commands
|
||||
fpl=flatpak list
|
||||
fps=flatpak search
|
||||
fpi=flatpak install
|
||||
fpr=flatpak run
|
||||
|
||||
alias nxc='ssh henrov@nextcloud.data-pro.nu'
|
||||
#ssh commands
|
||||
nxc=ssh henrov@nextcloud.data-pro.nu
|
||||
|
||||
alias vs='code'
|
||||
alias blog='cd ~/Repos/blog && ll'
|
||||
alias keys='hyprctl binds'
|
||||
#app shortcuts
|
||||
vs=code
|
||||
keys=hyprctl binds
|
||||
|
||||
@@ -1,38 +1,47 @@
|
||||
# --- This file has been auto-generated. For permanent changes alter the appropriate block in the README.org. ---
|
||||
{ lib, flakeRoot,... }:
|
||||
{ lib, pkgs, flakeRoot,... }:
|
||||
|
||||
let
|
||||
aliasFile = "${flakeRoot}/generated/assets/aliases.conf";
|
||||
|
||||
# Read file
|
||||
content = builtins.readFile aliasFile;
|
||||
|
||||
# Split into lines
|
||||
lines = lib.splitString "\n" content;
|
||||
lines =
|
||||
lib.filter (l: l != "")
|
||||
(map (l:
|
||||
let
|
||||
noComment = builtins.head (lib.splitString "#" l);
|
||||
in lib.trim noComment
|
||||
) (lib.splitString "\n" content));
|
||||
|
||||
# Parse "alias name='value'"
|
||||
parseAlias = line:
|
||||
parseLine = line:
|
||||
let
|
||||
match = builtins.match "alias ([^=]+)='(.*)'" line;
|
||||
parts = lib.splitString "=" line;
|
||||
in
|
||||
if match == null then null else {
|
||||
name = builtins.elemAt match 0;
|
||||
value = builtins.elemAt match 1;
|
||||
if lib.length parts < 2 then null else {
|
||||
name = lib.head parts;
|
||||
value = lib.concatStringsSep "=" (lib.tail parts);
|
||||
};
|
||||
|
||||
# Convert to attrset
|
||||
aliases =
|
||||
builtins.listToAttrs (
|
||||
lib.filter (x: x != null)
|
||||
(map (line:
|
||||
let parsed = parseAlias line;
|
||||
in if parsed == null then null else {
|
||||
name = parsed.name;
|
||||
value = parsed.value;
|
||||
}
|
||||
) lines)
|
||||
);
|
||||
parsed =
|
||||
lib.filter (x: x != null)
|
||||
(map parseLine lines);
|
||||
|
||||
functions =
|
||||
lib.concatStringsSep "\n"
|
||||
(map (x: ''
|
||||
${x.name}() {
|
||||
${x.value} "$@"
|
||||
}
|
||||
'') parsed);
|
||||
|
||||
in
|
||||
{
|
||||
environment.shellAliases = aliases;
|
||||
environment.etc."profile.d/99-alias-functions.sh".text = ''
|
||||
# system-wide functions generated from aliases.conf
|
||||
${functions}
|
||||
'';
|
||||
environment.shellInit = ''
|
||||
source /etc/profile
|
||||
'';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user