so long fish

This commit is contained in:
Danilo Reyes 2023-08-19 17:57:14 -06:00
parent 2aedb7039b
commit f6752a6d61
2 changed files with 703 additions and 894 deletions

View File

@ -7,27 +7,27 @@ let
25152 # ssh
49494 # gerbera
];
open_firewall_port_ranges = [
{ from = 1714; to = 1764; } # kdeconnect
open_firewall_port_ranges = [{
from = 1714;
to = 1764;
} # kdeconnect
];
VERSION = "23.05";
# "https://github.com/nix-community/home-manager/archive/master.tar.gz";
unstable_tarball = builtins.fetchTarball
https://github.com/nixos/nixpkgs/tarball/master;
unstable = import unstable_tarball {
config = config.nixpkgs.config;
};
nix-gaming = import (builtins.fetchTarball "https://github.com/fufexan/nix-gaming/archive/master.tar.gz");
nextcloud_scrapsync = pkgs.writeScriptBin
"nextcloud_scrapsync" (builtins.readFile ./scripts/nextcloud_scrapsync.sh);
manage_library = pkgs.writeScriptBin
"manage_library" (builtins.readFile ./scripts/manage_library.sh);
ffmpeg4discord = pkgs.writeScriptBin
"ffmpeg4discord" (builtins.readFile ./scripts/ffmpeg4discord.py);
chat-dl = pkgs.writeScriptBin
"chat-dl" (builtins.readFile ./scripts/chat-dl.sh);
in
{ # Remember to close this bracket at the end of the document
unstable_tarball =
builtins.fetchTarball "https://github.com/nixos/nixpkgs/tarball/master";
unstable = import unstable_tarball { config = config.nixpkgs.config; };
nix-gaming = import (builtins.fetchTarball
"https://github.com/fufexan/nix-gaming/archive/master.tar.gz");
nextcloud_scrapsync = pkgs.writeScriptBin "nextcloud_scrapsync"
(builtins.readFile ./scripts/nextcloud_scrapsync.sh);
manage_library = pkgs.writeScriptBin "manage_library"
(builtins.readFile ./scripts/manage_library.sh);
ffmpeg4discord = pkgs.writeScriptBin "ffmpeg4discord"
(builtins.readFile ./scripts/ffmpeg4discord.py);
chat-dl =
pkgs.writeScriptBin "chat-dl" (builtins.readFile ./scripts/chat-dl.sh);
in { # Remember to close this bracket at the end of the document
imports = [
./hardware-configuration.nix
@ -44,9 +44,7 @@ time.timeZone = "America/Mexico_City";
i18n = {
defaultLocale = "en_CA.UTF-8";
extraLocaleSettings = {
LC_MONETARY = "es_MX.UTF-8";
};
extraLocaleSettings = { LC_MONETARY = "es_MX.UTF-8"; };
};
console = {
font = "Lat2-Terminus16";
@ -72,8 +70,7 @@ environment.gnome.excludePackages = (with pkgs; [
gnome-connections
# gnome-shell-extensions
baobab
])
++ (with pkgs.gnome; [
]) ++ (with pkgs.gnome; [
# totem
gedit
gnome-music
@ -120,16 +117,16 @@ security.sudo = {
# noPass = true;
# }];
nixpkgs.config = {
allowUnfree = true;
};
nixpkgs.config = { allowUnfree = true; };
users.users.jawz = {
isNormalUser = true;
extraGroups = [ "wheel" "networkmanager" "docker" "scanner" "lp" ];
initialPassword = "password";
openssh = {
authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB5GaQM4N+yGAByibOFQOBVMV/6TjOfaGIP+NunMiK76 gpodeacero\cdreyes@100CDREYES" ];
authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB5GaQM4N+yGAByibOFQOBVMV/6TjOfaGIP+NunMiK76 gpodeacerocdreyes@100CDREYES"
];
};
packages = (with pkgs; [
@ -282,12 +279,17 @@ gnome.gnome-tweaks # tweaks for the gnome desktop environment
# Fonts
(nerdfonts.override {
fonts = [ "Agave" "CascadiaCode" "SourceCodePro" "Ubuntu" "FiraCode" "Iosevka" ];
fonts = [
"Agave"
"CascadiaCode"
"SourceCodePro"
"Ubuntu"
"FiraCode"
"Iosevka"
];
})
symbola
(papirus-icon-theme.override {
color = "adwaita";
})
(papirus-icon-theme.override { color = "adwaita"; })
]) ++ (with pkgs.python3Packages; [
flake8 # wraper for pyflakes, pycodestyle and mccabe
@ -305,8 +307,7 @@ symbola
src = ./scripts/download/.;
doCheck = false;
buildInputs = [ setuptools ];
propagatedBuildInputs =
[ pyyaml types-pyyaml ];
propagatedBuildInputs = [ pyyaml types-pyyaml ];
})
(buildPythonApplication rec {
pname = "classifier";
@ -317,8 +318,7 @@ symbola
};
doCheck = false;
buildInputs = [ setuptools ];
propagatedBuildInputs =
[ arrow ];
propagatedBuildInputs = [ arrow ];
})
(buildPythonApplication rec {
pname = "ffpb";
@ -329,8 +329,7 @@ symbola
};
doCheck = false;
buildInputs = [ setuptools ];
propagatedBuildInputs =
[ tqdm ];
propagatedBuildInputs = [ tqdm ];
})
]) ++ (with pkgs.bat-extras; [
@ -341,13 +340,6 @@ symbola
batwatch # probably my next best friend
prettybat # trans your sourcecode!
]) ++ (with pkgs.fishPlugins; [
sponge # keep history clean from typos
fzf-fish # fish command line with fzf keybindings
colored-man-pages # self explanatory
autopair-fish # who has time for a closing bracket?
bass # integrate bash utilities on fish
]) ++ (with pkgs.gnomeExtensions; [
appindicator # applets for open applications
gsconnect # sync data and notifications from your phone
@ -368,7 +360,8 @@ symbola
markdownlint-cli # Linter
prettier # Linter
pnpm # Package manager
]); }; # <--- end of package list
]);
}; # <--- end of package list
fonts.fontconfig.enable = true;
@ -384,16 +377,19 @@ programs.bash = {
historyFile = "\${XDG_STATE_HOME}/bash/history";
historyControl = [ "erasedups" ];
shellAliases = {
ls = "exa --icons --group-directories-first --no-permissions --no-user --no-time";
ls =
"exa --icons --group-directories-first --no-permissions --no-user --no-time";
edit = "emacsclient -t";
comic = "download -u jawz -i $(cat $lc | fzf --multi --exact -i)";
gallery = "download -u jawz -i $(cat $lw | fzf --multi --exact -i)";
open_gallery = "cd /mnt/disk2/scrapping/JawZ/gallery-dl && nautilus \
\"$(fd . ./ Husbands -tdirectory -d 1 | fzf -i)\"";
unique_extensions = "fd -tf | rev | cut -d. -f1 | rev | tr '[:upper:]' '[:lower:]' | sort | uniq --count | sort -rn";
open_gallery = ''
cd /mnt/disk2/scrapping/JawZ/gallery-dl && nautilus
"$(fd . ./ Husbands -tdirectory -d 1 | fzf -i)"'';
unique_extensions =
"fd -tf | rev | cut -d. -f1 | rev | tr '[:upper:]' '[:lower:]' | sort | uniq --count | sort -rn";
cp = "cp -i";
mv = "mv -i";
mkcd = "mkdir -pv \"$1\" && cd \"$1\" || exit";
mkcd = ''mkdir -pv "$1" && cd "$1" || exit'';
mkdir = "mkdir -p";
rm = "trash";
".." = "cd ..";
@ -437,76 +433,6 @@ nixos-magic () {
'';
};
programs.fish = {
enable = true;
# useBabelfish = true; This setting doens't work from inside home-manager
shellAliases = {
ls = "exa --icons --group-directories-first --no-permissions --no-user --no-time";
edit = "emacsclient -t";
comic = "download -u jawz -i (cat $lc | fzf --multi --exact -i)";
gallery = "download -u jawz -i (cat $lw | fzf --multi --exact -i)";
open_gallery = "open (cd /mnt/disk2/scrapping/JawZ/gallery-dl && fd . ./ Husbands kemonoparty -tdirectory -d 1 | fzf)";
unique_extensions = "find . -type f | string match -r '([^.\/]+)\$' | sort -u";
cp = "cp -i";
mv = "mv -i";
mkdir = "mkdir -p";
rm = "trash";
".." = "cd ..";
"..." = "cd ../..";
".3" = "cd ../../..";
".4" = "cd ../../../..";
".5" = "cd ../../../../..";
};
shellAbbrs = {
dl = "download -u jawz -i";
ex = "ls";
e = "edit";
c = "cat";
f = "fzf --multi --exact -i";
sc = "systemctl --user";
jc = "journalctl --user -xeu";
};
interactiveShellInit = ''
function fish_greeting
~/.local/bin/pokemon-colorscripts -r --no-title
end
# Lists
set -l list_root ${config.home.homeDirectory}/.config/jawz/lists/jawz
set lw $list_root/watch.txt
set li $list_root/instant.txt
set lc $list_root/comic.txt
set command_timeout = 30
set GPG_TTY (tty)
# Set EMACS/VI mode
function fish_user_key_bindings
# fish_default_key_bindings
fish_vi_key_bindings
end
'';
functions = {
nixos-magic = ''
set -l nix_file "$HOME/Development/NixOS/configuration.nix"
set -l hardware_file "$HOME/Development/NixOS/hardware-configuration.nix"
nixfmt $nix_file
nixfmt $hardware_file
sudo nixos-rebuild switch -I nixos-config=$nix_file
'';
mkcd = ''
mkdir -pv $argv
cd $argv
'';
};
};
programs = {
starship.enable = true;
direnv = {
@ -518,7 +444,8 @@ programs = {
enable = true;
config = {
pager = "less -FR";
theme = "base16"; };
theme = "base16";
};
};
git = {
enable = true;
@ -547,7 +474,8 @@ xdg = {
};
configFile = {
"wgetrc".source = ./dotfiles/wget/wgetrc;
"configstore/update-notifier-npm-check.json".source = ./dotfiles/npm/update-notifier-npm-check.json;
"configstore/update-notifier-npm-check.json".source =
./dotfiles/npm/update-notifier-npm-check.json;
"npm/npmrc".source = ./dotfiles/npm/npmrc;
"gallery-dl/config.json".source = ./dotfiles/gallery-dl/config.json;
"htop/htoprc".source = ./dotfiles/htop/htoprc;
@ -636,9 +564,7 @@ snapraid = {
olderThan = 10;
interval = "4:00";
};
parityFiles = [
"/mnt/parity/snapraid.parity"
];
parityFiles = [ "/mnt/parity/snapraid.parity" ];
extraConfig = ''
autosave 50
'';
@ -662,7 +588,6 @@ snapraid = {
};
programs = {
fish.enable = true;
fzf.fuzzyCompletion = true;
mtr.enable = true;
neovim = {
@ -673,9 +598,7 @@ programs = {
enable = true;
enableSSHSupport = true;
};
geary = {
enable = true;
};
geary = { enable = true; };
steam = {
enable = true;
remotePlay.openFirewall = true;
@ -693,11 +616,7 @@ services = {
fstrim.enable = true;
btrfs.autoScrub = {
enable = true;
fileSystems = [
"/"
"/mnt/disk1"
"/mnt/disk2"
];
fileSystems = [ "/" "/mnt/disk1" "/mnt/disk2" ];
};
openssh = {
enable = true;
@ -707,12 +626,10 @@ services = {
KbdInteractiveAuthentication = false;
};
startWhenNeeded = true;
listenAddresses = [
{
listenAddresses = [{
addr = "0.0.0.0";
port = 25152;
}
];
}];
};
emacs = {
enable = true;
@ -740,23 +657,19 @@ systemd.services = {
environment = {
FILE = "/home/jawz/Development/Docker/docker-compose.yml";
};
path = [
pkgs.docker-compose
];
path = [ pkgs.docker-compose ];
serviceConfig = {
Restart = "on-failure";
RestartSec = 30;
ExecStart = "${pkgs.docker-compose}/bin/docker-compose -f \${FILE} up --remove-orphans";
ExecStart =
"${pkgs.docker-compose}/bin/docker-compose -f \${FILE} up --remove-orphans";
ExecStop = "${pkgs.docker-compose}/bin/docker-compose -f \${FILE} down";
};
};
"nextcloud_scrapsync" = {
description = "Sync scrapped files with nextcloud";
wantedBy = [ "default.target" ];
path = [
pkgs.bash
nextcloud_scrapsync
];
path = [ pkgs.bash nextcloud_scrapsync ];
serviceConfig = {
RestartSec = 30;
ExecStart = "${nextcloud_scrapsync}/bin/nextcloud_scrapsync";
@ -786,9 +699,7 @@ systemd.user.services = {
restartIfChanged = true;
description = "Run hentai@home server";
wantedBy = [ "default.target" ];
path = [
pkgs.HentaiAtHome
];
path = [ pkgs.HentaiAtHome ];
serviceConfig = {
Restart = "on-failure";
RestartSec = 30;
@ -799,12 +710,9 @@ systemd.user.services = {
"manage_library" = {
enable = true;
restartIfChanged = true;
description = "Run the manage library fish script";
description = "Run the manage library bash script";
wantedBy = [ "default.target" ];
path = [
pkgs.fish
manage_library
];
path = [ pkgs.bash manage_library ];
serviceConfig = {
Restart = "on-failure";
RestartSec = 30;

View File

@ -531,17 +531,6 @@ symbola
prettybat # trans your sourcecode!
#+end_src
** FISH PLUGINS
#+begin_src nix
]) ++ (with pkgs.fishPlugins; [
sponge # keep history clean from typos
fzf-fish # fish command line with fzf keybindings
colored-man-pages # self explanatory
autopair-fish # who has time for a closing bracket?
bass # integrate bash utilities on fish
#+end_src
** GNOME EXTENSIONS
#+begin_src nix
@ -669,93 +658,6 @@ nixos-magic () {
};
#+end_src
*** FISH
#+begin_src nix
programs.fish = {
enable = true;
# useBabelfish = true; This setting doens't work from inside home-manager
shellAliases = {
ls = "exa --icons --group-directories-first --no-permissions --no-user --no-time";
edit = "emacsclient -t";
comic = "download -u jawz -i (cat $lc | fzf --multi --exact -i)";
gallery = "download -u jawz -i (cat $lw | fzf --multi --exact -i)";
open_gallery = "open (cd /mnt/disk2/scrapping/JawZ/gallery-dl && fd . ./ Husbands kemonoparty -tdirectory -d 1 | fzf)";
unique_extensions = "find . -type f | string match -r '([^.\/]+)\$' | sort -u";
cp = "cp -i";
mv = "mv -i";
mkdir = "mkdir -p";
rm = "trash";
".." = "cd ..";
"..." = "cd ../..";
".3" = "cd ../../..";
".4" = "cd ../../../..";
".5" = "cd ../../../../..";
};
shellAbbrs = {
dl = "download -u jawz -i";
ex = "ls";
e = "edit";
c = "cat";
f = "fzf --multi --exact -i";
sc = "systemctl --user";
jc = "journalctl --user -xeu";
};
interactiveShellInit = ''
#+end_src
#+begin_src fish
function fish_greeting
~/.local/bin/pokemon-colorscripts -r --no-title
end
# Lists
set -l list_root ${config.home.homeDirectory}/.config/jawz/lists/jawz
set lw $list_root/watch.txt
set li $list_root/instant.txt
set lc $list_root/comic.txt
set command_timeout = 30
set GPG_TTY (tty)
# Set EMACS/VI mode
function fish_user_key_bindings
# fish_default_key_bindings
fish_vi_key_bindings
end
#+end_src
#+begin_src nix
'';
#+end_src
#+begin_src nix
functions = {
nixos-magic = ''
#+end_src
#+begin_src fish
set -l nix_file "$HOME/Development/NixOS/configuration.nix"
set -l hardware_file "$HOME/Development/NixOS/hardware-configuration.nix"
nixfmt $nix_file
nixfmt $hardware_file
sudo nixos-rebuild switch -I nixos-config=$nix_file
#+end_src
#+begin_src nix
'';
mkcd = ''
#+end_src
#+begin_src fish
mkdir -pv $argv
cd $argv
#+end_src
#+begin_src nix
'';
};
};
#+end_src
*** OTHER
#+begin_src nix
@ -957,7 +859,6 @@ of some services.
#+begin_src nix
programs = {
fish.enable = true;
fzf.fuzzyCompletion = true;
mtr.enable = true;
neovim = {
@ -1100,10 +1001,10 @@ systemd.user.services = {
"manage_library" = {
enable = true;
restartIfChanged = true;
description = "Run the manage library fish script";
description = "Run the manage library bash script";
wantedBy = [ "default.target" ];
path = [
pkgs.fish
pkgs.bash
manage_library
];
serviceConfig = {