Compare commits

..

1 commit

Author SHA1 Message Date
nomadics9
4104de2d2c init - WIP - nothing works yet 2024-10-18 18:49:54 +03:00
50 changed files with 1637 additions and 871 deletions

1
.gitignore vendored
View file

@ -1,3 +1,2 @@
result
flake.lock.bk
sops

View file

@ -4,16 +4,17 @@
"inputs": {
"flake-parts": "flake-parts",
"haskell-flake": "haskell-flake",
"hercules-ci-effects": "hercules-ci-effects",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1733918465,
"narHash": "sha256-hSuGa8Hh67EHr2x812Ay6WFyFT2BGKn+zk+FJWeKXPg=",
"lastModified": 1722825873,
"narHash": "sha256-bFNXkD+s9NuidZePiJAjjFUnsMOwXb7hEZ4JEDdSALw=",
"owner": "hercules-ci",
"repo": "arion",
"rev": "f01c95c10f9d4f04bb08d97b3233b530b180f12e",
"rev": "90bc85532767c785245f5c1e29ebfecb941cf8c9",
"type": "github"
},
"original": {
@ -27,11 +28,11 @@
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1736711425,
"narHash": "sha256-8hKhPQuMtXfJi+4lPvw3FBk/zSJVHeb726Zo0uF1PP8=",
"lastModified": 1729099656,
"narHash": "sha256-VftVIg7UXTy1bq+tzi1aVYOWl7PQ35IpjW88yMYjjpc=",
"owner": "nix-community",
"repo": "disko",
"rev": "f720e64ec37fa16ebba6354eadf310f81555cc07",
"rev": "d7d57edb72e54891fa67a6f058a46b2bb405663b",
"type": "github"
},
"original": {
@ -43,11 +44,11 @@
"dotfiles": {
"flake": false,
"locked": {
"lastModified": 1732720152,
"narHash": "sha256-8/XX4SqEskwL5w31pQBKxWVlckWMB4X70vXuaKg48W8=",
"lastModified": 1729009831,
"narHash": "sha256-fSN4HZWxIH8n6UPoDDwn4CVA/lw7gQzBmLA2CM0Bx70=",
"ref": "refs/heads/main",
"rev": "c1e41c894627eb73ef7cc6cf401c93caacbfac32",
"revCount": 60,
"rev": "262d5fae27ddb7129a845dc0bb90e93c02407805",
"revCount": 30,
"type": "git",
"url": "https://github.com/nomadics9/dotfiles.git"
},
@ -64,11 +65,11 @@
]
},
"locked": {
"lastModified": 1733312601,
"narHash": "sha256-4pDvzqnegAfRkPwO3wmwBhVi/Sye1mzps0zHWYnP88c=",
"lastModified": 1722555600,
"narHash": "sha256-XOQkdLafnb/p9ij77byFQjDf5m5QYl9b2REiVClC+x4=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "205b12d8b7cd4802fbcb8e8ef6a0f1408781a4f9",
"rev": "8471fe90ad337a8074e957b69ca4d0089218391d",
"type": "github"
},
"original": {
@ -77,6 +78,27 @@
"type": "github"
}
},
"flake-parts_2": {
"inputs": {
"nixpkgs-lib": [
"arion",
"hercules-ci-effects",
"nixpkgs"
]
},
"locked": {
"lastModified": 1712014858,
"narHash": "sha256-sB4SWl2lX95bExY2gMFG5HIzvva5AVMJd4Igm+GpZNw=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "9126214d0a59633752a136528f5f3b9aa8565b7d",
"type": "github"
},
"original": {
"id": "flake-parts",
"type": "indirect"
}
},
"haskell-flake": {
"locked": {
"lastModified": 1675296942,
@ -93,6 +115,28 @@
"type": "github"
}
},
"hercules-ci-effects": {
"inputs": {
"flake-parts": "flake-parts_2",
"nixpkgs": [
"arion",
"nixpkgs"
]
},
"locked": {
"lastModified": 1719226092,
"narHash": "sha256-YNkUMcCUCpnULp40g+svYsaH1RbSEj6s4WdZY/SHe38=",
"owner": "hercules-ci",
"repo": "hercules-ci-effects",
"rev": "11e4b8dc112e2f485d7c97e1cee77f9958f498f5",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "hercules-ci-effects",
"type": "github"
}
},
"home-manager": {
"inputs": {
"nixpkgs": [
@ -100,11 +144,11 @@
]
},
"locked": {
"lastModified": 1736508663,
"narHash": "sha256-ZOaGwa+WnB7Zn3YXimqjmIugAnHePdXCmNu+AHkq808=",
"lastModified": 1729165983,
"narHash": "sha256-gtcodl79t5ZbbX4TSx4RNyggasEvLdVnc/IM+RyxqJw=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "2532b500c3ed2b8940e831039dcec5a5ea093afc",
"rev": "78a7a070bbcc3b37cc36080c2a3514207d427b3b",
"type": "github"
},
"original": {
@ -115,11 +159,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1736241350,
"narHash": "sha256-CHd7yhaDigUuJyDeX0SADbTM9FXfiWaeNyY34FL1wQU=",
"lastModified": 1725194671,
"narHash": "sha256-tLGCFEFTB5TaOKkpfw3iYT9dnk4awTP/q4w+ROpMfuw=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "8c9fd3e564728e90829ee7dbac6edc972971cd0f",
"rev": "b833ff01a0d694b910daca6e2ff4a3f26dee478c",
"type": "github"
},
"original": {
@ -145,13 +189,29 @@
"type": "github"
}
},
"nixpkgs-stable_2": {
"locked": {
"lastModified": 1728156290,
"narHash": "sha256-uogSvuAp+1BYtdu6UWuObjHqSbBohpyARXDWqgI12Ss=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "17ae88b569bb15590549ff478bab6494dde4a907",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "release-24.05",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1736701207,
"narHash": "sha256-jG/+MvjVY7SlTakzZ2fJ5dC3V1PrKKrUEOEE30jrOKA=",
"lastModified": 1728888510,
"narHash": "sha256-nsNdSldaAyu6PE3YUA+YQLqUDJh+gRbBooMMekZJwvI=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "ed4a395ea001367c1f13d34b1e01aa10290f67d6",
"rev": "a3c0b3b21515f74fd2665903d4ce6bc4dc81c77c",
"type": "github"
},
"original": {
@ -176,14 +236,15 @@
"inputs": {
"nixpkgs": [
"nixpkgs"
]
],
"nixpkgs-stable": "nixpkgs-stable_2"
},
"locked": {
"lastModified": 1736515725,
"narHash": "sha256-4P99yL8vGehwzytkpP87eklBePt6aqeEC5JFsIzhfUs=",
"lastModified": 1728345710,
"narHash": "sha256-lpunY1+bf90ts+sA2/FgxVNIegPDKCpEoWwOPu4ITTQ=",
"owner": "Mic92",
"repo": "sops-nix",
"rev": "f214c1b76c347a4e9c8fb68c73d4293a6820d125",
"rev": "06535d0e3d0201e6a8080dd32dbfde339b94f01b",
"type": "github"
},
"original": {

View file

@ -4,9 +4,6 @@
'';
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-23.11";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
@ -21,6 +18,9 @@
};
disko.url = "github:nix-community/disko";
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-23.11";
dotfiles = {
url = "git+https://github.com/nomadics9/dotfiles.git";
flake = false;
@ -41,7 +41,7 @@
];
forAllSystems = nixpkgs.lib.genAttrs systems;
user = "nomad";
hostname = "unkown";
hostname = "vps";
in
{
packages =

View file

@ -3,16 +3,12 @@
./zsh.nix
./fzf.nix
./neofetch.nix
./nushell.nix
./fish.nix
];
# Starship
programs.starship = {
enable = true;
enableZshIntegration = true;
enableNushellIntegration = true;
enableFishIntegration = true;
};
programs.bat = { enable = true; };
@ -25,7 +21,6 @@
tldr
zip
exiftool
chafa
nvtopPackages.full
];
}

View file

@ -1,28 +0,0 @@
{ config
, lib
, ...
}:
with lib; let
cfg = config.features.cli.fish;
in
{
options.features.cli.fish.enable = mkEnableOption "enable extended fish configuration";
config = mkIf cfg.enable {
programs.fish = {
enable = true;
shellAliases = {
rebuild = "sudo nixos-rebuild switch";
dotfilesu = "nix flake lock --update-input dotfiles";
cleanold = "sudo nix-collect-garbage --delete-old";
cleanboot = "sudo /run/current-system/bin/switch-to-configuration boot";
};
functions = {
fish_greeting = ''
chafa --align=Center ~/sync/0nmd/logo.webp --scale=0.8 -f symbols --symbols w
'';
};
};
};
}

View file

@ -29,7 +29,7 @@ in
};
defaultOptions = [
"--preview='bat --color=always -n {}'"
"--bind 'ctrl-p:toggle-preview'"
"--bind 'ctrl-/:toggle-preview'"
];
defaultCommand = "fd --type f --exclude .git --follow --hidden";
changeDirWidgetCommand = "fd --type d --exclude .git --follow --hidden";

View file

@ -5,7 +5,7 @@
}:
with lib; let
cfg = config.features.cli.neofetch;
neofetchConfig = /*bash*/ ''
neofetchConfig = ''
print_info() {
info "\033[1;32m 󱄅 " distro # cl2 (green)
info "\033[1;32m " kernel # cl2 (green)
@ -95,8 +95,8 @@ with lib; let
memory_display="on"
battery_display="on"
disk_display="on"
image_backend="chafa"
image_source="${config.home.homeDirectory}/dev/nixnix/nixcfg/assets/logo.png"
image_backend="kitty"
image_source="${config.home.homeDirectory}/nixcfg/assets/logo.png"
ascii_distro="off"
ascii="off"
ascii_colors=(distro)
@ -118,7 +118,7 @@ in
options.features.cli.neofetch.enable = mkEnableOption "enable neofetch";
config = mkIf cfg.enable {
home.packages = with pkgs; [ neofetch imagemagick ];
home.packages = with pkgs; [ neofetch ];
home.file.".config/neofetch/config.conf".text = lib.mkForce neofetchConfig;
};
}

View file

@ -1,24 +0,0 @@
{ config
, lib
, ...
}:
with lib; let
cfg = config.features.cli.nushell;
in
{
options.features.cli.nushell.enable = mkEnableOption "enable extended nushell configuration";
config = mkIf cfg.enable {
programs.nushell = {
enable = true;
shellAliases = {
rebuild = "sudo nixos-rebuild switch";
dotfilesu = "nix flake lock --update-input dotfiles";
cleanold = "sudo nix-collect-garbage --delete-old";
cleanboot = "sudo /run/current-system/bin/switch-to-configuration boot";
};
};
};
}

View file

@ -23,18 +23,17 @@ in
# '';
shellAliases = {
rebuild = "sudo nixos-rebuild switch";
switchhypr = "sudo nixos-rebuild switch --flake .";
dotfilesu = "nix flake lock --update-input dotfiles";
switchuhypr = "nix flake lock --update-input dotfiles && sudo nixos-rebuild switch --flake .";
clean = "sudo nix-collect-garbage -d";
cleanold = "sudo nix-collect-garbage --delete-old";
cleanboot = "sudo /run/current-system/bin/switch-to-configuration boot";
# nvim = "kitty @ set-spacing padding=0 && /run/current-system/sw/bin/nvim";
# nvim = "alacritty --config-file ~/.config/alacritty/alacritty_nvim.toml -e nvim";
nvim = "kitty @ set-spacing padding=0 && /run/current-system/sw/bin/nvim";
};
initExtraFirst = ''
unsetopt beep
path+=('/home/nomad/.local/bin')
'';
initExtraFirst = "
unsetopt beep
";
autosuggestion.enable = true;
syntaxHighlighting.enable = true;
# zplug = {

View file

@ -14,8 +14,7 @@ in
home.packages = with pkgs; [
fira-code
fira-code-symbols
nerd-fonts.fira-code
nerd-fonts.jetbrains-mono
fira-code-nerdfont
font-manager
font-awesome_5
font-awesome

View file

@ -27,53 +27,48 @@ in
"syncthing"
"sleep 3; qsyncthingtray"
"kdeconnect-indicator"
#"kdeconnectd"
"kdeconnectd"
"dbus-update-actvation-environment --systemd --all WAYLAND_DISPLAY XDG_CURRENT_DESKTOP"
"systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP DBUS_SESSION_BUS_ADDRESS"
];
env = [
"XCURSOR_SIZE,24"
"NIXOS_OZONE_WL,1"
"GTK_THEME,Nightfox-Dark"
"QT_AUTO_SCREEN_SCALE_FACTOR,1"
"ELECTRON_EXTRA_FLAGS,--force-device-scale-factor=1.5"
];
input = {
kb_layout = "us,ara";
kb_options = "grp:alt_shift_toggle";
kb_variant = "qwerty_digits";
kb_model = "";
kb_rules = "";
follow_mouse = 1;
touchpad = {
natural_scroll = true;
disable_while_typing = 1;
tap-to-click = 1;
};
sensitivity = 0.25;
sensitivity = 0;
};
general = {
gaps_in = 3;
gaps_in = 5;
gaps_out = 5;
border_size = 2;
"col.active_border" = "rgba(5faaffee) rgba(5faaffee) 45deg";
border_size = 1;
"col.active_border" = "rgba(02BEF5ee) rgba(02BEF5ee) 45deg";
"col.inactive_border" = "rgba(595959aa)";
layout = "dwindle";
};
decoration = {
"col.shadow" = "rgba(1E202966)";
drop_shadow = true;
shadow_range = 60;
shadow_offset = "1 2";
shadow_render_power = 3;
shadow_scale = 0.97;
rounding = 8;
shadow = {
enabled = true;
color = "rgba(1E202966)";
range = 60;
offset = "1 2";
render_power = 3;
scale = 0.97;
};
blur = {
enabled = true;
size = 3;
@ -108,10 +103,6 @@ in
workspace_swipe_min_speed_to_force = 5;
};
misc = {
vfr = true;
};
windowrule = [
"float, file_progress"
"float, confirm"
@ -121,11 +112,14 @@ in
"float, error"
"float, splash"
"float, confirmreset"
"float, title:Open File" # decrease screen brightness
"float, title:Open File"
"float, title:branchdialog"
"float, Rofi"
"float, Lxappearance"
"float, Wofi"
"float, Calculator"
"float, mako"
"rounding 10, Wofi"
"float, dunst"
"animation none,Wofi"
"float,viewnior"
"float,feh"
"float, pavucontrol-qt"
@ -134,7 +128,7 @@ in
"fullscreen, wlogout"
"float, title:wlogout"
"fullscreen, title:wlogout"
"idleinhibit focus, vlc"
"idleinhibit focus, mpv"
"idleinhibit fullscreen, firefox"
"float, title:^(Media viewer)$"
"float, title:^(Volume Control)$"
@ -150,6 +144,8 @@ in
bind = [
"$mainMod, Escape, exec, wlogout -p layer-shell"
"$mainMod, R, exec, wofi --show drun --allow-images"
"$mainMod, P, exec, wofi-pass"
"$mainMod, mouse_down, workspace, e+1"
"$mainMod, mouse_up, workspace, e-1"
@ -172,14 +168,14 @@ in
"$mainMod SHIFT, k, movewindow, u"
"$mainMod SHIFT, j, movewindow, d"
"$mainMod SHIFT, t, exec, alacritty --start-as=fullscreen -o 'font_size=18' --title all_is_kitty"
"ALT, RETURN, exec, alacritty --title fly_is_kitty"
"$mainMod, RETURN, exec, alacritty"
"$mainMod SHIFT, t, exec, kitty --start-as=fullscreen -o 'font_size=18' --title all_is_kitty"
"ALT, RETURN, exec, kitty --title fly_is_kitty"
"$mainMod, RETURN, exec, kitty --title kitty_term"
"$mainMod, C, killactive"
"$mainMod SHIFT, Q, exit"
"$mainMod, E, exec, nautilus"
"$mainMod, R, exec, ~/.config/rofi/launchers/type-6/launcher.sh"
#"$mainMod, R, exec, rofi -show drun -show-icons"
#"$mainMod, P, pseudo"
@ -188,13 +184,13 @@ in
# Screen shot
"$mainMod, S, exec, hyprctl keyword animation 'fadeOut,0,0,default'; grimshot --notify copy active; hyprctl keyword animation 'fadeOut,1,4,default'"
"$mainMod SHIFT, S, exec, grimshot savecopy area - | swappy -f - -o ~/Photos/screenshots/screenshot-$(date +'%d-%m-%Y_%H%M').png"
"$mainMod SHIFT, S, exec, grimshot savecopy area - | swappy -f - -o ~/Photos/screenshot-$(date +'%d-%m-%Y_%H:%M').png"
# Screen recorder
"$mainMod SHIFT, R, exec, wf-recorder -a -f ~/Video/recording.mkv & notify-send 'Recordering Started' -i -u -A '^C ,stop' -t 0 -i ~/icons/rec-button.png"
"$mainMod SHIFT, R, exec, wf-recorder & dunstify -a 'Recordering Started' -i -u -A '^C ,stop' -t 0 -i ~/icons/rec-button.png"
# Emoji selector
"$mainMod SHIFT, E, exec, rofimoji"
"$mainMod SHIFT, E, exec, wofi-emoji"
# Change HZ
@ -238,11 +234,14 @@ in
"$mainMod, right, resizeactive, 40 0"
"$mainMod, up, resizeactive, 0 -40"
"$mainMod, down, resizeactive, 0 40"
", XF86AudioMute, exec, $HOME/.config/hypr/scripts/volume mute"
", XF86AudioLowerVolume, exec, $HOME/.config/hypr/scripts/volume down"
", XF86AudioRaiseVolume, exec, $HOME/.config/hypr/scripts/volume up"
", XF86MonBrightnessUp, exec, $HOME/.config/hypr/scripts/brightness up"
", XF86MonBrightnessDown, exec, $HOME/.config/hypr/scripts/brightness down"
#"XF86AudioMute , exec, $HOME/.config/hypr/scripts/volume mute"
# "XF86AudioLowerVolume, exec, \"$HOME/.config/hypr/scripts/volume down\""
# "XF86AudioRaiseVolume, exec, sh -c \"$HOME/.config/hypr/scripts/volume up\""
# "XF86AudioMicMute, exec, \"pactl set-source-mute @DEFAULT_SOURCE@ toggle\""
#
# "XF86MonBrightnessUp, exec, \"$HOME/hypr/scripts/brightness up\"" # increase screen brightness
# "XF86MonBrightnessDown, exec, \"$HOME/.config/hypr/scripts/brightness down\"" # decrease screen brightness
];

View file

@ -17,16 +17,16 @@ in
mainBar = {
height = 20;
layer = "top";
modules-left = [ "custom/launcher" "custom/wg" "cpu" "memory" "custom/weather" "hyprland/workspaces" ];
modules-left = [ "custom/launcher" "cpu" "memory" "custom/weather" "hyprland/workspaces" ];
modules-center = [ "mpris" ];
modules-right = [ "network" "pulseaudio" "backlight" "battery" "tray" "hyprland/language" "custom/wallpaper" "idle_inhibitor" "custom/refresh-rate" "clock" ];
modules-right = [ "network" "pulseaudio" "backlight" "battery" "clock" "tray" "hyprland/language" "custom/wallpaper" "idle_inhibitor" "custom/refresh-rate" ];
"hyprland/workspaces" = {
format = "{name}";
all-outputs = true;
on-click = "activate";
format-icons = {
active = "󱎴";
active = " 󱎴";
default = "󰍹";
};
persistent-workspaces = {
@ -41,17 +41,17 @@ in
"9" = [ ];
};
};
"hyprland/language" = {
format = "{}";
format-ar = "🇰🇼 ";
format-en = "🇬🇧 ";
format = "{short}";
};
"hyprland/window" = {
max-length = 200;
separate-outputs = true;
};
"tray" = {
spacing = 10;
};
"clock" = {
format = "{:%H:%M}";
format-alt = "{:%b %d %Y}";
@ -60,17 +60,21 @@ in
"cpu" = {
interval = 10;
format = "🤖 {}%";
format = " {}%";
max-length = 10;
on-click = "";
};
"memory" = {
interval = 30;
format = "🧠 {}%";
format-alt = "🧠 {used:0.1f}GB";
max-length = 10;
};
"temperature" = {
interval = 10;
format = " {temperatureC}°C";
max-length = 10;
};
"backlight" = {
device = "intel_backlight";
format = "{icon}";
@ -82,7 +86,6 @@ in
smooth-scrolling-threshold = "2400";
tooltip-format = "Brightness {percent}%";
};
"network" = {
format-wifi = "<small>{bandwidthDownBytes}</small> {icon}";
min-length = 10;
@ -91,15 +94,19 @@ in
format-disconnected = "󰤭";
tooltip-format = "{essid}";
interval = 1;
on-click = "~/.config/hypr/scripts/rofi-wifi.sh";
on-click = "~/.config/hypr/scripts/wofi-wifi.sh";
format-icons = [ "󰤯" "󰤟" "󰤢" "󰤥" "󰤨" ];
};
"custom/wg" = {
exec = "~/.config/hypr/scripts/wg-status.sh";
interval = 5;
format = "{}";
on-click = "~/.config/hypr/scripts/wg-toggle.sh";
"bluetooth" = {
format = "{icon}";
format-alt = "bluetooth: {status}";
interval = 30;
format-icons = {
enabled = "";
disabled = "󰂲";
};
tooltip-format = "{status}";
};
"pulseaudio" = {
@ -120,8 +127,8 @@ in
adapter = "ADP0";
interval = 60;
states = {
warning = 15;
critical = 7;
warning = 20;
critical = 15;
};
max-length = 20;
format = "{icon}";
@ -131,9 +138,8 @@ in
format-plugged = "󰚥";
format-notcharging = "󰚥";
format-full = "󰂄";
format-alt = "<small>{capacity}%</small>";
format-alt-warning = "<small>{capacity}%</small>";
format-critical-alt = "<small>{capacity}%</small>";
format-alt = "<small>{capacity}%</small> ";
format-icons = [ "󱊡" "󱊢" "󱊣" ];
};
@ -177,7 +183,7 @@ in
"custom/launcher" = {
format = "󱄅";
on-click = "rofi -show drun";
on-click = "wofi --show drun --allow-images";
};
"custom/wallpaper" = {
@ -186,143 +192,385 @@ in
};
};
};
style = /*css*/ ''
* {
font-family: JetBrains Mono, JetBrainsMono Nerd Font, Material Design Icons;
font-size: 17px;
border: none;
border-radius: 0;
min-height: 0;
}
window#waybar {
background-color: rgba(26, 27, 38, 0.5);
color: #ffffff;
transition-property: background-color;
transition-duration: 0.5s;
}
/* General styling for individual modules */
#clock,
#temperature,
#mpris,
#cpu,
#memory,
#tray,
#workspaces,
#custom-launcher,
#custom-weather,
#custom-wg {
background-color: #222034;
font-size: 14px;
color: #8a909e;
padding: 3px 8px;
border-radius: 8px;
margin: 8px 2px;
}
/* Styling for Network, Pulseaudio, Backlight, and Battery group */
#network,
#pulseaudio,
#backlight,
#battery {
background-color: #222034;
font-size: 20px;
padding: 3px 8px;
margin: 8px 0px;
}
/* Module-specific colors for Network, Pulseaudio, Backlight, Battery */
#network, #pulseaudio { color: #5796E0; }
#backlight { color: #ecd3a0; }
#battery {
color: #8fbcbb;
padding-right: 14px
}
/* Battery state-specific colors */
#battery.warning { color: #ecd3a0; }
#battery.critical:not(.charging) { color: #fb958b; }
/* Pulseaudio mute state */
#pulseaudio.muted { color: #fb958b; }
/* Styling for Language, Custom Wallpaper, Idle Inhibitor, Custom Refresh Rate group */
#language,
#custom-refresh-rate,
#custom-wallpaper,
#idle_inhibitor {
background-color: #222034;
color: #8a909e;
padding: 3px 4px;
margin: 8px 0px;
}
/* Rounded corners for specific group elements */
#language { border-radius: 8px 0 0 8px; }
#custom-refresh-rate { border-radius: 0 8px 8px 0; }
#network { border-radius: 8px 0 0 8px; }
#battery { border-radius: 0 8px 8px 0; }
/* Temperature, CPU, and Memory colors */
#temperature { color: #5796E0; }
#cpu { color: #fb958b; }
#memory { color: #a1c999; }
/* Workspaces active button styling */
#workspaces button {
color: #5796E0;
border-radius: 8px;
box-shadow: inset 0 -3px transparent;
padding: 3px 4px;
transition: all 0.5s cubic-bezier(0.55, -0.68, 0.48, 1.68);
}
#workspaces button.active {
color: #ecd3a0;
font-weight: bold;
border-radius: 8px;
transition: all 0.5s cubic-bezier(0.55, -0.68, 0.48, 1.68);
}
#idle_inhibitor.activated {
background-color: #ecf0f1;
color: #2d3436;
border-radius: 8px;
}
/* Custom launcher */
#custom-launcher {
color: #5796E0;
font-size: 22px;
padding-right: 14px;
}
/* Tooltip styling */
tooltip {
border-radius: 15px;
padding: 15px;
background-color: #222034;
}
tooltip label {
padding: 5px;
font-size: 14px;
style = ''
* {
/* `otf-font-awesome` is required to be installed for icons */
font-family: Material Design Icons, JetBrainsMono Nerd Font, Iosevka Nerd Font ;
font-size: 14px;
border: none;
border-radius: 0;
min-height: 0;
}
'';
window#waybar {
background-color: rgba(26, 27, 38, 0.5);
color: #ffffff;
transition-property: background-color;
transition-duration: 0.5s;
}
window#waybar.hidden {
opacity: 0.1;
}
#window {
color: #64727d;
}
#clock,
#temperature,
#mpris,
#cpu,
#memory,
#custom-media,
#tray,
#mode,
#custom-lock,
#workspaces,
#custom-launcher,
#custom-spotify,
#custom-weather,
#custom-weather.severe,
#custom-weather.sunnyDay,
#custom-weather.clearNight,
#custom-weather.cloudyFoggyDay,
#custom-weather.cloudyFoggyNight,
#custom-weather.rainyDay,
#custom-weather.rainyNight,
#custom-weather.showyIcyDay,
#custom-weather.snowyIcyNight,
#custom-weather.default {
color: #e5e5e5;
border-radius: 6px;
padding: 2px 10px;
background-color: #252733;
border-radius: 8px;
font-size: 14px;
margin-left: 4px;
margin-right: 4px;
margin-top: 8.5px;
margin-bottom: 8.5px;
}
#temperature{
color: #7a95c9;
}
#cpu {
color: #fb958b;
}
#memory {
color: #a1c999;
}
#workspaces button {
color: #7a95c9;
box-shadow: inset 0 -3px transparent;
padding-right: 3px;
padding-left: 4px;
margin-left: 0.1em;
margin-right: 0em;
transition: all 0.5s cubic-bezier(0.55, -0.68, 0.48, 1.68);
}
#workspaces button.active {
color: #ecd3a0;
padding-left: 1px;
padding-right: 5px;
font-family: Iosevka Nerd Font;
font-weight: bold;
font-size: 12px;
margin-left: 0em;
margin-right: 0em;
transition: all 0.5s cubic-bezier(0.55, -0.68, 0.48, 1.68);
}
/* If workspaces is the leftmost module, omit left margin */
.modules-left > widget:first-child > #workspaces {
margin-left: 0;
}
/* If workspaces is the rightmost module, omit right margin */
.modules-right > widget:last-child > #workspaces {
margin-right: 0;
}
#custom-launcher {
margin-left: 12px;
padding-right: 18px;
padding-left: 14px;
font-size: 22px;
color: #7a95c9;
margin-top: 8.5px;
margin-bottom: 8.5px;
}
#bluetooth,
#backlight,
#battery,
#pulseaudio,
#network {
background-color: #252733;
padding: 0em 2em;
font-size: 14px;
padding-left: 7.5px;
padding-right: 7.5px;
padding-top: 3px;
padding-bottom: 3px;
margin-top: 7px;
margin-bottom: 7px;
font-size: 20px;
}
#pulseaudio {
color: #81A1C1;
padding-left: 9px;
font-size: 22px;
}
#pulseaudio.muted {
color: #fb958b;
padding-left: 9px;
font-size: 22px;
}
#backlight {
color: #ecd3a0;
padding-right: 5px;
padding-left: 8px;
font-size: 21.2px;
}
#network {
padding-left: 0.2em;
color: #5E81AC;
border-radius: 8px 0px 0px 8px;
padding-left: 14px;
padding-right: 14px;
font-size: 20px;
}
#network.disconnected {
color: #fb958b;
}
#bluetooth {
padding-left: 0.2em;
color: #5E81AC;
border-radius: 8px 0px 0px 8px;
padding-left: 14px;
padding-right: 14px;
font-size: 20px;
}
#bluetooth.disconnected {
color: #fb958b;
}
#battery {
color: #8fbcbb;
border-radius: 0px 8px 8px 0px;
padding-right: 12px;
padding-left: 12px;
font-size: 22px;
}
#battery.critical,
#battery.warning,
#battery.full,
#battery.plugged {
color: #8fbcbb;
padding-left: 12px;
padding-right: 12px;
font-size: 22px;
}
#battery.charging {
font-size: 18px;
padding-right: 12px;
padding-left: 12px;
}
#battery.full,
#battery.plugged {
font-size: 22.5px;
padding-right: 12px;
}
@keyframes blink {
to {
background-color: rgba(30, 34, 42, 0.5);
color: #abb2bf;
}
}
#battery.warning {
color: #ecd3a0;
}
#battery.critical:not(.charging) {
color: #fb958b;
}
#custom-lock {
color: #ecd3a0;
padding: 0 15px 0 15px;
margin-left: 7px;
margin-top: 7px;
margin-bottom: 7px;
}
#clock {
color: #8a909e;
font-family: Iosevka Nerd Font;
font-weight: bold;
margin-top: 7px;
margin-bottom: 7px;
}
#language,
#custom-refresh-rate,
#custom-wallpaper,
#idle_inhibitor {
background-color: #252733;
color: #8a909e;
font-family: JetBrains Mono Nerd Font;
font-weight: bold;
font-size: 17px;
padding: 0 7px; /* Adjust padding here */
margin-top: 7px;
margin-bottom: 7px;
padding-top: 3px;
padding-bottom: 3px;
}
#language {
border-radius: 8px 0 0 8px; /* Rounded on the left */
}
#custom-refresh-rate {
border-radius: 0 8px 8px 0; /* Rounded on the right */
margin-right: 12px;
}
#custom-wallpaper,
#idle_inhibitor {
/* No border-radius here to avoid separation */
padding-left: 7px;
padding-right: 7px;
}
/* Remove additional borders/margins that might cause separation */
#idle_inhibitor,
#custom-wallpaper {
margin-left: 0; /* Reset margin */
margin-right: 0; /* Reset margin */
margin-top: 7px; /* Reset margin */
margin-bottom: 7px; /* Reset margin */
}
tooltip {
font-family: Iosevka Nerd Font;
border-radius: 15px;
padding: 15px;
background-color: #1f232b;
}
tooltip label {
font-family: Iosevka Nerd Font;
padding: 5px;
}
label:focus {
background-color: #1f232b;
}
#tray {
margin-right: 8px;
margin-top: 7px;
margin-bottom: 7px;
font-size: 30px;
}
#tray > .passive {
-gtk-icon-effect: dim;
}
#tray > .needs-attention {
-gtk-icon-effect: highlight;
background-color: #eb4d4b;
}
#idle_inhibitor.activated {
background-color: #ecf0f1;
color: #2d3436;
border-radius: 8px
}
#mpris,
#custom-spotify {
color: #abb2bf;
}
#custom-weather {
font-family: Iosevka Nerd Font;
font-size: 14px;
color: #8a909e;
}
#custom-weather.severe {
color: #eb937d;
}
#custom-weather.sunnyDay {
color: #c2ca76;
}
#custom-weather.clearNight {
color: #cad3f5;
}
#custom-weather.cloudyFoggyDay,
#custom-weather.cloudyFoggyNight {
color: #c2ddda;
}
#custom-weather.rainyDay,
#custom-weather.rainyNight {
color: #5aaca5;
}
#custom-weather.showyIcyDay,
#custom-weather.snowyIcyNight {
color: #d6e7e5;
}
#custom-weather.default {
color: #dbd9d8;
}
'';
};
home.packages = with pkgs; [
wofi
wofi-emoji
dbus
sway-contrib.grimshot
hyprlock
hypridle
hyprpaper
hyprpicker
rofi-wayland
rofimoji
qt6.qtwayland
kdePackages.qt6ct
slurp
@ -341,11 +589,10 @@ in
brightnessctl
pamixer
pavucontrol # Volume control
dunst # Notifications
jellyfin-ffmpeg # Multimedia libs
viewnior # Image viewr
mako # Notifications
libcanberra-gtk3 # Notification sound
libnotify # notify-send
# Gnome Stuff
gtk-engine-murrine
@ -360,4 +607,3 @@ in
];
};
}

View file

@ -11,7 +11,7 @@ in
config = mkIf cfg.enable {
home.file.".config/user-dirs.dirs".text = /*bash*/ ''
home.file.".config/user-dirs.dirs".text = ''
XDG_DESKTOP_DIR="$HOME/Desktop"
XDG_DOWNLOAD_DIR="$HOME/Downloads"
XDG_PUBLICSHARE_DIR="$HOME/Public"

View file

@ -10,17 +10,15 @@ in
options.features.themes.qt.enable = mkEnableOption "qt theme";
config = mkIf cfg.enable {
qt = {
enable = true;
platformTheme.name = "adwaita";
style = {
name = "adwaita-dark";
};
qt.enable = true;
qt.platformTheme.name = "adwaita";
qt.style = {
name = "adwaita-dark";
};
home.packages = with pkgs;
[
adwaita-qt6
];
home.packages = with pkgs; [
adwaita-qt6
];
};
}

View file

@ -1,5 +1,5 @@
{
home.file.".config/bat/config".text = /*bash*/ ''
home.file.".config/bat/config".text = ''
--theme="Dracula"
# Show line numbers, Git modifications and file header (but no grid)

View file

@ -1,13 +1,11 @@
{ inputs, pkgs, ... }: {
imports = [
./bat.nix
./kitty.nix
./rofi.nix
./nvim.nix
./dunst.nix
];
home.file.".config/mako" = {
source = "${inputs.dotfiles}/mako";
home.file.".config/nvim" = {
source = "${inputs.dotfiles}/nvim";
recursive = true;
};

View file

@ -0,0 +1,208 @@
{
home.file.".config/dunst/dunstrc".text = ''
[global]
# --- Display --- #
# The monitor to be displayed to
monitor = 0
# Follow monitor with mouse
follow = mouse
width = 300
# height = 260
origin = top-right
offset = 10x1
progress_bar = true
progress_bar_height = 14
progress_bar_frame_width = 1
progress_bar_min_width = 150
progress_bar_max_width = 300
progress_bar_corner_radius = 5
# Show how many messages are hidden
indicate_hidden = yes
# Shrink window if it's smaller than the width.
shrink = no
# The transparency of the window.
transparency = 1
# Draw a line between multiple notifications
separator_height = 6
separator_color = "#272f57"
# Set notification padding
padding = 16
horizontal_padding = 16
# Disable frame (border)
frame_width = 0
# Sort messages by urgency.
sort = no
# Disable idle time
idle_threshold = 0
# --- Text --- #
# Set the font
# font = "Noto Sans 11"
font = "JetBrainsMono 11"
# Set line height to font height
line_height = 0
# Reference for markup and formatting:
# <b>bold</b>
# <i>italic</i>
# <s>strikethrough</s>
# <u>underline</u>
# <https://developer.gnome.org/pango/stable/pango-Markup.html>.
# %a appname
# %s summary
# %b body
# %i iconname (including its path)
# %I iconname (without its path)
# %p progress value if set ([ 0%] to [100%]) or nothing
# %n progress value if set without any extra characters
# %% Literal %
markup = full
format = "<b>%a</b>\n%b\n%s"
# Left align the text
alignment = left
# Vertical alignment of message text and icon.
vertical_alignment = center
# Show age of message if message is old
show_age_threshold = 120
# Wrap text if it doesn't fit in geometry
word_wrap = yes
# Where to place ellipses if word wrap is disabled
# ellipsize = middle
# Use newlines '\n' in notifications.
ignore_newline = no
# Don't stack together notifications
stack_duplicates = true
# Hide the count of stacked notifications
# hide_duplicate_count = false
# Display indicators for URLs (U) and actions (A).
show_indicators = yes
# ---- Icons ---- #
# Align icons left/right/off
icon_position = left
# Scale small icons up to this size, set to 0 to disable.
min_icon_size = 50
# Scale larger icons down to this size, set to 0 to disable
max_icon_size = 60
# Paths to default icons.
icon_path = /usr/share/icons/kora/apps/scalable:/usr/share/icons/kora/status/scalable:/usr/share/icons/kora/actions/scalable:/usr/share/icons/kora/emblems/scalable:/usr/share/icons/kora/devices/scalable
# --- History --- #
# Avoid timing out hidden notifications
sticky_history = yes
# Maximum amount of notifications kept in history
history_length = 100
# --- Misc/Advanced --- #
dmenu = /usr/bin/dmenu -p dunst:
# Browser for opening urls in context menu.
browser = google-chrome-stable -new-tab
# Always run rule-defined scripts, even if the notification is suppressed
always_run_script = false
# Define the title of the windows spawned by dunst
title = Dunst
# Define the class of the windows spawned by dunst
class = Dunst
# Define the corner radius of the notification window
corner_radius = 20
# Don't gnore the dbus closeNotification message.
ignore_dbusclose = false
# --- Legacy --- #
# Use the Xinerama extension instead of RandR for multi-monitor support.
force_xinerama = false
# --- Mouse --- #
mouse_left_click = close_current
mouse_middle_click = close_all, close_current
mouse_right_click = do_action
[experimental]
per_monitor_dpi = false
[urgency_low]
background = "#141929fe"
highlight = "#6fa6e7"
frame_color = "#272f57"
foreground = "#dae1f2"
timeout = 8
[urgency_normal]
background = "#26292e"
highlight = "#5ca1ff"
frame_color = "#272f57"
foreground = "#dae1f2"
timeout = 8
[urgency_critical]
background = "#5ca1ffff"
highlight = "#fe6c5a"
foreground = "#1c2138"
frame_color = "#52426e"
timeout = 0
icon = battery-ac-adapter
[backlight]
appname = "Backlight"
highlight = "#fc7b80"
[music]
appname = "Music"
[volume]
summary = "Volume*"
highlight = "#cb8cf4"
[battery]
appname = "Power Warning"
'';
}

View file

@ -1,97 +0,0 @@
{
home.file.".config/kitty/kitty.conf".text = /*bash*/ ''
linux_display_server wayland
wayland_titlebar_color background
allow_remote_control yes
enable_audio_bell no
font_family JetBrainsMono Nerd Font
bold_font auto
italic_font auto
bold_italic_font auto
font_size 14
background_opacity 0.9
# window settings
initial_window_width 95c
initial_window_height 35c
window_padding_width 20
confirm_os_window_close 0
# Upstream colors {{{
# Special
background #14151e
foreground #98b0d3
# Black
color0 #151720
color8 #4f5572
# Red
color1 #dd6777
color9 #e26c7c
# Green
color2 #90ceaa
color10 #95d3af
# Yellow
color3 #ecd3a0
color11 #f1d8a5
# Blue
color4 #86aaec
color12 #8baff1
# Magenta
color5 #c296eb
color13 #c79bf0
# Cyan
color6 #93cee9
color14 #98d3ee
# White
color7 #cbced3
color15 #d0d3d8
# Cursor
cursor #cbced3
cursor_text_color #a5b6cf
# Selection highlight
selection_foreground #a5b6cf
selection_background #1c1e27
# The color for highlighting URLs on mouse-over
# url_color #9ece6a
url color #5de4c7
# Window borders
active_border_color #3d59a1
inactive_border_color #101014
bell_border_color #fffac2
# Tab bar
tab_bar_style fade
tab_fade 1
active_tab_foreground #3d59a1
active_tab_background #16161e
active_tab_font_style bold
inactive_tab_foreground #787c99
inactive_tab_background #16161e
inactive_tab_font_style bold
tab_bar_background #101014
# Title bar
macos_titlebar_color #16161e
# {{{ Keybindings
map ctrl+t new_tab_with_cwd
map ctrl+t close_tab
# }}
'';
}

View file

@ -1,7 +0,0 @@
{ inputs, ... }:
{
home.file.".config/rofi" = {
source = "${inputs.dotfiles}/rofi";
recursive = true;
};
}

22
home/nomad/homelab.nix Normal file
View file

@ -0,0 +1,22 @@
{
imports = [
../common
./dotfiles/nvim.nix
../features/cli
../features/desktop
../features/themes
./home/home.nix
];
features = {
cli = {
zsh.enable = true;
fzf.enable = true;
neofetch.enable = true;
};
desktop = {
fonts.enable = true;
};
};
}

View file

@ -0,0 +1,34 @@
{ config, lib, pkgs, user, ... }:
{
home.username = lib.mkDefault user;
home.homeDirectory = lib.mkDefault "/home/${config.home.username}";
home.stateVersion = "24.05";
home.packages = with pkgs; [
mullvad-vpn
tailscale
htop
bun
lua-language-server
];
home.file = { };
home.sessionVariables = {
EDITOR = "nvim";
GBM_BACKEND = "nvidia-drm";
WLR_RENDERER = "vulkan";
VK_DRIVER_FILES = "/run/opengl-driver/share/vulkan/icd.d/nvidia_icd.x86_64.json";
XDG_CACHE_HOME = "${config.home.homeDirectory}/.cache";
XDG_CONFIG_HOME = "${config.home.homeDirectory}/.config";
XDG_BIN_HOME = "${config.home.homeDirectory}/.nix-profile/bin";
XDG_DATA_HOME = "${config.home.homeDirectory}/.local/share";
};
programs.home-manager.enable = true;
}

View file

@ -10,9 +10,7 @@
features = {
cli = {
zsh.enable = false;
nushell.enable = false;
fish.enable = true;
zsh.enable = true;
fzf.enable = true;
neofetch.enable = true;
};
@ -32,19 +30,29 @@
wayland.windowManager.hyprland = {
settings = {
device = [
{
name = "keyboard";
kb_layout = "us,ara";
}
{
name = "mouse";
sensitivity = -0.5;
}
];
monitor = [
"DP-1,highres,auto,1"
"eDP-1,2560x1600@60,0x0,1.25,mirror,DP-1"
"eDP-1,2560x1600@60,0x0,1.25"
"DP-2,1920x1080@60,auto,1"
];
workspace = [
# "1, monitor:DP-1, default:true"
# "2, monitor:DP-1"
# "3, monitor:DP-1"
# "4, monitor:DP-1"
# "5, monitor:DP-1"
# "6, monitor:DP-1"
# "7, monitor:DP-1"
"1, monitor:eDP-1, default:true"
"2, monitor:eDP-1"
"3, monitor:eDP-1"
"4, monitor:eDP-1"
"5, monitor:eDP-1"
"6, monitor:eDP-1"
"7, monitor:eDP-1"
];
};
};

View file

@ -7,25 +7,28 @@
{
home.username = lib.mkDefault user;
home.homeDirectory = lib.mkDefault "/home/${config.home.username}";
# This value determines the Home Manager release that your configuration is
# compatible with. This helps avoid breakage when a new Home Manager release
# introduces backwards incompatible changes.
#
# You should not change this value, even if you update Home Manager. If you do
# want to update the value, then make sure to first check the Home Manager
# release notes.
home.stateVersion = "24.05"; # Please read the comment before changing.
# The home.packages option allows you to install Nix packages into your
# environment.
home.packages = with pkgs; [
# Essentials
kitty
alacritty
tmux
firefox
google-chrome
age
sops
networkmanagerapplet
nvd
# Apps
vlc
amberol
webcord
#bottles
#cava
bottles
cava
ryujinx
mullvad-vpn
transmission_4-gtk
@ -34,17 +37,11 @@
syncthing
qsyncthingtray
htop
openvpn
#nvtopPackages.full
nvtopPackages.full
exiftool
moonlight-qt
kdePackages.kdeconnect-kde
cmatrix
#jellyfin-media-player
speedtest-go
wireguard-tools
# Dev
devbox
go
python3
nim
@ -54,18 +51,13 @@
bruno
ripgrep
zip
nodejs
gcc
python312Packages.pip
android-studio
android-tools
#zed-fhs
# android-studio
# android-tools
jre17_minimal
# Nvim-Lsps
# Nvim-Lua
lua-language-server
tailwindcss-language-server
glow
# Hacks
responder-patched
cowsay
# # Adds the 'hello' command to your environment. It prints a friendly
@ -86,7 +78,20 @@
# '')
];
home.file = { };
# Home Manager is pretty good at managing dotfiles. The primary way to manage
# plain files is through 'home.file'.
home.file = {
# # Building this configuration will create a copy of 'dotfiles/screenrc' in
# # the Nix store. Activating the configuration will then make '~/.screenrc' a
# # symlink to the Nix store copy.
# ".screenrc".source = dotfiles/screenrc;
# # You can also set the file content immediately.
# ".gradle/gradle.properties".text = ''
# org.gradle.console=verbose
# org.gradle.daemon.idletimeout=3600000
# '';
};
# Home Manager can also manage your environment variables through
# 'home.sessionVariables'. If you don't want to manage your shell through Home
@ -110,17 +115,15 @@
NIXOS_OZONE_WL = "1";
MOZ_ENABLE_WAYLAND = "1";
SDL_VIDEODRIVER = "wayland";
QT_AUTO_SCREEN_SCALE_FACTOR = "1";
ELECTRON_EXTRA_FLAGS = "--force-device-scale-factor=1.5";
#_JAVA_AWT_WM_NONREPARENTING = "1";
#MOZ_DRM_DEVICE = "/dev/dri/card0:/dev/dri/card1";
#WLR_DRM_DEVICES = "/dev/dri/card0:/dev/dri/card1";
_JAVA_AWT_WM_NONREPARENTING = "1";
MOZ_DRM_DEVICE = "/dev/dri/card0:/dev/dri/card1";
WLR_DRM_DEVICES = "/dev/dri/card0:/dev/dri/card1";
#WLR_NO_HARDWARE_CURSORS = "1"; # if no cursor,uncomment this line
#GBM_BACKEND = "nvidia-drm";
#CLUTTER_BACKEND = "wayland";
CLUTTER_BACKEND = "wayland";
LIBVA_DRIVER_NAME = "iHD";
#WLR_RENDERER = "vulkan";
#VK_DRIVER_FILES = "/run/opengl-driver/share/vulkan/icd.d/nvidia_icd.x86_64.json";
WLR_RENDERER = "vulkan";
VK_DRIVER_FILES = "/run/opengl-driver/share/vulkan/icd.d/nvidia_icd.x86_64.json";
#__GLX_VENDOR_LIBRARY_NAME = "nvidia";
#__NV_PRIME_RENDER_OFFLOAD = "1";
XDG_CURRENT_DESKTOP = "Hyprland";

View file

@ -8,7 +8,7 @@
features = {
cli = {
fish.enable = true;
zsh.enable = true;
fzf.enable = true;
neofetch.enable = true;
};

View file

@ -4,6 +4,7 @@
imports = [
./users
./services
./homelab
./vps
inputs.home-manager.nixosModules.home-manager
];

View file

@ -0,0 +1,111 @@
{ config, lib, pkgs, user, ... }:
with lib;
let
arrServices = {
prowlarr = {
image = "ghcr.io/hotio/prowlarr";
container_name = "prowlarr";
environment = {
PUID = "1000";
PGID = "1000";
UMASK = "002";
TZ = "Asia/Kuwait";
};
volumes = [ "/home/${user}/configs/prowlarr_config:/config" ];
ports = [ "9696:9696" ];
restart = "unless-stopped";
};
sonarr = {
image = "linuxserver/sonarr:latest";
container_name = "sonarr";
environment = {
PUID = "1000";
PGID = "1000";
TZ = "Asia/Kuwait";
};
volumes = [
"/home/${user}/configs/sonarr_config:/config"
"/home/${user}/media/tvshows:/tvshows"
"/home/${user}/media/anime:/anime"
"/home/${user}/media/transmission/downloads/complete:/downloads/complete"
];
ports = [ "8989:8989" ];
restart = "unless-stopped";
};
radarr = {
image = "linuxserver/radarr:latest";
container_name = "radarr";
environment = {
PUID = "1000";
PGID = "1000";
TZ = "Asia/Kuwait";
};
networks = [ "jellyfin" ];
volumes = [
"/home/${user}/configs/radarr_config:/config"
"/home/${user}/media/movies:/movies"
"/home/${user}/media/transmission/downloads/complete:/downloads/complete"
];
ports = [ "7878:7878" ];
restart = "unless-stopped";
};
readarr = {
image = "lscr.io/linuxserver/readarr:develop";
container_name = "readarr";
environment = {
PUID = "1000";
PGID = "1000";
TZ = "Asia/Kuwait";
};
networks = [ "jellyfin" ];
volumes = [
"/home/${user}/configs/readarr_config:/config"
"/home/${user}/media/books:/books"
"/home/${user}/media/transmission/downloads/complete:/downloads/complete"
];
ports = [ "8787:8787" ];
restart = "unless-stopped";
};
bazarr = {
image = "linuxserver/bazarr";
container_name = "bazarr";
environment = {
DOCKER_MODS = "wayller/bazarr-mod-subsync:latest";
PUID = "1000";
PGID = "1000";
TZ = "Asia/Kuwait";
};
networks = [ "jellyfin" ];
volumes = [
"/home/${user}/configs/bazarr_config:/config"
"/home/${user}/media/tvshows:/tvshows"
"/home/${user}/media/movies:/movies"
"/home/${user}/media/anime:/anime"
];
ports = [ "6767:6767" ];
restart = "unless-stopped";
};
networks = [ "jellyfin" ];
};
in
{
options.services.arr.enable = mkEnableOption "Enable ARR services stack";
config = mkIf config.services.arr.enable {
virtualisation.arion = {
backend = "docker";
projects.dufs = {
serviceName = "arr";
settings = arrServices;
};
};
};
}

View file

@ -0,0 +1,10 @@
{
imports = [
./arr.nix
./jellyfin.nix
./transcoding.nix
./transmission.nix
./utils.nix
];
}

View file

@ -0,0 +1,57 @@
{ config, lib, pkgs, ... }:
with lib;
let
jellyfinServices = {
jellyfin = {
image = "nomadics/alaskarfin:latest";
container_name = "jellyfin";
environment = {
PUID = "1000";
PGID = "1000";
TZ = "Asia/Kuwait";
};
volumes = [
"/home/${user}/configs/jellyfin_config:/config"
"/home/${user}/media/tvshows:/data/tvshows"
"/home/${user}/media/movies:/data/movies"
];
ports = [ "8096:8096" ];
restart = "unless-stopped";
};
jellyseerr = {
image = "nomadics/alaskarseer:latest";
container_name = "jellyseerr";
environment = {
PUID = "1000";
PGID = "1000";
LOG_LEVEL = "debug";
TZ = "Asia/Kuwait";
JELLYFIN_TYPE = "jellyfin";
};
networks = [ "jellyfin" ];
ports = [ "5055:5055" ];
volumes = [ "/home/${user}/configs/jellyseerr_config:/app/config" ];
restart = "unless-stopped";
depends_on = [
"radarr"
"sonarr"
];
};
networks = [ "jellyfin" ];
};
in
{
options.services.jellyfin-server.enable = mkEnableOption "Enable Jellyfin stack";
config = mkIf config.services.jellyfin-server.enable {
virtualisation.arion = {
backend = "docker";
projects.dufs = {
serviceName = "jellyfin";
settings = jellyfinServices;
};
};
};
}

View file

@ -0,0 +1,39 @@
{ config, lib, pkgs, ... }:
with lib;
let
transcodingServices = {
tdarr = {
image = "ghcr.io/haveagitgat/tdarr:latest";
container_name = "tdarr";
environment = {
PUID = "1000";
PGID = "1000";
TZ = "Asia/Kuwait";
NVIDIA_VISIBLE_DEVICES = "all";
};
volumes = [
"/home/${user}/configs/tdarr_config:/config"
"/home/${user}/media:/media"
];
ports = [
"8265:8265"
"8266:8266"
];
restart = "unless-stopped";
};
};
in
{
options.services.transcoding.enable = mkEnableOption "Enable transcoding stack";
config = mkIf config.services.transcoding.enable {
virtualisation.arion = {
backend = "docker"; # Or "podman" if you use Podman
projects.dufs = {
serviceName = "transcoding";
settings = transcodingServices;
};
};
};
}

View file

@ -0,0 +1,39 @@
{ config, lib, pkgs, ... }:
with lib;
let
transmissionServices = {
transmission = {
image = "linuxserver/transmission:latest";
container_name = "transmission";
environment = {
PUID = "1000";
PGID = "1000";
TZ = "Asia/Kuwait";
};
volumes = [
"/home/${user}/configs/transmission_config:/config"
"/home/${user}/media/transmission/downloads:/downloads"
];
ports = [
"9091:9091"
"51413:51413"
"51413:51413/udp"
];
restart = "unless-stopped";
};
};
in
{
options.services.downloader.enable = mkEnableOption "Enable Transmission service";
config = mkIf config.services.downloader.enable {
virtualisation.arion = {
backend = "docker"; # Or "podman" if you use Podman
projects.dufs = {
serviceName = "transmission";
settings = transmissionServices;
};
};
};
}

View file

@ -0,0 +1,112 @@
{ config, lib, pkgs, user, ... }:
with lib;
let
utilsServices = {
jellystat = {
image = "cyfershepard/jellystat:unstable";
container_name = "jellystat";
environment = {
POSTGRES_USER = "postgres";
POSTGRES_PASSWORD = "serverstat";
TZ = "Asia/Kuwait";
};
volumes = [ "/home/${user}/configs/jellystat-backup-data:/app/backend/backup-data" ];
ports = [ "3000:3000" ];
restart = "unless-stopped";
};
jellystat-db = {
container_name = "jellystat-db";
image = "postgres:15.2";
environment = {
POSTGRES_DB = "jfstat";
POSTGRES_USER = "postgres";
POSTGRES_PASSWORD = "serverstat";
TZ = "Asia/Kuwait";
};
restart = "unless-stopped";
volumes = [
"/home/${user}/configs/postgres-data:/var/lib/postgresql/data" # Mounting the volume
];
};
jfa-go = {
container_name = "jfa-go";
image = "hrfee/jfa-go:latest";
restart = "unless-stopped";
volumes = [
"/home/${user}/configs/jfa-go_config/jfa-go:/data"
"/home/sager/stream-stack/jellyfin_config:/jf"
"/etc/localtime:/etc/localtime:ro"
];
ports = [
"8056:8056"
];
};
image = "golift/unpackerr";
container_name = "unpackerr";
volumes = [
"/home/${user}/media/transmission/downloads:/downloads"
];
restart = "always";
user = "1000:1000";
environment = {
TZ = "Asia/Kuwait";
UN_DEBUG = "false";
UN_LOG_FILE = "";
UN_LOG_FILES = "10";
UN_LOG_FILE_MB = "10";
UN_INTERVAL = "2m";
UN_START_DELAY = "1m";
UN_RETRY_DELAY = "5m";
UN_MAX_RETRIES = "3";
UN_PARALLEL = "1";
UN_FILE_MODE = "0644";
UN_DIR_MODE = "0755";
# Sonarr Config
UN_SONARR_0_URL = "http://192.168.0.200:8989";
UN_SONARR_0_API_KEY = "ece789601b4541be934324cc5c338092";
UN_SONARR_0_PATHS_0 = "/downloads";
UN_SONARR_0_PROTOCOLS = "torrent";
UN_SONARR_0_TIMEOUT = "10s";
UN_SONARR_0_DELETE_ORIG = "false";
UN_SONARR_0_DELETE_DELAY = "5m";
# Radarr Config
UN_RADARR_0_URL = "http://192.168.0.200:7878";
UN_RADARR_0_API_KEY = "446ab739173c4cb1b2c52eb1f3000f50";
UN_RADARR_0_PATHS_0 = "/downloads";
UN_RADARR_0_PROTOCOLS = "torrent";
UN_RADARR_0_TIMEOUT = "10s";
UN_RADARR_0_DELETE_ORIG = "false";
UN_RADARR_0_DELETE_DELAY = "5m";
# UN_READARR_0_URL = "http://readarr:8787";
# UN_READARR_0_API_KEY = "";
# UN_READARR_0_PATHS_0 = "/downloads";
# UN_READARR_0_PROTOCOLS = "torrent";
# UN_READARR_0_TIMEOUT = "10s";
# UN_READARR_0_DELETE_ORIG = "false";
# UN_READARR_0_DELETE_DELAY = "5m";
};
security_opt = [ "no-new-privileges:true" ];
};
in
{
options.services.utils.enable = mkEnableOption "Enable Utils services stack";
config = mkIf config.services.utils.enable {
virtualisation.arion = {
backend = "docker"; # Or "podman" if you use Podman
projects.dufs = {
serviceName = "utils";
settings = utilsServices;
};
};
};
}

View file

@ -13,7 +13,7 @@ in
services.gnome.gnome-keyring.enable = true;
programs.nautilus-open-any-terminal = {
enable = true;
terminal = "alacritty";
terminal = "kitty";
};
services.gvfs.enable = true;
services.tumbler.enable = true;

View file

@ -8,7 +8,7 @@
${user} = {
initialPassword = "4321";
isNormalUser = true;
shell = pkgs.fish;
shell = pkgs.zsh;
description = "${user}";
extraGroups = [
"wheel"
@ -23,25 +23,24 @@
"qemu-libvirtd"
"docker"
"key"
"wireshark"
];
packages = [ inputs.home-manager.packages.${pkgs.system}.default ];
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICqA7j8hk3+k0b04eDxuoUakldqKrP0aatLm+CREjFJe" #SSH, YOU HAVE TO CHANGE THIS OR REMOVE IT
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICqA7j8hk3+k0b04eDxuoUakldqKrP0aatLm+CREjFJe"
];
};
root = {
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICqA7j8hk3+k0b04eDxuoUakldqKrP0aatLm+CREjFJe" #SSH, YOU HAVE TO CHANGE THIS OR REMOVE IT
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICqA7j8hk3+k0b04eDxuoUakldqKrP0aatLm+CREjFJe"
];
extraGroups = [ "key" ];
};
};
#Decrypt the secrets file using sops-nix with age
# Decrypt the secrets file using sops-nix with age
sops.secrets = {
DUFS_USERNAME = { };
DUFS_PASSWORD = { };
@ -50,6 +49,7 @@
NEXTCLOUD_DB = { };
};
sops.templates."my-env.env".content = ''
DUFS_USERNAME = "${config.sops.placeholder.DUFS_USERNAME}"
DUFS_PASSWORD = "${config.sops.placeholder.DUFS_PASSWORD}"
@ -58,13 +58,9 @@
NEXTCLOUD_DB = "${config.sops.placeholder.NEXTCLOUD_DB}"
'';
programs.wireshark = {
enable = true;
package = pkgs.wireshark;
};
users.users = { };
# programs.zsh.enable = true;
programs.fish.enable = true;
programs.zsh.enable = true;
home-manager.users.${user} =
import ../../../home/${user}/${config.networking.hostName}.nix;
}

View file

@ -1,42 +0,0 @@
{ config, lib, pkgs, user, ... }:
with lib;
let
audiobookshelfService = {
project.name = "audiobookshelf";
services = {
dashdot = {
service = {
image = "ghcr.io/advplyr/audiobookshelf:latest";
ports = [
"13378:80"
];
volumes = [
"${config.users.users.${user}.home}/dockers/audiobookshelf/audiobooks:/audiobooks"
"${config.users.users.${user}.home}/dockers/audiobookshelf/podcasts:/podcasts"
"${config.users.users.${user}.home}/dockers/audiobookshelf/config:/config"
"${config.users.users.${user}.home}/dockers/audiobookshelf/metadata:/metadata"
];
environment = {
TZ = "Asia/Kuwait";
};
};
};
};
};
in
{
options.vps.audiobookshelf.enable = mkEnableOption "Enable audiobookshelf for VPS";
config = mkIf config.vps.audiobookshelf.enable {
virtualisation.arion = {
backend = "docker";
projects.audiobookshelf = {
serviceName = "audiobookshelf";
settings = audiobookshelfService;
};
};
};
}

View file

@ -1,42 +0,0 @@
{ config, lib, pkgs, user, ... }:
with lib;
let
dashdotService = {
project.name = "dashdot";
services = {
dashdot = {
service = {
image = "mauricenino/dashdot:latest";
restart = "unless-stopped";
privileged = true;
ports = [
"19999:3001"
];
volumes = [
"/:/mnt/host:ro"
];
environment = {
DASHDOT_PAGE_TITLE = "Nomadics VPS";
DASHDOT_ALWAYS_SHOW_PERCENTAGES = "true";
};
};
};
};
};
in
{
options.vps.dashdot.enable = mkEnableOption "Enable dashdot dashboard for VPS";
config = mkIf config.vps.dashdot.enable {
virtualisation.arion = {
backend = "docker";
projects.dashdot = {
serviceName = "dashdot";
settings = dashdotService;
};
};
};
}

View file

@ -5,8 +5,6 @@
./pairdrop.nix
./syncthing.nix
./vpn.nix
./dashdot.nix
./audiobookshelf.nix
];
}

View file

@ -15,13 +15,12 @@ let
service.command = [
"/data"
"-a"
''???:???#fs@/:rw'' # till i figure out how to pass the damn env
"???:???@/:rw"
"-A"
"-a"
"@/p"
];
service.env_file = [ "${config.sops.templates."my-env.env".path}" ];
};
};
};

View file

@ -0,0 +1,109 @@
{ pkgs, hostname, ... }: {
imports = [
./hardware-configuration.nix
];
hardware.nvidia.enable = true;
hardware.disko.enable = true;
programs.nix-ld.enable = true;
common.services.appimage.enable = true;
systemd.services.arion = {
enable = true;
serviceConfig = {
Restart = "on-failure";
};
};
services = {
arr.enable = true;
jellyfin.enable = true;
transcoding.enable = true;
transmission.enable = true;
utils.enable = true;
};
sops = {
age.keyFile = "/home/${user}/.config/sops/age/keys.txt";
defaultSopsFile = ../../secrets/secrets.yaml;
defaultSopsFormat = "yaml";
};
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
boot.loader.efi.efiSysMountPoint = "/boot/efi";
boot.loader.systemd-boot.configurationLimit = 3;
boot.supportedFilesystems = [ "ntfs" ];
networking.hostName = "Homelab";
networking.networkmanager.enable = true;
hardware.pulseaudio.enable = false;
security.rtkit.enable = false;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
};
time.timeZone = "Asia/Kuwait";
i18n.defaultLocale = "en_US.UTF-8";
i18n.extraLocaleSettings = {
LC_ADDRESS = "en_GB.UTF-8";
LC_IDENTIFICATION = "en_GB.UTF-8";
LC_MEASUREMENT = "en_GB.UTF-8";
LC_MONETARY = "en_GB.UTF-8";
LC_NAME = "en_GB.UTF-8";
LC_NUMERIC = "en_GB.UTF-8";
LC_PAPER = "en_GB.UTF-8";
LC_TELEPHONE = "en_GB.UTF-8";
LC_TIME = "en_GB.UTF-8";
};
services.xserver = {
exportConfiguration = true;
xkb.layout = "us,ara";
xkb.options = "grp:alt_shift_toggle";
xkb.variant = "qwerty_digits";
};
services.printing.enable = true;
nixpkgs.config.allowUnfree = true;
environment.systemPackages = with pkgs; [
neovim
git
zsh
];
networking.firewall.enable = true;
networking.firewall.allowedTCPPorts = [
9696
8989
7878
8787
6767
8096
5055
8265
8266
9091
51413
3000
8056
];
system.stateVersion = "24.05";
}

48
hosts/homelab/default.nix Normal file
View file

@ -0,0 +1,48 @@
# A staring point is the basic NIXOS configuration generated by the ISO installer.
# On an existing NIXOS install you can use the following command in your flakes basedir:
# sudo nixos-generate-config --dir ./hosts/your-host
#
# Please make sure to change the first couple of lines in your configuration.nix:
# { config, inputs, ouputs, lib, pkgs, ... }:
{
# imports = [ # Include the results of the hardware scan.
# ./hardware-configuration.nix
# inputs.home-manager.nixosModules.home-manager
# ];
#
# # ...
#
# Moreover please update the packages option in your user configuration and add the home-manager options:
# users.users = {
# ${user} = {
# isNormalUser = true;
# initialPassword = "4321";
# extraGroups = [ "wheel" ]; # Enable sudo for the user.
# packages = [ inputs.home-manager.packages.${pkgs.system}.default ];
# };
# };
# home-manager = {
# useUserPackages = true;
# extraSpecialArgs = { inherit inputs outputs; };
# users.${user} =
# import ../../home/${user}/${config.networking.hostName}.nix;
# };
# Please also change your hostname accordingly:
#:w
# networking.hostName = "unkown"; # Define your hostname.
imports = [
../common
../homelab
./hardware
./configuration.nix
];
}

View file

@ -0,0 +1,7 @@
{
imports = [
./nvidia.nix
./disko.nix
];
}

View file

@ -0,0 +1,50 @@
{ config
, lib
, pkgs
, ...
}:
with lib; let
cfg = config.hardware.disko;
in
{
options.hardware.disko.enable = mkEnableOption "disko harddrives";
config = mkIf cfg.enable {
disko.devices = {
disk = {
os_drive = {
type = "disk";
path = "/dev/sde"; # OS hard drive
partitions = {
ESP = {
type = "EF00"; # EFI system partition type
size = "512M"; # EFI partition size
content = {
type = "filesystem";
format = "vfat"; # Filesystem type for EFI
mountpoint = "/boot/efi"; # Mount point for EFI
};
};
root = {
size = "100%"; # Use remaining space for root partition
content = {
type = "filesystem";
format = "ext4"; # Filesystem type for root
mountpoint = "/"; # Root mount point
};
};
};
ssd_1 = {
content = {
type = "lvm";
path = "/dev/vg-ssd/lv-ssd";
mountPoint = "/home";
#format = null; # Do not format, preserve data
};
};
};
};
};
};
}

View file

@ -0,0 +1,68 @@
{ config
, lib
, pkgs
, ...
}:
with lib; let
cfg = config.hardware.nvidia;
in
{
options.hardware.nvidia.enable = mkEnableOption "nvidia driver";
config = mkIf cfg.enable {
#Allow unfree packages
nixpkgs.config.allowUnfree = true;
services.xserver = {
videoDrivers = [ "nvidia" ];
};
hardware = {
graphics.enable = true;
# opengl.driSupport = true;
graphics.enable32Bit = true;
graphics = {
extraPackages = with pkgs; [
intel-media-driver # LIBVA_DRIVER_NAME=iHD
# intel-vaapi-driver # LIBVA_DRIVER_NAME=i965 (older but works better for Firefox/Chromium)
# libvdpau-va-gl
# vaapiVdpau
# mesa.drivers
];
};
nvidia.nvidiaSettings = true;
nvidia.powerManagement.enable = false;
nvidia.powerManagement.finegrained = false;
nvidia.open = false;
# nvidia.forceFullCompositionPipeline = true;
# nvidia-drm.modeset=1 is required for some wayland compositors, e.g. sway
nvidia.modesetting.enable = false;
#nvidia.nvidiaPersistenced = true;
# Optionally, you may need to select the appropriate driver version for your specific GPU.
nvidia.package = config.boot.kernelPackages.nvidiaPackages.stable;
};
# Nvidia in Docker
virtualisation.docker = {
enable = true;
enableOnBoot = true;
#enableNvidia = true;
};
hardware.nvidia-container-toolkit.enable = true;
environment.systemPackages = with pkgs; [
cudatoolkit
];
};
}

View file

@ -27,15 +27,6 @@
common.services.steam.enable = true;
services.flatpak.enable = true;
# Sops secrets Comment this out if you dont need secrets! and configure ur user in hosts/common/users/YOURUSERNAME.nix
sops = {
age.keyFile = "/etc/nixos/sops/age/keys.txt";
defaultSopsFile = ../../secrets/secrets.yaml;
defaultSopsFormat = "yaml";
};
#services.samba.enable = true;
#Bootloader
boot.loader.systemd-boot.enable = true;
@ -46,6 +37,13 @@
# Ntfs support
boot.supportedFilesystems = [ "ntfs" ];
sops = {
age.keyFile = "/etc/nixos/sops/age/keys.txt";
defaultSopsFile = ../../secrets/secrets.yaml;
defaultSopsFormat = "yaml";
};
# Enable GDM Login Manager
services.xserver.enable = true;
@ -56,33 +54,20 @@
autoSuspend = true;
};
programs.hyprland = {
enable = true;
xwayland.enable = true;
};
#Network
#Define your hostname
networking.hostName = "${hostname}";
# Enable networking
networking.networkmanager.enable = true;
services.avahi = {
enable = true;
nssmdns4 = true;
};
#Hosts
networking.extraHosts = ''
192.168.0.200 rancher.local
'';
# Bluethooth
hardware.bluetooth.enable = true;
services.blueman.enable = true;
# services.blueman.enable = true;
# Enable sound with pipewire.
# sound.enable = true;
hardware.pulseaudio.enable = false;
security.rtkit.enable = true;
security.rtkit.enable = false;
services.pipewire = {
enable = true;
alsa.enable = true;
@ -94,10 +79,7 @@
# Set your time zone.
#time.timeZone = "Asia/Kuwait";
services.ntp = {
enable = true;
};
time.timeZone = "Asia/Kuwait";
# Select internationalisation properties.
i18n.defaultLocale = "en_US.UTF-8";
i18n.extraLocaleSettings = {
@ -116,7 +98,7 @@
services.xserver = {
exportConfiguration = true; # link /usr/share/X11/ properly
xkb.layout = "us,ara";
xkb.options = "grp:alt_shift_toggle,ctrl:swapcaps";
xkb.options = "grp:alt_shift_toggle";
xkb.variant = "qwerty_digits";
};
@ -137,9 +119,13 @@
neovim
git
zsh
nssmdns
];
programs.hyprland = {
enable = true;
xwayland.enable = true;
};
#Firewall
# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ];
@ -147,7 +133,6 @@
# networking.firewall.allowedUDPPortRanges = [ { from = 32768; to = 60999; } ];
# Or disable the firewall altogether.
networking.firewall.enable = false;
networking.nftables.enable = false;
# Before changing this value read the documentation for this option

View file

@ -9,7 +9,7 @@
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "thunderbolt" "nvme" "i915" ];
boot.initrd.availableKernelModules = [ "xhci_pci" "thunderbolt" "nvme" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];

View file

@ -26,9 +26,9 @@ in
extraPackages = with pkgs; [
intel-media-driver # LIBVA_DRIVER_NAME=iHD
# intel-vaapi-driver # LIBVA_DRIVER_NAME=i965 (older but works better for Firefox/Chromium)
libvdpau-va-gl
vaapiVdpau
mesa.drivers
# libvdpau-va-gl
# vaapiVdpau
# mesa.drivers
];
};
@ -74,8 +74,7 @@ in
virtualisation.docker = {
enable = true;
enableOnBoot = true;
enableNvidia = true;
extraOptions = ''--data-root=/home/nomad/docker-data'';
#enableNvidia = true;
};
hardware.nvidia-container-toolkit.enable = true;

View file

@ -17,17 +17,12 @@
};
};
documentation.enable = false;
vps = {
dufs.enable = true;
nextcloud.enable = false;
pairdrop.enable = true;
syncthing.enable = true;
vpn.enable = true;
dashdot.enable = true;
audiobookshelf.enable = false;
};
sops = {
@ -38,91 +33,26 @@
services.caddy = {
enable = true;
logDir = "/var/log/caddy";
# Configure log format using mkForce to make sure it takes effect
logFormat = lib.mkForce ''
level INFO
'';
# Reverse proxy configuration for each domain
extraConfig = ''
(logging) {
log {
output file /var/log/caddy/{args[0]}.log {
roll_size 50mb
roll_keep 5
roll_keep_for 720h
}
}
}
fs.nmd.mov {
reverse_proxy localhost:5000
import logging fs
}
vpn.nmd.mov {
reverse_proxy localhost:51821
import logging vpn
}
s.nmd.mov {
reverse_proxy localhost:8384
import logging s
}
drop.nmd.mov {
reverse_proxy localhost:3000
import logging drop
}
}
dot.nmd.mov {
reverse_proxy localhost:19999
basic_auth /* {
nomad $2a$12$toBh5sfXyxigtHGNY4t8tO7YYQp6i3aZk/O0qd19lgk0LRz5eqDVi
}
reverse_proxy localhost:4400
}
dash.nmd.mov {
reverse_proxy localhost:8080
}
nmd.mov www.nmd.mov {
reverse_proxy localhost:3001
}
www.alaskar.dev alaskar.dev {
root * /var/www/portofolio
file_server
try_files {path} {path}.html
handle_errors {
rewrite * /404.html
file_server
}
}
log.nmd.mov {
root * /var/www/goaccess
file_server
reverse_proxy /ws_fs localhost:7890
reverse_proxy /ws_drop localhost:7891
reverse_proxy /ws_vpn localhost:7892
reverse_proxy /ws_sync localhost:7893
basic_auth /* {
nomad $2a$12$toBh5sfXyxigtHGNY4t8tO7YYQp6i3aZk/O0qd19lgk0LRz5eqDVi
}
}
'';
};
networking.useDHCP = lib.mkForce false;
services.cloud-init = {
enable = true;
@ -177,15 +107,18 @@
zsh
arion
sops
jq
];
networking.firewall.enable = true;
networking.firewall.enable = false;
networking.firewall.allowedTCPPorts = [
22
80
443
5000
4400
3000
8384
22000
51821
];
@ -194,12 +127,6 @@
21027
51820
];
networking.firewall.extraCommands = ''
# Allow access to port 19999 from localhost
iptables -A INPUT -p tcp -s 127.0.0.1 --dport 19999 -j ACCEPT
# Block all other access to port 19999
iptables -A INPUT -p tcp --dport 19999 -j DROP
'';
system.stateVersion = "24.05";
}

View file

@ -4,7 +4,6 @@ GREEN="\e[32m"
YELLOW="\e[33m"
BLUE="\e[34m"
ENDCOLOR="\e[0m"
echo -e " $YELLOW
_ _ ___ __ __ _ ____ _ _ _____ _____ ____ ___ _ _ ____ _____ _ _ _ _____ ____
| \ | |/ _ \| \/ | / \ | _ \ | \ | |_ _\ \/ / _ \/ ___| |_ _| \ | / ___|_ _|/ \ | | | | | ____| _ \
@ -17,84 +16,100 @@ $ENDCOLOR
$RED TO MAKE SURE EVERYTHING RUNS CORRECTLY $ENDCOLOR $GREEN RUN AS ROOT '"sudo bash install.sh"' $ENDCOLOR
"
echo
echo
# Prompt for username and hostname
read -p "Enter the new username: " new_user
read -p "Enter the new hostname: " new_hostname
# Define the flake file path and current user
# Define the flake file path
flake_file="./flake.nix"
config_file="./hosts/$new_hostname/configuration.nix"
config_file="./hosts/$new_hostname/configuration.nix" # Specify the correct path for your host's configuration file
monitor_config_file="./home/$new_user/$new_hostname.nix"
current_user=$(logname)
# Check if source files exist
if [[ ! -f "./hosts/common/users/nomad.nix" && ! -d "./hosts/unkown/" ]]; then
echo -e "$RED Source files nomad.nix or ./hosts/unkown directory does not exist! $ENDCOLOR"
exit 1
fi
# Function to copy and configure the home.nix file for the user and hostname
setup_home_configuration() {
local user_dir="./home/$new_user/$new_hostname"
if [ ! -d "$user_dir" ]; then
mkdir -p "$user_dir"
fi
# Copy the home.nix file and update the hostname path inside
cp "./home/nomad/unkown/home.nix" "$user_dir/home.nix"
cp "./home/nomad/unkown.nix" "./home/$new_user/$new_hostname.nix"
cp -r "./home/nomad/dotfiles/" "./home/$new_user/"
sed -i "s|unkown|$new_hostname|g" "./home/$new_user/$new_hostname.nix"
chown -R $current_user:users "./home/$new_user"
echo -e "$GREEN Home configuration for $new_user created and updated with hostname $new_hostname! $ENDCOLOR"
}
# Function to create or overwrite host configuration
setup_host_configuration() {
if [ -d "./hosts/$new_hostname" ]; then
read -p "Directory $new_hostname already exists. Overwrite contents? (y/n) " choice
if [[ "$choice" != "y" && "$choice" != "yes" ]]; then
echo -e "$YELLOW Skipping host configuration for $new_hostname... $ENDCOLOR"
return
fi
echo -e "$YELLOW Overwriting Host configuration for $new_hostname... $ENDCOLOR"
rm -r "./hosts/$new_hostname"
else
echo -e "$YELLOW Creating Host configuration for $new_hostname... $ENDCOLOR"
fi
# Create new host
if [ -d "./hosts/$new_hostname" ]; then
read -p "Directory $new_hostname already exists. Overwrite contents? (y/n) " choice
if [[ "$choice" != "y" && "$choice" != "yes" ]]; then
echo -e "$YELLOW Skipping.. $ENDCOLOR"
else
echo -e "$YELLOW Overwriting Host configuration for $new_hostname... $ENDCOLOR"
rm -r "./hosts/$new_hostname"
cp -r "./hosts/unkown" "./hosts/$new_hostname"
sleep 0.2
chown -R $current_user:users "./hosts/$new_hostname"
rm "./hosts/$new_hostname/hardware-configuration.nix"
cp "/etc/nixos/hardware-configuration.nix" "./hosts/${new_hostname}/"
echo -e "$GREEN Host configuration for $new_hostname created successfully! $ENDCOLOR"
}
fi
else
echo -e "$YELLOW Creating Host configuration for $new_hostname... $ENDCOLOR"
cp -r "./hosts/unkown" "./hosts/$new_hostname"
sleep 0.2
echo -e "$YELLOW Copying your hardware configurations $ENDCOLOR"
cp "/etc/nixos/hardware-configuration.nix" "./hosts/unkown/hardware-configuration.nix"
chown -R $current_user:users "./hosts/$new_hostname"
echo -e "$GREEN Host configuration for $new_hostname created successfully! $ENDCOLOR"
fi
# Function to create or overwrite user configuration
setup_user_configuration() {
if [ -f "./hosts/common/users/$new_user.nix" ]; then
read -p "File $new_user.nix already exists. Overwrite? (y/n) " choice
if [[ "$choice" != "y" && "$choice" != "yes" ]]; then
echo -e "$YELLOW Skipping user configuration for $new_user... $ENDCOLOR"
return
fi
echo -e "$YELLOW Overwriting User configuration for $new_user... $ENDCOLOR"
else
echo -e "$YELLOW Creating User configuration for $new_user... $ENDCOLOR"
fi
# Create user directories
if [ -f "./hosts/common/users/$new_user.nix" ]; then
read -p "File $new_user.nix already exists. Overwrite? (y/n) " choice
if [[ "$choice" != "y" && "$choice" != "yes" ]]; then
echo -e "$YELLOW Skipping.. $ENDCOLOR"
else
echo -e "$YELLOW Overwriting User configuration for $new_user... $ENDCOLOR"
cp "./hosts/common/users/nomad.nix" "./hosts/common/users/$new_user.nix"
chown $current_user:users "./hosts/common/users/$new_user.nix"
echo -e "$GREEN User configuration for $new_user created successfully! $ENDCOLOR"
}
fi
else
echo -e "$YELLOW Creating User configuration for $new_user... $ENDCOLOR"
cp "./hosts/common/users/nomad.nix" "./hosts/common/users/$new_user.nix"
chown $current_user:users "./hosts/common/users/$new_user.nix"
echo -e "$GREEN User configuration for $new_user created successfully! $ENDCOLOR"
fi
if [ -d "./home/$new_user" ]; then
read -p "Directory $new_user already exists. Overwrite contents? (y/n) " choice
if [[ "$choice" != "y" && "$choice" != "yes" ]]; then
echo -e "$YELLOW Skipping.. $ENDCOLOR"
else
echo -e "$YELLOW Overwriting Home configuration for $new_user... $ENDCOLOR"
if [ ! -d "./home/$new_user" ]; then
mkdir "./home/$new_user"
fi
sleep 0.2
cp "./home/nomad/home.nix" "./home/$new_user/home.nix"
cp "./home/nomad/unkown.nix" "./home/$new_user/$new_hostname.nix"
cp -r "./home/nomad/dotfiles/" "./home/$new_user/"
chown -R $current_user:users "./home/$new_user"
echo -e "$GREEN Home configuration for $new_user created successfully! $ENDCOLOR"
fi
else
echo -e "$YELLOW Creating Home configuration for $new_user... $ENDCOLOR"
if [ ! -d "./home/$new_user" ]; then
mkdir "./home/$new_user"
fi
sleep 0.2
cp "./home/nomad/home.nix" "./home/$new_user/home.nix"
cp "./home/nomad/unkown.nix" "./home/$new_user/$new_hostname.nix"
cp -r "./home/nomad/dotfiles/" "./home/$new_user/"
chown -R $current_user:users "./home/$new_user"
echo -e "$GREEN Home configuration for $new_user created successfully! $ENDCOLOR"
fi
# Call the functions to create configurations
setup_host_configuration
setup_user_configuration
setup_home_configuration
# Replace the 'user' and 'hostname' values in the flake.nix file
sed -i "s/user = \".*\";/user = \"$new_user\";/" "$flake_file"
@ -182,9 +197,7 @@ fi
echo -e "$GREEN Configuration has been updated with your preferences $ENDCOLOR"
sleep 2
git add .
nixos-rebuild switch --flake .#unkown
home-manager switch -b backup --flake .
sudo nixos-rebuild boot --flake .#${new_hostname}
echo -e "$GREEN Reboot after completion your initial password is 4321 $ENDCOLOR"

View file

@ -10,74 +10,6 @@
# example = prev.example.overrideAttrs (oldAttrs: rec {
# ...
# });
rofimoji = prev.rofimoji.override { rofi = prev.rofi-wayland; };
# electron = prev.electron.overrideAttrs (oldAttrs: {
# postInstall = ''
# wrapProgram $out/bin/electron \
# --add-flags "--force-device-scale-factor=1.5"
# '';
# });
responder-patched = prev.responder.overrideAttrs (oldAttrs: rec {
buildInputs = oldAttrs.buildInputs or [ ] ++ [ prev.openssl prev.coreutils ];
installPhase = ''
runHook preInstall
mkdir -p $out/bin $out/share/Responder
cp -R . $out/share/Responder
makeWrapper ${prev.python3.interpreter} $out/bin/responder \
--set PYTHONPATH "$PYTHONPATH:$out/share/Responder" \
--add-flags "$out/share/Responder/Responder.py" \
--run "mkdir -p /var/lib/responder"
substituteInPlace $out/share/Responder/Responder.conf \
--replace-quiet "Responder-Session.log" "/var/lib/responder/Responder-Session.log" \
--replace-quiet "Poisoners-Session.log" "/var/lib/responder/Poisoners-Session.log" \
--replace-quiet "Analyzer-Session.log" "/var/lib/responder/Analyzer-Session.log" \
--replace-quiet "Config-Responder.log" "/var/lib/responder/Config-Responder.log" \
--replace-quiet "Responder.db" "/var/lib/responder/Responder.db"
runHook postInstall
runHook postPatch
'';
postInstall = ''
wrapProgram $out/bin/responder \
--run "mkdir -p /var/lib/responder/certs && ${prev.openssl}/bin/openssl genrsa -out /var/lib/responder/certs/responder.key 2048 && ${prev.openssl}/bin/openssl req -new -x509 -days 3650 -key /var/lib/responder/certs/responder.key -out /var/lib/responder/certs/responder.crt -subj '/'" \
--run "mkdir -p /etc/responder && if [ ! -f /etc/responder/Responder.conf ]; then cp $out/share/Responder/Responder.conf /etc/responder/Responder.conf && chmod +w /etc/responder/Responder.conf; fi"
'';
postPatch = ''
if [ -f $out/share/Responder/settings.py ]; then
substituteInPlace $out/share/Responder/settings.py \
--replace-quiet "self.LogDir = os.path.join(self.ResponderPATH, 'logs')" "self.LogDir = os.path.join('/var/lib/responder', 'logs')" \
--replace-quiet "os.path.join(self.ResponderPATH, 'Responder.conf')" "'/etc/responder/Responder.conf'"
fi
if [ -f $out/share/Responder/utils.py ]; then
substituteInPlace $out/share/Responder/utils.py \
--replace-quiet "logfile = os.path.join(settings.Config.ResponderPATH, 'logs', fname)" "logfile = os.path.join('/var/lib/responder', 'logs', fname)"
fi
if [ -f $out/share/Responder/Responder.py ]; then
substituteInPlace $out/share/Responder/Responder.py \
--replace-quiet "certs/responder.crt" "/var/lib/responder/certs/responder.crt" \
--replace-quiet "certs/responder.key" "/var/lib/responder/certs/responder.key"
fi
if [ -f $out/share/Responder/Responder.conf ]; then
substituteInPlace $out/share/Responder/Responder.conf \
--replace-quiet "certs/responder.crt" "/var/lib/responder/certs/responder.crt" \
--replace-quiet "certs/responder.key" "/var/lib/responder/certs/responder.key"
fi
'';
});
};
stable-packages = final: _prev: {
@ -87,7 +19,3 @@
};
};
}

View file

@ -1,52 +1 @@
output=$(nix store diff-closures $(ls -d /nix/var/nix/profiles/* | tail -2) | sed -r "s/\x1B\[[0-9;]*[mK]//g")
# Replace newline characters with spaces for a more horizontal notification
formatted_output=$(echo "$output" | awk '
{
# Extract package name, version, and size from the input line
if (match($0, /^([^:]+):.*→ ([^,]+), \+([0-9.]+) KiB/, arr)) {
package = arr[1]
full_version = arr[2]
size_kib = arr[3]
# Extract only the first and second numbers of the version
split(full_version, version_parts, ".")
version = version_parts[1] "." version_parts[2]
# Convert KiB to MiB and round to the nearest whole number if needed
size_mib = size_kib / 1024
size_mib_rounded = (size_mib >= 1) ? sprintf("%.0f", size_mib) "M" : size_kib "KiB"
# Append each entry to the formatted output
formatted_output = formatted_output "🔹 " package ": " version " +" size_mib_rounded "\n"
}
} END {
# Output all entries once processing is complete
print formatted_output
}')
chunk_size=5
echo "$formatted_output" | awk -v chunk_size="$chunk_size" '
{
lines[++count] = $0
if (count % chunk_size == 0) {
for (i = 1; i <= count; i++) {
printf "%s\n", lines[i]
}
printf "---\n"
count = 0
}
}
END {
if (count > 0) {
for (i = 1; i <= count; i++) {
printf "%s\n", lines[i]
}
}
}' | while IFS= read -r chunk; do
if [[ "$chunk" != "---" ]]; then
notify-send -u low -h string:x-mako-stack-tag:diff "💫 Updated Packages" "$chunk" -t 0 -u critical
fi
done
nix store diff-closures $(ls -d /nix/var/nix/profiles/*|tail -2)

View file

@ -1,8 +0,0 @@
#!/usr/bin/env bash
git pull
sleep 1
sudo nixos-rebuild switch --flake .#unkown
echo -e "Update Completed!"
./update-report.sh