Compare commits
2 Commits
2eb24167e5
...
98069fa8d9
| Author | SHA1 | Date | |
|---|---|---|---|
| 98069fa8d9 | |||
| 077d8f07e7 |
@@ -65,25 +65,14 @@
|
|||||||
hostDirs = builtins.attrNames (builtins.readDir ./hosts);
|
hostDirs = builtins.attrNames (builtins.readDir ./hosts);
|
||||||
|
|
||||||
mkHost = hostName: let
|
mkHost = hostName: let
|
||||||
inherit
|
hostVars = import ./hosts/${hostName}/variables.nix;
|
||||||
(import ./hosts/${hostName}/variables.nix)
|
hostPrinterVars = import ./hosts/${hostName}/printers.nix;
|
||||||
host
|
|
||||||
username
|
|
||||||
profile
|
|
||||||
system
|
|
||||||
;
|
|
||||||
in
|
in
|
||||||
nixpkgs.lib.nixosSystem {
|
nixpkgs.lib.nixosSystem {
|
||||||
inherit system;
|
inherit (hostVars) system;
|
||||||
specialArgs = {
|
specialArgs = hostVars // hostPrinterVars // {inherit inputs;};
|
||||||
inherit inputs;
|
|
||||||
inherit username;
|
|
||||||
inherit host;
|
|
||||||
inherit profile;
|
|
||||||
inherit system;
|
|
||||||
};
|
|
||||||
modules = [
|
modules = [
|
||||||
./profiles/${profile}
|
./profiles/${hostVars.profile}
|
||||||
nix-flatpak.nixosModules.nix-flatpak
|
nix-flatpak.nixosModules.nix-flatpak
|
||||||
garandos-tui.nixosModules.garandos-tui
|
garandos-tui.nixosModules.garandos-tui
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -15,6 +15,10 @@
|
|||||||
gitUsername = "GarandPLG";
|
gitUsername = "GarandPLG";
|
||||||
gitEmail = "garandplg@garandplg.com";
|
gitEmail = "garandplg@garandplg.com";
|
||||||
|
|
||||||
|
# User shell
|
||||||
|
# Availabe options: "fish", "bash"
|
||||||
|
shell = "fish";
|
||||||
|
|
||||||
# Hyprland Settings
|
# Hyprland Settings
|
||||||
# Examples:
|
# Examples:
|
||||||
# extraMonitorSettings = "monitor = Virtual-1,1920x1080@60,auto,1";
|
# extraMonitorSettings = "monitor = Virtual-1,1920x1080@60,auto,1";
|
||||||
@@ -35,9 +39,6 @@
|
|||||||
# Enable NFS
|
# Enable NFS
|
||||||
enableNFS = false;
|
enableNFS = false;
|
||||||
|
|
||||||
# Enable Printing Support
|
|
||||||
printEnable = true;
|
|
||||||
|
|
||||||
# Set Stylix Image
|
# Set Stylix Image
|
||||||
# This will set your color palette
|
# This will set your color palette
|
||||||
# Default background
|
# Default background
|
||||||
|
|||||||
@@ -15,6 +15,10 @@
|
|||||||
gitUsername = "GarandPLG";
|
gitUsername = "GarandPLG";
|
||||||
gitEmail = "garandplg@garandplg.com";
|
gitEmail = "garandplg@garandplg.com";
|
||||||
|
|
||||||
|
# User shell
|
||||||
|
# Availabe options: "fish", "bash"
|
||||||
|
shell = "fish";
|
||||||
|
|
||||||
# Hyprland Settings
|
# Hyprland Settings
|
||||||
# Examples:
|
# Examples:
|
||||||
# extraMonitorSettings = "monitor = Virtual-1,1920x1080@60,auto,1";
|
# extraMonitorSettings = "monitor = Virtual-1,1920x1080@60,auto,1";
|
||||||
|
|||||||
@@ -15,6 +15,10 @@
|
|||||||
gitUsername = "GarandPLG";
|
gitUsername = "GarandPLG";
|
||||||
gitEmail = "my@email.com";
|
gitEmail = "my@email.com";
|
||||||
|
|
||||||
|
# User shell
|
||||||
|
# Availabe options: "fish", "bash"
|
||||||
|
shell = "fish";
|
||||||
|
|
||||||
# Hyprland Settings
|
# Hyprland Settings
|
||||||
# Examples:
|
# Examples:
|
||||||
# extraMonitorSettings = "monitor = Virtual-1,1920x1080@60,auto,1";
|
# extraMonitorSettings = "monitor = Virtual-1,1920x1080@60,auto,1";
|
||||||
@@ -37,9 +41,6 @@
|
|||||||
# Enable NFS
|
# Enable NFS
|
||||||
enableNFS = false;
|
enableNFS = false;
|
||||||
|
|
||||||
# Enable Printing Support
|
|
||||||
printEnable = false;
|
|
||||||
|
|
||||||
# Themes, waybar and animation.
|
# Themes, waybar and animation.
|
||||||
# Only uncomment your selection
|
# Only uncomment your selection
|
||||||
# The others much be commented out.
|
# The others much be commented out.
|
||||||
|
|||||||
@@ -2,11 +2,9 @@
|
|||||||
pkgs,
|
pkgs,
|
||||||
lib,
|
lib,
|
||||||
config,
|
config,
|
||||||
host,
|
profile,
|
||||||
...
|
...
|
||||||
}: let
|
}: {
|
||||||
inherit (import ../../hosts/${host}/variables.nix) profile;
|
|
||||||
in {
|
|
||||||
options.docker.enable = lib.mkEnableOption "Docker";
|
options.docker.enable = lib.mkEnableOption "Docker";
|
||||||
|
|
||||||
config.virtualisation.docker = lib.mkIf config.docker.enable {
|
config.virtualisation.docker = lib.mkIf config.docker.enable {
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
{
|
{
|
||||||
host,
|
host,
|
||||||
|
hostId,
|
||||||
options,
|
options,
|
||||||
...
|
...
|
||||||
}: let
|
}: {
|
||||||
inherit (import ../../hosts/${host}/variables.nix) hostId;
|
|
||||||
in {
|
|
||||||
# Defensive assertion for hostname validity (clearer message at eval time)
|
# Defensive assertion for hostname validity (clearer message at eval time)
|
||||||
assertions = [
|
assertions = [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
{host, ...}: let
|
{enableNFS, ...}: {
|
||||||
inherit (import ../../hosts/${host}/variables.nix) enableNFS;
|
|
||||||
in {
|
|
||||||
services = {
|
services = {
|
||||||
rpcbind.enable = enableNFS;
|
rpcbind.enable = enableNFS;
|
||||||
nfs.server.enable = enableNFS;
|
nfs.server.enable = enableNFS;
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ _: {
|
|||||||
enable = true;
|
enable = true;
|
||||||
withUWSM = false;
|
withUWSM = false;
|
||||||
};
|
};
|
||||||
|
fish.enable = true;
|
||||||
dconf.enable = true;
|
dconf.enable = true;
|
||||||
seahorse.enable = true;
|
seahorse.enable = true;
|
||||||
fuse.userAllowOther = true;
|
fuse.userAllowOther = true;
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
{
|
{
|
||||||
pkgs,
|
pkgs,
|
||||||
lib,
|
lib,
|
||||||
host,
|
printEnable,
|
||||||
|
ensureDefaultPrinter,
|
||||||
|
ensurePrinters,
|
||||||
...
|
...
|
||||||
}: let
|
}: {
|
||||||
inherit (import ../../hosts/${host}/printers.nix) printEnable ensureDefaultPrinter ensurePrinters;
|
|
||||||
in {
|
|
||||||
services = lib.mkIf printEnable {
|
services = lib.mkIf printEnable {
|
||||||
printing = {
|
printing = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|||||||
@@ -1,10 +1,8 @@
|
|||||||
{
|
{
|
||||||
pkgs,
|
pkgs,
|
||||||
host,
|
stylixImage,
|
||||||
...
|
...
|
||||||
}: let
|
}: {
|
||||||
inherit (import ../../hosts/${host}/variables.nix) stylixImage;
|
|
||||||
in {
|
|
||||||
# Styling Options
|
# Styling Options
|
||||||
stylix = {
|
stylix = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|||||||
@@ -1,10 +1,8 @@
|
|||||||
{
|
{
|
||||||
host,
|
consoleKeyMap,
|
||||||
inputs,
|
inputs,
|
||||||
...
|
...
|
||||||
}: let
|
}: {
|
||||||
inherit (import ../../hosts/${host}/variables.nix) consoleKeyMap;
|
|
||||||
in {
|
|
||||||
nix = {
|
nix = {
|
||||||
nixPath = ["nixpkgs=${inputs.nixpkgs}"];
|
nixPath = ["nixpkgs=${inputs.nixpkgs}"];
|
||||||
settings = {
|
settings = {
|
||||||
|
|||||||
+19
-4
@@ -5,10 +5,14 @@
|
|||||||
host,
|
host,
|
||||||
profile,
|
profile,
|
||||||
system,
|
system,
|
||||||
|
gitUsername,
|
||||||
|
shell,
|
||||||
|
extraMonitorSettings,
|
||||||
|
keyboardLayout,
|
||||||
|
gitEmail,
|
||||||
|
location,
|
||||||
...
|
...
|
||||||
}: let
|
}: {
|
||||||
inherit (import ../../hosts/${host}/variables.nix) gitUsername;
|
|
||||||
in {
|
|
||||||
imports = [inputs.home-manager.nixosModules.home-manager];
|
imports = [inputs.home-manager.nixosModules.home-manager];
|
||||||
home-manager = {
|
home-manager = {
|
||||||
useUserPackages = true;
|
useUserPackages = true;
|
||||||
@@ -21,6 +25,12 @@ in {
|
|||||||
host
|
host
|
||||||
profile
|
profile
|
||||||
system
|
system
|
||||||
|
extraMonitorSettings
|
||||||
|
shell
|
||||||
|
keyboardLayout
|
||||||
|
gitEmail
|
||||||
|
gitUsername
|
||||||
|
location
|
||||||
;
|
;
|
||||||
};
|
};
|
||||||
users.${username} = {
|
users.${username} = {
|
||||||
@@ -33,6 +43,7 @@ in {
|
|||||||
username = "${username}";
|
username = "${username}";
|
||||||
homeDirectory = "/home/${username}";
|
homeDirectory = "/home/${username}";
|
||||||
stateVersion = "25.11";
|
stateVersion = "25.11";
|
||||||
|
shell.enableFishIntegration = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@@ -53,7 +64,11 @@ in {
|
|||||||
"gamemode"
|
"gamemode"
|
||||||
"lpadmin"
|
"lpadmin"
|
||||||
];
|
];
|
||||||
shell = pkgs.bash;
|
shell = with pkgs; (
|
||||||
|
if shell == "fish"
|
||||||
|
then fish
|
||||||
|
else bash
|
||||||
|
);
|
||||||
ignoreShellProgramCheck = true;
|
ignoreShellProgramCheck = true;
|
||||||
linger = true;
|
linger = true;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
{host, ...}: let
|
{keyboardLayout, ...}: {
|
||||||
inherit (import ../../hosts/${host}/variables.nix) keyboardLayout;
|
|
||||||
in {
|
|
||||||
services.xserver = {
|
services.xserver = {
|
||||||
enable = true;
|
enable = true;
|
||||||
xkb = {
|
xkb = {
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
_: {
|
{shell, ...}: {
|
||||||
programs.bash = {
|
programs.bash = {
|
||||||
enable = true;
|
enable =
|
||||||
|
if shell == "bash"
|
||||||
|
then true
|
||||||
|
else false;
|
||||||
enableCompletion = true;
|
enableCompletion = true;
|
||||||
# initExtra = ''
|
# initExtra = ''
|
||||||
# fastfetch
|
# fastfetch
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
batgrep
|
batgrep
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
home.sessionVariables = {
|
home.sessionVariables = {
|
||||||
MANPAGER = "sh -c 'col -bx | bat -l man -p'";
|
MANPAGER = "sh -c 'col -bx | bat -l man -p'";
|
||||||
MANROFFOPT = "-c";
|
MANROFFOPT = "-c";
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ _: {
|
|||||||
./bash
|
./bash
|
||||||
./chromium
|
./chromium
|
||||||
./fastfetch
|
./fastfetch
|
||||||
|
./fish
|
||||||
./hyprland
|
./hyprland
|
||||||
./kitty
|
./kitty
|
||||||
./librewolf
|
./librewolf
|
||||||
@@ -16,7 +17,6 @@ _: {
|
|||||||
./btop.nix
|
./btop.nix
|
||||||
./cava.nix
|
./cava.nix
|
||||||
./easyeffects.nix
|
./easyeffects.nix
|
||||||
./emoji.nix
|
|
||||||
./eza.nix
|
./eza.nix
|
||||||
./fzf.nix
|
./fzf.nix
|
||||||
./git.nix
|
./git.nix
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -3,6 +3,7 @@
|
|||||||
programs.eza = {
|
programs.eza = {
|
||||||
enable = true;
|
enable = true;
|
||||||
icons = "auto";
|
icons = "auto";
|
||||||
|
enableFishIntegration = true;
|
||||||
enableBashIntegration = true;
|
enableBashIntegration = true;
|
||||||
git = true;
|
git = true;
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,140 @@
|
|||||||
|
{
|
||||||
|
username,
|
||||||
|
host,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
programs.fish.shellAliases = {
|
||||||
|
# GarandOS aliases
|
||||||
|
pullos = "git -C /home/${username}/garandos pull";
|
||||||
|
upd = "nh os switch -H ${host} -d always";
|
||||||
|
upg = "nh os switch -H ${host} --update -d always";
|
||||||
|
upf = "sudo nix flake update --flake /home/${username}/garandos";
|
||||||
|
upf-undo = "git -C /home/${username}/garandos restore /home/${username}/garandos/flake.lock";
|
||||||
|
upd-bt = "nh os boot -H ${host} -d always";
|
||||||
|
upd-ts = "nh os test -H ${host} -d always";
|
||||||
|
upd-bd = "nh os build -H ${host} -d always";
|
||||||
|
tui = "garandos-tui";
|
||||||
|
ncg = "nh clean all --optimise";
|
||||||
|
|
||||||
|
# Development aliases
|
||||||
|
## Django
|
||||||
|
srvenv = "source .venv/bin/activate";
|
||||||
|
"..srvenv" = "source ../.venv/bin/activate";
|
||||||
|
uv-add = "uv add -r requirements.txt";
|
||||||
|
pm = "uv run manage.py";
|
||||||
|
pm-rs = "uv run manage.py runserver";
|
||||||
|
pm-mg = "uv run manage.py migrate";
|
||||||
|
pm-mm = "uv run manage.py makemigrations";
|
||||||
|
pm-sq = "uv run manage.py sqlmigrate";
|
||||||
|
f8 = "uv run flake8 .";
|
||||||
|
## JavaScript/TypeScript
|
||||||
|
bbr = "bun --bun run";
|
||||||
|
## Git
|
||||||
|
"ga." = "git add .";
|
||||||
|
mkgidf = "git add . --intent-to-add . && git diff > git-diff.txt";
|
||||||
|
|
||||||
|
# Development aliases for nix flake
|
||||||
|
nd = "nix develop";
|
||||||
|
nb = "nix build .";
|
||||||
|
nr = "nix run .";
|
||||||
|
nbr = "nix build . && nix run .";
|
||||||
|
nbd = "nix build .#develop";
|
||||||
|
nrd = "nix run .#develop";
|
||||||
|
nbrd = "nix build .#develop && nix run .#develop";
|
||||||
|
|
||||||
|
# Development aliases for docker
|
||||||
|
dcu = "docker compose up -d";
|
||||||
|
dcd = "docker compose down";
|
||||||
|
dcb = "docker compose build";
|
||||||
|
dcub = "docker compose up -d --build";
|
||||||
|
|
||||||
|
# System aliases
|
||||||
|
# flush-codium = "sudo killall codium && sudo rm -rf ~/.config/VSCodium/Cache && sudo rm -rf ~/.config/VSCodium/CachedData";
|
||||||
|
kys = "systemctl poweroff";
|
||||||
|
jezus = "systemctl reboot";
|
||||||
|
ookla = "speedtest";
|
||||||
|
hypr-cli = "hyprctl clients";
|
||||||
|
|
||||||
|
# Navigation aliases
|
||||||
|
".." = "cd ..";
|
||||||
|
"..." = "cd ../..";
|
||||||
|
"...." = "cd ../../..";
|
||||||
|
"....." = "cd ../../../..";
|
||||||
|
|
||||||
|
# Modifies commands
|
||||||
|
cat = "bat";
|
||||||
|
cp = "cp -i";
|
||||||
|
mv = "mv -i";
|
||||||
|
rm = "trash -v";
|
||||||
|
mkdir = "mkdir -p";
|
||||||
|
ps = "ps auxf";
|
||||||
|
ping = "ping -c 10";
|
||||||
|
less = "less -R";
|
||||||
|
cls = "clear";
|
||||||
|
multitail = "multitail --no-repeat -c";
|
||||||
|
freshclam = "sudo freshclam";
|
||||||
|
|
||||||
|
# Alias"s for multiple directory listing commands
|
||||||
|
la = "eza -alh --icons"; # show hidden files
|
||||||
|
ls = "eza -aF --icons --color=always"; # add colors and file type extensions
|
||||||
|
lx = "eza -lh --icons --sort=extension"; # sort by extension
|
||||||
|
lk = "eza -lh --icons --sort=size --reverse"; # sort by size
|
||||||
|
lc = "eza -lh --icons --sort=changed"; # sort by change time
|
||||||
|
lu = "eza -lh --icons --sort=accessed"; # sort by access time
|
||||||
|
lr = "eza -lh --icons --recurse"; # recursive ls
|
||||||
|
lt = "eza -lh --icons --sort=modified"; # sort by date
|
||||||
|
lm = "eza -alh --icons | more"; # pipe through "more"
|
||||||
|
lw = "eza -xh --icons"; # wide listing format
|
||||||
|
ll = "eza -lh --icons"; # long listing format
|
||||||
|
labc = "eza -lah --icons --sort=name"; # alphabetical sort
|
||||||
|
lf = "eza -lh --icons | grep -v '^d'"; # files only (przybliżenie)
|
||||||
|
ldir = "eza -lh --icons --only-dirs"; # directories only
|
||||||
|
lla = "eza -alh --icons"; # List and Hidden Files
|
||||||
|
las = "eza -a --icons"; # Hidden Files
|
||||||
|
lls = "eza -lh --icons"; # List
|
||||||
|
|
||||||
|
# chmod commands
|
||||||
|
mx = "chmod a+x";
|
||||||
|
"000" = "chmod -R 000";
|
||||||
|
"644" = "chmod -R 644";
|
||||||
|
"666" = "chmod -R 666";
|
||||||
|
"755" = "chmod -R 755";
|
||||||
|
"777" = "chmod -R 777";
|
||||||
|
|
||||||
|
# Search command line history
|
||||||
|
h = "history | grep ";
|
||||||
|
|
||||||
|
# Search running processes
|
||||||
|
p = "ps aux | grep ";
|
||||||
|
topcpu = "/bin/ps -eo pcpu,pid,user,args | sort -k 1 -r | head -10";
|
||||||
|
|
||||||
|
# Search files in the current folder
|
||||||
|
f = "find . | grep ";
|
||||||
|
|
||||||
|
# Alias"s to show disk space and space used in a folder
|
||||||
|
diskspace = "du -S | sort -n -r |more";
|
||||||
|
folders = "du -h --max-depth=1";
|
||||||
|
folderssort = "find . -maxdepth 1 -type d -print0 | xargs -0 du -sk | sort -rn";
|
||||||
|
tree = "tree -CAhF --dirsfirst";
|
||||||
|
treed = "tree -CAFd";
|
||||||
|
mountedinfo = "df -hT";
|
||||||
|
|
||||||
|
# fix kitty ssh connection
|
||||||
|
kssh = "kitty +kitten ssh";
|
||||||
|
|
||||||
|
docker-clean = "docker container prune -f ; docker image prune -f ; docker network prune -f ; docker volume prune -f";
|
||||||
|
|
||||||
|
# Remove a directory and all files
|
||||||
|
rmd = "/bin/rm --recursive --force --verbose ";
|
||||||
|
|
||||||
|
# Fun aliases
|
||||||
|
pasjans = "ttysolitaire -p 10 --no-background-color";
|
||||||
|
fc = "fortune | cowsay";
|
||||||
|
|
||||||
|
# Network aliases
|
||||||
|
kssh-server = "kssh hp-t640-homeserver";
|
||||||
|
kssh-server-ts = "kssh hp-t640-homeserver-tailscale";
|
||||||
|
ssh-server = "ssh hp-t640-homeserver";
|
||||||
|
ssh-server-ts = "ssh hp-t640-homeserver-tailscale";
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
{
|
||||||
|
pkgs,
|
||||||
|
shell,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
programs = {
|
||||||
|
fish = {
|
||||||
|
enable =
|
||||||
|
if shell == "fish"
|
||||||
|
then true
|
||||||
|
else false;
|
||||||
|
package = pkgs.fish;
|
||||||
|
generateCompletions = true;
|
||||||
|
interactiveShellInit = ''
|
||||||
|
set fish_greeting
|
||||||
|
# fastfetch
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
nix-your-shell = {
|
||||||
|
enable = true;
|
||||||
|
package = pkgs.nix-your-shell;
|
||||||
|
enableFishIntegration = true;
|
||||||
|
nix-output-monitor = {
|
||||||
|
enable = true;
|
||||||
|
package = pkgs.nix-output-monitor;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
imports = [
|
||||||
|
./aliases.nix
|
||||||
|
./functions.nix
|
||||||
|
./plugins.nix
|
||||||
|
];
|
||||||
|
}
|
||||||
@@ -0,0 +1,236 @@
|
|||||||
|
_: {
|
||||||
|
programs.fish.functions = {
|
||||||
|
# Count files, links and directories in the current folder
|
||||||
|
countfiles = {
|
||||||
|
body = ''
|
||||||
|
for t in files links directories
|
||||||
|
# $t[1] – pierwszy znak (f, l, d)
|
||||||
|
echo (find . -type $t[1] | wc -l) $t
|
||||||
|
end
|
||||||
|
'';
|
||||||
|
description = "Count files, links and directories in the current folder";
|
||||||
|
};
|
||||||
|
|
||||||
|
# Tail all text logs in /var/log
|
||||||
|
logs = {
|
||||||
|
body = ''
|
||||||
|
sudo find /var/log -type f -exec file {} \; \
|
||||||
|
| grep 'text' \
|
||||||
|
| cut -d' ' -f1 \
|
||||||
|
| sed -e 's/:$//g' \
|
||||||
|
| grep -v '[0-9]$' \
|
||||||
|
| xargs tail -f
|
||||||
|
'';
|
||||||
|
description = "Tail all text logs in /var/log";
|
||||||
|
};
|
||||||
|
|
||||||
|
# Quick directory creation and navigation
|
||||||
|
mkcd = {
|
||||||
|
body = ''
|
||||||
|
mkdir -p $argv[1]; and cd $argv[1]
|
||||||
|
'';
|
||||||
|
description = "Create a directory and cd into it";
|
||||||
|
};
|
||||||
|
|
||||||
|
# Extract various archive formats
|
||||||
|
extract = {
|
||||||
|
body = ''
|
||||||
|
for archive in $argv
|
||||||
|
if test -f $archive
|
||||||
|
switch $archive
|
||||||
|
case *.tar.bz2
|
||||||
|
tar xvjf $archive
|
||||||
|
case *.tar.gz
|
||||||
|
tar xvzf $archive
|
||||||
|
case *.bz2
|
||||||
|
bunzip2 $archive
|
||||||
|
case *.rar
|
||||||
|
unrar x $archive
|
||||||
|
case *.gz
|
||||||
|
gunzip $archive
|
||||||
|
case *.tar
|
||||||
|
tar xvf $archive
|
||||||
|
case *.tbz2
|
||||||
|
tar xvjf $archive
|
||||||
|
case *.tgz
|
||||||
|
tar xvzf $archive
|
||||||
|
case *.zip
|
||||||
|
unzip $archive
|
||||||
|
case *.Z
|
||||||
|
uncompress $archive
|
||||||
|
case *.7z
|
||||||
|
7z x $archive
|
||||||
|
case '*'
|
||||||
|
echo "don't know how to extract '$archive'..."
|
||||||
|
end
|
||||||
|
else
|
||||||
|
echo "'$archive' is not a valid file!"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
'';
|
||||||
|
description = "Extract various archive formats";
|
||||||
|
};
|
||||||
|
|
||||||
|
# Find files quickly
|
||||||
|
ff = {
|
||||||
|
body = ''
|
||||||
|
if test -n "$argv[1]"
|
||||||
|
find . -type f -name "*$argv[1]*"
|
||||||
|
else
|
||||||
|
echo "Usage: ff <pattern>"
|
||||||
|
end
|
||||||
|
'';
|
||||||
|
description = "Find files matching a pattern";
|
||||||
|
};
|
||||||
|
|
||||||
|
# Find directories quickly
|
||||||
|
fd = {
|
||||||
|
body = ''
|
||||||
|
if test -n "$argv[1]"
|
||||||
|
find . -type d -name "*$argv[1]*"
|
||||||
|
else
|
||||||
|
echo "Usage: fd <pattern>"
|
||||||
|
end
|
||||||
|
'';
|
||||||
|
description = "Find directories matching a pattern";
|
||||||
|
};
|
||||||
|
|
||||||
|
# IP address lookup
|
||||||
|
whatismyip = {
|
||||||
|
body = ''
|
||||||
|
# Internal IP
|
||||||
|
if command -v ip >/dev/null
|
||||||
|
echo -n "Internal IP: "
|
||||||
|
ip addr show wlan0 | grep "inet " | awk '{print $2}' | cut -d/ -f1
|
||||||
|
else
|
||||||
|
echo -n "Internal IP: "
|
||||||
|
ifconfig wlan0 | grep "inet " | awk '{print $2}'
|
||||||
|
end
|
||||||
|
|
||||||
|
# External IP
|
||||||
|
echo -n "External IP: "
|
||||||
|
curl -4 ifconfig.me
|
||||||
|
'';
|
||||||
|
description = "Show internal and external IP addresses";
|
||||||
|
};
|
||||||
|
|
||||||
|
# Search for text in all files in the current folder
|
||||||
|
ftext = {
|
||||||
|
body = ''
|
||||||
|
if test -n "$argv[1]"
|
||||||
|
grep -iIHrn --color=always "$argv[1]" . | less -r
|
||||||
|
else
|
||||||
|
echo "Usage: ftext <search term>"
|
||||||
|
end
|
||||||
|
'';
|
||||||
|
description = "Search text in files, showing matches with highlighting";
|
||||||
|
};
|
||||||
|
|
||||||
|
# Copy file with a progress bar
|
||||||
|
cpp = {
|
||||||
|
body = ''
|
||||||
|
set -e
|
||||||
|
# Use strace to monitor cp progress
|
||||||
|
strace -q -ewrite cp -- $argv[1] $argv[2] 2>&1 |
|
||||||
|
awk '
|
||||||
|
{
|
||||||
|
count += $NF
|
||||||
|
if (count % 10 == 0) {
|
||||||
|
percent = count / total_size * 100
|
||||||
|
printf "%3d%% [", percent
|
||||||
|
for (i=0;i<=percent;i++) printf "="
|
||||||
|
printf ">"
|
||||||
|
for (i=percent;i<100;i++) printf " "
|
||||||
|
printf "]\r"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
END { print "" }' total_size="$(stat -c "%s" $argv[1])" count=0
|
||||||
|
'';
|
||||||
|
description = "Copy a file with a visual progress bar";
|
||||||
|
};
|
||||||
|
|
||||||
|
# Copy and go to the directory
|
||||||
|
cpg = {
|
||||||
|
body = ''
|
||||||
|
cp $argv[1] $argv[2]
|
||||||
|
if test -d $argv[2]
|
||||||
|
cd $argv[2]
|
||||||
|
end
|
||||||
|
'';
|
||||||
|
description = "Copy a file and cd into the destination directory if it's a directory";
|
||||||
|
};
|
||||||
|
|
||||||
|
# Move and go to the directory
|
||||||
|
mvg = {
|
||||||
|
body = ''
|
||||||
|
mv $argv[1] $argv[2]
|
||||||
|
if test -d $argv[2]
|
||||||
|
cd $argv[2]
|
||||||
|
end
|
||||||
|
'';
|
||||||
|
description = "Move a file and cd into the destination directory if it's a directory";
|
||||||
|
};
|
||||||
|
|
||||||
|
# Create and go to the directory
|
||||||
|
mkdirg = {
|
||||||
|
body = ''
|
||||||
|
mkdir -p $argv[1]; and cd $argv[1]
|
||||||
|
'';
|
||||||
|
description = "Create a directory and cd into it";
|
||||||
|
};
|
||||||
|
|
||||||
|
# Go up N directories (e.g. up 4)
|
||||||
|
up = {
|
||||||
|
body = ''
|
||||||
|
set limit $argv[1]
|
||||||
|
if test -z "$limit"
|
||||||
|
set limit 1
|
||||||
|
end
|
||||||
|
set path (pwd)
|
||||||
|
for i in (seq $limit)
|
||||||
|
set path (dirname $path)
|
||||||
|
end
|
||||||
|
cd $path
|
||||||
|
'';
|
||||||
|
description = "Go up N directories";
|
||||||
|
};
|
||||||
|
|
||||||
|
# cd with automatic ls after each cd
|
||||||
|
cd = {
|
||||||
|
body = ''
|
||||||
|
builtin cd $argv
|
||||||
|
if test $status -eq 0
|
||||||
|
ls
|
||||||
|
end
|
||||||
|
'';
|
||||||
|
description = "cd with automatic ls";
|
||||||
|
};
|
||||||
|
|
||||||
|
# Return the last two components of the working directory
|
||||||
|
pwdtail = {
|
||||||
|
body = ''
|
||||||
|
pwd | awk -F/ '{nlast = NF - 1; print $nlast "/" $NF}'
|
||||||
|
'';
|
||||||
|
description = "Show the last two components of the current path";
|
||||||
|
};
|
||||||
|
|
||||||
|
# Download video via ffmpeg
|
||||||
|
ffmpeg_dl = {
|
||||||
|
body = ''
|
||||||
|
if count $argv != 3
|
||||||
|
echo "Usage: ffmpeg_dl <url> <name> <fs_path>"
|
||||||
|
return 1
|
||||||
|
end
|
||||||
|
set url $argv[1]
|
||||||
|
set name $argv[2]
|
||||||
|
set fs_path $argv[3]
|
||||||
|
|
||||||
|
mkdir -p $fs_path
|
||||||
|
set output "$fs_path/$name.mp4"
|
||||||
|
|
||||||
|
ffmpeg -i $url -c copy $output
|
||||||
|
'';
|
||||||
|
description = "Download a video using ffmpeg to a given location";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
{pkgs, ...}: {
|
||||||
|
programs.fish.plugins = [
|
||||||
|
# {
|
||||||
|
# name = "z";
|
||||||
|
# src = pkgs.fetchFromGitHub {
|
||||||
|
# owner = "jethrokuan";
|
||||||
|
# repo = "z";
|
||||||
|
# rev = "ddeb28a7b6a1f0ec6dae40c636e5ca4908ad160a";
|
||||||
|
# sha256 = "0c5i7sdrsp0q3vbziqzdyqn4fmp235ax4mn4zslrswvn8g3fvdyh";
|
||||||
|
# };
|
||||||
|
# }
|
||||||
|
|
||||||
|
# # oh-my-fish plugins are stored in their own repositories, which
|
||||||
|
# # makes them simple to import into home-manager.
|
||||||
|
# {
|
||||||
|
# name = "fasd";
|
||||||
|
# src = pkgs.fetchFromGitHub {
|
||||||
|
# owner = "oh-my-fish";
|
||||||
|
# repo = "plugin-fasd";
|
||||||
|
# rev = "38a5b6b6011106092009549e52249c6d6f501fba";
|
||||||
|
# sha256 = "06v37hqy5yrv5a6ssd1p3cjd9y3hnp19d3ab7dag56fs1qmgyhbs";
|
||||||
|
# };
|
||||||
|
# }
|
||||||
|
];
|
||||||
|
}
|
||||||
+2
-18
@@ -1,24 +1,8 @@
|
|||||||
# Fzf is a general-purpose command-line fuzzy finder.
|
_: {
|
||||||
{
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
accent = "#" + config.lib.stylix.colors.base0D;
|
|
||||||
foreground = "#" + config.lib.stylix.colors.base05;
|
|
||||||
muted = "#" + config.lib.stylix.colors.base03;
|
|
||||||
in {
|
|
||||||
programs.fzf = {
|
programs.fzf = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
enableFishIntegration = true;
|
||||||
enableBashIntegration = true;
|
enableBashIntegration = true;
|
||||||
colors = lib.mkForce {
|
|
||||||
"fg+" = accent;
|
|
||||||
"bg+" = "-1";
|
|
||||||
"fg" = foreground;
|
|
||||||
"bg" = "-1";
|
|
||||||
"prompt" = muted;
|
|
||||||
"pointer" = accent;
|
|
||||||
};
|
|
||||||
defaultOptions = [
|
defaultOptions = [
|
||||||
"--margin=1"
|
"--margin=1"
|
||||||
"--layout=reverse"
|
"--layout=reverse"
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
{host, ...}: let
|
{
|
||||||
inherit (import ../../hosts/${host}/variables.nix) gitUsername gitEmail;
|
gitUsername,
|
||||||
in {
|
gitEmail,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
programs.git = {
|
programs.git = {
|
||||||
enable = true;
|
enable = true;
|
||||||
settings = {
|
settings = {
|
||||||
|
|||||||
@@ -1,11 +1,9 @@
|
|||||||
{
|
{
|
||||||
host,
|
extraMonitorSettings,
|
||||||
config,
|
keyboardLayout,
|
||||||
pkgs,
|
pkgs,
|
||||||
...
|
...
|
||||||
}: let
|
}: {
|
||||||
inherit (import ../../../hosts/${host}/variables.nix) extraMonitorSettings keyboardLayout;
|
|
||||||
in {
|
|
||||||
systemd.user.targets.hyprland-session.Unit.Wants = [
|
systemd.user.targets.hyprland-session.Unit.Wants = [
|
||||||
"xdg-desktop-autostart.target"
|
"xdg-desktop-autostart.target"
|
||||||
];
|
];
|
||||||
@@ -64,8 +62,8 @@ in {
|
|||||||
gaps_out = 8;
|
gaps_out = 8;
|
||||||
border_size = 2;
|
border_size = 2;
|
||||||
resize_on_border = true;
|
resize_on_border = true;
|
||||||
"col.active_border" = "rgb(${config.lib.stylix.colors.base08}) rgb(${config.lib.stylix.colors.base0C}) 45deg";
|
# "col.active_border" = "rgb(${config.lib.stylix.colors.base08}) rgb(${config.lib.stylix.colors.base0C}) 45deg";
|
||||||
"col.inactive_border" = "rgb(${config.lib.stylix.colors.base01})";
|
# "col.inactive_border" = "rgb(${config.lib.stylix.colors.base01})";
|
||||||
};
|
};
|
||||||
|
|
||||||
misc = {
|
misc = {
|
||||||
@@ -107,7 +105,7 @@ in {
|
|||||||
enabled = true;
|
enabled = true;
|
||||||
range = 4;
|
range = 4;
|
||||||
render_power = 3;
|
render_power = 3;
|
||||||
color = "rgba(1a1a1aee)";
|
# color = "rgba(1a1a1aee)";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
programs.kitty = {
|
programs.kitty = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = pkgs.kitty;
|
package = pkgs.kitty;
|
||||||
|
shellIntegration.enableFishIntegration = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
imports = [
|
imports = [
|
||||||
|
|||||||
@@ -1,11 +1,9 @@
|
|||||||
{
|
{
|
||||||
lib,
|
lib,
|
||||||
host,
|
keyboardLayout,
|
||||||
username,
|
username,
|
||||||
...
|
...
|
||||||
}: let
|
}: {
|
||||||
inherit (import ../../../../hosts/${host}/variables.nix) keyboardLayout;
|
|
||||||
in {
|
|
||||||
programs.noctalia-shell.settings.general = lib.mkForce {
|
programs.noctalia-shell.settings.general = lib.mkForce {
|
||||||
avatarImage = "/home/${username}/.face.icon";
|
avatarImage = "/home/${username}/.face.icon";
|
||||||
dimmerOpacity = 0.2;
|
dimmerOpacity = 0.2;
|
||||||
|
|||||||
@@ -1,10 +1,8 @@
|
|||||||
{
|
{
|
||||||
lib,
|
lib,
|
||||||
host,
|
location,
|
||||||
...
|
...
|
||||||
}: let
|
}: {
|
||||||
inherit (import ../../../../hosts/${host}/variables.nix) location;
|
|
||||||
in {
|
|
||||||
programs.noctalia-shell.settings.location = lib.mkForce {
|
programs.noctalia-shell.settings.location = lib.mkForce {
|
||||||
name = "${location}";
|
name = "${location}";
|
||||||
weatherEnabled = true;
|
weatherEnabled = true;
|
||||||
|
|||||||
@@ -1,12 +1,7 @@
|
|||||||
{
|
{lib, ...}: {
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
accent = "#${config.lib.stylix.colors.base0D}";
|
|
||||||
in {
|
|
||||||
programs.starship = {
|
programs.starship = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
enableFishIntegration = true;
|
||||||
settings = {
|
settings = {
|
||||||
add_newline = true;
|
add_newline = true;
|
||||||
format = lib.concatStrings [
|
format = lib.concatStrings [
|
||||||
@@ -44,8 +39,8 @@ in {
|
|||||||
};
|
};
|
||||||
|
|
||||||
character = {
|
character = {
|
||||||
success_symbol = "[](${accent})";
|
success_symbol = "";
|
||||||
error_symbol = "[](red)";
|
error_symbol = "";
|
||||||
};
|
};
|
||||||
|
|
||||||
nix_shell = {
|
nix_shell = {
|
||||||
|
|||||||
+58
-2
@@ -1,14 +1,70 @@
|
|||||||
{host, ...}: {
|
{host, ...}: {
|
||||||
stylix.targets = {
|
stylix.targets = {
|
||||||
librewolf.profileNames = ["${host}"];
|
librewolf.profileNames = ["${host}"];
|
||||||
hyprland.enable = false;
|
|
||||||
|
hyprland = {
|
||||||
|
enable = true;
|
||||||
|
colors.enable = true;
|
||||||
|
hyprpaper.enable = true;
|
||||||
|
image.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
vscode.enable = false;
|
vscode.enable = false;
|
||||||
|
|
||||||
zed.enable = false;
|
zed.enable = false;
|
||||||
vesktop.enable = false;
|
|
||||||
|
vesktop = {
|
||||||
|
enable = true;
|
||||||
|
colors.enable = true;
|
||||||
|
fonts.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
noctalia-shell.enable = true;
|
noctalia-shell.enable = true;
|
||||||
|
|
||||||
qt = {
|
qt = {
|
||||||
enable = true;
|
enable = true;
|
||||||
platform = "qtct";
|
platform = "qtct";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
fish = {
|
||||||
|
enable = true;
|
||||||
|
colors.enable = true;
|
||||||
|
inputs.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
starship = {
|
||||||
|
enable = true;
|
||||||
|
colors.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
fzf = {
|
||||||
|
enable = true;
|
||||||
|
colors.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
bat = {
|
||||||
|
enable = true;
|
||||||
|
colors.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
anki = {
|
||||||
|
enable = true;
|
||||||
|
colors.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
btop = {
|
||||||
|
enable = true;
|
||||||
|
colors.enable = true;
|
||||||
|
opacity.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
kitty = {
|
||||||
|
enable = true;
|
||||||
|
colors.enable = true;
|
||||||
|
fonts.enable = true;
|
||||||
|
inputs.enable = true;
|
||||||
|
opacity.enable = true;
|
||||||
|
variant256Colors = true;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
+12
-14
@@ -1,16 +1,14 @@
|
|||||||
{username, ...}: {
|
{username, ...}: {
|
||||||
home.file = {
|
home.file.".config/swappy/config".text = ''
|
||||||
".config/swappy/config".text = ''
|
[Default]
|
||||||
[Default]
|
save_dir=/home/${username}/Pictures/Screenshots
|
||||||
save_dir=/home/${username}/Pictures/Screenshots
|
save_filename_format=swappy-%Y%m%d-%H%M%S.png
|
||||||
save_filename_format=swappy-%Y%m%d-%H%M%S.png
|
show_panel=false
|
||||||
show_panel=false
|
line_size=5
|
||||||
line_size=5
|
text_size=20
|
||||||
text_size=20
|
text_font=Ubuntu
|
||||||
text_font=Ubuntu
|
paint_mode=brush
|
||||||
paint_mode=brush
|
early_exit=true
|
||||||
early_exit=true
|
fill_shape=false
|
||||||
fill_shape=false
|
'';
|
||||||
'';
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
_: {
|
_: {
|
||||||
dconf.settings = {
|
dconf.settings."org/virt-manager/virt-manager/connections" = {
|
||||||
"org/virt-manager/virt-manager/connections" = {
|
autoconnect = ["qemu:///system"];
|
||||||
autoconnect = ["qemu:///system"];
|
uris = ["qemu:///system"];
|
||||||
uris = ["qemu:///system"];
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,5 +19,6 @@ _: {
|
|||||||
"deputy"
|
"deputy"
|
||||||
"biome"
|
"biome"
|
||||||
"opencode"
|
"opencode"
|
||||||
|
"fish"
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
_: {
|
_: {
|
||||||
programs = {
|
programs.zoxide = {
|
||||||
zoxide = {
|
enable = true;
|
||||||
enable = true;
|
enableFishIntegration = true;
|
||||||
enableBashIntegration = true;
|
enableBashIntegration = true;
|
||||||
options = [
|
options = [
|
||||||
"--cmd cd"
|
"--cmd cd"
|
||||||
];
|
];
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
{host, ...}: let
|
{
|
||||||
inherit (import ../../hosts/${host}/variables.nix) intelID nvidiaID;
|
host,
|
||||||
in {
|
intelID,
|
||||||
|
nvidiaID,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
imports = [
|
imports = [
|
||||||
../../hosts/${host}
|
../../hosts/${host}
|
||||||
../../modules/drivers
|
../../modules/drivers
|
||||||
|
|||||||
Reference in New Issue
Block a user