From 06dea9ce7183b1f2991f08fb784c2398cd4c3c9d Mon Sep 17 00:00:00 2001 From: Ivan Kirilov Dimitrov Date: Wed, 7 Aug 2024 17:41:33 +0200 Subject: [PATCH] alejandra format --- default.nix | 8 +- flake.nix | 7 +- hardware-configurations/default.nix | 30 +- home/default.nix | 2 +- home/modules/default.nix | 569 +++++++++++++++++++--------- nixos/configs/default.nix | 58 ++- nixos/default.nix | 4 +- nixos/modules/default.nix | 423 ++++++++++++--------- overlays/default.nix | 14 +- packages/default.nix | 18 +- 10 files changed, 715 insertions(+), 418 deletions(-) diff --git a/default.nix b/default.nix index b5970cc..f7a574e 100644 --- a/default.nix +++ b/default.nix @@ -1,8 +1,8 @@ -top@{ inputs, ... }: { - imports = [ ./nixos ./home ./packages ./overlays ./hardware-configurations ]; - systems = [ "x86_64-linux" ]; +top @ {inputs, ...}: { + imports = [./nixos ./home ./packages ./overlays ./hardware-configurations]; + systems = ["x86_64-linux"]; flake.stateVersion = "24.05"; - perSystem = perSystem@{ system, ... }: { + perSystem = perSystem @ {system, ...}: { config._module.args = { pkgs = import inputs.nixpkgs { inherit system; diff --git a/flake.nix b/flake.nix index 0585670..6aa3373 100644 --- a/flake.nix +++ b/flake.nix @@ -20,7 +20,10 @@ }; sal = { url = "github:ivandimitrov8080/sal"; - inputs = { nixpkgs.follows = "nixpkgs"; ide.follows = "ide"; }; + inputs = { + nixpkgs.follows = "nixpkgs"; + ide.follows = "ide"; + }; }; musnix = { url = "github:musnix/musnix"; @@ -35,5 +38,5 @@ inputs.nixpkgs.follows = "nixpkgs"; }; }; - outputs = inputs: inputs.parts.lib.mkFlake { inherit inputs; } { imports = [ ./. ]; }; + outputs = inputs: inputs.parts.lib.mkFlake {inherit inputs;} {imports = [./.];}; } diff --git a/hardware-configurations/default.nix b/hardware-configurations/default.nix index 91f9607..7003a30 100644 --- a/hardware-configurations/default.nix +++ b/hardware-configurations/default.nix @@ -1,21 +1,31 @@ -top@{ ... }: { +top @ {...}: { flake.hardwareConfigurations = { - nova = { lib, modulesPath, ... }: { - imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; + nova = { + lib, + modulesPath, + ... + }: { + imports = [(modulesPath + "/installer/scan/not-detected.nix")]; boot = { initrd = { - availableKernelModules = [ "xhci_pci" "thunderbolt" "nvme" "usb_storage" "sd_mod" "sdhci_pci" ]; - kernelModules = [ ]; + availableKernelModules = ["xhci_pci" "thunderbolt" "nvme" "usb_storage" "sd_mod" "sdhci_pci"]; + kernelModules = []; luks.devices."nixos".device = "/dev/disk/by-uuid/712dd8ba-d5b4-438a-9a77-663b8c935cfe"; }; - kernelModules = [ "kvm-intel" ]; - extraModulePackages = [ ]; + kernelModules = ["kvm-intel"]; + extraModulePackages = []; }; fileSystems = { - "/" = { device = "/dev/disk/by-uuid/47536cbe-7265-493b-a2e3-bbd376a6f9af"; fsType = "btrfs"; }; - "/boot" = { device = "/dev/disk/by-uuid/4C3C-993A"; fsType = "vfat"; }; + "/" = { + device = "/dev/disk/by-uuid/47536cbe-7265-493b-a2e3-bbd376a6f9af"; + fsType = "btrfs"; + }; + "/boot" = { + device = "/dev/disk/by-uuid/4C3C-993A"; + fsType = "vfat"; + }; }; - swapDevices = [ ]; + swapDevices = []; networking.useDHCP = lib.mkForce true; nixpkgs.hostPlatform = lib.mkForce "x86_64-linux"; hardware.cpu.intel.updateMicrocode = lib.mkForce false; diff --git a/home/default.nix b/home/default.nix index 7c06d82..7643ad5 100644 --- a/home/default.nix +++ b/home/default.nix @@ -1,3 +1,3 @@ { - imports = [ ./modules ]; + imports = [./modules]; } diff --git a/home/modules/default.nix b/home/modules/default.nix index a5520ee..11118ea 100644 --- a/home/modules/default.nix +++ b/home/modules/default.nix @@ -1,8 +1,7 @@ -toplevel@{ moduleWithSystem, ... }: { +toplevel @ {moduleWithSystem, ...}: { flake.homeManagerModules = { base = moduleWithSystem ( - top@{ ... }: - perSystem@{ config, ... }: { + top @ {...}: perSystem @ {config, ...}: { programs.home-manager.enable = true; home.stateVersion = toplevel.config.flake.stateVersion; xdg = { @@ -24,163 +23,256 @@ toplevel@{ moduleWithSystem, ... }: { } ); ivand = moduleWithSystem ( - top@{ ... }: - perSystem@{ pkgs, ... }: { + top @ {...}: perSystem @ {pkgs, ...}: { home = { username = "ivand"; homeDirectory = "/home/ivand"; - sessionVariables = { EDITOR = "nvim"; }; - packages = with pkgs; [ nvim ]; + sessionVariables = {EDITOR = "nvim";}; + packages = with pkgs; [nvim]; }; programs = { git = with pkgs.lib; { userName = mkForce "Ivan Kirilov Dimitrov"; userEmail = mkForce "ivan@idimitrov.dev"; - signing = mkForce { signByDefault = true; key = "ivan@idimitrov.dev"; }; + signing = mkForce { + signByDefault = true; + key = "ivan@idimitrov.dev"; + }; }; ssh = { matchBlocks = { - vpsfree-ivand = { hostname = "10.0.0.1"; user = "ivand"; }; - vpsfree-root = { hostname = "10.0.0.1"; user = "root"; }; + vpsfree-ivand = { + hostname = "10.0.0.1"; + user = "ivand"; + }; + vpsfree-root = { + hostname = "10.0.0.1"; + user = "root"; + }; }; }; }; } ); util = moduleWithSystem ( - top@{ ... }: - perSystem@{ pkgs, config, ... }: { + top @ {...}: perSystem @ { + pkgs, + config, + ... + }: { home = { - packages = with pkgs; [ openssl mlocate uutils-coreutils-noprefix speedtest-cli ]; - sessionVariables = { PAGER = "bat"; BAT_THEME = "catppuccin-mocha"; }; + packages = with pkgs; [openssl mlocate uutils-coreutils-noprefix speedtest-cli]; + sessionVariables = { + PAGER = "bat"; + BAT_THEME = "catppuccin-mocha"; + }; }; programs = { - password-store = { enable = true; package = pkgs.pass.withExtensions (e: with e; [ pass-otp pass-file ]); settings = { PASSWORD_STORE_DIR = "${config.home.homeDirectory}/.password-store"; }; }; + password-store = { + enable = true; + package = pkgs.pass.withExtensions (e: with e; [pass-otp pass-file]); + settings = {PASSWORD_STORE_DIR = "${config.home.homeDirectory}/.password-store";}; + }; git = { enable = true; delta.enable = true; - extraConfig = { color.ui = "auto"; pull.rebase = true; push.autoSetupRemote = true; }; - aliases = { a = "add ."; c = "commit"; d = "diff --cached"; p = "push"; pa = "!git remote | xargs -L1 git push --all"; }; + extraConfig = { + color.ui = "auto"; + pull.rebase = true; + push.autoSetupRemote = true; + }; + aliases = { + a = "add ."; + c = "commit"; + d = "diff --cached"; + p = "push"; + pa = "!git remote | xargs -L1 git push --all"; + }; }; tealdeer = { enable = true; - settings = { display = { compact = true; }; updates = { auto_update = true; }; }; + settings = { + display = {compact = true;}; + updates = {auto_update = true;}; + }; }; bottom = { enable = true; settings = { - flags = { rate = "250ms"; }; + flags = {rate = "250ms";}; row = [ - { ratio = 40; child = [{ type = "cpu"; } { type = "mem"; } { type = "net"; }]; } - { ratio = 35; child = [{ type = "temp"; } { type = "disk"; }]; } - { ratio = 40; child = [{ type = "proc"; default = true; }]; } + { + ratio = 40; + child = [{type = "cpu";} {type = "mem";} {type = "net";}]; + } + { + ratio = 35; + child = [{type = "temp";} {type = "disk";}]; + } + { + ratio = 40; + child = [ + { + type = "proc"; + default = true; + } + ]; + } ]; }; }; - fzf = { enable = true; enableBashIntegration = true; enableZshIntegration = true; }; - nix-index = { enable = true; enableZshIntegration = false; enableBashIntegration = false; }; + fzf = { + enable = true; + enableBashIntegration = true; + enableZshIntegration = true; + }; + nix-index = { + enable = true; + enableZshIntegration = false; + enableBashIntegration = false; + }; bat = { enable = true; - themes = - let - catppuccin = pkgs.fetchFromGitHub { owner = "catppuccin"; repo = "bat"; rev = "82e7ca555f805b53d2b377390e4ab38c20282e83"; sha256 = "sha256-/Ob9iCVyjJDBCXlss9KwFQTuxybmSSzYRBZxOT10PZg="; }; - in - { - catppuccin-mocha = { src = catppuccin; file = "themes/Catppuccin Mocha.tmTheme"; }; - catppuccin-macchiato = { src = catppuccin; file = "themes/Catppuccin Macchiato.tmTheme"; }; - catppuccin-frappe = { src = catppuccin; file = "themes/Catppuccin Frappe.tmTheme"; }; - catppuccin-latte = { src = catppuccin; file = "themes/Catppuccin Latte.tmTheme"; }; + themes = let + catppuccin = pkgs.fetchFromGitHub { + owner = "catppuccin"; + repo = "bat"; + rev = "82e7ca555f805b53d2b377390e4ab38c20282e83"; + sha256 = "sha256-/Ob9iCVyjJDBCXlss9KwFQTuxybmSSzYRBZxOT10PZg="; }; + in { + catppuccin-mocha = { + src = catppuccin; + file = "themes/Catppuccin Mocha.tmTheme"; + }; + catppuccin-macchiato = { + src = catppuccin; + file = "themes/Catppuccin Macchiato.tmTheme"; + }; + catppuccin-frappe = { + src = catppuccin; + file = "themes/Catppuccin Frappe.tmTheme"; + }; + catppuccin-latte = { + src = catppuccin; + file = "themes/Catppuccin Latte.tmTheme"; + }; + }; }; ssh.enable = true; gpg.enable = true; }; - services = { gpg-agent = { enable = true; enableBashIntegration = true; enableZshIntegration = true; enableNushellIntegration = true; pinentryPackage = pkgs.pinentry-qt; }; }; + services = { + gpg-agent = { + enable = true; + enableBashIntegration = true; + enableZshIntegration = true; + enableNushellIntegration = true; + pinentryPackage = pkgs.pinentry-qt; + }; + }; } ); shell = moduleWithSystem ( - top@{ ... }: - perSystem@{ pkgs, ... }: { - programs = - let + top @ {...}: perSystem @ {pkgs, ...}: { + programs = let + shellAliases = { + cal = "cal $(date +%Y)"; + GG = "git add . && git commit -m 'GG' && git push --set-upstream origin HEAD"; + gad = "git add . && git diff --cached"; + gac = "ga && gc"; + ga = "git add ."; + gc = "git commit"; + dev = "nix develop --command $SHELL"; + ls = "eza"; + la = "eza --all"; + lt = "eza --git-ignore --all --tree --level=10"; + sc = "systemctl"; + neofetch = "${pkgs.fastfetch}/bin/fastfetch -c all.jsonc"; + }; + sessionVariables = {}; + in { + bash = { + inherit shellAliases sessionVariables; + enable = true; + enableVteIntegration = true; + historyControl = ["erasedups"]; + historyIgnore = ["ls" "cd" "exit"]; + }; + zsh = { + inherit shellAliases sessionVariables; + enable = true; + dotDir = ".config/zsh"; + defaultKeymap = "viins"; + enableVteIntegration = true; + syntaxHighlighting.enable = true; + autosuggestion.enable = true; + history.expireDuplicatesFirst = true; + historySubstringSearch.enable = true; + }; + nushell = { + enable = true; + environmentVariables = {config = ''{ show_banner: false, completions: { quick: false partial: false algorithm: "prefix" } } '';}; shellAliases = { - cal = "cal $(date +%Y)"; - GG = "git add . && git commit -m 'GG' && git push --set-upstream origin HEAD"; - gad = "git add . && git diff --cached"; - gac = "ga && gc"; - ga = "git add ."; - gc = "git commit"; - dev = "nix develop --command $SHELL"; - ls = "eza"; - la = "eza --all"; - lt = "eza --git-ignore --all --tree --level=10"; - sc = "systemctl"; - neofetch = "${pkgs.fastfetch}/bin/fastfetch -c all.jsonc"; - }; - sessionVariables = { }; - in - { - bash = { - inherit shellAliases sessionVariables; - enable = true; - enableVteIntegration = true; - historyControl = [ "erasedups" ]; - historyIgnore = [ "ls" "cd" "exit" ]; - }; - zsh = { - inherit shellAliases sessionVariables; - enable = true; - dotDir = ".config/zsh"; - defaultKeymap = "viins"; - enableVteIntegration = true; - syntaxHighlighting.enable = true; - autosuggestion.enable = true; - history.expireDuplicatesFirst = true; - historySubstringSearch.enable = true; - }; - nushell = { - enable = true; - environmentVariables = { config = '' { show_banner: false, completions: { quick: false partial: false algorithm: "prefix" } } ''; }; - shellAliases = { gcal = '' bash -c "cal $(date +%Y)" ''; la = "ls -al"; dev = "nix develop --command $env.SHELL"; }; - }; - kitty.shellIntegration = { enableBashIntegration = true; enableZshIntegration = true; }; - tmux = { - enable = true; - clock24 = true; - baseIndex = 1; - escapeTime = 0; - keyMode = "vi"; - shell = "\${SHELL}"; - terminal = "screen-256color"; - plugins = with pkgs.tmuxPlugins; [ tilish catppuccin ]; - extraConfig = '' - set-option -a terminal-features 'screen-256color:RGB' - ''; - }; - starship = { enable = true; enableNushellIntegration = true; enableZshIntegration = true; enableBashIntegration = true; }; - eza = { - enable = true; - enableZshIntegration = true; - enableBashIntegration = true; - extraOptions = [ - "--long" - "--header" - "--icons" - "--smart-group" - "--mounts" - "--octal-permissions" - "--git" - ]; + gcal = ''bash -c "cal $(date +%Y)" ''; + la = "ls -al"; + dev = "nix develop --command $env.SHELL"; }; }; + kitty.shellIntegration = { + enableBashIntegration = true; + enableZshIntegration = true; + }; + tmux = { + enable = true; + clock24 = true; + baseIndex = 1; + escapeTime = 0; + keyMode = "vi"; + shell = "\${SHELL}"; + terminal = "screen-256color"; + plugins = with pkgs.tmuxPlugins; [tilish catppuccin]; + extraConfig = '' + set-option -a terminal-features 'screen-256color:RGB' + ''; + }; + starship = { + enable = true; + enableNushellIntegration = true; + enableZshIntegration = true; + enableBashIntegration = true; + }; + eza = { + enable = true; + enableZshIntegration = true; + enableBashIntegration = true; + extraOptions = [ + "--long" + "--header" + "--icons" + "--smart-group" + "--mounts" + "--octal-permissions" + "--git" + ]; + }; + }; } ); swayland = moduleWithSystem ( - top@{ ... }: - perSystem@{ pkgs, config, ... }: { + top @ {...}: perSystem @ { + pkgs, + config, + ... + }: { home = { - packages = with pkgs; [ audacity gimp grim libnotify libreoffice-qt mupdf slurp transmission_4 wl-clipboard xdg-user-dirs xdg-utils xwayland telegram-desktop ]; - pointerCursor = with pkgs; { name = "catppuccin-mocha-green-cursors"; package = catppuccin-cursors.mochaGreen; size = 24; gtk.enable = true; }; + packages = with pkgs; [audacity gimp grim libnotify libreoffice-qt mupdf slurp transmission_4 wl-clipboard xdg-user-dirs xdg-utils xwayland telegram-desktop]; + pointerCursor = with pkgs; { + name = "catppuccin-mocha-green-cursors"; + package = catppuccin-cursors.mochaGreen; + size = 24; + gtk.enable = true; + }; }; wayland.windowManager.sway = { enable = true; @@ -190,10 +282,10 @@ toplevel@{ moduleWithSystem, ... }: { terminal = "kitty"; modifier = "Mod4"; startup = [ - { command = "swaymsg 'workspace 2; exec firefox'"; } - { command = "swaymsg 'workspace 1; exec kitty'"; } + {command = "swaymsg 'workspace 2; exec firefox'";} + {command = "swaymsg 'workspace 1; exec kitty'";} ]; - bars = [ ]; + bars = []; window.titlebar = false; keybindings = pkgs.lib.mkOptionDefault { "F1" = "exec ${pkgs.pulseaudio}/bin/pactl set-sink-mute @DEFAULT_SINK@ toggle"; @@ -213,65 +305,94 @@ toplevel@{ moduleWithSystem, ... }: { "${modifier}+Shift+c" = "kill"; "${modifier}+Shift+q" = "exit"; }; - input = { "*" = { xkb_layout = "us,bg"; xkb_options = "grp:win_space_toggle"; xkb_variant = ",phonetic"; }; }; + input = { + "*" = { + xkb_layout = "us,bg"; + xkb_options = "grp:win_space_toggle"; + xkb_variant = ",phonetic"; + }; + }; }; - swaynag = { enable = config.wayland.windowManager.sway.enable; }; + swaynag = {enable = config.wayland.windowManager.sway.enable;}; }; programs = { waybar = { enable = true; settings = { - mainBar = - let - in - { - layer = "top"; - position = "top"; - height = 30; - output = [ "eDP-1" "HDMI-A-1" "*" ]; + mainBar = let + in { + layer = "top"; + position = "top"; + height = 30; + output = ["eDP-1" "HDMI-A-1" "*"]; - modules-left = [ "sway/workspaces" "sway/mode" ]; - modules-center = [ "clock#week" "clock#year" "clock#time" ]; - modules-right = [ "network" "pulseaudio" "memory" "cpu" "battery" ]; + modules-left = ["sway/workspaces" "sway/mode"]; + modules-center = ["clock#week" "clock#year" "clock#time"]; + modules-right = ["network" "pulseaudio" "memory" "cpu" "battery"]; - "clock#time" = { format = "{:%H:%M:%S}"; interval = 1; tooltip = false; }; - "clock#week" = { format = "{:%a}"; tooltip = false; }; - "clock#year" = { format = "{:%Y-%m-%d}"; tooltip = false; }; - - battery = { - format = "{icon} {capacity}% {time}"; - format-time = " {H} h {M} m"; - format-icons = [ "" "" "" "" "" ]; - states = { warning = 30; critical = 15; }; - tooltip = false; - }; - - cpu = { format = " {usage}%"; }; - - memory = { format = " {percentage}%"; interval = 5; }; - - pulseaudio = { - format = "{icon} {volume}% | {format_source}"; - format-muted = "󰝟 {volume}% | {format_source}"; - format-source = "{volume}% "; - format-source-muted = "{volume}% "; - format-icons = { headphone = ""; default = [ "" "" "" ]; }; - tooltip = false; - }; - - network = { - format-ethernet = "󰈁 | {bandwidthUpBytes} {bandwidthDownBytes}"; - format-wifi = "{icon} | {bandwidthUpBytes} {bandwidthDownBytes}"; - format-disconnected = "󰈂 no connection"; - format-icons = [ "󰤟" "󰤢" "󰤥" "󰤨" ]; - interval = 5; - tooltip = false; - }; - - "sway/workspaces" = { disable-scroll = true; all-outputs = true; }; + "clock#time" = { + format = "{:%H:%M:%S}"; + interval = 1; + tooltip = false; }; + "clock#week" = { + format = "{:%a}"; + tooltip = false; + }; + "clock#year" = { + format = "{:%Y-%m-%d}"; + tooltip = false; + }; + + battery = { + format = "{icon} {capacity}% {time}"; + format-time = " {H} h {M} m"; + format-icons = ["" "" "" "" ""]; + states = { + warning = 30; + critical = 15; + }; + tooltip = false; + }; + + cpu = {format = " {usage}%";}; + + memory = { + format = " {percentage}%"; + interval = 5; + }; + + pulseaudio = { + format = "{icon} {volume}% | {format_source}"; + format-muted = "󰝟 {volume}% | {format_source}"; + format-source = "{volume}% "; + format-source-muted = "{volume}% "; + format-icons = { + headphone = ""; + default = ["" "" ""]; + }; + tooltip = false; + }; + + network = { + format-ethernet = "󰈁 | {bandwidthUpBytes} {bandwidthDownBytes}"; + format-wifi = "{icon} | {bandwidthUpBytes} {bandwidthDownBytes}"; + format-disconnected = "󰈂 no connection"; + format-icons = ["󰤟" "󰤢" "󰤥" "󰤨"]; + interval = 5; + tooltip = false; + }; + + "sway/workspaces" = { + disable-scroll = true; + all-outputs = true; + }; + }; + }; + systemd = { + enable = true; + target = "sway-session.target"; }; - systemd = { enable = true; target = "sway-session.target"; }; style = '' @define-color rosewater #f5e0dc; @define-color flamingo #f2cdcd; @@ -401,12 +522,14 @@ toplevel@{ moduleWithSystem, ... }: { animation-iteration-count: infinite; animation-direction: alternate; } - '' - ; + ''; }; swaylock = { enable = true; - settings = { show-failed-attempts = true; image = config.home.homeDirectory + "/pic/bg.png"; }; + settings = { + show-failed-attempts = true; + image = config.home.homeDirectory + "/pic/bg.png"; + }; }; rofi = { enable = true; @@ -414,9 +537,9 @@ toplevel@{ moduleWithSystem, ... }: { plugins = with pkgs; [ ( rofi-calc.override - { - rofi-unwrapped = rofi-wayland-unwrapped; - } + { + rofi-unwrapped = rofi-wayland-unwrapped; + } ) ]; }; @@ -426,24 +549,54 @@ toplevel@{ moduleWithSystem, ... }: { }; kitty = { enable = true; - font = { package = pkgs.fira-code; name = "FiraCodeNFM-Reg"; }; - settings = { background_opacity = "0.90"; cursor_shape = "beam"; }; + font = { + package = pkgs.fira-code; + name = "FiraCodeNFM-Reg"; + }; + settings = { + background_opacity = "0.90"; + cursor_shape = "beam"; + }; + }; + imv = { + enable = true; + settings = {options.fullscreen = true;}; + }; + mpv = { + enable = true; + scripts = with pkgs.mpvScripts; [uosc thumbfast]; + }; + bash.profileExtra = ''[ "$(tty)" = "/dev/tty1" ] && exec sway ''; + zsh.loginExtra = ''[ "$(tty)" = "/dev/tty1" ] && exec sway ''; + nushell.loginFile.text = ''if (tty) == "/dev/tty1" { sway } ''; + }; + services = { + mako.enable = true; + cliphist = { + enable = true; + systemdTarget = "sway-session.target"; }; - imv = { enable = true; settings = { options.fullscreen = true; }; }; - mpv = { enable = true; scripts = with pkgs.mpvScripts; [ uosc thumbfast ]; }; - bash.profileExtra = '' [ "$(tty)" = "/dev/tty1" ] && exec sway ''; - zsh.loginExtra = '' [ "$(tty)" = "/dev/tty1" ] && exec sway ''; - nushell.loginFile.text = '' if (tty) == "/dev/tty1" { sway } ''; }; - services = { mako.enable = true; cliphist = { enable = true; systemdTarget = "sway-session.target"; }; }; systemd.user = { - timers = { rbingwp = { Timer = { OnCalendar = "*-*-* 10:00:00"; Persistent = true; }; Install = { WantedBy = [ "timers.target" ]; }; }; }; + timers = { + rbingwp = { + Timer = { + OnCalendar = "*-*-* 10:00:00"; + Persistent = true; + }; + Install = {WantedBy = ["timers.target"];}; + }; + }; services = { wpd = { - Install = { WantedBy = [ "sway-session.target" ]; }; - Unit = { Description = "Switch background every x minutes"; After = "graphical-session-pre.target"; PartOf = "graphical-session.target"; }; + Install = {WantedBy = ["sway-session.target"];}; + Unit = { + Description = "Switch background every x minutes"; + After = "graphical-session-pre.target"; + PartOf = "graphical-session.target"; + }; Service = { - ExecStart = [ "${pkgs.wpd}/bin/wpd" ]; + ExecStart = ["${pkgs.wpd}/bin/wpd"]; }; }; }; @@ -464,18 +617,27 @@ toplevel@{ moduleWithSystem, ... }: { } ); web = moduleWithSystem ( - top@{ ... }: - perSystem@{ ... }: { + top @ {...}: perSystem @ {...}: { programs = { browserpass.enable = true; firefox = { enable = true; profiles.ivand = { id = 0; - search = { default = "DuckDuckGo"; privateDefault = "DuckDuckGo"; force = true; }; + search = { + default = "DuckDuckGo"; + privateDefault = "DuckDuckGo"; + force = true; + }; bookmarks = [ - { name = "home-options"; url = "https://nix-community.github.io/home-manager/options.xhtml"; } - { name = "nixvim-docs"; url = "https://nix-community.github.io/nixvim/"; } + { + name = "home-options"; + url = "https://nix-community.github.io/home-manager/options.xhtml"; + } + { + name = "nixvim-docs"; + url = "https://nix-community.github.io/nixvim/"; + } ]; settings = { "general.smoothScroll" = true; @@ -499,13 +661,44 @@ toplevel@{ moduleWithSystem, ... }: { TranslateEnabled = false; SearchBar = "unified"; SearchSuggestEnabled = false; - SanitizeOnShutdown = { Cache = true; FormData = true; Locked = true; Cookies = false; Downloads = false; History = false; Sessions = false; SiteSettings = false; OfflineApps = true; }; - FirefoxHome = { Search = true; Pocket = false; Snippets = false; TopSites = false; Highlights = false; }; - UserMessaging = { ExtensionRecommendations = false; FeatureRecommendations = false; UrlbarInterventions = false; MoreFromMozilla = false; SkipOnboarding = true; }; + SanitizeOnShutdown = { + Cache = true; + FormData = true; + Locked = true; + Cookies = false; + Downloads = false; + History = false; + Sessions = false; + SiteSettings = false; + OfflineApps = true; + }; + FirefoxHome = { + Search = true; + Pocket = false; + Snippets = false; + TopSites = false; + Highlights = false; + }; + UserMessaging = { + ExtensionRecommendations = false; + FeatureRecommendations = false; + UrlbarInterventions = false; + MoreFromMozilla = false; + SkipOnboarding = true; + }; Handlers = { schemes = { - mailto = { action = "useHelperApp"; ask = false; handlers = [{ name = "RoundCube"; uriTemplate = "https://mail.idimitrov.dev/?_task=mail&_action=compose&_to=%s"; }]; }; + mailto = { + action = "useHelperApp"; + ask = false; + handlers = [ + { + name = "RoundCube"; + uriTemplate = "https://mail.idimitrov.dev/?_task=mail&_action=compose&_to=%s"; + } + ]; + }; }; }; }; diff --git a/nixos/configs/default.nix b/nixos/configs/default.nix index 1638521..d771b7b 100644 --- a/nixos/configs/default.nix +++ b/nixos/configs/default.nix @@ -1,28 +1,44 @@ -toplevel@{ inputs, withSystem, ... }: -let +toplevel @ { + inputs, + withSystem, + ... +}: let system = "x86_64-linux"; mods = toplevel.config.flake.nixosModules; hardwareConfigurations = toplevel.config.flake.hardwareConfigurations; - essential = with mods; [ grub base shell security wireless intranet ]; - desktop = with mods; [ sound wayland ]; - configWithModules = { hardware ? { nixpkgs.hostPlatform = system; }, modules }: withSystem system (ctx@{ config, inputs', pkgs, ... }: inputs.nixpkgs.lib.nixosSystem { - specialArgs = { - inherit inputs inputs' pkgs; - packages = config.packages; + essential = with mods; [grub base shell security wireless intranet]; + desktop = with mods; [sound wayland]; + configWithModules = { + hardware ? {nixpkgs.hostPlatform = system;}, + modules, + }: + withSystem system (ctx @ { + config, + inputs', + pkgs, + ... + }: + inputs.nixpkgs.lib.nixosSystem { + specialArgs = { + inherit inputs inputs' pkgs; + packages = config.packages; + }; + modules = [hardware] ++ modules; + }); + novaConfig = mods: + configWithModules { + hardware = hardwareConfigurations.nova; + modules = essential ++ desktop ++ mods; }; - modules = [ hardware ] ++ modules; - }); - novaConfig = mods: configWithModules { hardware = hardwareConfigurations.nova; modules = essential ++ desktop ++ mods; }; -in -{ +in { flake.nixosConfigurations = { - nova = novaConfig [ mods.ivand ]; - nova-music = novaConfig (with mods; [ ivand music ]); - nova-crypto = novaConfig (with mods; [ ivand cryptocurrency ]); - nova-nonya = novaConfig (with mods; [ ivand anon cryptocurrency ]); - nova-ai = novaConfig (with mods; [ ivand ai ]); - install-iso = configWithModules { modules = (with mods; [ grub base shell wireless ]); }; - vps = configWithModules { modules = (with mods; [ base shell security vps mailserver nginx wireguard-output anonymous-dns firewall rest ]); }; - stara-miner = configWithModules { modules = (essential ++ [ mods.monero-miner ]); }; + nova = novaConfig [mods.ivand]; + nova-music = novaConfig (with mods; [ivand music]); + nova-crypto = novaConfig (with mods; [ivand cryptocurrency]); + nova-nonya = novaConfig (with mods; [ivand anon cryptocurrency]); + nova-ai = novaConfig (with mods; [ivand ai]); + install-iso = configWithModules {modules = with mods; [grub base shell wireless];}; + vps = configWithModules {modules = with mods; [base shell security vps mailserver nginx wireguard-output anonymous-dns firewall rest];}; + stara-miner = configWithModules {modules = essential ++ [mods.monero-miner];}; }; } diff --git a/nixos/default.nix b/nixos/default.nix index e1af904..68b3bea 100644 --- a/nixos/default.nix +++ b/nixos/default.nix @@ -1,3 +1,3 @@ -{ ... }: { - imports = [ ./modules ./configs ]; +{...}: { + imports = [./modules ./configs]; } diff --git a/nixos/modules/default.nix b/nixos/modules/default.nix index 8d3ad33..08fd61b 100644 --- a/nixos/modules/default.nix +++ b/nixos/modules/default.nix @@ -1,45 +1,63 @@ -top@{ inputs, moduleWithSystem, ... }: { +top @ { + inputs, + moduleWithSystem, + ... +}: { flake.nixosModules = { - grub = moduleWithSystem (toplevel@{ ... }: perSystem@{ pkgs, ... }: { + grub = moduleWithSystem (toplevel @ {...}: perSystem @ {pkgs, ...}: { boot = { loader = { - grub = - let - theme = pkgs.sleek-grub-theme.override { withBanner = "Hello Ivan"; withStyle = "bigSur"; }; - in - { - enable = pkgs.lib.mkDefault true; - useOSProber = true; - efiSupport = true; - device = "nodev"; - theme = theme; - splashImage = "${theme}/background.png"; + grub = let + theme = pkgs.sleek-grub-theme.override { + withBanner = "Hello Ivan"; + withStyle = "bigSur"; }; + in { + enable = pkgs.lib.mkDefault true; + useOSProber = true; + efiSupport = true; + device = "nodev"; + theme = theme; + splashImage = "${theme}/background.png"; + }; efi.canTouchEfiVariables = true; }; }; }); - base = moduleWithSystem (toplevel@{ ... }: perSystem@{ pkgs, ... }: { - imports = [ inputs.hosts.nixosModule ]; + base = moduleWithSystem (toplevel @ {...}: perSystem @ {pkgs, ...}: { + imports = [inputs.hosts.nixosModule]; system.stateVersion = top.config.flake.stateVersion; - nix = { extraOptions = ''experimental-features = nix-command flakes''; }; - i18n.supportedLocales = [ "all" ]; + nix = {extraOptions = ''experimental-features = nix-command flakes'';}; + i18n.supportedLocales = ["all"]; time.timeZone = "Europe/Prague"; environment = { - systemPackages = with pkgs; [ cmatrix uutils-coreutils-noprefix cryptsetup fd file git glibc gnumake mlocate openssh openssl procs ripgrep srm unzip vim zip just nixos-install-tools tshark ]; - sessionVariables = { MAKEFLAGS = "-j 4"; }; - shells = with pkgs; [ bash zsh nushell ]; + systemPackages = with pkgs; [cmatrix uutils-coreutils-noprefix cryptsetup fd file git glibc gnumake mlocate openssh openssl procs ripgrep srm unzip vim zip just nixos-install-tools tshark]; + sessionVariables = {MAKEFLAGS = "-j 4";}; + shells = with pkgs; [bash zsh nushell]; enableAllTerminfo = true; }; users.defaultUserShell = pkgs.zsh; - programs = { zsh.enable = true; nix-ld.enable = true; }; + programs = { + zsh.enable = true; + nix-ld.enable = true; + }; services = { dbus.enable = true; - logind = { killUserProcesses = true; powerKeyLongPress = "reboot"; }; + logind = { + killUserProcesses = true; + powerKeyLongPress = "reboot"; + }; + }; + networking = { + stevenBlackHosts = { + enable = true; + blockFakenews = true; + blockGambling = true; + blockSocial = true; + }; }; - networking = { stevenBlackHosts = { enable = true; blockFakenews = true; blockGambling = true; blockSocial = true; }; }; }); - shell = moduleWithSystem (toplevel@{ ... }: perSystem@{ pkgs, ... }: { + shell = moduleWithSystem (toplevel @ {...}: perSystem @ {pkgs, ...}: { programs = { starship.enable = true; zsh = { @@ -47,7 +65,7 @@ top@{ inputs, moduleWithSystem, ... }: { syntaxHighlighting.enable = true; autosuggestions = { enable = true; - strategy = [ "completion" ]; + strategy = ["completion"]; }; shellAliases = { cal = "cal $(date +%Y)"; @@ -67,38 +85,68 @@ top@{ inputs, moduleWithSystem, ... }: { }; }; }); - sound = moduleWithSystem (toplevel@{ ... }: perSystem@{ pkgs, ... }: { - services = { pipewire = { enable = true; alsa.enable = true; pulse.enable = true; }; }; - environment.systemPackages = with pkgs; [ pwvucontrol ]; + sound = moduleWithSystem (toplevel @ {...}: perSystem @ {pkgs, ...}: { + services = { + pipewire = { + enable = true; + alsa.enable = true; + pulse.enable = true; + }; + }; + environment.systemPackages = with pkgs; [pwvucontrol]; }); - music = moduleWithSystem (toplevel@{ ... }: perSystem@{ pkgs, ... }: { - imports = [ inputs.musnix.nixosModules.musnix ]; - environment.systemPackages = with pkgs; [ guitarix ]; + music = moduleWithSystem (toplevel @ {...}: perSystem @ {pkgs, ...}: { + imports = [inputs.musnix.nixosModules.musnix]; + environment.systemPackages = with pkgs; [guitarix]; services.pipewire = { jack.enable = true; - extraConfig = { jack."69-low-latency" = { "jack.properties" = { "node.latency" = "64/48000"; }; }; }; + extraConfig = {jack."69-low-latency" = {"jack.properties" = {"node.latency" = "64/48000";};};}; }; musnix = { enable = true; rtcqs.enable = true; soundcardPciId = "00:1f.3"; - kernel = { realtime = true; packages = pkgs.linuxPackages-rt; }; + kernel = { + realtime = true; + packages = pkgs.linuxPackages-rt; + }; }; }); - wayland = moduleWithSystem (toplevel@{ ... }: perSystem@{ ... }: { + wayland = moduleWithSystem (toplevel @ {...}: perSystem @ {...}: { hardware.graphics.enable = true; - security.pam.services.swaylock = { }; + security.pam.services.swaylock = {}; xdg.portal = { enable = true; xdgOpenUsePortal = true; - wlr = { enable = true; settings = { screencast = { output_name = "HDMI-A-1"; max_fps = 60; }; }; }; + wlr = { + enable = true; + settings = { + screencast = { + output_name = "HDMI-A-1"; + max_fps = 60; + }; + }; + }; config.common.default = "*"; }; }); - security = moduleWithSystem (toplevel@{ ... }: perSystem@{ ... }: { + security = moduleWithSystem (toplevel @ {...}: perSystem @ {...}: { security = { - sudo = { enable = false; execWheelOnly = true; extraRules = [{ groups = [ "wheel" ]; }]; }; - doas = { enable = true; extraRules = [{ groups = [ "wheel" ]; noPass = true; keepEnv = true; }]; }; + sudo = { + enable = false; + execWheelOnly = true; + extraRules = [{groups = ["wheel"];}]; + }; + doas = { + enable = true; + extraRules = [ + { + groups = ["wheel"]; + noPass = true; + keepEnv = true; + } + ]; + }; polkit.enable = true; rtkit.enable = true; }; @@ -106,12 +154,12 @@ top@{ inputs, moduleWithSystem, ... }: { intranet = { networking.wg-quick.interfaces = { wg0 = { - address = [ "10.0.0.2/32" ]; + address = ["10.0.0.2/32"]; privateKeyFile = "/etc/wireguard/privatekey"; peers = [ { publicKey = "5FiTLnzbgcbgQLlyVyYeESEd+2DtwM1JHCGz/32UcEU="; - allowedIPs = [ "0.0.0.0/0" "::/0" ]; + allowedIPs = ["0.0.0.0/0" "::/0"]; endpoint = "37.205.13.29:51820"; persistentKeepalive = 25; } @@ -170,65 +218,75 @@ top@{ inputs, moduleWithSystem, ... }: { }; }; }; - ivand = moduleWithSystem (toplevel@{ ... }: perSystem@{ pkgs, ... }: - let homeMods = top.config.flake.homeManagerModules; in { - imports = [ inputs.home-manager.nixosModules.default ]; - home-manager = { - backupFileExtension = "bak"; - useUserPackages = true; - useGlobalPkgs = true; - users.ivand = { ... }: { - imports = with homeMods; [ - base - ivand - shell - util - swayland - web + ivand = moduleWithSystem (toplevel @ {...}: perSystem @ {pkgs, ...}: let + homeMods = top.config.flake.homeManagerModules; + in { + imports = [inputs.home-manager.nixosModules.default]; + home-manager = { + backupFileExtension = "bak"; + useUserPackages = true; + useGlobalPkgs = true; + users.ivand = {...}: { + imports = with homeMods; [ + base + ivand + shell + util + swayland + web + ]; + }; + }; + fonts.packages = with pkgs; [(nerdfonts.override {fonts = ["FiraCode"];}) noto-fonts noto-fonts-emoji noto-fonts-lgc-plus]; + users = { + users = { + ivand = { + isNormalUser = true; + createHome = true; + extraGroups = [ + "adbusers" + "adm" + "audio" + "bluetooth" + "dialout" + "flatpak" + "kvm" + "mlocate" + "realtime" + "render" + "video" + "wheel" ]; }; }; - fonts.packages = with pkgs; [ (nerdfonts.override { fonts = [ "FiraCode" ]; }) noto-fonts noto-fonts-emoji noto-fonts-lgc-plus ]; - users = { - users = { - ivand = { - isNormalUser = true; - createHome = true; - extraGroups = [ - "adbusers" - "adm" - "audio" - "bluetooth" - "dialout" - "flatpak" - "kvm" - "mlocate" - "realtime" - "render" - "video" - "wheel" - ]; - }; - }; - extraGroups = { mlocate = { }; realtime = { }; }; + extraGroups = { + mlocate = {}; + realtime = {}; }; - programs.dconf.enable = true; - }); + }; + programs.dconf.enable = true; + }); flatpak = { - xdg = { portal = { enable = true; wlr.enable = true; config.common.default = "*"; }; }; + xdg = { + portal = { + enable = true; + wlr.enable = true; + config.common.default = "*"; + }; + }; services.flatpak.enable = true; }; - ai = moduleWithSystem (toplevel@{ ... }: perSystem@{ ... }: { - services = { ollama.enable = true; }; + ai = moduleWithSystem (toplevel @ {...}: perSystem @ {...}: { + services = {ollama.enable = true;}; }); - anon = moduleWithSystem (toplevel@{ ... }: perSystem@{ pkgs, ... }: { - environment.systemPackages = with pkgs; [ tor-browser ]; + anon = moduleWithSystem (toplevel @ {...}: perSystem @ {pkgs, ...}: { + environment.systemPackages = with pkgs; [tor-browser]; }); - cryptocurrency = moduleWithSystem (toplevel@{ ... }: perSystem@{ pkgs, ... }: { - environment.systemPackages = with pkgs; [ monero-cli ]; - services = { monero.enable = true; }; + cryptocurrency = moduleWithSystem (toplevel @ {...}: perSystem @ {pkgs, ...}: { + environment.systemPackages = with pkgs; [monero-cli]; + services = {monero.enable = true;}; }); - monero-miner = moduleWithSystem (toplevel@{ ... }: perSystem@{ ... }: { + monero-miner = moduleWithSystem (toplevel @ {...}: perSystem @ {...}: { services = { xmrig = { enable = true; @@ -249,12 +307,16 @@ top@{ inputs, moduleWithSystem, ... }: { }; }; }); - vps = moduleWithSystem (toplevel@{ ... }: perSystem@{ ... }: { + vps = moduleWithSystem (toplevel @ {...}: perSystem @ {...}: { imports = [ inputs.vpsadminos.nixosConfigurations.container ]; }); - mailserver = moduleWithSystem (toplevel@{ ... }: perSystem@{ config, pkgs, ... }: { + mailserver = moduleWithSystem (toplevel @ {...}: perSystem @ { + config, + pkgs, + ... + }: { imports = [ inputs.simple-nixos-mailserver.nixosModule ]; @@ -262,11 +324,11 @@ top@{ inputs, moduleWithSystem, ... }: { enable = true; localDnsResolver = false; fqdn = "mail.idimitrov.dev"; - domains = [ "idimitrov.dev" "mail.idimitrov.dev" ]; + domains = ["idimitrov.dev" "mail.idimitrov.dev"]; loginAccounts = { "ivan@idimitrov.dev" = { hashedPassword = "$2b$05$rTVIQD98ogXeCBKdk/YufulWHqpMCAlb7SHDPlh5y8Xbukoa/uQLm"; - aliases = [ "admin@idimitrov.dev" ]; + aliases = ["admin@idimitrov.dev"]; }; "security@idimitrov.dev" = { hashedPassword = "$2b$05$rTVIQD98ogXeCBKdk/YufulWHqpMCAlb7SHDPlh5y8Xbukoa/uQLm"; @@ -276,10 +338,10 @@ top@{ inputs, moduleWithSystem, ... }: { hierarchySeparator = "/"; }; services = { - dovecot2.sieve.extensions = [ "fileinto" ]; + dovecot2.sieve.extensions = ["fileinto"]; roundcube = { enable = true; - package = pkgs.roundcube.withPlugins (plugins: [ plugins.persistent_login ]); + package = pkgs.roundcube.withPlugins (plugins: [plugins.persistent_login]); plugins = [ "persistent_login" ]; @@ -290,20 +352,18 @@ top@{ inputs, moduleWithSystem, ... }: { $config['smtp_pass'] = "%p"; ''; }; - nginx.virtualHosts = - let - restrictToVpn = '' - allow 10.0.0.2/32; - allow 10.0.0.3/32; - allow 10.0.0.4/32; - deny all; - ''; - in - { - "${config.mailserver.fqdn}" = { - extraConfig = restrictToVpn; - }; + nginx.virtualHosts = let + restrictToVpn = '' + allow 10.0.0.2/32; + allow 10.0.0.3/32; + allow 10.0.0.4/32; + deny all; + ''; + in { + "${config.mailserver.fqdn}" = { + extraConfig = restrictToVpn; }; + }; postgresql.enable = true; }; security = { @@ -313,65 +373,63 @@ top@{ inputs, moduleWithSystem, ... }: { }; }; }); - nginx = moduleWithSystem (toplevel@{ ... }: perSystem@{ pkgs, ... }: { + nginx = moduleWithSystem (toplevel @ {...}: perSystem @ {pkgs, ...}: { services = { - nginx = - let - webshiteConfig = '' - add_header 'Referrer-Policy' 'origin-when-cross-origin'; - add_header X-Content-Type-Options nosniff; - ''; - extensions = [ "html" "txt" "png" "jpg" "jpeg" ]; - serveStatic = exts: '' - try_files $uri $uri/ ${pkgs.lib.strings.concatStringsSep " " (builtins.map (x: "$uri." + "${x}") exts)} =404; - ''; - in - { - enable = true; - recommendedGzipSettings = true; - recommendedOptimisation = true; - recommendedProxySettings = true; - recommendedTlsSettings = true; - sslCiphers = "AES256+EECDH:AES256+EDH:!aNULL"; - virtualHosts = { - "idimitrov.dev" = { - enableACME = true; - forceSSL = true; - locations."/" = { - root = "${pkgs.webshite}"; - extraConfig = serveStatic extensions; - }; - extraConfig = webshiteConfig; + nginx = let + webshiteConfig = '' + add_header 'Referrer-Policy' 'origin-when-cross-origin'; + add_header X-Content-Type-Options nosniff; + ''; + extensions = ["html" "txt" "png" "jpg" "jpeg"]; + serveStatic = exts: '' + try_files $uri $uri/ ${pkgs.lib.strings.concatStringsSep " " (builtins.map (x: "$uri." + "${x}") exts)} =404; + ''; + in { + enable = true; + recommendedGzipSettings = true; + recommendedOptimisation = true; + recommendedProxySettings = true; + recommendedTlsSettings = true; + sslCiphers = "AES256+EECDH:AES256+EDH:!aNULL"; + virtualHosts = { + "idimitrov.dev" = { + enableACME = true; + forceSSL = true; + locations."/" = { + root = "${pkgs.webshite}"; + extraConfig = serveStatic extensions; }; - "www.idimitrov.dev" = { - enableACME = true; - forceSSL = true; - locations."/" = { - root = "${pkgs.webshite}"; - extraConfig = serveStatic extensions; - }; - extraConfig = webshiteConfig; + extraConfig = webshiteConfig; + }; + "www.idimitrov.dev" = { + enableACME = true; + forceSSL = true; + locations."/" = { + root = "${pkgs.webshite}"; + extraConfig = serveStatic extensions; }; - "src.idimitrov.dev" = { - enableACME = true; - forceSSL = true; - locations."/" = { - proxyPass = "http://127.0.0.1:3001"; - }; + extraConfig = webshiteConfig; + }; + "src.idimitrov.dev" = { + enableACME = true; + forceSSL = true; + locations."/" = { + proxyPass = "http://127.0.0.1:3001"; }; - "pic.idimitrov.dev" = { - enableACME = true; - forceSSL = true; - locations."/" = { - root = "/var/pic"; - extraConfig = '' - autoindex on; - ${serveStatic ["png"]} - ''; - }; + }; + "pic.idimitrov.dev" = { + enableACME = true; + forceSSL = true; + locations."/" = { + root = "/var/pic"; + extraConfig = '' + autoindex on; + ${serveStatic ["png"]} + ''; }; }; }; + }; gitea = { enable = true; appName = "src"; @@ -407,17 +465,20 @@ top@{ inputs, moduleWithSystem, ... }: { }; }; }); - wireguard-output = moduleWithSystem (toplevel@{ ... }: perSystem@{ pkgs, ... }: { + wireguard-output = moduleWithSystem (toplevel @ {...}: perSystem @ {pkgs, ...}: { networking = { nat = { enable = true; enableIPv6 = true; externalInterface = "venet0"; - internalInterfaces = [ "wg0" ]; + internalInterfaces = ["wg0"]; }; wg-quick.interfaces = { - wg0 = let iptables = "${pkgs.iptables}/bin/iptables"; ip6tables = "${pkgs.iptables}/bin/ip6tables"; in { - address = [ "10.0.0.1/32" ]; + wg0 = let + iptables = "${pkgs.iptables}/bin/iptables"; + ip6tables = "${pkgs.iptables}/bin/ip6tables"; + in { + address = ["10.0.0.1/32"]; listenPort = 51820; privateKeyFile = "/etc/wireguard/privatekey"; postUp = '' @@ -435,24 +496,24 @@ top@{ inputs, moduleWithSystem, ... }: { peers = [ { publicKey = "kI93V0dVKSqX8hxMJHK5C0c1hEDPQTgPQDU8TKocVgo="; - allowedIPs = [ "10.0.0.2/32" ]; + allowedIPs = ["10.0.0.2/32"]; } { publicKey = "RqTsFxFCcgYsytcDr+jfEoOA5UNxa1ZzGlpx6iuTpXY="; - allowedIPs = [ "10.0.0.3/32" ]; + allowedIPs = ["10.0.0.3/32"]; } { publicKey = "1e0mjluqXdLbzv681HlC9B8BfGN8sIXIw3huLyQqwXI="; - allowedIPs = [ "10.0.0.4/32" ]; + allowedIPs = ["10.0.0.4/32"]; } ]; }; }; }; }); - anonymous-dns = moduleWithSystem (toplevel@{ ... }: perSystem@{ ... }: { + anonymous-dns = moduleWithSystem (toplevel @ {...}: perSystem @ {...}: { networking = { - nameservers = [ "127.0.0.1" "::1" ]; + nameservers = ["127.0.0.1" "::1"]; dhcpcd.extraConfig = "nohook resolv.conf"; }; services = { @@ -469,7 +530,12 @@ top@{ inputs, moduleWithSystem, ... }: { require_nolog = true; require_nofilter = true; anonymized_dns = { - routes = [{ server_name = "*"; via = [ "sdns://gQ8yMTcuMTM4LjIyMC4yNDM" ]; }]; + routes = [ + { + server_name = "*"; + via = ["sdns://gQ8yMTcuMTM4LjIyMC4yNDM"]; + } + ]; }; sources.public-resolvers = { urls = [ @@ -483,7 +549,7 @@ top@{ inputs, moduleWithSystem, ... }: { }; }; }); - firewall = moduleWithSystem (toplevel@{ ... }: perSystem@{ lib, ... }: { + firewall = moduleWithSystem (toplevel @ {...}: perSystem @ {lib, ...}: { networking = { firewall = lib.mkForce { enable = true; @@ -516,25 +582,24 @@ top@{ inputs, moduleWithSystem, ... }: { }; }; }); - rest = moduleWithSystem (toplevel@{ ... }: perSystem@{ pkgs, ... }: { + rest = moduleWithSystem (toplevel @ {...}: perSystem @ {pkgs, ...}: { fileSystems."/mnt/export1981" = { device = "172.16.128.47:/nas/5490"; fsType = "nfs"; - options = [ "nofail" ]; + options = ["nofail"]; }; users = { users.ivand = { isNormalUser = true; - hashedPassword = - "$2b$05$hPrPcewxj4qjLCRQpKBAu.FKvKZdIVlnyn4uYsWE8lc21Jhvc9jWG"; - extraGroups = [ "wheel" "adm" "mlocate" ]; + hashedPassword = "$2b$05$hPrPcewxj4qjLCRQpKBAu.FKvKZdIVlnyn4uYsWE8lc21Jhvc9jWG"; + extraGroups = ["wheel" "adm" "mlocate"]; openssh.authorizedKeys.keys = [ '' ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICcLkzuCoBEg+wq/H+hkrv6pLJ8J5BejaNJVNnymlnlo ivan@idimitrov.dev '' ]; }; - extraGroups = { mlocate = { }; }; + extraGroups = {mlocate = {};}; }; services = { openssh = { @@ -547,7 +612,7 @@ top@{ inputs, moduleWithSystem, ... }: { systemd = { timers = { bingwp = { - wantedBy = [ "timers.target" ]; + wantedBy = ["timers.target"]; timerConfig = { OnCalendar = "*-*-* 10:00:00"; Persistent = true; diff --git a/overlays/default.nix b/overlays/default.nix index 5d759b1..a036c3f 100644 --- a/overlays/default.nix +++ b/overlays/default.nix @@ -1,7 +1,13 @@ -top@{ inputs, withSystem, ... }: { - flake.overlays.default = final: prev: - let system = "x86_64-linux"; in withSystem system ( - { config, ... }: { +top @ { + inputs, + withSystem, + ... +}: { + flake.overlays.default = final: prev: let + system = "x86_64-linux"; + in + withSystem system ( + {config, ...}: { nvim = config.packages.nvim; bingwp = config.packages.bingwp; screenshot = config.packages.screenshot; diff --git a/packages/default.nix b/packages/default.nix index 958f8c9..27ae691 100644 --- a/packages/default.nix +++ b/packages/default.nix @@ -1,5 +1,9 @@ -top@{ inputs, ... }: { - perSystem = perSystem@{ system, pkgs, ... }: { +top @ {inputs, ...}: { + perSystem = perSystem @ { + system, + pkgs, + ... + }: { config.packages = { nvim = inputs.ide.nvim.${system}.standalone.default { plugins.lsp.servers = { @@ -7,12 +11,12 @@ top@{ inputs, ... }: { pylsp.enable = true; lua-ls.enable = true; }; - extraPlugins = with pkgs.vimPlugins; [ vim-just ]; + extraPlugins = with pkgs.vimPlugins; [vim-just]; }; wpd = pkgs.writeShellApplication { name = "wpd"; - runtimeInputs = with pkgs; [ swaybg xdg-user-dirs fd uutils-coreutils-noprefix ]; - runtimeEnv = { WAYLAND_DISPLAY = "wayland-1"; }; + runtimeInputs = with pkgs; [swaybg xdg-user-dirs fd uutils-coreutils-noprefix]; + runtimeEnv = {WAYLAND_DISPLAY = "wayland-1";}; text = '' random_pic () { bg_dir="$(xdg-user-dir PICTURES)/bg" @@ -32,7 +36,7 @@ top@{ inputs, ... }: { }; screenshot = pkgs.writeShellApplication { name = "screenshot"; - runtimeInputs = with pkgs; [ wl-clipboard xdg-utils ]; + runtimeInputs = with pkgs; [wl-clipboard xdg-utils]; text = '' ss_dir="$(xdg-user-dir PICTURES)/ss" pic_dir="$ss_dir/$(date "+%Y-%m-%d_%H-%M-%S").png" @@ -53,7 +57,7 @@ top@{ inputs, ... }: { }; cursors = pkgs.catppuccin-cursors.overrideAttrs (prev: rec { version = "0.3.1"; - nativeBuildInputs = prev.nativeBuildInputs ++ [ pkgs.xcur2png ]; + nativeBuildInputs = prev.nativeBuildInputs ++ [pkgs.xcur2png]; src = pkgs.fetchFromGitHub { owner = "catppuccin"; repo = "cursors";