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=
|
** =generated/assets/aliases.conf=
|
||||||
This is a list of additional apps to install
|
This is a list of additional apps to install
|
||||||
#+BEGIN_SRC toml :tangle generated/assets/aliases.conf :noweb yes :mkdirp yes :eval never
|
#+BEGIN_SRC conf :tangle generated/assets/aliases.conf :noweb yes :mkdirp yes :eval never
|
||||||
alias ll='ls -lah'
|
#File & navigation
|
||||||
alias gs='git status'
|
ll=ls -lah
|
||||||
alias ga='git add'
|
cd=z
|
||||||
alias gc='git commit'
|
blog=cd ~/Repos/blog && ls -lah
|
||||||
alias gp='git push'
|
|
||||||
alias gcp='git add . && git commit && git push'
|
|
||||||
|
|
||||||
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'
|
#Nix commands
|
||||||
alias hvnx='cd ~/Repos/nixos/henrovnix_ok'
|
nps=xdg-open https://search.nixos.org
|
||||||
alias emt='hvnx && emacs README.org --batch -f org-babel-tangle && emacs -Q --batch README.org -f org-html-export-to-html'
|
hvnx=cd ~/Repos/nixos/henrovnix_ok
|
||||||
alias nxs='hvnx && sudo nixos-rebuild switch --flake .#traveldroid'
|
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
|
||||||
alias nxt='hvnx && sudo nixos-rebuild test --flake .#traveldroid'
|
nxs=cd ~/Repos/nixos/henrovnix_ok && sudo nixos-rebuild switch --flake .#traveldroid
|
||||||
alias nxv='hvnx && sudo nixos-rebuild build-vm --flake .#traveldroid && "$(ls -1 ./result/bin/run-*-vm | head -n 1)"'
|
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'
|
#system commands
|
||||||
alias pls='sudo'
|
please=sudo
|
||||||
alias rb='sudo reboot'
|
pls=sudo
|
||||||
alias po='sudo poweroff'
|
rb=sudo reboot
|
||||||
|
po=sudo poweroff
|
||||||
|
|
||||||
alias fpl='flatpak list'
|
#flatpak commands
|
||||||
alias fps='flatpak search'
|
fpl=flatpak list
|
||||||
alias fpi='flatpak install'
|
fps=flatpak search
|
||||||
alias fpr='flatpak run'
|
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'
|
#app shortcuts
|
||||||
alias blog='cd ~/Repos/blog && ll'
|
vs=code
|
||||||
alias keys='hyprctl binds'
|
keys=hyprctl binds
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
|
|
||||||
* The Actual Code :code:
|
* The Actual Code :code:
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: the-actual-code
|
:CUSTOM_ID: the-actual-code
|
||||||
@@ -1356,42 +1363,51 @@ in
|
|||||||
** =generated/modules/traveldroid/system/aliases.nix=
|
** =generated/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/modules/traveldroid/system/aliases.nix :noweb yes :mkdirp yes :eval never
|
||||||
{ lib, flakeRoot,... }:
|
{ lib, pkgs, flakeRoot,... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
aliasFile = "${flakeRoot}/generated/assets/aliases.conf";
|
aliasFile = "${flakeRoot}/generated/assets/aliases.conf";
|
||||||
|
|
||||||
# Read file
|
|
||||||
content = builtins.readFile aliasFile;
|
content = builtins.readFile aliasFile;
|
||||||
|
|
||||||
# Split into lines
|
lines =
|
||||||
lines = lib.splitString "\n" content;
|
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'"
|
parseLine = line:
|
||||||
parseAlias = line:
|
|
||||||
let
|
let
|
||||||
match = builtins.match "alias ([^=]+)='(.*)'" line;
|
parts = lib.splitString "=" line;
|
||||||
in
|
in
|
||||||
if match == null then null else {
|
if lib.length parts < 2 then null else {
|
||||||
name = builtins.elemAt match 0;
|
name = lib.head parts;
|
||||||
value = builtins.elemAt match 1;
|
value = lib.concatStringsSep "=" (lib.tail parts);
|
||||||
};
|
};
|
||||||
|
|
||||||
# Convert to attrset
|
parsed =
|
||||||
aliases =
|
lib.filter (x: x != null)
|
||||||
builtins.listToAttrs (
|
(map parseLine lines);
|
||||||
lib.filter (x: x != null)
|
|
||||||
(map (line:
|
functions =
|
||||||
let parsed = parseAlias line;
|
lib.concatStringsSep "\n"
|
||||||
in if parsed == null then null else {
|
(map (x: ''
|
||||||
name = parsed.name;
|
${x.name}() {
|
||||||
value = parsed.value;
|
${x.value} "$@"
|
||||||
}
|
}
|
||||||
) lines)
|
'') parsed);
|
||||||
);
|
|
||||||
|
|
||||||
in
|
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
|
#+END_SRC
|
||||||
|
|
||||||
|
|||||||
@@ -1,32 +1,40 @@
|
|||||||
# --- 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. ---
|
||||||
alias ll='ls -lah'
|
#File & navigation
|
||||||
alias gs='git status'
|
ll=ls -lah
|
||||||
alias ga='git add'
|
cd=z
|
||||||
alias gc='git commit'
|
blog=cd ~/Repos/blog && ls -lah
|
||||||
alias gp='git push'
|
|
||||||
alias gcp='git add . && git commit && git push'
|
|
||||||
|
|
||||||
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'
|
#Nix commands
|
||||||
alias hvnx='cd ~/Repos/nixos/henrovnix_ok'
|
nps=xdg-open https://search.nixos.org
|
||||||
alias emt='hvnx && emacs README.org --batch -f org-babel-tangle && emacs -Q --batch README.org -f org-html-export-to-html'
|
hvnx=cd ~/Repos/nixos/henrovnix_ok
|
||||||
alias nxs='hvnx && sudo nixos-rebuild switch --flake .#traveldroid'
|
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
|
||||||
alias nxt='hvnx && sudo nixos-rebuild test --flake .#traveldroid'
|
nxs=cd ~/Repos/nixos/henrovnix_ok && sudo nixos-rebuild switch --flake .#traveldroid
|
||||||
alias nxv='hvnx && sudo nixos-rebuild build-vm --flake .#traveldroid && "$(ls -1 ./result/bin/run-*-vm | head -n 1)"'
|
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'
|
#system commands
|
||||||
alias pls='sudo'
|
please=sudo
|
||||||
alias rb='sudo reboot'
|
pls=sudo
|
||||||
alias po='sudo poweroff'
|
rb=sudo reboot
|
||||||
|
po=sudo poweroff
|
||||||
|
|
||||||
alias fpl='flatpak list'
|
#flatpak commands
|
||||||
alias fps='flatpak search'
|
fpl=flatpak list
|
||||||
alias fpi='flatpak install'
|
fps=flatpak search
|
||||||
alias fpr='flatpak run'
|
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'
|
#app shortcuts
|
||||||
alias blog='cd ~/Repos/blog && ll'
|
vs=code
|
||||||
alias keys='hyprctl binds'
|
keys=hyprctl binds
|
||||||
|
|||||||
@@ -1,38 +1,47 @@
|
|||||||
# --- 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, flakeRoot,... }:
|
{ lib, pkgs, flakeRoot,... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
aliasFile = "${flakeRoot}/generated/assets/aliases.conf";
|
aliasFile = "${flakeRoot}/generated/assets/aliases.conf";
|
||||||
|
|
||||||
# Read file
|
|
||||||
content = builtins.readFile aliasFile;
|
content = builtins.readFile aliasFile;
|
||||||
|
|
||||||
# Split into lines
|
lines =
|
||||||
lines = lib.splitString "\n" content;
|
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'"
|
parseLine = line:
|
||||||
parseAlias = line:
|
|
||||||
let
|
let
|
||||||
match = builtins.match "alias ([^=]+)='(.*)'" line;
|
parts = lib.splitString "=" line;
|
||||||
in
|
in
|
||||||
if match == null then null else {
|
if lib.length parts < 2 then null else {
|
||||||
name = builtins.elemAt match 0;
|
name = lib.head parts;
|
||||||
value = builtins.elemAt match 1;
|
value = lib.concatStringsSep "=" (lib.tail parts);
|
||||||
};
|
};
|
||||||
|
|
||||||
# Convert to attrset
|
parsed =
|
||||||
aliases =
|
lib.filter (x: x != null)
|
||||||
builtins.listToAttrs (
|
(map parseLine lines);
|
||||||
lib.filter (x: x != null)
|
|
||||||
(map (line:
|
functions =
|
||||||
let parsed = parseAlias line;
|
lib.concatStringsSep "\n"
|
||||||
in if parsed == null then null else {
|
(map (x: ''
|
||||||
name = parsed.name;
|
${x.name}() {
|
||||||
value = parsed.value;
|
${x.value} "$@"
|
||||||
}
|
}
|
||||||
) lines)
|
'') parsed);
|
||||||
);
|
|
||||||
|
|
||||||
in
|
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