diff --git a/aspects/ai.nix b/aspects/ai.nix index 6befeae..f67bbbc 100644 --- a/aspects/ai.nix +++ b/aspects/ai.nix @@ -1,12 +1,14 @@ { ... }: { - flake.modules.nixos.ai = { inputs, pkgs, ... }: { - environment.systemPackages = - (with pkgs; [claude-desktop]) ++ - (with inputs.nix-ai-tools.packages.${pkgs.system}; [ - claude-code - claudebox - opencode - ]); - }; + flake.modules.nixos.ai = + { inputs, pkgs, ... }: + { + environment.systemPackages = + (with pkgs; [ claude-desktop ]) + ++ (with inputs.nix-ai-tools.packages.${pkgs.system}; [ + claude-code + claudebox + opencode + ]); + }; } diff --git a/aspects/bluetooth.nix b/aspects/bluetooth.nix index 222bdf2..2027ac1 100644 --- a/aspects/bluetooth.nix +++ b/aspects/bluetooth.nix @@ -1,6 +1,13 @@ { ... }: { - flake.modules.nixos.bluetooth = { config, lib, pkgs, ... }: { - hardware.bluetooth.enable = true; - }; + flake.modules.nixos.bluetooth = + { + config, + lib, + pkgs, + ... + }: + { + hardware.bluetooth.enable = true; + }; } diff --git a/aspects/cli/btop.nix b/aspects/cli/btop.nix index 09a815e..2b9c3fc 100644 --- a/aspects/cli/btop.nix +++ b/aspects/cli/btop.nix @@ -1,13 +1,20 @@ { ... }: { - flake.modules.homeManager.cli-btop = { config, lib, pkgs, ... }: { - programs.btop = { - enable = true; - settings = { - theme_background = false; - proc_sorting = "cpu direct"; - update_ms = 500; + flake.modules.homeManager.cli-btop = + { + config, + lib, + pkgs, + ... + }: + { + programs.btop = { + enable = true; + settings = { + theme_background = false; + proc_sorting = "cpu direct"; + update_ms = 500; + }; }; }; - }; } diff --git a/aspects/cli/comma.nix b/aspects/cli/comma.nix index b8e6c2a..71ddb9c 100644 --- a/aspects/cli/comma.nix +++ b/aspects/cli/comma.nix @@ -1,8 +1,16 @@ { ... }: { - flake.modules.homeManager.cli-comma = { config, lib, pkgs, inputs, ... }: { - imports = [ inputs.nix-index-database.homeModules.nix-index ]; + flake.modules.homeManager.cli-comma = + { + config, + lib, + pkgs, + inputs, + ... + }: + { + imports = [ inputs.nix-index-database.homeModules.nix-index ]; - programs.nix-index-database.comma.enable = true; - }; + programs.nix-index-database.comma.enable = true; + }; } diff --git a/aspects/cli/direnv.nix b/aspects/cli/direnv.nix index 4399283..60ea7ad 100644 --- a/aspects/cli/direnv.nix +++ b/aspects/cli/direnv.nix @@ -1,9 +1,16 @@ { ... }: { - flake.modules.homeManager.cli-direnv = { config, lib, pkgs, ... }: { - programs.direnv = { - enable = true; - nix-direnv.enable = true; + flake.modules.homeManager.cli-direnv = + { + config, + lib, + pkgs, + ... + }: + { + programs.direnv = { + enable = true; + nix-direnv.enable = true; + }; }; - }; } diff --git a/aspects/cli/helix.nix b/aspects/cli/helix.nix index 1fa2baf..fe0cf74 100644 --- a/aspects/cli/helix.nix +++ b/aspects/cli/helix.nix @@ -1,50 +1,57 @@ { ... }: { - flake.modules.homeManager.cli-helix = { config, lib, pkgs, ... }: { - home.sessionVariables = { - EDITOR = "hx"; - }; + flake.modules.homeManager.cli-helix = + { + config, + lib, + pkgs, + ... + }: + { + home.sessionVariables = { + EDITOR = "hx"; + }; - programs.helix = { - enable = true; - settings = { - editor = { - file-picker.hidden = false; - idle-timeout = 0; - line-number = "relative"; - cursor-shape = { - normal = "underline"; - insert = "bar"; - select = "underline"; + programs.helix = { + enable = true; + settings = { + editor = { + file-picker.hidden = false; + idle-timeout = 0; + line-number = "relative"; + cursor-shape = { + normal = "underline"; + insert = "bar"; + select = "underline"; + }; + soft-wrap.enable = true; + auto-format = true; + indent-guides.render = true; }; - soft-wrap.enable = true; - auto-format = true; - indent-guides.render = true; - }; - keys.normal = { - space = { - o = "file_picker_in_current_buffer_directory"; - esc = [ - "collapse_selection" - "keep_primary_selection" - ]; + keys.normal = { + space = { + o = "file_picker_in_current_buffer_directory"; + esc = [ + "collapse_selection" + "keep_primary_selection" + ]; + }; }; }; - }; - languages = { - language = [ - { - name = "nix"; - auto-format = true; - formatter.command = "nixfmt"; - } - { - name = "typst"; - auto-format = true; - formatter.command = "typstyle -c 1000 -i"; - } - ]; + languages = { + language = [ + { + name = "nix"; + auto-format = true; + formatter.command = "nixfmt"; + } + { + name = "typst"; + auto-format = true; + formatter.command = "typstyle -c 1000 -i"; + } + ]; + }; }; }; - }; } diff --git a/aspects/cli/hm-cli.nix b/aspects/cli/hm-cli.nix index acee59d..7064a3f 100644 --- a/aspects/cli/hm-cli.nix +++ b/aspects/cli/hm-cli.nix @@ -1,11 +1,18 @@ { ... }: { - flake.modules.homeManager.cli-base = { config, lib, pkgs, ... }: { - home = { - packages = with pkgs; [ hm-cli ]; - sessionVariables = { - HM_PATH = "/etc/nixos"; + flake.modules.homeManager.cli-base = + { + config, + lib, + pkgs, + ... + }: + { + home = { + packages = with pkgs; [ hm-cli ]; + sessionVariables = { + HM_PATH = "/etc/nixos"; + }; }; }; - }; } diff --git a/aspects/cli/starship.nix b/aspects/cli/starship.nix index e9884a7..7ba3a54 100644 --- a/aspects/cli/starship.nix +++ b/aspects/cli/starship.nix @@ -1,41 +1,48 @@ { ... }: { - flake.modules.homeManager.cli-starship = { config, lib, pkgs, ... }: { - programs.starship = { - enable = true; - enableBashIntegration = true; - enableFishIntegration = true; - settings = { - add_newline = false; - format = '' - $hostname$directory$git_branch$git_status$nix_shell - [ ❯ ](bold green) - ''; - right_format = "$cmd_duration$character"; - hostname = { - ssh_symbol = "󰖟 "; - }; - character = { - error_symbol = "[](red)"; - success_symbol = "[󱐋](green)"; - }; - cmd_duration = { - format = "[󰄉 $duration ]($style)"; - style = "yellow"; - min_time = 500; - }; - git_branch = { - symbol = " "; - style = "purple"; - }; - git_status.style = "red"; - nix_shell = { - format = "via [$symbol$state]($style)"; - heuristic = true; - style = "blue"; - symbol = "󱄅 "; + flake.modules.homeManager.cli-starship = + { + config, + lib, + pkgs, + ... + }: + { + programs.starship = { + enable = true; + enableBashIntegration = true; + enableFishIntegration = true; + settings = { + add_newline = false; + format = '' + $hostname$directory$git_branch$git_status$nix_shell + [ ❯ ](bold green) + ''; + right_format = "$cmd_duration$character"; + hostname = { + ssh_symbol = "󰖟 "; + }; + character = { + error_symbol = "[](red)"; + success_symbol = "[󱐋](green)"; + }; + cmd_duration = { + format = "[󰄉 $duration ]($style)"; + style = "yellow"; + min_time = 500; + }; + git_branch = { + symbol = " "; + style = "purple"; + }; + git_status.style = "red"; + nix_shell = { + format = "via [$symbol$state]($style)"; + heuristic = true; + style = "blue"; + symbol = "󱄅 "; + }; }; }; }; - }; } diff --git a/aspects/cli/tmux.nix b/aspects/cli/tmux.nix index 078a6aa..1238501 100644 --- a/aspects/cli/tmux.nix +++ b/aspects/cli/tmux.nix @@ -1,12 +1,19 @@ { ... }: { - flake.modules.homeManager.cli-tmux = { config, lib, pkgs, ... }: { - programs.tmux = { - enable = true; - clock24 = true; - terminal = "xterm-256color"; - mouse = true; - keyMode = "vi"; + flake.modules.homeManager.cli-tmux = + { + config, + lib, + pkgs, + ... + }: + { + programs.tmux = { + enable = true; + clock24 = true; + terminal = "xterm-256color"; + mouse = true; + keyMode = "vi"; + }; }; - }; } diff --git a/aspects/common/boot.nix b/aspects/common/boot.nix index 109d6f2..b74b68c 100644 --- a/aspects/common/boot.nix +++ b/aspects/common/boot.nix @@ -1,21 +1,23 @@ { ... }: { - flake.modules.nixos.common-boot = { pkgs, ... }: { - boot = { - loader = { - timeout = 1; - efi.canTouchEfiVariables = true; - systemd-boot = { - enable = true; - editor = false; - consoleMode = "max"; - sortKey = "aa"; - netbootxyz = { + flake.modules.nixos.common-boot = + { pkgs, ... }: + { + boot = { + loader = { + timeout = 1; + efi.canTouchEfiVariables = true; + systemd-boot = { enable = true; - sortKey = "zz"; + editor = false; + consoleMode = "max"; + sortKey = "aa"; + netbootxyz = { + enable = true; + sortKey = "zz"; + }; }; }; }; }; - }; } diff --git a/aspects/common/console.nix b/aspects/common/console.nix index 6f6be9f..128b914 100644 --- a/aspects/common/console.nix +++ b/aspects/common/console.nix @@ -1,9 +1,11 @@ { ... }: { - flake.modules.nixos.common-console = { ... }: { - console = { - useXkbConfig = true; - earlySetup = true; + flake.modules.nixos.common-console = + { ... }: + { + console = { + useXkbConfig = true; + earlySetup = true; + }; }; - }; } diff --git a/aspects/common/firewall.nix b/aspects/common/firewall.nix index af1a8f7..0e5297d 100644 --- a/aspects/common/firewall.nix +++ b/aspects/common/firewall.nix @@ -1,9 +1,11 @@ { ... }: { - flake.modules.nixos.common-firewall = { ... }: { - networking = { - firewall.enable = true; - nftables.enable = true; + flake.modules.nixos.common-firewall = + { ... }: + { + networking = { + firewall.enable = true; + nftables.enable = true; + }; }; - }; } diff --git a/aspects/common/locale.nix b/aspects/common/locale.nix index 2b91759..a6b5754 100644 --- a/aspects/common/locale.nix +++ b/aspects/common/locale.nix @@ -1,22 +1,24 @@ { ... }: { - flake.modules.nixos.common-locale = { ... }: { - time.timeZone = "America/Bahia"; + flake.modules.nixos.common-locale = + { ... }: + { + time.timeZone = "America/Bahia"; - i18n = { - defaultLocale = "en_US.UTF-8"; - extraLocaleSettings = { - LC_ADDRESS = "pt_BR.utf8"; - LC_COLLATE = "pt_BR.utf8"; - LC_IDENTIFICATION = "pt_BR.utf8"; - LC_MEASUREMENT = "pt_BR.utf8"; - LC_MONETARY = "pt_BR.utf8"; - LC_NAME = "pt_BR.utf8"; - LC_NUMERIC = "pt_BR.utf8"; - LC_PAPER = "pt_BR.utf8"; - LC_TELEPHONE = "pt_BR.utf8"; - LC_TIME = "en_IE.utf8"; + i18n = { + defaultLocale = "en_US.UTF-8"; + extraLocaleSettings = { + LC_ADDRESS = "pt_BR.utf8"; + LC_COLLATE = "pt_BR.utf8"; + LC_IDENTIFICATION = "pt_BR.utf8"; + LC_MEASUREMENT = "pt_BR.utf8"; + LC_MONETARY = "pt_BR.utf8"; + LC_NAME = "pt_BR.utf8"; + LC_NUMERIC = "pt_BR.utf8"; + LC_PAPER = "pt_BR.utf8"; + LC_TELEPHONE = "pt_BR.utf8"; + LC_TIME = "en_IE.utf8"; + }; }; }; - }; } diff --git a/aspects/common/nix.nix b/aspects/common/nix.nix index 414c315..cd76f62 100644 --- a/aspects/common/nix.nix +++ b/aspects/common/nix.nix @@ -1,39 +1,41 @@ { ... }: { - flake.modules.nixos.common-nix = { inputs, ... }: { - imports = [ inputs.nixos-cli.nixosModules.nixos-cli ]; + flake.modules.nixos.common-nix = + { inputs, ... }: + { + imports = [ inputs.nixos-cli.nixosModules.nixos-cli ]; - nix = { - settings = { - auto-optimise-store = true; - connect-timeout = 10; - log-lines = 25; - min-free = 128000000; - max-free = 1000000000; - trusted-users = [ "@wheel" ]; + nix = { + settings = { + auto-optimise-store = true; + connect-timeout = 10; + log-lines = 25; + min-free = 128000000; + max-free = 1000000000; + trusted-users = [ "@wheel" ]; + }; + extraOptions = "experimental-features = nix-command flakes"; + gc = { + automatic = true; + options = "--delete-older-than 8d"; + }; }; - extraOptions = "experimental-features = nix-command flakes"; - gc = { - automatic = true; - options = "--delete-older-than 8d"; + + nixpkgs.config = { + allowUnfree = true; + enableParallelBuilding = true; + buildManPages = false; + buildDocs = false; }; - }; - nixpkgs.config = { - allowUnfree = true; - enableParallelBuilding = true; - buildManPages = false; - buildDocs = false; - }; - - services.nixos-cli = { - enable = true; - config = { - use_nvd = true; - ignore_dirty_tree = true; + services.nixos-cli = { + enable = true; + config = { + use_nvd = true; + ignore_dirty_tree = true; + }; }; - }; - system.stateVersion = "22.11"; - }; + system.stateVersion = "22.11"; + }; } diff --git a/aspects/common/openssh.nix b/aspects/common/openssh.nix index c515d81..b8179f2 100644 --- a/aspects/common/openssh.nix +++ b/aspects/common/openssh.nix @@ -1,12 +1,14 @@ { ... }: { - flake.modules.nixos.common-openssh = { ... }: { - services.openssh = { - enable = true; - settings.PermitRootLogin = "no"; - extraConfig = '' - PrintLastLog no - ''; + flake.modules.nixos.common-openssh = + { ... }: + { + services.openssh = { + enable = true; + settings.PermitRootLogin = "no"; + extraConfig = '' + PrintLastLog no + ''; + }; }; - }; } diff --git a/aspects/common/services.nix b/aspects/common/services.nix index befdbb9..e05dcf0 100644 --- a/aspects/common/services.nix +++ b/aspects/common/services.nix @@ -1,10 +1,12 @@ { ... }: { - flake.modules.nixos.common-services = { ... }: { - services = { - dbus.implementation = "broker"; - irqbalance.enable = true; - fstrim.enable = true; + flake.modules.nixos.common-services = + { ... }: + { + services = { + dbus.implementation = "broker"; + irqbalance.enable = true; + fstrim.enable = true; + }; }; - }; } diff --git a/aspects/common/tailscale.nix b/aspects/common/tailscale.nix index 13eb82a..74381ac 100644 --- a/aspects/common/tailscale.nix +++ b/aspects/common/tailscale.nix @@ -1,9 +1,11 @@ { ... }: { - flake.modules.nixos.common-tailscale = { ... }: { - services.tailscale = { - enable = true; - extraUpFlags = [ "--operator=user" ]; + flake.modules.nixos.common-tailscale = + { ... }: + { + services.tailscale = { + enable = true; + extraUpFlags = [ "--operator=user" ]; + }; }; - }; } diff --git a/aspects/constants.nix b/aspects/constants.nix index 2d980e1..7d77098 100644 --- a/aspects/constants.nix +++ b/aspects/constants.nix @@ -54,12 +54,15 @@ let sharedData = import ../data/services.nix; # Enrich services with host IP information - enrichServices = hosts: services: - map (svc: + enrichServices = + hosts: services: + map ( + svc: let - hostInfo = hosts.${svc.host} or {}; + hostInfo = hosts.${svc.host} or { }; in - svc // { + svc + // { lanIP = hostInfo.lanIP or null; tailscaleIP = hostInfo.tailscaleIP or null; } @@ -70,19 +73,19 @@ in options.flake = { hosts = lib.mkOption { type = lib.types.attrsOf hostType; - default = {}; + default = { }; description = "Host definitions with IP addresses"; }; services = lib.mkOption { type = lib.types.listOf serviceType; - default = []; + default = [ ]; description = "Service definitions with enriched host information"; }; lib = lib.mkOption { type = lib.types.attrsOf lib.types.raw; - default = {}; + default = { }; description = "Utility functions for flake configuration"; }; }; @@ -94,9 +97,11 @@ in lib = { # Nginx virtual host utilities - mkNginxVHosts = { domains }: + mkNginxVHosts = + { domains }: let - mkVHostConfig = domain: vhostConfig: + mkVHostConfig = + domain: vhostConfig: lib.recursiveUpdate { useACMEHost = domain; forceSSL = true; @@ -107,7 +112,8 @@ in # Split DNS utilities for unbound # Generates unbound view config from a list of DNS entries - mkSplitDNS = entries: + mkSplitDNS = + entries: let tailscaleData = map (e: ''"${e.domain}. IN A ${e.tailscaleIP}"'') entries; lanData = map (e: ''"${e.domain}. IN A ${e.lanIP}"'') entries; diff --git a/aspects/desktop/boot.nix b/aspects/desktop/boot.nix index 48f879d..cd0fa9c 100644 --- a/aspects/desktop/boot.nix +++ b/aspects/desktop/boot.nix @@ -1,27 +1,34 @@ { ... }: { - flake.modules.nixos.desktop-boot = { config, lib, pkgs, ... }: { - boot = { - plymouth.enable = true; - initrd.systemd.enable = true; - loader.efi.efiSysMountPoint = "/boot/efi"; - kernelPackages = pkgs.linuxPackages_xanmod_latest; - extraModprobeConfig = '' - options bluetooth disable_ertm=1 - ''; - kernel.sysctl = { - "net.ipv4.tcp_mtu_probing" = 1; + flake.modules.nixos.desktop-boot = + { + config, + lib, + pkgs, + ... + }: + { + boot = { + plymouth.enable = true; + initrd.systemd.enable = true; + loader.efi.efiSysMountPoint = "/boot/efi"; + kernelPackages = pkgs.linuxPackages_xanmod_latest; + extraModprobeConfig = '' + options bluetooth disable_ertm=1 + ''; + kernel.sysctl = { + "net.ipv4.tcp_mtu_probing" = 1; + }; + kernelParams = [ + "quiet" + "splash" + "i2c-dev" + "i2c-piix4" + "loglevel=3" + "udev.log_priority=3" + "rd.udev.log_level=3" + "rd.systemd.show_status=false" + ]; }; - kernelParams = [ - "quiet" - "splash" - "i2c-dev" - "i2c-piix4" - "loglevel=3" - "udev.log_priority=3" - "rd.udev.log_level=3" - "rd.systemd.show_status=false" - ]; }; - }; } diff --git a/aspects/desktop/desktop.nix b/aspects/desktop/desktop.nix index f2298e7..fb54f55 100644 --- a/aspects/desktop/desktop.nix +++ b/aspects/desktop/desktop.nix @@ -4,289 +4,304 @@ }: { flake.modules = { - nixos.desktop-desktop = { config, lib, pkgs, ... }: { - imports = [ - inputs.niri-flake.nixosModules.niri - inputs.nix-flatpak.nixosModules.nix-flatpak - ]; - - environment = { - sessionVariables = { - KDEHOME = "$XDG_CONFIG_HOME/kde4"; # Stops kde from placing a .kde4 folder in the home dir - NIXOS_OZONE_WL = "1"; # Forces chromium and most electron apps to run in wayland - }; - systemPackages = with pkgs; [ - ### Web ### - bitwarden-desktop - fragments - nextcloud-client - tor-browser - vesktop - inputs.zen-browser.packages."${system}".default - ### Office & Productivity ### - aspell - aspellDicts.de - aspellDicts.en - aspellDicts.en-computers - aspellDicts.pt_BR - papers - presenterm - rnote - ### Graphics & Design ### - gimp - inkscape - plasticity - ### System Utilities ### - adwaita-icon-theme - ghostty - gnome-disk-utility - junction - libfido2 - mission-center - nautilus - p7zip - rclone - toggleaudiosink - unrar - ### Media ### - decibels - loupe - obs-studio - showtime + nixos.desktop-desktop = + { + config, + lib, + pkgs, + ... + }: + { + imports = [ + inputs.niri-flake.nixosModules.niri + inputs.nix-flatpak.nixosModules.nix-flatpak ]; - }; - services = { - pipewire = { - enable = true; - alsa.enable = true; - alsa.support32Bit = true; - pulse.enable = true; - jack.enable = true; - wireplumber.enable = true; - }; - greetd = { - enable = true; - settings = { - default_session = { - command = "${lib.getExe pkgs.tuigreet} --user-menu --time --remember --asterisks --cmd ${config.programs.niri.package}/bin/niri-session"; - user = "greeter"; - }; - } - // lib.optionalAttrs (config.networking.hostName == "io") { - initial_session = { - command = "${config.programs.niri.package}/bin/niri-session"; - user = "user"; - }; + environment = { + sessionVariables = { + KDEHOME = "$XDG_CONFIG_HOME/kde4"; # Stops kde from placing a .kde4 folder in the home dir + NIXOS_OZONE_WL = "1"; # Forces chromium and most electron apps to run in wayland }; - }; - flatpak = { - enable = true; - packages = [ + systemPackages = with pkgs; [ + ### Web ### + bitwarden-desktop + fragments + nextcloud-client + tor-browser + vesktop + inputs.zen-browser.packages."${system}".default ### Office & Productivity ### - "com.collabora.Office" + aspell + aspellDicts.de + aspellDicts.en + aspellDicts.en-computers + aspellDicts.pt_BR + papers + presenterm + rnote ### Graphics & Design ### - "com.boxy_svg.BoxySVG" - rec { - appId = "io.github.softfever.OrcaSlicer"; - sha256 = "0hdx5sg6fknj1pfnfxvlfwb5h6y1vjr6fyajbsnjph5gkp97c6p1"; - bundle = "${pkgs.fetchurl { - url = "https://github.com/SoftFever/OrcaSlicer/releases/download/v2.3.0/OrcaSlicer-Linux-flatpak_V2.3.0_x86_64.flatpak"; - inherit sha256; - }}"; - } + gimp + inkscape + plasticity ### System Utilities ### - "com.github.tchx84.Flatseal" - "com.rustdesk.RustDesk" - ]; - uninstallUnmanaged = true; - update.auto.enable = true; - }; - gvfs.enable = true; - }; - - security.rtkit.enable = true; # Needed for pipewire to acquire realtime priority - - users = { - users.greeter = { - isSystemUser = true; - group = "greeter"; - }; - groups.greeter = { }; - }; - - programs = { - niri = { - enable = true; - package = inputs.niri.packages.${pkgs.system}.niri; - }; - kdeconnect = { - enable = true; - package = pkgs.valent; - }; - dconf.enable = true; - appimage = { - enable = true; - binfmt = true; - }; - }; - - niri-flake.cache.enable = false; - - fonts = { - fontDir.enable = true; - packages = with pkgs; [ - corefonts - inter - nerd-fonts.fira-code - noto-fonts-cjk-sans - noto-fonts-color-emoji - roboto - ]; - }; - - xdg.portal = { - extraPortals = with pkgs; [ - xdg-desktop-portal-gnome - xdg-desktop-portal-gtk - ]; - config = { - common.default = "*"; - niri.default = [ - "gtk" - "gnome" + adwaita-icon-theme + ghostty + gnome-disk-utility + junction + libfido2 + mission-center + nautilus + p7zip + rclone + toggleaudiosink + unrar + ### Media ### + decibels + loupe + obs-studio + showtime ]; }; - }; - }; - homeManager.desktop-desktop = { config, lib, pkgs, inputs, ... }: { - imports = [ inputs.vicinae.homeManagerModules.default ]; - - fonts.fontconfig.enable = true; - - home.packages = with pkgs; [ xwayland-satellite ]; - - services.vicinae = { - enable = true; - systemd = { - enable = true; - autoStart = true; + services = { + pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + jack.enable = true; + wireplumber.enable = true; + }; + greetd = { + enable = true; + settings = { + default_session = { + command = "${lib.getExe pkgs.tuigreet} --user-menu --time --remember --asterisks --cmd ${config.programs.niri.package}/bin/niri-session"; + user = "greeter"; + }; + } + // lib.optionalAttrs (config.networking.hostName == "io") { + initial_session = { + command = "${config.programs.niri.package}/bin/niri-session"; + user = "user"; + }; + }; + }; + flatpak = { + enable = true; + packages = [ + ### Office & Productivity ### + "com.collabora.Office" + ### Graphics & Design ### + "com.boxy_svg.BoxySVG" + rec { + appId = "io.github.softfever.OrcaSlicer"; + sha256 = "0hdx5sg6fknj1pfnfxvlfwb5h6y1vjr6fyajbsnjph5gkp97c6p1"; + bundle = "${pkgs.fetchurl { + url = "https://github.com/SoftFever/OrcaSlicer/releases/download/v2.3.0/OrcaSlicer-Linux-flatpak_V2.3.0_x86_64.flatpak"; + inherit sha256; + }}"; + } + ### System Utilities ### + "com.github.tchx84.Flatseal" + "com.rustdesk.RustDesk" + ]; + uninstallUnmanaged = true; + update.auto.enable = true; + }; + gvfs.enable = true; }; - }; - programs = { - ghostty = { - enable = true; - settings = { - cursor-style = "block"; - shell-integration-features = "no-cursor"; - cursor-style-blink = false; - custom-shader = "${builtins.fetchurl { - url = "https://raw.githubusercontent.com/hackr-sh/ghostty-shaders/cb6eb4b0d1a3101c869c62e458b25a826f9dcde3/cursor_blaze.glsl"; - sha256 = "sha256:0g2lgqjdrn3c51glry7x2z30y7ml0y61arl5ykmf4yj0p85s5f41"; - }}"; - bell-features = ""; - gtk-titlebar-style = "tabs"; - keybind = [ "shift+enter=text:\\x1b\\r" ]; + security.rtkit.enable = true; # Needed for pipewire to acquire realtime priority + + users = { + users.greeter = { + isSystemUser = true; + group = "greeter"; + }; + groups.greeter = { }; + }; + + programs = { + niri = { + enable = true; + package = inputs.niri.packages.${pkgs.system}.niri; + }; + kdeconnect = { + enable = true; + package = pkgs.valent; + }; + dconf.enable = true; + appimage = { + enable = true; + binfmt = true; }; }; - password-store = { - enable = true; - package = pkgs.pass-wayland; - }; - }; + niri-flake.cache.enable = false; - xdg = { - enable = true; - userDirs.enable = true; - mimeApps = { - enable = true; - defaultApplications = { - "text/html" = [ - "re.sonny.Junction.desktop" - "zen-browser.desktop" - "torbrowser.desktop" + fonts = { + fontDir.enable = true; + packages = with pkgs; [ + corefonts + inter + nerd-fonts.fira-code + noto-fonts-cjk-sans + noto-fonts-color-emoji + roboto + ]; + }; + + xdg.portal = { + extraPortals = with pkgs; [ + xdg-desktop-portal-gnome + xdg-desktop-portal-gtk + ]; + config = { + common.default = "*"; + niri.default = [ + "gtk" + "gnome" ]; - "x-scheme-handler/http" = [ - "re.sonny.Junction.desktop" - "zen-browser.desktop" - "torbrowser.desktop" - ]; - "x-scheme-handler/https" = [ - "re.sonny.Junction.desktop" - "zen-browser.desktop" - "torbrowser.desktop" - ]; - "x-scheme-handler/about" = [ - "re.sonny.Junction.desktop" - "zen-browser.desktop" - "torbrowser.desktop" - ]; - "x-scheme-handler/unknown" = [ - "re.sonny.Junction.desktop" - "zen-browser.desktop" - "torbrowser.desktop" - ]; - "image/jpeg" = "org.gnome.Loupe.desktop"; - "image/png" = "org.gnome.Loupe.desktop"; - "image/gif" = "org.gnome.Loupe.desktop"; - "image/webp" = "org.gnome.Loupe.desktop"; - "image/bmp" = "org.gnome.Loupe.desktop"; - "image/svg+xml" = "org.gnome.Loupe.desktop"; - "image/tiff" = "org.gnome.Loupe.desktop"; - "video/mp4" = "io.bassi.Showtime.desktop"; - "video/x-matroska" = "io.bassi.Showtime.desktop"; - "video/webm" = "io.bassi.Showtime.desktop"; - "video/mpeg" = "io.bassi.Showtime.desktop"; - "video/x-msvideo" = "io.bassi.Showtime.desktop"; - "video/quicktime" = "io.bassi.Showtime.desktop"; - "video/x-flv" = "io.bassi.Showtime.desktop"; - "audio/mpeg" = "io.bassi.Showtime.desktop"; - "audio/flac" = "io.bassi.Showtime.desktop"; - "audio/ogg" = "io.bassi.Showtime.desktop"; - "audio/wav" = "io.bassi.Showtime.desktop"; - "audio/mp4" = "io.bassi.Showtime.desktop"; - "audio/x-opus+ogg" = "io.bassi.Showtime.desktop"; - "application/pdf" = [ - "org.gnome.Papers.desktop" - "zen-browser.desktop" - ]; - "text/plain" = "Helix.desktop"; - "text/markdown" = "Helix.desktop"; - "text/x-log" = "Helix.desktop"; - "application/x-shellscript" = "Helix.desktop"; - "application/vnd.openxmlformats-officedocument.wordprocessingml.document" = - "com.collabora.Office.desktop"; # DOCX - "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" = - "com.collabora.Office.desktop"; # XLSX - "application/vnd.openxmlformats-officedocument.presentationml.presentation" = - "com.collabora.Office.desktop"; # PPTX - "application/vnd.oasis.opendocument.text" = "com.collabora.Office.desktop"; # ODT - "application/vnd.oasis.opendocument.spreadsheet" = "com.collabora.Office.desktop"; # ODS - "application/vnd.oasis.opendocument.presentation" = "com.collabora.Office.desktop"; # ODP - "application/msword" = "com.collabora.Office.desktop"; # DOC - "application/vnd.ms-excel" = "com.collabora.Office.desktop"; # XLS - "application/vnd.ms-powerpoint" = "com.collabora.Office.desktop"; # PPT - "application/zip" = "org.gnome.FileRoller.desktop"; - "application/x-tar" = "org.gnome.FileRoller.desktop"; - "application/x-compressed-tar" = "org.gnome.FileRoller.desktop"; - "application/x-bzip-compressed-tar" = "org.gnome.FileRoller.desktop"; - "application/x-xz-compressed-tar" = "org.gnome.FileRoller.desktop"; - "application/x-7z-compressed" = "org.gnome.FileRoller.desktop"; - "application/x-rar" = "org.gnome.FileRoller.desktop"; - "application/gzip" = "org.gnome.FileRoller.desktop"; - "application/x-bzip" = "org.gnome.FileRoller.desktop"; - "inode/directory" = "org.gnome.Nautilus.desktop"; }; }; }; - # Set Ghostty as default terminal - home.sessionVariables = { - TERMINAL = "ghostty"; + homeManager.desktop-desktop = + { + config, + lib, + pkgs, + inputs, + ... + }: + { + imports = [ inputs.vicinae.homeManagerModules.default ]; + + fonts.fontconfig.enable = true; + + home.packages = with pkgs; [ xwayland-satellite ]; + + services.vicinae = { + enable = true; + systemd = { + enable = true; + autoStart = true; + }; + }; + + programs = { + ghostty = { + enable = true; + settings = { + cursor-style = "block"; + shell-integration-features = "no-cursor"; + cursor-style-blink = false; + custom-shader = "${builtins.fetchurl { + url = "https://raw.githubusercontent.com/hackr-sh/ghostty-shaders/cb6eb4b0d1a3101c869c62e458b25a826f9dcde3/cursor_blaze.glsl"; + sha256 = "sha256:0g2lgqjdrn3c51glry7x2z30y7ml0y61arl5ykmf4yj0p85s5f41"; + }}"; + bell-features = ""; + gtk-titlebar-style = "tabs"; + keybind = [ "shift+enter=text:\\x1b\\r" ]; + }; + }; + + password-store = { + enable = true; + package = pkgs.pass-wayland; + }; + }; + + xdg = { + enable = true; + userDirs.enable = true; + mimeApps = { + enable = true; + defaultApplications = { + "text/html" = [ + "re.sonny.Junction.desktop" + "zen-browser.desktop" + "torbrowser.desktop" + ]; + "x-scheme-handler/http" = [ + "re.sonny.Junction.desktop" + "zen-browser.desktop" + "torbrowser.desktop" + ]; + "x-scheme-handler/https" = [ + "re.sonny.Junction.desktop" + "zen-browser.desktop" + "torbrowser.desktop" + ]; + "x-scheme-handler/about" = [ + "re.sonny.Junction.desktop" + "zen-browser.desktop" + "torbrowser.desktop" + ]; + "x-scheme-handler/unknown" = [ + "re.sonny.Junction.desktop" + "zen-browser.desktop" + "torbrowser.desktop" + ]; + "image/jpeg" = "org.gnome.Loupe.desktop"; + "image/png" = "org.gnome.Loupe.desktop"; + "image/gif" = "org.gnome.Loupe.desktop"; + "image/webp" = "org.gnome.Loupe.desktop"; + "image/bmp" = "org.gnome.Loupe.desktop"; + "image/svg+xml" = "org.gnome.Loupe.desktop"; + "image/tiff" = "org.gnome.Loupe.desktop"; + "video/mp4" = "io.bassi.Showtime.desktop"; + "video/x-matroska" = "io.bassi.Showtime.desktop"; + "video/webm" = "io.bassi.Showtime.desktop"; + "video/mpeg" = "io.bassi.Showtime.desktop"; + "video/x-msvideo" = "io.bassi.Showtime.desktop"; + "video/quicktime" = "io.bassi.Showtime.desktop"; + "video/x-flv" = "io.bassi.Showtime.desktop"; + "audio/mpeg" = "io.bassi.Showtime.desktop"; + "audio/flac" = "io.bassi.Showtime.desktop"; + "audio/ogg" = "io.bassi.Showtime.desktop"; + "audio/wav" = "io.bassi.Showtime.desktop"; + "audio/mp4" = "io.bassi.Showtime.desktop"; + "audio/x-opus+ogg" = "io.bassi.Showtime.desktop"; + "application/pdf" = [ + "org.gnome.Papers.desktop" + "zen-browser.desktop" + ]; + "text/plain" = "Helix.desktop"; + "text/markdown" = "Helix.desktop"; + "text/x-log" = "Helix.desktop"; + "application/x-shellscript" = "Helix.desktop"; + "application/vnd.openxmlformats-officedocument.wordprocessingml.document" = + "com.collabora.Office.desktop"; # DOCX + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" = + "com.collabora.Office.desktop"; # XLSX + "application/vnd.openxmlformats-officedocument.presentationml.presentation" = + "com.collabora.Office.desktop"; # PPTX + "application/vnd.oasis.opendocument.text" = "com.collabora.Office.desktop"; # ODT + "application/vnd.oasis.opendocument.spreadsheet" = "com.collabora.Office.desktop"; # ODS + "application/vnd.oasis.opendocument.presentation" = "com.collabora.Office.desktop"; # ODP + "application/msword" = "com.collabora.Office.desktop"; # DOC + "application/vnd.ms-excel" = "com.collabora.Office.desktop"; # XLS + "application/vnd.ms-powerpoint" = "com.collabora.Office.desktop"; # PPT + "application/zip" = "org.gnome.FileRoller.desktop"; + "application/x-tar" = "org.gnome.FileRoller.desktop"; + "application/x-compressed-tar" = "org.gnome.FileRoller.desktop"; + "application/x-bzip-compressed-tar" = "org.gnome.FileRoller.desktop"; + "application/x-xz-compressed-tar" = "org.gnome.FileRoller.desktop"; + "application/x-7z-compressed" = "org.gnome.FileRoller.desktop"; + "application/x-rar" = "org.gnome.FileRoller.desktop"; + "application/gzip" = "org.gnome.FileRoller.desktop"; + "application/x-bzip" = "org.gnome.FileRoller.desktop"; + "inode/directory" = "org.gnome.Nautilus.desktop"; + }; + }; + }; + + # Set Ghostty as default terminal + home.sessionVariables = { + TERMINAL = "ghostty"; + }; }; - }; }; } diff --git a/aspects/desktop/niri.nix b/aspects/desktop/niri.nix index 6458ab0..cdd02ac 100644 --- a/aspects/desktop/niri.nix +++ b/aspects/desktop/niri.nix @@ -1,6 +1,14 @@ { ... }: { - flake.modules.homeManager.desktop-niri = { config, lib, pkgs, inputs, hostname ? null, ... }: + flake.modules.homeManager.desktop-niri = + { + config, + lib, + pkgs, + inputs, + hostname ? null, + ... + }: let isRotterdam = hostname == "rotterdam"; in diff --git a/aspects/desktop/nix.nix b/aspects/desktop/nix.nix index a3aa421..3a9e71e 100644 --- a/aspects/desktop/nix.nix +++ b/aspects/desktop/nix.nix @@ -1,14 +1,21 @@ { inputs, ... }: { - flake.modules.nixos.desktop-nix = { config, lib, pkgs, ... }: { - environment.etc."channels/nixpkgs".source = inputs.nixpkgs.outPath; + flake.modules.nixos.desktop-nix = + { + config, + lib, + pkgs, + ... + }: + { + environment.etc."channels/nixpkgs".source = inputs.nixpkgs.outPath; - nix = { - registry.nixpkgs.flake = inputs.nixpkgs; - nixPath = [ - "nixpkgs=${inputs.nixpkgs}" - "/nix/var/nix/profiles/per-user/root/channels" - ]; + nix = { + registry.nixpkgs.flake = inputs.nixpkgs; + nixPath = [ + "nixpkgs=${inputs.nixpkgs}" + "/nix/var/nix/profiles/per-user/root/channels" + ]; + }; }; - }; } diff --git a/aspects/desktop/services.nix b/aspects/desktop/services.nix index 8ebbb6b..eb9482a 100644 --- a/aspects/desktop/services.nix +++ b/aspects/desktop/services.nix @@ -1,16 +1,23 @@ { ... }: { - flake.modules.nixos.desktop-services = { config, lib, pkgs, ... }: { - services = { - printing.enable = true; - udev.packages = with pkgs; [ yubikey-personalization ]; - keyd = { - enable = true; - keyboards.all = { - ids = [ "*" ]; - settings.main.capslock = "overload(meta, esc)"; + flake.modules.nixos.desktop-services = + { + config, + lib, + pkgs, + ... + }: + { + services = { + printing.enable = true; + udev.packages = with pkgs; [ yubikey-personalization ]; + keyd = { + enable = true; + keyboards.all = { + ids = [ "*" ]; + settings.main.capslock = "overload(meta, esc)"; + }; }; }; }; - }; } diff --git a/aspects/dev.nix b/aspects/dev.nix index cc84646..89a1026 100644 --- a/aspects/dev.nix +++ b/aspects/dev.nix @@ -1,19 +1,26 @@ { ... }: { - flake.modules.nixos.dev = { config, lib, pkgs, ... }: { - environment.systemPackages = with pkgs; [ - android-tools - bat - lazygit - fd - fzf - glow - nixfmt - nix-init - nix-output-monitor - ripgrep - ]; + flake.modules.nixos.dev = + { + config, + lib, + pkgs, + ... + }: + { + environment.systemPackages = with pkgs; [ + android-tools + bat + lazygit + fd + fzf + glow + nixfmt + nix-init + nix-output-monitor + ripgrep + ]; - users.users.user.extraGroups = [ "adbusers" ]; - }; + users.users.user.extraGroups = [ "adbusers" ]; + }; } diff --git a/aspects/ephemeral.nix b/aspects/ephemeral.nix index 724f931..90c03c6 100644 --- a/aspects/ephemeral.nix +++ b/aspects/ephemeral.nix @@ -3,7 +3,8 @@ { inputs, ... }: { # Base module with options (for external flakes or direct use) - flake.modules.nixos.ephemeral = { lib, config, ... }: + flake.modules.nixos.ephemeral = + { lib, config, ... }: let cfg = config.ephemeral; in @@ -89,18 +90,19 @@ # Factory function that generates configured modules flake.factory.ephemeral = - { rootDevice - , rootSubvolume ? "@root" - , retentionDays ? 30 - , persistentStoragePath ? "/persistent" - , persistentFiles ? [ + { + rootDevice, + rootSubvolume ? "@root", + retentionDays ? 30, + persistentStoragePath ? "/persistent", + persistentFiles ? [ "/etc/machine-id" "/etc/ssh/ssh_host_ed25519_key" "/etc/ssh/ssh_host_ed25519_key.pub" "/etc/ssh/ssh_host_rsa_key" "/etc/ssh/ssh_host_rsa_key.pub" - ] - , persistentDirectories ? [ + ], + persistentDirectories ? [ "/etc/NetworkManager/system-connections" "/etc/nixos" "/var/lib/bluetooth" @@ -111,9 +113,10 @@ "/var/lib/systemd/timers" "/var/lib/tailscale" "/var/log" - ] + ], }: - { ... }: { + { ... }: + { imports = [ inputs.impermanence.nixosModules.impermanence inputs.self.modules.nixos.ephemeral diff --git a/aspects/fwupd.nix b/aspects/fwupd.nix index 746f1d0..217f1eb 100644 --- a/aspects/fwupd.nix +++ b/aspects/fwupd.nix @@ -1,6 +1,13 @@ { ... }: { - flake.modules.nixos.fwupd = { config, lib, pkgs, ... }: { - services.fwupd.enable = true; - }; + flake.modules.nixos.fwupd = + { + config, + lib, + pkgs, + ... + }: + { + services.fwupd.enable = true; + }; } diff --git a/aspects/gaming/flatpak.nix b/aspects/gaming/flatpak.nix index ad50c7c..cc4d0ee 100644 --- a/aspects/gaming/flatpak.nix +++ b/aspects/gaming/flatpak.nix @@ -1,23 +1,25 @@ { ... }: { - flake.modules.nixos.gaming-flatpak = { pkgs, ... }: { - services.flatpak.packages = [ - "com.github.k4zmu2a.spacecadetpinball" - "com.steamgriddb.SGDBoop" - "io.github.Foldex.AdwSteamGtk" - "io.itch.itch" - "io.mrarm.mcpelauncher" - "net.retrodeck.retrodeck" - "org.freedesktop.Platform.VulkanLayer.MangoHud/x86_64/25.08" - rec { - appId = "com.hypixel.HytaleLauncher"; - sha256 = "01307s44bklc1ldcigcn9n4lm8hf8q793v9fv7w4w04xd5zyh4rv"; - bundle = "${pkgs.fetchurl { - url = "https://launcher.hytale.com/builds/release/linux/amd64/hytale-launcher-latest.flatpak"; - inherit sha256; - }}"; - } - ]; - }; + flake.modules.nixos.gaming-flatpak = + { pkgs, ... }: + { + services.flatpak.packages = [ + "com.github.k4zmu2a.spacecadetpinball" + "com.steamgriddb.SGDBoop" + "io.github.Foldex.AdwSteamGtk" + "io.itch.itch" + "io.mrarm.mcpelauncher" + "net.retrodeck.retrodeck" + "org.freedesktop.Platform.VulkanLayer.MangoHud/x86_64/25.08" + rec { + appId = "com.hypixel.HytaleLauncher"; + sha256 = "01307s44bklc1ldcigcn9n4lm8hf8q793v9fv7w4w04xd5zyh4rv"; + bundle = "${pkgs.fetchurl { + url = "https://launcher.hytale.com/builds/release/linux/amd64/hytale-launcher-latest.flatpak"; + inherit sha256; + }}"; + } + ]; + }; } diff --git a/aspects/gaming/hardware.nix b/aspects/gaming/hardware.nix index f1bd75b..e3b5c4b 100644 --- a/aspects/gaming/hardware.nix +++ b/aspects/gaming/hardware.nix @@ -1,11 +1,13 @@ { ... }: { - flake.modules.nixos.gaming-hardware = { ... }: { - hardware = { - xpadneo.enable = true; - steam-hardware.enable = true; # Allow steam client to manage controllers - graphics.enable32Bit = true; # For OpenGL games + flake.modules.nixos.gaming-hardware = + { ... }: + { + hardware = { + xpadneo.enable = true; + steam-hardware.enable = true; # Allow steam client to manage controllers + graphics.enable32Bit = true; # For OpenGL games + }; }; - }; } diff --git a/aspects/gaming/launchers.nix b/aspects/gaming/launchers.nix index 5684f9f..1fd3bb4 100644 --- a/aspects/gaming/launchers.nix +++ b/aspects/gaming/launchers.nix @@ -1,11 +1,13 @@ { ... }: { - flake.modules.nixos.gaming-launchers = { pkgs, ... }: { - environment.systemPackages = with pkgs; [ - clonehero - heroic - prismlauncher - ]; - }; + flake.modules.nixos.gaming-launchers = + { pkgs, ... }: + { + environment.systemPackages = with pkgs; [ + clonehero + heroic + prismlauncher + ]; + }; } diff --git a/aspects/gaming/mangohud.nix b/aspects/gaming/mangohud.nix index 7f83644..2856b8f 100644 --- a/aspects/gaming/mangohud.nix +++ b/aspects/gaming/mangohud.nix @@ -2,42 +2,46 @@ { flake.modules = { - nixos.gaming-mangohud = { pkgs, ... }: { - environment.systemPackages = with pkgs; [ - mangohud - ]; - }; + nixos.gaming-mangohud = + { pkgs, ... }: + { + environment.systemPackages = with pkgs; [ + mangohud + ]; + }; - homeManager.gaming-mangohud = { config, ... }: { - programs.mangohud = { - enable = true; - enableSessionWide = true; - settings = { - position = "top-left"; - fps = true; - frametime = false; - frame_timing = false; - gpu_stats = true; - gpu_temp = true; - gpu_power = true; - cpu_stats = true; - cpu_temp = true; - cpu_power = true; - ram = true; - vram = true; - gamemode = false; - vkbasalt = false; - version = false; - engine_version = false; - vulkan_driver = false; - wine = false; - time = false; - fps_sampling_period = 500; - toggle_hud = "Shift_L+F12"; - toggle_logging = "Ctrl_L+F2"; - output_folder = "${config.home.homeDirectory}/.local/share/mangohud"; + homeManager.gaming-mangohud = + { config, ... }: + { + programs.mangohud = { + enable = true; + enableSessionWide = true; + settings = { + position = "top-left"; + fps = true; + frametime = false; + frame_timing = false; + gpu_stats = true; + gpu_temp = true; + gpu_power = true; + cpu_stats = true; + cpu_temp = true; + cpu_power = true; + ram = true; + vram = true; + gamemode = false; + vkbasalt = false; + version = false; + engine_version = false; + vulkan_driver = false; + wine = false; + time = false; + fps_sampling_period = 500; + toggle_hud = "Shift_L+F12"; + toggle_logging = "Ctrl_L+F2"; + output_folder = "${config.home.homeDirectory}/.local/share/mangohud"; + }; }; }; - }; }; } diff --git a/aspects/gaming/steam.nix b/aspects/gaming/steam.nix index e0ab9a8..530c99b 100644 --- a/aspects/gaming/steam.nix +++ b/aspects/gaming/steam.nix @@ -1,17 +1,19 @@ { ... }: { - flake.modules.nixos.gaming-steam = { pkgs, ... }: { - environment.systemPackages = with pkgs; [ - steam-run - ]; + flake.modules.nixos.gaming-steam = + { pkgs, ... }: + { + environment.systemPackages = with pkgs; [ + steam-run + ]; - programs = { - steam = { - enable = true; - extraCompatPackages = [ pkgs.proton-ge-bin ]; + programs = { + steam = { + enable = true; + extraCompatPackages = [ pkgs.proton-ge-bin ]; + }; + gamemode.enable = true; }; - gamemode.enable = true; }; - }; } diff --git a/aspects/hosts/_alexandria/unbound.nix b/aspects/hosts/_alexandria/unbound.nix index 07c8850..8aedc37 100644 --- a/aspects/hosts/_alexandria/unbound.nix +++ b/aspects/hosts/_alexandria/unbound.nix @@ -34,8 +34,7 @@ in # LAN-only DNS records local-zone = ''"baduhai.dev." transparent''; - local-data = map (e: ''"${e.domain}. IN A ${e.lanIP}"'') - (lib.filter (e: e.lanIP != null) services); + local-data = map (e: ''"${e.domain}. IN A ${e.lanIP}"'') (lib.filter (e: e.lanIP != null) services); }; forward-zone = [ diff --git a/aspects/hosts/_trantor/nginx.nix b/aspects/hosts/_trantor/nginx.nix index 5522e24..899666e 100644 --- a/aspects/hosts/_trantor/nginx.nix +++ b/aspects/hosts/_trantor/nginx.nix @@ -9,9 +9,7 @@ let services = inputs.self.services; # Get all unique domains from shared services on trantor (host = "trantor") - localDomains = lib.unique ( - map (s: s.domain) (lib.filter (s: s.host == "trantor") services) - ); + localDomains = lib.unique (map (s: s.domain) (lib.filter (s: s.host == "trantor") services)); # Generate ACME cert configs for all local domains acmeCerts = lib.genAttrs localDomains (domain: { diff --git a/aspects/hosts/alexandria.nix b/aspects/hosts/alexandria.nix index 28c333e..aacf3b0 100644 --- a/aspects/hosts/alexandria.nix +++ b/aspects/hosts/alexandria.nix @@ -1,4 +1,5 @@ { inputs, self, ... }: + { flake.nixosConfigurations.alexandria = inputs.nixpkgs-stable.lib.nixosSystem { system = "x86_64-linux"; diff --git a/aspects/libvirtd.nix b/aspects/libvirtd.nix index 6487999..1135306 100644 --- a/aspects/libvirtd.nix +++ b/aspects/libvirtd.nix @@ -1,18 +1,25 @@ { ... }: { - flake.modules.nixos.libvirtd = { config, lib, pkgs, ... }: { - virtualisation = { - libvirtd.enable = true; - spiceUSBRedirection.enable = true; + flake.modules.nixos.libvirtd = + { + config, + lib, + pkgs, + ... + }: + { + virtualisation = { + libvirtd.enable = true; + spiceUSBRedirection.enable = true; + }; + + programs.virt-manager.enable = true; + + networking.firewall.trustedInterfaces = [ "virbr0" ]; + + users.users.user.extraGroups = [ + "libvirt" + "libvirtd" + ]; }; - - programs.virt-manager.enable = true; - - networking.firewall.trustedInterfaces = [ "virbr0" ]; - - users.users.user.extraGroups = [ - "libvirt" - "libvirtd" - ]; - }; } diff --git a/aspects/networkmanager.nix b/aspects/networkmanager.nix index 74c9260..8bcb1f2 100644 --- a/aspects/networkmanager.nix +++ b/aspects/networkmanager.nix @@ -1,11 +1,18 @@ { ... }: { - flake.modules.nixos.networkmanager = { config, lib, pkgs, ... }: { - networking.networkmanager = { - enable = true; - wifi.backend = "iwd"; - }; + flake.modules.nixos.networkmanager = + { + config, + lib, + pkgs, + ... + }: + { + networking.networkmanager = { + enable = true; + wifi.backend = "iwd"; + }; - users.users.user.extraGroups = [ "networkmanager" ]; - }; + users.users.user.extraGroups = [ "networkmanager" ]; + }; } diff --git a/aspects/server/boot.nix b/aspects/server/boot.nix index ff5ef25..38634d1 100644 --- a/aspects/server/boot.nix +++ b/aspects/server/boot.nix @@ -1,7 +1,14 @@ # aspects/server/boot.nix { ... }: { - flake.modules.nixos.server-boot = { config, lib, pkgs, ... }: { - boot.kernelPackages = pkgs.linuxPackages_hardened; - }; + flake.modules.nixos.server-boot = + { + config, + lib, + pkgs, + ... + }: + { + boot.kernelPackages = pkgs.linuxPackages_hardened; + }; } diff --git a/aspects/server/nix.nix b/aspects/server/nix.nix index 84bec67..1cb8e8b 100644 --- a/aspects/server/nix.nix +++ b/aspects/server/nix.nix @@ -1,15 +1,22 @@ # aspects/server/nix.nix { inputs, ... }: { - flake.modules.nixos.server-nix = { config, lib, pkgs, ... }: { - environment.etc."channels/nixpkgs".source = inputs.nixpkgs-stable.outPath; + flake.modules.nixos.server-nix = + { + config, + lib, + pkgs, + ... + }: + { + environment.etc."channels/nixpkgs".source = inputs.nixpkgs-stable.outPath; - nix = { - registry.nixpkgs.flake = inputs.nixpkgs-stable; - nixPath = [ - "nixpkgs=/etc/channels/nixpkgs" - "/nix/var/nix/profiles/per-user/root/channels" - ]; + nix = { + registry.nixpkgs.flake = inputs.nixpkgs-stable; + nixPath = [ + "nixpkgs=/etc/channels/nixpkgs" + "/nix/var/nix/profiles/per-user/root/channels" + ]; + }; }; - }; } diff --git a/aspects/server/tailscale.nix b/aspects/server/tailscale.nix index 5a48799..cf2fa4b 100644 --- a/aspects/server/tailscale.nix +++ b/aspects/server/tailscale.nix @@ -1,15 +1,22 @@ # aspects/server/tailscale.nix { ... }: { - flake.modules.nixos.server-tailscale = { config, lib, pkgs, ... }: { - services.tailscale = { - extraSetFlags = [ "--advertise-exit-node" ]; - useRoutingFeatures = "server"; - }; + flake.modules.nixos.server-tailscale = + { + config, + lib, + pkgs, + ... + }: + { + services.tailscale = { + extraSetFlags = [ "--advertise-exit-node" ]; + useRoutingFeatures = "server"; + }; - boot.kernel.sysctl = { - "net.ipv4.ip_forward" = 1; - "net.ipv6.conf.all.forwarding" = 1; + boot.kernel.sysctl = { + "net.ipv4.ip_forward" = 1; + "net.ipv6.conf.all.forwarding" = 1; + }; }; - }; } diff --git a/aspects/shell/bash.nix b/aspects/shell/bash.nix index 3ec7237..e451148 100644 --- a/aspects/shell/bash.nix +++ b/aspects/shell/bash.nix @@ -1,9 +1,16 @@ { ... }: { - flake.modules.homeManager.shell-bash = { config, lib, pkgs, ... }: { - programs.bash = { - enable = true; - historyFile = "~/.cache/bash_history"; + flake.modules.homeManager.shell-bash = + { + config, + lib, + pkgs, + ... + }: + { + programs.bash = { + enable = true; + historyFile = "~/.cache/bash_history"; + }; }; - }; } diff --git a/aspects/shell/fish.nix b/aspects/shell/fish.nix index e2ae9cf..22c0f5c 100644 --- a/aspects/shell/fish.nix +++ b/aspects/shell/fish.nix @@ -1,33 +1,40 @@ { ... }: { - flake.modules.homeManager.shell-fish = { config, lib, pkgs, ... }: { - programs.fish = { - enable = true; - interactiveShellInit = '' - set fish_greeting - ${lib.getExe pkgs.nix-your-shell} fish | source - ''; - loginShellInit = "${lib.getExe pkgs.nix-your-shell} fish | source"; - plugins = [ - { - name = "bang-bang"; - src = pkgs.fetchFromGitHub { - owner = "oh-my-fish"; - repo = "plugin-bang-bang"; - rev = "f969c618301163273d0a03d002614d9a81952c1e"; - sha256 = "sha256-A8ydBX4LORk+nutjHurqNNWFmW6LIiBPQcxS3x4nbeQ="; - }; - } - { - name = "z"; - src = pkgs.fetchFromGitHub { - owner = "jethrokuan"; - repo = "z"; - rev = "067e867debee59aee231e789fc4631f80fa5788e"; - sha256 = "sha256-emmjTsqt8bdI5qpx1bAzhVACkg0MNB/uffaRjjeuFxU="; - }; - } - ]; + flake.modules.homeManager.shell-fish = + { + config, + lib, + pkgs, + ... + }: + { + programs.fish = { + enable = true; + interactiveShellInit = '' + set fish_greeting + ${lib.getExe pkgs.nix-your-shell} fish | source + ''; + loginShellInit = "${lib.getExe pkgs.nix-your-shell} fish | source"; + plugins = [ + { + name = "bang-bang"; + src = pkgs.fetchFromGitHub { + owner = "oh-my-fish"; + repo = "plugin-bang-bang"; + rev = "f969c618301163273d0a03d002614d9a81952c1e"; + sha256 = "sha256-A8ydBX4LORk+nutjHurqNNWFmW6LIiBPQcxS3x4nbeQ="; + }; + } + { + name = "z"; + src = pkgs.fetchFromGitHub { + owner = "jethrokuan"; + repo = "z"; + rev = "067e867debee59aee231e789fc4631f80fa5788e"; + sha256 = "sha256-emmjTsqt8bdI5qpx1bAzhVACkg0MNB/uffaRjjeuFxU="; + }; + } + ]; + }; }; - }; } diff --git a/packages/claude-desktop.nix b/packages/claude-desktop.nix index e93f3af..c21ec8e 100644 --- a/packages/claude-desktop.nix +++ b/packages/claude-desktop.nix @@ -18,7 +18,8 @@ }; src = - srcs.${pkgs.stdenv.hostPlatform.system} or (throw "Unsupported system: ${pkgs.stdenv.hostPlatform.system}"); + srcs.${pkgs.stdenv.hostPlatform.system} + or (throw "Unsupported system: ${pkgs.stdenv.hostPlatform.system}"); claudeNativeStub = '' // Stub implementation of claude-native using KeyboardKey enum values diff --git a/packages/overlays.nix b/packages/overlays.nix index a36ed60..169a67b 100644 --- a/packages/overlays.nix +++ b/packages/overlays.nix @@ -4,19 +4,20 @@ let packageDir = builtins.readDir ./.; # Filter to .nix files, excluding overlays.nix - isPackageFile = name: - name != "overlays.nix" && builtins.match ".*\\.nix$" name != null; + isPackageFile = name: name != "overlays.nix" && builtins.match ".*\\.nix$" name != null; # Extract package name from filename (e.g., "foo-bar.nix" -> "foo-bar") - toPackageName = filename: - builtins.head (builtins.match "(.+)\\.nix$" filename); + toPackageName = filename: builtins.head (builtins.match "(.+)\\.nix$" filename); packageNames = map toPackageName (builtins.filter isPackageFile (builtins.attrNames packageDir)); in { - flake.overlays.default = final: prev: - builtins.listToAttrs (map (name: { - inherit name; - value = inputs.self.packages.${final.system}.${name}; - }) packageNames); + flake.overlays.default = + final: prev: + builtins.listToAttrs ( + map (name: { + inherit name; + value = inputs.self.packages.${final.system}.${name}; + }) packageNames + ); } diff --git a/terranix/kernelpanic.space.nix b/terranix/kernelpanic.space.nix index 01e5c08..91b615e 100644 --- a/terranix/kernelpanic.space.nix +++ b/terranix/kernelpanic.space.nix @@ -8,9 +8,12 @@ terranix.terranixConfigurations.cloudflare-kernelpanicspace = { terraformWrapper.package = pkgs.opentofu; modules = [ - ({ config, ... }: { - # Terraform config goes here - }) + ( + { config, ... }: + { + # Terraform config goes here + } + ) ]; }; }; diff --git a/terranix/terminus.nix b/terranix/terminus.nix index 7a0fa5b..d7689f9 100644 --- a/terranix/terminus.nix +++ b/terranix/terminus.nix @@ -8,9 +8,12 @@ terranix.terranixConfigurations.oci-terminus = { terraformWrapper.package = pkgs.opentofu; modules = [ - ({ config, ... }: { - # Terraform config goes here - }) + ( + { config, ... }: + { + # Terraform config goes here + } + ) ]; }; };