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 result
flake.lock.bk flake.lock.bk
sops

View file

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

View file

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

View file

@ -3,16 +3,12 @@
./zsh.nix ./zsh.nix
./fzf.nix ./fzf.nix
./neofetch.nix ./neofetch.nix
./nushell.nix
./fish.nix
]; ];
# Starship # Starship
programs.starship = { programs.starship = {
enable = true; enable = true;
enableZshIntegration = true; enableZshIntegration = true;
enableNushellIntegration = true;
enableFishIntegration = true;
}; };
programs.bat = { enable = true; }; programs.bat = { enable = true; };
@ -25,7 +21,6 @@
tldr tldr
zip zip
exiftool exiftool
chafa
nvtopPackages.full 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 = [ defaultOptions = [
"--preview='bat --color=always -n {}'" "--preview='bat --color=always -n {}'"
"--bind 'ctrl-p:toggle-preview'" "--bind 'ctrl-/:toggle-preview'"
]; ];
defaultCommand = "fd --type f --exclude .git --follow --hidden"; defaultCommand = "fd --type f --exclude .git --follow --hidden";
changeDirWidgetCommand = "fd --type d --exclude .git --follow --hidden"; changeDirWidgetCommand = "fd --type d --exclude .git --follow --hidden";

View file

@ -5,7 +5,7 @@
}: }:
with lib; let with lib; let
cfg = config.features.cli.neofetch; cfg = config.features.cli.neofetch;
neofetchConfig = /*bash*/ '' neofetchConfig = ''
print_info() { print_info() {
info "\033[1;32m 󱄅 " distro # cl2 (green) info "\033[1;32m 󱄅 " distro # cl2 (green)
info "\033[1;32m " kernel # cl2 (green) info "\033[1;32m " kernel # cl2 (green)
@ -95,8 +95,8 @@ with lib; let
memory_display="on" memory_display="on"
battery_display="on" battery_display="on"
disk_display="on" disk_display="on"
image_backend="chafa" image_backend="kitty"
image_source="${config.home.homeDirectory}/dev/nixnix/nixcfg/assets/logo.png" image_source="${config.home.homeDirectory}/nixcfg/assets/logo.png"
ascii_distro="off" ascii_distro="off"
ascii="off" ascii="off"
ascii_colors=(distro) ascii_colors=(distro)
@ -118,7 +118,7 @@ in
options.features.cli.neofetch.enable = mkEnableOption "enable neofetch"; options.features.cli.neofetch.enable = mkEnableOption "enable neofetch";
config = mkIf cfg.enable { 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; 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 = { shellAliases = {
rebuild = "sudo nixos-rebuild switch"; switchhypr = "sudo nixos-rebuild switch --flake .";
dotfilesu = "nix flake lock --update-input dotfiles"; 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"; cleanold = "sudo nix-collect-garbage --delete-old";
cleanboot = "sudo /run/current-system/bin/switch-to-configuration boot"; cleanboot = "sudo /run/current-system/bin/switch-to-configuration boot";
# nvim = "kitty @ set-spacing padding=0 && /run/current-system/sw/bin/nvim"; nvim = "kitty @ set-spacing padding=0 && /run/current-system/sw/bin/nvim";
# nvim = "alacritty --config-file ~/.config/alacritty/alacritty_nvim.toml -e nvim";
}; };
initExtraFirst = '' initExtraFirst = "
unsetopt beep unsetopt beep
path+=('/home/nomad/.local/bin') ";
'';
autosuggestion.enable = true; autosuggestion.enable = true;
syntaxHighlighting.enable = true; syntaxHighlighting.enable = true;
# zplug = { # zplug = {

View file

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

View file

@ -27,53 +27,48 @@ in
"syncthing" "syncthing"
"sleep 3; qsyncthingtray" "sleep 3; qsyncthingtray"
"kdeconnect-indicator" "kdeconnect-indicator"
#"kdeconnectd" "kdeconnectd"
"dbus-update-actvation-environment --systemd --all WAYLAND_DISPLAY XDG_CURRENT_DESKTOP" "dbus-update-actvation-environment --systemd --all WAYLAND_DISPLAY XDG_CURRENT_DESKTOP"
"systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP DBUS_SESSION_BUS_ADDRESS" "systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP DBUS_SESSION_BUS_ADDRESS"
]; ];
env = [ env = [
"XCURSOR_SIZE,24" "XCURSOR_SIZE,24"
"NIXOS_OZONE_WL,1"
"GTK_THEME,Nightfox-Dark" "GTK_THEME,Nightfox-Dark"
"QT_AUTO_SCREEN_SCALE_FACTOR,1"
"ELECTRON_EXTRA_FLAGS,--force-device-scale-factor=1.5"
]; ];
input = { input = {
kb_layout = "us,ara"; kb_layout = "us,ara";
kb_options = "grp:alt_shift_toggle"; kb_options = "grp:alt_shift_toggle";
kb_variant = "qwerty_digits"; kb_variant = "qwerty_digits";
kb_model = "";
kb_rules = "";
follow_mouse = 1; follow_mouse = 1;
touchpad = { touchpad = {
natural_scroll = true; natural_scroll = true;
disable_while_typing = 1;
tap-to-click = 1;
}; };
sensitivity = 0.25; sensitivity = 0;
}; };
general = { general = {
gaps_in = 3; gaps_in = 5;
gaps_out = 5; gaps_out = 5;
border_size = 2; border_size = 1;
"col.active_border" = "rgba(5faaffee) rgba(5faaffee) 45deg"; "col.active_border" = "rgba(02BEF5ee) rgba(02BEF5ee) 45deg";
"col.inactive_border" = "rgba(595959aa)"; "col.inactive_border" = "rgba(595959aa)";
layout = "dwindle"; layout = "dwindle";
}; };
decoration = { 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; rounding = 8;
shadow = {
enabled = true;
color = "rgba(1E202966)";
range = 60;
offset = "1 2";
render_power = 3;
scale = 0.97;
};
blur = { blur = {
enabled = true; enabled = true;
size = 3; size = 3;
@ -108,10 +103,6 @@ in
workspace_swipe_min_speed_to_force = 5; workspace_swipe_min_speed_to_force = 5;
}; };
misc = {
vfr = true;
};
windowrule = [ windowrule = [
"float, file_progress" "float, file_progress"
"float, confirm" "float, confirm"
@ -121,11 +112,14 @@ in
"float, error" "float, error"
"float, splash" "float, splash"
"float, confirmreset" "float, confirmreset"
"float, title:Open File" # decrease screen brightness "float, title:Open File"
"float, title:branchdialog" "float, title:branchdialog"
"float, Rofi" "float, Lxappearance"
"float, Wofi"
"float, Calculator" "float, Calculator"
"float, mako" "rounding 10, Wofi"
"float, dunst"
"animation none,Wofi"
"float,viewnior" "float,viewnior"
"float,feh" "float,feh"
"float, pavucontrol-qt" "float, pavucontrol-qt"
@ -134,7 +128,7 @@ in
"fullscreen, wlogout" "fullscreen, wlogout"
"float, title:wlogout" "float, title:wlogout"
"fullscreen, title:wlogout" "fullscreen, title:wlogout"
"idleinhibit focus, vlc" "idleinhibit focus, mpv"
"idleinhibit fullscreen, firefox" "idleinhibit fullscreen, firefox"
"float, title:^(Media viewer)$" "float, title:^(Media viewer)$"
"float, title:^(Volume Control)$" "float, title:^(Volume Control)$"
@ -150,6 +144,8 @@ in
bind = [ bind = [
"$mainMod, Escape, exec, wlogout -p layer-shell" "$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_down, workspace, e+1"
"$mainMod, mouse_up, workspace, e-1" "$mainMod, mouse_up, workspace, e-1"
@ -172,14 +168,14 @@ in
"$mainMod SHIFT, k, movewindow, u" "$mainMod SHIFT, k, movewindow, u"
"$mainMod SHIFT, j, movewindow, d" "$mainMod SHIFT, j, movewindow, d"
"$mainMod SHIFT, t, exec, alacritty --start-as=fullscreen -o 'font_size=18' --title all_is_kitty" "$mainMod SHIFT, t, exec, kitty --start-as=fullscreen -o 'font_size=18' --title all_is_kitty"
"ALT, RETURN, exec, alacritty --title fly_is_kitty" "ALT, RETURN, exec, kitty --title fly_is_kitty"
"$mainMod, RETURN, exec, alacritty" "$mainMod, RETURN, exec, kitty --title kitty_term"
"$mainMod, C, killactive" "$mainMod, C, killactive"
"$mainMod SHIFT, Q, exit" "$mainMod SHIFT, Q, exit"
"$mainMod, E, exec, nautilus" "$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" #"$mainMod, P, pseudo"
@ -188,13 +184,13 @@ in
# Screen shot # Screen shot
"$mainMod, S, exec, hyprctl keyword animation 'fadeOut,0,0,default'; grimshot --notify copy active; hyprctl keyword animation 'fadeOut,1,4,default'" "$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 # 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 # Emoji selector
"$mainMod SHIFT, E, exec, rofimoji" "$mainMod SHIFT, E, exec, wofi-emoji"
# Change HZ # Change HZ
@ -238,11 +234,14 @@ in
"$mainMod, right, resizeactive, 40 0" "$mainMod, right, resizeactive, 40 0"
"$mainMod, up, resizeactive, 0 -40" "$mainMod, up, resizeactive, 0 -40"
"$mainMod, down, resizeactive, 0 40" "$mainMod, down, resizeactive, 0 40"
", XF86AudioMute, exec, $HOME/.config/hypr/scripts/volume mute" #"XF86AudioMute , exec, $HOME/.config/hypr/scripts/volume mute"
", XF86AudioLowerVolume, exec, $HOME/.config/hypr/scripts/volume down" # "XF86AudioLowerVolume, exec, \"$HOME/.config/hypr/scripts/volume down\""
", XF86AudioRaiseVolume, exec, $HOME/.config/hypr/scripts/volume up" # "XF86AudioRaiseVolume, exec, sh -c \"$HOME/.config/hypr/scripts/volume up\""
", XF86MonBrightnessUp, exec, $HOME/.config/hypr/scripts/brightness up" # "XF86AudioMicMute, exec, \"pactl set-source-mute @DEFAULT_SOURCE@ toggle\""
", XF86MonBrightnessDown, exec, $HOME/.config/hypr/scripts/brightness down" #
# "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 = { mainBar = {
height = 20; height = 20;
layer = "top"; 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-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" = { "hyprland/workspaces" = {
format = "{name}"; format = "{name}";
all-outputs = true; all-outputs = true;
on-click = "activate"; on-click = "activate";
format-icons = { format-icons = {
active = "󱎴"; active = " 󱎴";
default = "󰍹"; default = "󰍹";
}; };
persistent-workspaces = { persistent-workspaces = {
@ -41,17 +41,17 @@ in
"9" = [ ]; "9" = [ ];
}; };
}; };
"hyprland/language" = { "hyprland/language" = {
format = "{}"; format = "{short}";
format-ar = "🇰🇼 ";
format-en = "🇬🇧 ";
}; };
"hyprland/window" = {
max-length = 200;
separate-outputs = true;
};
"tray" = { "tray" = {
spacing = 10; spacing = 10;
}; };
"clock" = { "clock" = {
format = "{:%H:%M}"; format = "{:%H:%M}";
format-alt = "{:%b %d %Y}"; format-alt = "{:%b %d %Y}";
@ -60,17 +60,21 @@ in
"cpu" = { "cpu" = {
interval = 10; interval = 10;
format = "🤖 {}%"; format = " {}%";
max-length = 10; max-length = 10;
on-click = "";
}; };
"memory" = { "memory" = {
interval = 30; interval = 30;
format = "🧠 {}%"; format = "🧠 {}%";
format-alt = "🧠 {used:0.1f}GB"; format-alt = "🧠 {used:0.1f}GB";
max-length = 10; max-length = 10;
}; };
"temperature" = {
interval = 10;
format = " {temperatureC}°C";
max-length = 10;
};
"backlight" = { "backlight" = {
device = "intel_backlight"; device = "intel_backlight";
format = "{icon}"; format = "{icon}";
@ -82,7 +86,6 @@ in
smooth-scrolling-threshold = "2400"; smooth-scrolling-threshold = "2400";
tooltip-format = "Brightness {percent}%"; tooltip-format = "Brightness {percent}%";
}; };
"network" = { "network" = {
format-wifi = "<small>{bandwidthDownBytes}</small> {icon}"; format-wifi = "<small>{bandwidthDownBytes}</small> {icon}";
min-length = 10; min-length = 10;
@ -91,15 +94,19 @@ in
format-disconnected = "󰤭"; format-disconnected = "󰤭";
tooltip-format = "{essid}"; tooltip-format = "{essid}";
interval = 1; interval = 1;
on-click = "~/.config/hypr/scripts/rofi-wifi.sh"; on-click = "~/.config/hypr/scripts/wofi-wifi.sh";
format-icons = [ "󰤯" "󰤟" "󰤢" "󰤥" "󰤨" ]; format-icons = [ "󰤯" "󰤟" "󰤢" "󰤥" "󰤨" ];
}; };
"custom/wg" = { "bluetooth" = {
exec = "~/.config/hypr/scripts/wg-status.sh"; format = "{icon}";
interval = 5; format-alt = "bluetooth: {status}";
format = "{}"; interval = 30;
on-click = "~/.config/hypr/scripts/wg-toggle.sh"; format-icons = {
enabled = "";
disabled = "󰂲";
};
tooltip-format = "{status}";
}; };
"pulseaudio" = { "pulseaudio" = {
@ -120,8 +127,8 @@ in
adapter = "ADP0"; adapter = "ADP0";
interval = 60; interval = 60;
states = { states = {
warning = 15; warning = 20;
critical = 7; critical = 15;
}; };
max-length = 20; max-length = 20;
format = "{icon}"; format = "{icon}";
@ -131,9 +138,8 @@ in
format-plugged = "󰚥"; format-plugged = "󰚥";
format-notcharging = "󰚥"; format-notcharging = "󰚥";
format-full = "󰂄"; format-full = "󰂄";
format-alt = "<small>{capacity}%</small>";
format-alt-warning = "<small>{capacity}%</small>"; format-alt = "<small>{capacity}%</small> ";
format-critical-alt = "<small>{capacity}%</small>";
format-icons = [ "󱊡" "󱊢" "󱊣" ]; format-icons = [ "󱊡" "󱊢" "󱊣" ];
}; };
@ -177,7 +183,7 @@ in
"custom/launcher" = { "custom/launcher" = {
format = "󱄅"; format = "󱄅";
on-click = "rofi -show drun"; on-click = "wofi --show drun --allow-images";
}; };
"custom/wallpaper" = { "custom/wallpaper" = {
@ -186,13 +192,11 @@ in
}; };
}; };
}; };
style = ''
style = /*css*/ ''
* { * {
font-family: JetBrains Mono, JetBrainsMono Nerd Font, Material Design Icons; /* `otf-font-awesome` is required to be installed for icons */
font-size: 17px; font-family: Material Design Icons, JetBrainsMono Nerd Font, Iosevka Nerd Font ;
font-size: 14px;
border: none; border: none;
border-radius: 0; border-radius: 0;
min-height: 0; min-height: 0;
@ -205,124 +209,368 @@ in
transition-duration: 0.5s; transition-duration: 0.5s;
} }
/* General styling for individual modules */ window#waybar.hidden {
opacity: 0.1;
}
#window {
color: #64727d;
}
#clock, #clock,
#temperature, #temperature,
#mpris, #mpris,
#cpu, #cpu,
#memory, #memory,
#custom-media,
#tray, #tray,
#mode,
#custom-lock,
#workspaces, #workspaces,
#custom-launcher, #custom-launcher,
#custom-spotify,
#custom-weather, #custom-weather,
#custom-wg { #custom-weather.severe,
background-color: #222034; #custom-weather.sunnyDay,
font-size: 14px; #custom-weather.clearNight,
color: #8a909e; #custom-weather.cloudyFoggyDay,
padding: 3px 8px; #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; border-radius: 8px;
margin: 8px 2px; font-size: 14px;
margin-left: 4px;
margin-right: 4px;
margin-top: 8.5px;
margin-bottom: 8.5px;
}
#temperature{
color: #7a95c9;
}
#cpu {
color: #fb958b;
} }
/* Styling for Network, Pulseaudio, Backlight, and Battery group */ #memory {
#network, color: #a1c999;
#pulseaudio, }
#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, #backlight,
#battery { #battery,
background-color: #222034; #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; font-size: 20px;
padding: 3px 8px;
margin: 8px 0px;
} }
/* Module-specific colors for Network, Pulseaudio, Backlight, Battery */ #pulseaudio {
#network, #pulseaudio { color: #5796E0; } color: #81A1C1;
#backlight { color: #ecd3a0; } 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 { #battery {
color: #8fbcbb; color: #8fbcbb;
padding-right: 14px border-radius: 0px 8px 8px 0px;
padding-right: 12px;
padding-left: 12px;
font-size: 22px;
} }
/* Battery state-specific colors */ #battery.critical,
#battery.warning { color: #ecd3a0; } #battery.warning,
#battery.critical:not(.charging) { color: #fb958b; } #battery.full,
#battery.plugged {
color: #8fbcbb;
padding-left: 12px;
padding-right: 12px;
font-size: 22px;
}
/* Pulseaudio mute state */ #battery.charging {
#pulseaudio.muted { color: #fb958b; } 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;
}
/* Styling for Language, Custom Wallpaper, Idle Inhibitor, Custom Refresh Rate group */
#language, #language,
#custom-refresh-rate, #custom-refresh-rate,
#custom-wallpaper, #custom-wallpaper,
#idle_inhibitor { #idle_inhibitor {
background-color: #222034; background-color: #252733;
color: #8a909e; color: #8a909e;
padding: 3px 4px; font-family: JetBrains Mono Nerd Font;
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; font-weight: bold;
border-radius: 8px; font-size: 17px;
transition: all 0.5s cubic-bezier(0.55, -0.68, 0.48, 1.68); 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 { #idle_inhibitor.activated {
background-color: #ecf0f1; background-color: #ecf0f1;
color: #2d3436; color: #2d3436;
border-radius: 8px; border-radius: 8px
}
#mpris,
#custom-spotify {
color: #abb2bf;
} }
/* Custom launcher */ #custom-weather {
#custom-launcher { font-family: Iosevka Nerd Font;
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; 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; [ home.packages = with pkgs; [
wofi
wofi-emoji
dbus dbus
sway-contrib.grimshot sway-contrib.grimshot
hyprlock hyprlock
hypridle hypridle
hyprpaper hyprpaper
hyprpicker hyprpicker
rofi-wayland
rofimoji
qt6.qtwayland qt6.qtwayland
kdePackages.qt6ct kdePackages.qt6ct
slurp slurp
@ -341,11 +589,10 @@ in
brightnessctl brightnessctl
pamixer pamixer
pavucontrol # Volume control pavucontrol # Volume control
dunst # Notifications
jellyfin-ffmpeg # Multimedia libs jellyfin-ffmpeg # Multimedia libs
viewnior # Image viewr viewnior # Image viewr
mako # Notifications
libcanberra-gtk3 # Notification sound libcanberra-gtk3 # Notification sound
libnotify # notify-send
# Gnome Stuff # Gnome Stuff
gtk-engine-murrine gtk-engine-murrine
@ -360,4 +607,3 @@ in
]; ];
}; };
} }

View file

@ -11,7 +11,7 @@ in
config = mkIf cfg.enable { 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_DESKTOP_DIR="$HOME/Desktop"
XDG_DOWNLOAD_DIR="$HOME/Downloads" XDG_DOWNLOAD_DIR="$HOME/Downloads"
XDG_PUBLICSHARE_DIR="$HOME/Public" XDG_PUBLICSHARE_DIR="$HOME/Public"

View file

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

View file

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

View file

@ -1,13 +1,11 @@
{ inputs, pkgs, ... }: { { inputs, pkgs, ... }: {
imports = [ imports = [
./bat.nix ./bat.nix
./kitty.nix ./dunst.nix
./rofi.nix
./nvim.nix
]; ];
home.file.".config/mako" = { home.file.".config/nvim" = {
source = "${inputs.dotfiles}/mako"; source = "${inputs.dotfiles}/nvim";
recursive = true; 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 = { features = {
cli = { cli = {
zsh.enable = false; zsh.enable = true;
nushell.enable = false;
fish.enable = true;
fzf.enable = true; fzf.enable = true;
neofetch.enable = true; neofetch.enable = true;
}; };
@ -32,19 +30,29 @@
wayland.windowManager.hyprland = { wayland.windowManager.hyprland = {
settings = { settings = {
device = [
{
name = "keyboard";
kb_layout = "us,ara";
}
{
name = "mouse";
sensitivity = -0.5;
}
];
monitor = [ monitor = [
"DP-1,highres,auto,1" "eDP-1,2560x1600@60,0x0,1.25"
"eDP-1,2560x1600@60,0x0,1.25,mirror,DP-1" "DP-2,1920x1080@60,auto,1"
]; ];
workspace = [ workspace = [
# "1, monitor:DP-1, default:true" "1, monitor:eDP-1, default:true"
# "2, monitor:DP-1" "2, monitor:eDP-1"
# "3, monitor:DP-1" "3, monitor:eDP-1"
# "4, monitor:DP-1" "4, monitor:eDP-1"
# "5, monitor:DP-1" "5, monitor:eDP-1"
# "6, monitor:DP-1" "6, monitor:eDP-1"
# "7, monitor:DP-1" "7, monitor:eDP-1"
]; ];
}; };
}; };

View file

@ -7,25 +7,28 @@
{ {
home.username = lib.mkDefault user; home.username = lib.mkDefault user;
home.homeDirectory = lib.mkDefault "/home/${config.home.username}"; 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. 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; [ home.packages = with pkgs; [
# Essentials # Essentials
kitty kitty
alacritty
tmux
firefox firefox
google-chrome google-chrome
age
sops
networkmanagerapplet
nvd
# Apps # Apps
vlc vlc
amberol amberol
webcord webcord
#bottles bottles
#cava cava
ryujinx ryujinx
mullvad-vpn mullvad-vpn
transmission_4-gtk transmission_4-gtk
@ -34,17 +37,11 @@
syncthing syncthing
qsyncthingtray qsyncthingtray
htop htop
openvpn nvtopPackages.full
#nvtopPackages.full
exiftool exiftool
moonlight-qt moonlight-qt
kdePackages.kdeconnect-kde kdePackages.kdeconnect-kde
cmatrix
#jellyfin-media-player
speedtest-go
wireguard-tools
# Dev # Dev
devbox
go go
python3 python3
nim nim
@ -54,18 +51,13 @@
bruno bruno
ripgrep ripgrep
zip zip
nodejs #zed-fhs
gcc # android-studio
python312Packages.pip # android-tools
android-studio
android-tools
jre17_minimal jre17_minimal
# Nvim-Lsps # Nvim-Lua
lua-language-server lua-language-server
tailwindcss-language-server cowsay
glow
# Hacks
responder-patched
# # Adds the 'hello' command to your environment. It prints a friendly # # 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 Manager can also manage your environment variables through
# 'home.sessionVariables'. If you don't want to manage your shell through Home # 'home.sessionVariables'. If you don't want to manage your shell through Home
@ -110,17 +115,15 @@
NIXOS_OZONE_WL = "1"; NIXOS_OZONE_WL = "1";
MOZ_ENABLE_WAYLAND = "1"; MOZ_ENABLE_WAYLAND = "1";
SDL_VIDEODRIVER = "wayland"; SDL_VIDEODRIVER = "wayland";
QT_AUTO_SCREEN_SCALE_FACTOR = "1"; _JAVA_AWT_WM_NONREPARENTING = "1";
ELECTRON_EXTRA_FLAGS = "--force-device-scale-factor=1.5"; MOZ_DRM_DEVICE = "/dev/dri/card0:/dev/dri/card1";
#_JAVA_AWT_WM_NONREPARENTING = "1"; WLR_DRM_DEVICES = "/dev/dri/card0:/dev/dri/card1";
#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 #WLR_NO_HARDWARE_CURSORS = "1"; # if no cursor,uncomment this line
#GBM_BACKEND = "nvidia-drm"; #GBM_BACKEND = "nvidia-drm";
#CLUTTER_BACKEND = "wayland"; CLUTTER_BACKEND = "wayland";
LIBVA_DRIVER_NAME = "iHD"; LIBVA_DRIVER_NAME = "iHD";
#WLR_RENDERER = "vulkan"; WLR_RENDERER = "vulkan";
#VK_DRIVER_FILES = "/run/opengl-driver/share/vulkan/icd.d/nvidia_icd.x86_64.json"; VK_DRIVER_FILES = "/run/opengl-driver/share/vulkan/icd.d/nvidia_icd.x86_64.json";
#__GLX_VENDOR_LIBRARY_NAME = "nvidia"; #__GLX_VENDOR_LIBRARY_NAME = "nvidia";
#__NV_PRIME_RENDER_OFFLOAD = "1"; #__NV_PRIME_RENDER_OFFLOAD = "1";
XDG_CURRENT_DESKTOP = "Hyprland"; XDG_CURRENT_DESKTOP = "Hyprland";

View file

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

View file

@ -4,6 +4,7 @@
imports = [ imports = [
./users ./users
./services ./services
./homelab
./vps ./vps
inputs.home-manager.nixosModules.home-manager 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; services.gnome.gnome-keyring.enable = true;
programs.nautilus-open-any-terminal = { programs.nautilus-open-any-terminal = {
enable = true; enable = true;
terminal = "alacritty"; terminal = "kitty";
}; };
services.gvfs.enable = true; services.gvfs.enable = true;
services.tumbler.enable = true; services.tumbler.enable = true;

View file

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

View file

@ -15,13 +15,12 @@ let
service.command = [ service.command = [
"/data" "/data"
"-a" "-a"
''???:???#fs@/:rw'' # till i figure out how to pass the damn env "???:???@/:rw"
"-A" "-A"
"-a" "-a"
"@/p" "@/p"
]; ];
service.env_file = [ "${config.sops.templates."my-env.env".path}" ]; 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; common.services.steam.enable = true;
services.flatpak.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 #Bootloader
boot.loader.systemd-boot.enable = true; boot.loader.systemd-boot.enable = true;
@ -46,6 +37,13 @@
# Ntfs support # Ntfs support
boot.supportedFilesystems = [ "ntfs" ]; boot.supportedFilesystems = [ "ntfs" ];
sops = {
age.keyFile = "/etc/nixos/sops/age/keys.txt";
defaultSopsFile = ../../secrets/secrets.yaml;
defaultSopsFormat = "yaml";
};
# Enable GDM Login Manager # Enable GDM Login Manager
services.xserver.enable = true; services.xserver.enable = true;
@ -56,33 +54,20 @@
autoSuspend = true; autoSuspend = true;
}; };
programs.hyprland = {
enable = true;
xwayland.enable = true;
};
#Network #Network
#Define your hostname #Define your hostname
networking.hostName = "${hostname}"; networking.hostName = "${hostname}";
# Enable networking # Enable networking
networking.networkmanager.enable = true; networking.networkmanager.enable = true;
services.avahi = {
enable = true;
nssmdns4 = true;
};
#Hosts
networking.extraHosts = ''
192.168.0.200 rancher.local
'';
# Bluethooth # Bluethooth
hardware.bluetooth.enable = true; hardware.bluetooth.enable = true;
services.blueman.enable = true; # services.blueman.enable = true;
# Enable sound with pipewire. # Enable sound with pipewire.
# sound.enable = true; # sound.enable = true;
hardware.pulseaudio.enable = false; hardware.pulseaudio.enable = false;
security.rtkit.enable = true; security.rtkit.enable = false;
services.pipewire = { services.pipewire = {
enable = true; enable = true;
alsa.enable = true; alsa.enable = true;
@ -94,10 +79,7 @@
# Set your time zone. # Set your time zone.
#time.timeZone = "Asia/Kuwait"; time.timeZone = "Asia/Kuwait";
services.ntp = {
enable = true;
};
# Select internationalisation properties. # Select internationalisation properties.
i18n.defaultLocale = "en_US.UTF-8"; i18n.defaultLocale = "en_US.UTF-8";
i18n.extraLocaleSettings = { i18n.extraLocaleSettings = {
@ -116,7 +98,7 @@
services.xserver = { services.xserver = {
exportConfiguration = true; # link /usr/share/X11/ properly exportConfiguration = true; # link /usr/share/X11/ properly
xkb.layout = "us,ara"; xkb.layout = "us,ara";
xkb.options = "grp:alt_shift_toggle,ctrl:swapcaps"; xkb.options = "grp:alt_shift_toggle";
xkb.variant = "qwerty_digits"; xkb.variant = "qwerty_digits";
}; };
@ -137,9 +119,13 @@
neovim neovim
git git
zsh zsh
nssmdns
]; ];
programs.hyprland = {
enable = true;
xwayland.enable = true;
};
#Firewall #Firewall
# Open ports in the firewall. # Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ]; # networking.firewall.allowedTCPPorts = [ ... ];
@ -147,7 +133,6 @@
# networking.firewall.allowedUDPPortRanges = [ { from = 32768; to = 60999; } ]; # networking.firewall.allowedUDPPortRanges = [ { from = 32768; to = 60999; } ];
# Or disable the firewall altogether. # Or disable the firewall altogether.
networking.firewall.enable = false; networking.firewall.enable = false;
networking.nftables.enable = false;
# Before changing this value read the documentation for this option # Before changing this value read the documentation for this option

View file

@ -9,7 +9,7 @@
(modulesPath + "/installer/scan/not-detected.nix") (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.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ]; boot.kernelModules = [ "kvm-intel" ];

View file

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

View file

@ -17,17 +17,12 @@
}; };
}; };
documentation.enable = false;
vps = { vps = {
dufs.enable = true; dufs.enable = true;
nextcloud.enable = false; nextcloud.enable = false;
pairdrop.enable = true; pairdrop.enable = true;
syncthing.enable = true; syncthing.enable = true;
vpn.enable = true; vpn.enable = true;
dashdot.enable = true;
audiobookshelf.enable = false;
}; };
sops = { sops = {
@ -38,91 +33,26 @@
services.caddy = { services.caddy = {
enable = true; 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 = '' extraConfig = ''
(logging) {
log {
output file /var/log/caddy/{args[0]}.log {
roll_size 50mb
roll_keep 5
roll_keep_for 720h
}
}
}
fs.nmd.mov { fs.nmd.mov {
reverse_proxy localhost:5000 reverse_proxy localhost:5000
import logging fs
} }
vpn.nmd.mov { vpn.nmd.mov {
reverse_proxy localhost:51821 reverse_proxy localhost:51821
import logging vpn
} }
s.nmd.mov { s.nmd.mov {
reverse_proxy localhost:8384 reverse_proxy localhost:8384
import logging s
} }
drop.nmd.mov { drop.nmd.mov {
reverse_proxy localhost:3000 reverse_proxy localhost:3000
import logging drop
} }
dot.nmd.mov { dot.nmd.mov {
reverse_proxy localhost:19999 reverse_proxy localhost:4400
basic_auth /* {
nomad $2a$12$toBh5sfXyxigtHGNY4t8tO7YYQp6i3aZk/O0qd19lgk0LRz5eqDVi
}
}
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; networking.useDHCP = lib.mkForce false;
services.cloud-init = { services.cloud-init = {
enable = true; enable = true;
@ -177,15 +107,18 @@
zsh zsh
arion arion
sops sops
jq
]; ];
networking.firewall.enable = true; networking.firewall.enable = false;
networking.firewall.allowedTCPPorts = [ networking.firewall.allowedTCPPorts = [
22 22
80 80
443 443
5000
4400
3000
8384
22000 22000
51821 51821
]; ];
@ -194,12 +127,6 @@
21027 21027
51820 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"; system.stateVersion = "24.05";
} }

View file

@ -4,7 +4,6 @@ GREEN="\e[32m"
YELLOW="\e[33m" YELLOW="\e[33m"
BLUE="\e[34m" BLUE="\e[34m"
ENDCOLOR="\e[0m" ENDCOLOR="\e[0m"
echo -e " $YELLOW 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 $RED TO MAKE SURE EVERYTHING RUNS CORRECTLY $ENDCOLOR $GREEN RUN AS ROOT '"sudo bash install.sh"' $ENDCOLOR
" "
echo echo
echo
# Prompt for username and hostname # Prompt for username and hostname
read -p "Enter the new username: " new_user read -p "Enter the new username: " new_user
read -p "Enter the new hostname: " new_hostname 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" 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" monitor_config_file="./home/$new_user/$new_hostname.nix"
current_user=$(logname) current_user=$(logname)
# Check if source files exist
if [[ ! -f "./hosts/common/users/nomad.nix" && ! -d "./hosts/unkown/" ]]; then 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" echo -e "$RED Source files nomad.nix or ./hosts/unkown directory does not exist! $ENDCOLOR"
exit 1 exit 1
fi 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 # Create new host
cp "./home/nomad/unkown/home.nix" "$user_dir/home.nix" if [ -d "./hosts/$new_hostname" ]; then
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 read -p "Directory $new_hostname already exists. Overwrite contents? (y/n) " choice
if [[ "$choice" != "y" && "$choice" != "yes" ]]; then if [[ "$choice" != "y" && "$choice" != "yes" ]]; then
echo -e "$YELLOW Skipping host configuration for $new_hostname... $ENDCOLOR" echo -e "$YELLOW Skipping.. $ENDCOLOR"
return else
fi
echo -e "$YELLOW Overwriting Host configuration for $new_hostname... $ENDCOLOR" echo -e "$YELLOW Overwriting Host configuration for $new_hostname... $ENDCOLOR"
rm -r "./hosts/$new_hostname" rm -r "./hosts/$new_hostname"
else
echo -e "$YELLOW Creating Host configuration for $new_hostname... $ENDCOLOR"
fi
cp -r "./hosts/unkown" "./hosts/$new_hostname" cp -r "./hosts/unkown" "./hosts/$new_hostname"
sleep 0.2
chown -R $current_user:users "./hosts/$new_hostname" 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" 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() { # Create user directories
if [ -f "./hosts/common/users/$new_user.nix" ]; then if [ -f "./hosts/common/users/$new_user.nix" ]; then
read -p "File $new_user.nix already exists. Overwrite? (y/n) " choice read -p "File $new_user.nix already exists. Overwrite? (y/n) " choice
if [[ "$choice" != "y" && "$choice" != "yes" ]]; then if [[ "$choice" != "y" && "$choice" != "yes" ]]; then
echo -e "$YELLOW Skipping user configuration for $new_user... $ENDCOLOR" echo -e "$YELLOW Skipping.. $ENDCOLOR"
return else
fi
echo -e "$YELLOW Overwriting User configuration for $new_user... $ENDCOLOR" echo -e "$YELLOW Overwriting User configuration for $new_user... $ENDCOLOR"
else
echo -e "$YELLOW Creating User configuration for $new_user... $ENDCOLOR"
fi
cp "./hosts/common/users/nomad.nix" "./hosts/common/users/$new_user.nix" cp "./hosts/common/users/nomad.nix" "./hosts/common/users/$new_user.nix"
chown $current_user:users "./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" 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 # Replace the 'user' and 'hostname' values in the flake.nix file
sed -i "s/user = \".*\";/user = \"$new_user\";/" "$flake_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" echo -e "$GREEN Configuration has been updated with your preferences $ENDCOLOR"
sleep 2 sleep 2
git add . sudo nixos-rebuild boot --flake .#${new_hostname}
nixos-rebuild switch --flake .#unkown
home-manager switch -b backup --flake .
echo -e "$GREEN Reboot after completion your initial password is 4321 $ENDCOLOR" echo -e "$GREEN Reboot after completion your initial password is 4321 $ENDCOLOR"

View file

@ -10,74 +10,6 @@
# example = prev.example.overrideAttrs (oldAttrs: rec { # 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: { stable-packages = final: _prev: {
@ -87,7 +19,3 @@
}; };
}; };
} }

View file

@ -1,52 +1 @@
nix store diff-closures $(ls -d /nix/var/nix/profiles/*|tail -2)
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

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