diff --git a/flake.nix b/flake.nix index fd2ad102..6334ceb9 100644 --- a/flake.nix +++ b/flake.nix @@ -13,34 +13,50 @@ }; }; - outputs = { nixpkgs, home-manager, stylix, ... }: - let - default = { - hostName = "Atlas"; - user = "xenia"; - system = "x86_64-linux"; - group = "users"; - shell = "fish"; - systemModules = [ ./system/hyprland.nix ]; - serviceModules = [ ]; - homeModules = [ ./home/hyprland/default.nix ]; - stateVersion = "23.05"; - }; - systemConfig = { hostName ? default.hostName, user ? default.user - , system ? default.system, group ? default.group, shell ? default.shell - , systemModules ? default.systemModules - , serviceModules ? default.serviceModules - , homeModules ? default.homeModules, stateVersion ? default.stateVersion - }: - let specialArgs = { inherit hostName user; }; - in nixpkgs.lib.nixosSystem { - inherit system specialArgs; - modules = [ + outputs = { + nixpkgs, + home-manager, + stylix, + ... + }: let + default = { + hostName = "Atlas"; + user = "xenia"; + system = "x86_64-linux"; + group = "users"; + shell = "fish"; + systemModules = [./system/hyprland.nix]; + serviceModules = []; + homeModules = [./home/hyprland/default.nix]; + stateVersion = "23.05"; + }; + systemConfig = { + hostName ? default.hostName, + user ? default.user, + system ? default.system, + group ? default.group, + shell ? default.shell, + systemModules ? default.systemModules, + serviceModules ? default.serviceModules, + homeModules ? default.homeModules, + stateVersion ? default.stateVersion, + }: let + specialArgs = {inherit hostName user;}; + in + nixpkgs.lib.nixosSystem { + inherit system specialArgs; + modules = + [ ./hosts/${hostName}/configuration.nix ./hosts/${hostName}/hardware-configuration.nix home-manager.nixosModules.home-manager stylix.nixosModules.stylix - ({ config, lib, pkgs, ... }: { + ({ + config, + lib, + pkgs, + ... + }: { boot.loader = { systemd-boot.enable = true; efi.canTouchEfiVariables = true; @@ -61,8 +77,8 @@ nix = { enable = true; settings = { - trusted-users = [ "root" user ]; - experimental-features = [ "nix-command" "flakes" ]; + trusted-users = ["root" user]; + experimental-features = ["nix-command" "flakes"]; auto-optimise-store = true; }; channel.enable = true; @@ -108,7 +124,7 @@ "steam-run" "nomachine-client" ]; - system = { inherit stateVersion; }; + system = {inherit stateVersion;}; networking = { inherit hostName; firewall.enable = true; @@ -121,11 +137,9 @@ fish.enable = true; }; image = ./wallpapers/space.png; - base16Scheme = - "${pkgs.base16-schemes}/share/themes/catppuccin-mocha.yaml"; + base16Scheme = "${pkgs.base16-schemes}/share/themes/catppuccin-mocha.yaml"; override = { - scheme = - "Catppuccin Mocha, using fg and bg colours from emacs modus-vivdendi-tinted"; + scheme = "Catppuccin Mocha, using fg and bg colours from emacs modus-vivdendi-tinted"; base00 = "0d0e1c"; base01 = "1d2235"; base04 = "c6daff"; @@ -148,7 +162,7 @@ monospace = { name = "Iosevka Nerd Font"; package = - (pkgs.nerdfonts.override { fonts = [ "Iosevka" ]; }); + pkgs.nerdfonts.override {fonts = ["Iosevka"];}; }; emoji = { name = "Noto Color Emoji"; @@ -159,7 +173,7 @@ }; fonts = { packages = with pkgs; [ - (nerdfonts.override { fonts = [ "NerdFontsSymbolsOnly" ]; }) + (nerdfonts.override {fonts = ["NerdFontsSymbolsOnly"];}) emacs-all-the-icons-fonts weather-icons noto-fonts @@ -176,26 +190,24 @@ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJ/ZSSCN5sqrA+tdoIZr5EUm5DRuBV4dQ7J+QBEtUwUU xenia@Northstar" ]; in { - root.openssh = { inherit authorizedKeys; }; + root.openssh = {inherit authorizedKeys;}; ${user} = { inherit group; isNormalUser = true; description = "Evie Litherland-Smith"; - extraGroups = - [ "networkmanager" "wheel" "video" "input" "uinput" ]; + extraGroups = ["networkmanager" "wheel" "video" "input" "uinput"]; shell = pkgs.${shell}; - initialHashedPassword = - "$y$j9T$tHIPQt09Kf3KH2eIRze3g/$2mwSlcq27DTGvHNPJ5EP9/1CfL3bXP0F6oS/Vuffmn3"; - openssh = { inherit authorizedKeys; }; + initialHashedPassword = "$y$j9T$tHIPQt09Kf3KH2eIRze3g/$2mwSlcq27DTGvHNPJ5EP9/1CfL3bXP0F6oS/Vuffmn3"; + openssh = {inherit authorizedKeys;}; }; }; home-manager = { - extraSpecialArgs = { inherit hostName; }; + extraSpecialArgs = {inherit hostName;}; useGlobalPkgs = true; useUserPackages = true; users = { root = { - imports = [ ./home/default.nix ]; + imports = [./home/default.nix]; home = { inherit stateVersion; username = "root"; @@ -208,9 +220,9 @@ homeDirectory = "/home/${user}"; in { imports = - [ ./hosts/${hostName}/home.nix ./home/default.nix ] + [./hosts/${hostName}/home.nix ./home/default.nix] ++ homeModules; - home = { inherit username homeDirectory stateVersion; }; + home = {inherit username homeDirectory stateVersion;}; programs.home-manager.enable = true; xdg.userDirs = { enable = true; @@ -223,20 +235,22 @@ }; }; }) - ] ++ systemModules ++ serviceModules; - }; - in { - nixosConfigurations = { + ] + ++ systemModules + ++ serviceModules; + }; + in { + nixosConfigurations = { + ## Server - ## Server - - Legion = let - hostName = "Legion"; - user = "xenia"; - system = "x86_64-linux"; - in systemConfig { + Legion = let + hostName = "Legion"; + user = "xenia"; + system = "x86_64-linux"; + in + systemConfig { inherit hostName user system; - systemModules = [ ./system/default.nix ]; + systemModules = [./system/default.nix]; serviceModules = [ ./services/adguardhome.nix ./services/caddy.nix @@ -246,43 +260,46 @@ ./services/sshd.nix ./services/syncthing.nix ]; - homeModules = [ ./home/default.nix ]; + homeModules = [./home/default.nix]; }; - ## Personal + ## Personal - Northstar = let - hostName = "Northstar"; - user = "xenia"; - system = "x86_64-linux"; - in systemConfig { + Northstar = let + hostName = "Northstar"; + user = "xenia"; + system = "x86_64-linux"; + in + systemConfig { inherit hostName user system; - systemModules = default.systemModules ++ [ ./system/games.nix ]; + systemModules = default.systemModules ++ [./system/games.nix]; }; - Vanguard = let - hostName = "Vanguard"; - user = "xenia"; - system = "x86_64-linux"; - in systemConfig { + Vanguard = let + hostName = "Vanguard"; + user = "xenia"; + system = "x86_64-linux"; + in + systemConfig { inherit hostName user system; - systemModules = default.systemModules ++ [ ./system/games.nix ]; + systemModules = default.systemModules ++ [./system/games.nix]; }; - ## Work + ## Work - Ronin = let - hostName = "Ronin"; - user = "elitherl"; - system = "x86_64-linux"; - in systemConfig { inherit hostName user system; }; + Ronin = let + hostName = "Ronin"; + user = "elitherl"; + system = "x86_64-linux"; + in + systemConfig {inherit hostName user system;}; - Scorch = let - hostName = "Scorch"; - user = "elitherl"; - system = "x86_64-linux"; - in systemConfig { inherit hostName user system; }; - - }; + Scorch = let + hostName = "Scorch"; + user = "elitherl"; + system = "x86_64-linux"; + in + systemConfig {inherit hostName user system;}; }; + }; } diff --git a/home/accounts/default.nix b/home/accounts/default.nix index d55cf9ca..1a00e88a 100644 --- a/home/accounts/default.nix +++ b/home/accounts/default.nix @@ -1 +1 @@ -{ ... }: { imports = [ ./pass.nix ./email.nix ]; } +{...}: {imports = [./pass.nix ./email.nix];} diff --git a/home/accounts/email.nix b/home/accounts/email.nix index 352c34c0..48fda00b 100644 --- a/home/accounts/email.nix +++ b/home/accounts/email.nix @@ -1,8 +1,15 @@ -{ config, lib, pkgs, hostName, ... }: { - home.packages = with pkgs; [ davmail ]; +{ + config, + lib, + pkgs, + hostName, + ... +}: { + home.packages = with pkgs; [davmail]; accounts.email = { maildirBasePath = "Mail"; - accounts = let realName = "Evie Litherland-Smith"; + accounts = let + realName = "Evie Litherland-Smith"; in { proton = let host = "127.0.0.1"; @@ -21,17 +28,15 @@ port = 1025; }; address = "e.litherlandsmith@proton.me"; - aliases = [ "evie@xenia.me.uk" "evie@litherlandsmith.slmail.me" ]; + aliases = ["evie@xenia.me.uk" "evie@litherlandsmith.slmail.me"]; userName = address; - passwordCommand = - "${pkgs.pass}/bin/pass show mbsync/${hostName}/proton | head -n1"; + passwordCommand = "${pkgs.pass}/bin/pass show mbsync/${hostName}/proton | head -n1"; mbsync = { enable = lib.mkDefault accountEnabled; create = "both"; expunge = "both"; remove = "both"; - patterns = - [ "*" "!All Mail" "!Labels*" "!Starred" "!Recovered Messages" ]; + patterns = ["*" "!All Mail" "!Labels*" "!Starred" "!Recovered Messages"]; subFolders = "Verbatim"; extraConfig.account.AuthMechs = "LOGIN"; }; @@ -44,7 +49,8 @@ }; mu.enable = lib.mkDefault accountEnabled; }; - icloud = let accountEnabled = true; + icloud = let + accountEnabled = true; in rec { inherit realName; primary = lib.mkDefault false; @@ -53,14 +59,13 @@ smtp.host = "smtp.mail.me.com"; address = "e.litherlandsmith@icloud.com"; userName = address; - passwordCommand = - "${pkgs.pass}/bin/pass show mbsync/${hostName}/icloud | head -n1"; + passwordCommand = "${pkgs.pass}/bin/pass show mbsync/${hostName}/icloud | head -n1"; mbsync = { enable = lib.mkDefault accountEnabled; create = "both"; expunge = "both"; remove = "both"; - patterns = [ "*" "!Notes" ]; + patterns = ["*" "!Notes"]; subFolders = "Verbatim"; }; msmtp.enable = lib.mkDefault accountEnabled; @@ -83,10 +88,9 @@ port = 1026; }; address = "evie.litherland-smith@ukaea.uk"; - aliases = [ "elitherl@jet.uk" ]; + aliases = ["elitherl@jet.uk"]; userName = address; - passwordCommand = - "${pkgs.pass}/bin/pass show mbsync/${hostName}/outlook | head -n1"; + passwordCommand = "${pkgs.pass}/bin/pass show mbsync/${hostName}/outlook | head -n1"; mbsync = { enable = lib.mkDefault accountEnabled; create = "both"; @@ -120,25 +124,25 @@ mbsync = { enable = true; groups.inboxes = { - proton = [ "INBOX" ]; - icloud = [ "INBOX" ]; - outlook = [ "INBOX" ]; + proton = ["INBOX"]; + icloud = ["INBOX"]; + outlook = ["INBOX"]; }; }; }; - systemd.user.services = let emailAccounts = config.accounts.email.accounts; + systemd.user.services = let + emailAccounts = config.accounts.email.accounts; in { protonmail-bridge = lib.mkIf emailAccounts.proton.mbsync.enable { Unit = { Description = "Podman container-protonmail-bridge.service"; - Documentation = [ "man:podman-generate-systemd(1)" ]; - Wants = [ "network-online.target" ]; - After = [ "network-online.target" ]; + Documentation = ["man:podman-generate-systemd(1)"]; + Wants = ["network-online.target"]; + After = ["network-online.target"]; RequiresMountsFor = "%t/containers"; }; Service = { - Environment = - [ "PODMAN_SYSTEMD_UNIT=%n" "PATH=/run/wrappers/bin/:$PATH" ]; + Environment = ["PODMAN_SYSTEMD_UNIT=%n" "PATH=/run/wrappers/bin/:$PATH"]; Restart = "always"; TimeoutStopSec = 70; ExecStart = '' @@ -165,26 +169,23 @@ Type = "notify"; NotifyAccess = "all"; }; - Install.WantedBy = [ "default.target" ]; + Install.WantedBy = ["default.target"]; }; davmail = lib.mkIf emailAccounts.outlook.mbsync.enable { Unit = { Description = "Davmail server"; - Wants = [ "network-online.target" ]; - After = [ "network-online.target" ]; + Wants = ["network-online.target"]; + After = ["network-online.target"]; }; Service = { - Environment = [ "PATH=/run/current-system/sw/bin/:$PATH" ]; + Environment = ["PATH=/run/current-system/sw/bin/:$PATH"]; Restart = "always"; ExecStartPre = with config.home; '' - /bin/sh -c "if [ ! -f ${homeDirectory}/.davmail.properties ]; then cp ${ - ./.davmail.properties - } ${homeDirectory}/.davmail.properties; fi; chmod 644 ${homeDirectory}/.davmail.properties" + /bin/sh -c "if [ ! -f ${homeDirectory}/.davmail.properties ]; then cp ${./.davmail.properties} ${homeDirectory}/.davmail.properties; fi; chmod 644 ${homeDirectory}/.davmail.properties" ''; - ExecStart = - "${pkgs.davmail}/bin/davmail -notray ${config.home.homeDirectory}/.davmail.properties"; + ExecStart = "${pkgs.davmail}/bin/davmail -notray ${config.home.homeDirectory}/.davmail.properties"; }; - Install.WantedBy = [ "default.target" ]; + Install.WantedBy = ["default.target"]; }; }; } diff --git a/home/accounts/pass.nix b/home/accounts/pass.nix index 7a50c00d..56f09e5d 100644 --- a/home/accounts/pass.nix +++ b/home/accounts/pass.nix @@ -1,12 +1,18 @@ -{ config, lib, pkgs, ... }: { +{ + config, + lib, + pkgs, + ... +}: { xdg.configFile."pass-git-helper/git-pass-mapping.ini".source = ./git-pass-mapping.ini; programs = { gpg.enable = true; password-store = { enable = true; - package = pkgs.pass-nodmenu.withExtensions - (exts: with exts; [ pass-otp pass-update pass-audit pass-import ]); + package = + pkgs.pass-nodmenu.withExtensions + (exts: with exts; [pass-otp pass-update pass-audit pass-import]); settings = { PASSWORD_STORE_DIR = "${config.home.homeDirectory}/.password-store"; PASSWORD_STORE_ENABLE_EXTENSIONS = "true"; diff --git a/home/config/default.nix b/home/config/default.nix index ce52fd9a..9e96e386 100644 --- a/home/config/default.nix +++ b/home/config/default.nix @@ -1,4 +1,4 @@ -{ ... }: { +{...}: { # TODO: ipython config file xdg.configFile = { "bat/themes/Catppuccin-mocha.tmTheme".source = ./Catppuccin-mocha.tmTheme; diff --git a/home/default.nix b/home/default.nix index ddb8460c..cd486052 100644 --- a/home/default.nix +++ b/home/default.nix @@ -1,5 +1,5 @@ -{ lib, ... }: { - imports = [ ./config/default.nix ./scripts/default.nix ]; +{lib, ...}: { + imports = [./config/default.nix ./scripts/default.nix]; stylix.targets = { avizo.enable = true; firefox.enable = true; @@ -22,8 +22,7 @@ table_header_color = "#f5e0dc"; all_cpu_color = "#f5e0dc"; avg_cpu_color = "#eba0ac"; - cpu_core_colors = - [ "#f38ba8" "#fab387" "#f9e2af" "#a6e3a1" "#74c7ec" "#cba6f7" ]; + cpu_core_colors = ["#f38ba8" "#fab387" "#f9e2af" "#a6e3a1" "#74c7ec" "#cba6f7"]; ram_color = "#a6e3a1"; swap_color = "#fab387"; rx_color = "#a6e3a1"; @@ -39,8 +38,7 @@ high_battery_color = "#a6e3a1"; medium_battery_color = "#f9e2af"; low_battery_color = "#f38ba8"; - gpu_core_colors = - [ "#74c7ec" "#cba6f7" "#f38ba8" "#fab387" "#f9e2af" "#a6e3a1" ]; + gpu_core_colors = ["#74c7ec" "#cba6f7" "#f38ba8" "#fab387" "#f9e2af" "#a6e3a1"]; arc_color = "#89dceb"; }; }; @@ -49,7 +47,7 @@ git = true; icons = true; enableAliases = true; - extraOptions = [ "--octal-permissions" ]; + extraOptions = ["--octal-permissions"]; }; readline = { enable = true; @@ -126,9 +124,9 @@ enableFishIntegration = true; enableTransience = true; settings = { - c = { symbol = " "; }; + c = {symbol = " ";}; command_timeout = 1000; - container = { symbol = " "; }; + container = {symbol = " ";}; add_newline = false; character = { success_symbol = "[!](bold green)"; @@ -144,7 +142,7 @@ git_branch = { symbol = " "; only_attached = true; - ignore_branches = [ "master" "main" ]; + ignore_branches = ["master" "main"]; }; git_commit = { format = "[󰜘 $hash | $tag]($style) "; @@ -166,16 +164,16 @@ untracked = " "; typechanged = " "; }; - golang = { symbol = " "; }; - guix_shell = { symbol = " "; }; - haskell = { symbol = " "; }; + golang = {symbol = " ";}; + guix_shell = {symbol = " ";}; + haskell = {symbol = " ";}; hostname = { ssh_only = true; ssh_symbol = "󰢹 "; }; - java = { symbol = " "; }; - localip = { disabled = false; }; - lua = { symbol = " "; }; + java = {symbol = " ";}; + localip = {disabled = false;}; + lua = {symbol = " ";}; memory_usage = { disabled = false; symbol = "󰍛 "; @@ -214,12 +212,12 @@ Windows = " "; }; }; - package = { symbol = "󰏗 "; }; + package = {symbol = "󰏗 ";}; python = { symbol = "󰌠 "; python_binary = "python3"; }; - rust = { symbol = "󱘗 "; }; + rust = {symbol = "󱘗 ";}; shell = { disabled = false; format = "using [$indicator ]($style)"; @@ -228,7 +226,7 @@ powershell_indicator = "󰨊 "; unknown_indicator = "󱔢 "; }; - status = { }; + status = {}; sudo = { disabled = false; symbol = "󰪋 "; diff --git a/home/emacs/default.nix b/home/emacs/default.nix index b02a109f..c97d20cc 100644 --- a/home/emacs/default.nix +++ b/home/emacs/default.nix @@ -1,4 +1,8 @@ -{ config, pkgs, ... }: { +{ + config, + pkgs, + ... +}: { programs.emacs = { # Clone emacs config from https://git.xenia.me.uk/xenia/emacs.git enable = true; @@ -113,7 +117,7 @@ imagemagick languagetool wordnet - (aspellWithDicts (ds: with ds; [ en en-computers en-science ])) + (aspellWithDicts (ds: with ds; [en en-computers en-science])) # For org-plot gnuplot @@ -131,8 +135,17 @@ # Customised LaTeX install # texlive.combined.scheme-full (texlive.combine { - inherit (pkgs.texlive) - scheme-basic dvisvgm dvipng wrapfig amsmath ulem hyperref capt-of; + inherit + (pkgs.texlive) + scheme-basic + dvisvgm + dvipng + wrapfig + amsmath + ulem + hyperref + capt-of + ; }) # Linters diff --git a/home/eww/default.nix b/home/eww/default.nix index 81aa0d0a..56b9153c 100644 --- a/home/eww/default.nix +++ b/home/eww/default.nix @@ -1,6 +1,9 @@ -{ config, lib, pkgs, ... }: - { + config, + lib, + pkgs, + ... +}: { programs.eww = { enable = true; package = pkgs.eww-wayland; diff --git a/home/firefox/default.nix b/home/firefox/default.nix index 31a41510..390b11aa 100644 --- a/home/firefox/default.nix +++ b/home/firefox/default.nix @@ -1,5 +1,5 @@ -{ pkgs, ... }: { - stylix.targets.firefox.profileNames = [ "default" ]; +{pkgs, ...}: { + stylix.targets.firefox.profileNames = ["default"]; programs.firefox = { enable = true; package = null; # Use system Firefox @@ -44,14 +44,12 @@ search = { default = "DuckDuckGo"; force = true; - order = [ "DuckDuckGo" ]; + order = ["DuckDuckGo"]; engines = { "MyNixOS" = { - urls = - [{ template = "https://mynixos.com/search?q={searchTerms}"; }]; - icon = - "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; - definedAliases = [ "@mn" ]; + urls = [{template = "https://mynixos.com/search?q={searchTerms}";}]; + icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; + definedAliases = ["@mn"]; }; }; }; diff --git a/home/hyprland/default.nix b/home/hyprland/default.nix index de06ed3b..0398d277 100644 --- a/home/hyprland/default.nix +++ b/home/hyprland/default.nix @@ -1,4 +1,9 @@ -{ config, lib, pkgs, ... }: { +{ + config, + lib, + pkgs, + ... +}: { imports = [ ../default.nix ../accounts/default.nix @@ -34,7 +39,7 @@ urgent = true; notify = true; }; - mouse = { hide-when-typing = "yes"; }; + mouse = {hide-when-typing = "yes";}; }; }; gtk = { @@ -50,7 +55,7 @@ }; theme = { package = pkgs.catppuccin-gtk.override { - accents = [ "lavender" ]; + accents = ["lavender"]; size = "standard"; variant = "mocha"; }; @@ -58,7 +63,7 @@ }; }; xdg.configFile = { - "hypr/extra.conf" = lib.mkDefault { text = ""; }; + "hypr/extra.conf" = lib.mkDefault {text = "";}; "hypr/hyprpaper.conf".text = '' preload = ${config.stylix.image} wallpaper = ,${config.stylix.image} @@ -69,7 +74,7 @@ xwayland.enable = true; systemd.enable = true; settings = { - monitor = [ ",preferred,auto,auto" ]; + monitor = [",preferred,auto,auto"]; env = with config; [ "XDG_CURRENT_DESKTOP=Hyprland" "XDG_SESSION_TYPE=wayland" @@ -165,8 +170,9 @@ "notifications" "swaync-.*" ]; - in (lib.lists.forEach layers blur) - ++ (lib.lists.forEach layers ignorealpha); + in + (lib.lists.forEach layers blur) + ++ (lib.lists.forEach layers ignorealpha); windowrule = [ # Float + move system windows "float,org.kde.polkit-kde-authentication-agent-1|Pinentry" @@ -213,61 +219,61 @@ "SUPER, ${toString w}, workspace, ${toString w}" "SUPER SHIFT, ${toString w}, movetoworkspace, ${toString w}" ]; - in with lib.lists; - flatten (forEach (range 1 9) workspace) ++ [ - # See https://wiki.hyprland.org/Configuring/Keywords/ for more - "SUPER, F1, exec, ${pkgs.swaylock-effects}/bin/swaylock --screenshots --clock --indicator --grace-no-mouse" - "SUPER, Q, killactive," - "SUPER SHIFT, Q, exec, rofi -replace -show power-menu" - "SUPER, V, togglefloating" - "SUPER, M, fullscreen, 0" - "SUPER SHIFT, M, fullscreen, 1" - "SUPER, tab, exec, rofi -replace -show window" - "SUPER, P, exec, pkill rofi || rofi-pass" - "SUPER SHIFT, P, exec, pkill rofi || rofi-pass --last-used" - "SUPER ALT, P, exec, pkill rofi || rofi-pass --insert" - "SUPER, Z, exec, swaync-client -t -sw" - "SUPER SHIFT, Z, exec, swaync-client -d -sw" + in + with lib.lists; + flatten (forEach (range 1 9) workspace) + ++ [ + # See https://wiki.hyprland.org/Configuring/Keywords/ for more + "SUPER, F1, exec, ${pkgs.swaylock-effects}/bin/swaylock --screenshots --clock --indicator --grace-no-mouse" + "SUPER, Q, killactive," + "SUPER SHIFT, Q, exec, rofi -replace -show power-menu" + "SUPER, V, togglefloating" + "SUPER, M, fullscreen, 0" + "SUPER SHIFT, M, fullscreen, 1" + "SUPER, tab, exec, rofi -replace -show window" + "SUPER, P, exec, pkill rofi || rofi-pass" + "SUPER SHIFT, P, exec, pkill rofi || rofi-pass --last-used" + "SUPER ALT, P, exec, pkill rofi || rofi-pass --insert" + "SUPER, Z, exec, swaync-client -t -sw" + "SUPER SHIFT, Z, exec, swaync-client -d -sw" - # Common program shortcuts - "SUPER, Space, exec, rofi -replace -show combi" - "SUPER, Return, exec, foot" - "SUPER SHIFT, Return, exec, emacsclient -c" - "SUPER, S, exec, foot -e btm --group --battery" - "SUPER, W, exec, nyxt --no-socket --with-file bookmarks=${ - ../nyxt/bookmarks.lisp - }" - "SUPER, F, exec, thunar $HOME" + # Common program shortcuts + "SUPER, Space, exec, rofi -replace -show combi" + "SUPER, Return, exec, foot" + "SUPER SHIFT, Return, exec, emacsclient -c" + "SUPER, S, exec, foot -e btm --group --battery" + "SUPER, W, exec, nyxt --no-socket --with-file bookmarks=${../nyxt/bookmarks.lisp}" + "SUPER, F, exec, thunar $HOME" - # Misc useful binds - '',Print,exec,${pkgs.grim}/bin/grim -g "$(${pkgs.slurp}/bin/slurp)"'' - ",XF86Calculator,exec,rofi -replace -show calc" + # Misc useful binds + '',Print,exec,${pkgs.grim}/bin/grim -g "$(${pkgs.slurp}/bin/slurp)"'' + ",XF86Calculator,exec,rofi -replace -show calc" - # Movement binds - "SUPER, H, movefocus, l" - "SUPER, L, movefocus, r" - "SUPER, K, movefocus, u" - "SUPER, J, movefocus, d" - "SUPER SHIFT, H, movewindow, l" - "SUPER SHIFT, L, movewindow, r" - "SUPER SHIFT, K, movewindow, u" - "SUPER SHIFT, J, movewindow, d" + # Movement binds + "SUPER, H, movefocus, l" + "SUPER, L, movefocus, r" + "SUPER, K, movefocus, u" + "SUPER, J, movefocus, d" + "SUPER SHIFT, H, movewindow, l" + "SUPER SHIFT, L, movewindow, r" + "SUPER SHIFT, K, movewindow, u" + "SUPER SHIFT, J, movewindow, d" - # Special workspaces - "SUPER, comma, workspace, r-1" - "SUPER SHIFT, comma, movetoworkspace, r-1" - "SUPER, period, workspace, r+1" - "SUPER SHIFT, period, movetoworkspace, r+1" - "SUPER, N, workspace, empty" - "SUPER SHIFT, N, movetoworkspace, empty" - "SUPER, minus, togglespecialworkspace" - "SUPER SHIFT, minus, movetoworkspace, special" - "SUPER, bracketright, focusmonitor, +1" - "SUPER SHIFT, bracketright, movecurrentworkspacetomonitor, +1" - "SUPER, bracketleft, focusmonitor, -1" - "SUPER SHIFT, bracketleft, movecurrentworkspacetomonitor, -1" - "SUPER, O, focusurgentorlast" - ]; + # Special workspaces + "SUPER, comma, workspace, r-1" + "SUPER SHIFT, comma, movetoworkspace, r-1" + "SUPER, period, workspace, r+1" + "SUPER SHIFT, period, movetoworkspace, r+1" + "SUPER, N, workspace, empty" + "SUPER SHIFT, N, movetoworkspace, empty" + "SUPER, minus, togglespecialworkspace" + "SUPER SHIFT, minus, movetoworkspace, special" + "SUPER, bracketright, focusmonitor, +1" + "SUPER SHIFT, bracketright, movecurrentworkspacetomonitor, +1" + "SUPER, bracketleft, focusmonitor, -1" + "SUPER SHIFT, bracketleft, movecurrentworkspacetomonitor, -1" + "SUPER, O, focusurgentorlast" + ]; bindl = [ # Sound ",XF86AudioMute,exec,${pkgs.avizo}/bin/volumectl %" diff --git a/home/nyxt/default.nix b/home/nyxt/default.nix index 9abeec82..fa62422c 100644 --- a/home/nyxt/default.nix +++ b/home/nyxt/default.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: { - home.packages = [ pkgs.nyxt ]; +{pkgs, ...}: { + home.packages = [pkgs.nyxt]; xdg.configFile."nyxt/config.lisp".source = ./config.lisp; } diff --git a/home/obs/default.nix b/home/obs/default.nix index 7ca2cc59..5b9d6a99 100644 --- a/home/obs/default.nix +++ b/home/obs/default.nix @@ -1,6 +1,6 @@ -{ pkgs, ... }: { +{pkgs, ...}: { xdg.configFile."obs-studio/themes".source = ./themes; - home.packages = with pkgs; [ helvum ]; + home.packages = with pkgs; [helvum]; programs.obs-studio = { enable = true; plugins = with pkgs.obs-studio-plugins; [ diff --git a/home/pkgs/candy-icon-theme/default.nix b/home/pkgs/candy-icon-theme/default.nix index 8b0c1f38..0b22fed3 100644 --- a/home/pkgs/candy-icon-theme/default.nix +++ b/home/pkgs/candy-icon-theme/default.nix @@ -1,4 +1,11 @@ -{ stdenvNoCC, fetchFromGitHub, gtk3, libsForQt5, gnome, hicolor-icon-theme }: +{ + stdenvNoCC, + fetchFromGitHub, + gtk3, + libsForQt5, + gnome, + hicolor-icon-theme, +}: stdenvNoCC.mkDerivation rec { pname = "candy-icon-theme"; version = "6a35be5cb133c6be8314807f55da3d795e24fb86"; @@ -11,10 +18,9 @@ stdenvNoCC.mkDerivation rec { sha256 = "sha256-M58ts/xyVf+ZDidd4MEp/LlU3vk2imEwOnb0/sVJUYo="; }; - nativeBuildInputs = [ gtk3 ]; + nativeBuildInputs = [gtk3]; - buildInputs = - [ libsForQt5.breeze-icons gnome.adwaita-icon-theme hicolor-icon-theme ]; + buildInputs = [libsForQt5.breeze-icons gnome.adwaita-icon-theme hicolor-icon-theme]; dontDropIconThemeCache = true; diff --git a/home/pkgs/sweet-folder-theme/default.nix b/home/pkgs/sweet-folder-theme/default.nix index 9a94f0d3..c00b1699 100644 --- a/home/pkgs/sweet-folder-theme/default.nix +++ b/home/pkgs/sweet-folder-theme/default.nix @@ -1,5 +1,13 @@ -{ stdenvNoCC, fetchFromGitHub, gtk3, candy-icon-theme, gnome-icon-theme -, ubuntu-themes, cinnamon, elementary-xfce-icon-theme }: +{ + stdenvNoCC, + fetchFromGitHub, + gtk3, + candy-icon-theme, + gnome-icon-theme, + ubuntu-themes, + cinnamon, + elementary-xfce-icon-theme, +}: stdenvNoCC.mkDerivation rec { pname = "sweet-folder-theme"; version = "b2192ff1412472f036fdf9778c6b9dbcb6c044ec"; @@ -12,7 +20,7 @@ stdenvNoCC.mkDerivation rec { sha256 = "sha256-QexfqXH5a1IEhKBRjWSMdrEvThvLRzd4M32Xti1DCGE="; }; - nativeBuildInputs = [ gtk3 ]; + nativeBuildInputs = [gtk3]; buildInputs = [ candy-icon-theme diff --git a/home/rofi/default.nix b/home/rofi/default.nix index 9507b452..1627f9af 100644 --- a/home/rofi/default.nix +++ b/home/rofi/default.nix @@ -1,4 +1,8 @@ -{ config, pkgs, ... }: { +{ + config, + pkgs, + ... +}: { programs.rofi = { enable = true; package = pkgs.rofi-wayland; @@ -11,27 +15,27 @@ USERNAME_field='login' ''; }; - extraConfig = - let power-menu = "power-menu:${pkgs.rofi-power-menu}/bin/rofi-power-menu"; - in { - modi = "window,run,drun,ssh,${power-menu},combi"; - combi-modi = "window,drun,ssh"; - sidebar-mode = true; - sort = true; - sorting-method = "fzf"; - matching = "fuzzy"; - icon-theme = config.gtk.iconTheme.name; - show-icons = true; - application-fallback-icon = "󰋙 "; - drun-display-format = "{icon} {name} ({categories})"; - disable-history = false; - hide-scrollbar = true; - display-window = " 󰧨 Move "; - display-run = " 󰅴 Run "; - display-drun = " 󱓞 Apps "; - display-ssh = " 󰢹 SSH "; - display-combi = " 󰛡 Combi "; - display-power-menu = " 󰐥 Power "; - }; + extraConfig = let + power-menu = "power-menu:${pkgs.rofi-power-menu}/bin/rofi-power-menu"; + in { + modi = "window,run,drun,ssh,${power-menu},combi"; + combi-modi = "window,drun,ssh"; + sidebar-mode = true; + sort = true; + sorting-method = "fzf"; + matching = "fuzzy"; + icon-theme = config.gtk.iconTheme.name; + show-icons = true; + application-fallback-icon = "󰋙 "; + drun-display-format = "{icon} {name} ({categories})"; + disable-history = false; + hide-scrollbar = true; + display-window = " 󰧨 Move "; + display-run = " 󰅴 Run "; + display-drun = " 󱓞 Apps "; + display-ssh = " 󰢹 SSH "; + display-combi = " 󰛡 Combi "; + display-power-menu = " 󰐥 Power "; + }; }; } diff --git a/home/scripts/default.nix b/home/scripts/default.nix index 9af9b6fa..9918692a 100644 --- a/home/scripts/default.nix +++ b/home/scripts/default.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: { +{pkgs, ...}: { home.packages = [ (pkgs.writeShellScriptBin "nixos-update" (builtins.readFile ./nixos-update.sh)) diff --git a/home/swaylock/default.nix b/home/swaylock/default.nix index eca50221..0c4e761c 100644 --- a/home/swaylock/default.nix +++ b/home/swaylock/default.nix @@ -1,4 +1,8 @@ -{ config, pkgs, ... }: { +{ + config, + pkgs, + ... +}: { programs.swaylock = { enable = true; package = pkgs.swaylock-effects; @@ -9,9 +13,7 @@ indicator-caps-lock = true; ignore-empty-password = true; show-failed-attempts = true; - effect-blur = - with config.wayland.windowManager.hyprland.settings.decoration.blur; - "${toString size}x${toString passes}"; + effect-blur = with config.wayland.windowManager.hyprland.settings.decoration.blur; "${toString size}x${toString passes}"; effect-vignette = "0.5:0.5"; fade-in = 0.2; }; diff --git a/home/swaync/default.nix b/home/swaync/default.nix index 246c14e8..1bb1d388 100644 --- a/home/swaync/default.nix +++ b/home/swaync/default.nix @@ -1 +1 @@ -{ ... }: { xdg.configFile."swaync/style.css".source = ./style.css; } +{...}: {xdg.configFile."swaync/style.css".source = ./style.css;} diff --git a/home/waybar/default.nix b/home/waybar/default.nix index b6da5ed9..85314598 100644 --- a/home/waybar/default.nix +++ b/home/waybar/default.nix @@ -1,7 +1,11 @@ -{ config, pkgs, ... }: { +{ + config, + pkgs, + ... +}: { systemd.user.targets.tray.Unit = { Description = "Home Manager System Tray"; - Requires = [ "graphical-session-pre.target" ]; + Requires = ["graphical-session-pre.target"]; }; programs.waybar = { enable = true; @@ -14,8 +18,8 @@ layer = "top"; position = "top"; # Layout - "modules-left" = [ "hyprland/window" "mpris" ]; - "modules-center" = [ "hyprland/workspaces" ]; + "modules-left" = ["hyprland/window" "mpris"]; + "modules-center" = ["hyprland/workspaces"]; "modules-right" = [ "custom/notification" "pulseaudio" @@ -26,7 +30,7 @@ "tray" ]; # Module config - "custom/separator" = { format = "|"; }; + "custom/separator" = {format = "|";}; "hyprland/window" = { "format" = "{title}"; # TODO workspace rewrites @@ -54,19 +58,19 @@ show-special = false; sort-by = "id"; persistent-workspaces = { - "1" = [ ]; - "2" = [ ]; - "3" = [ ]; - "4" = [ ]; - "5" = [ ]; - "6" = [ ]; + "1" = []; + "2" = []; + "3" = []; + "4" = []; + "5" = []; + "6" = []; }; }; mpris = { "format" = "> {player_icon} {player}"; "tooltip-format" = "{player_icon} ({player}) {dynamic}"; "interval" = 1; - "dynamic-order" = [ "album" "artist" "title" "position" "length" ]; + "dynamic-order" = ["album" "artist" "title" "position" "length"]; "player-icons" = { "default" = "󰲸 "; "emms" = " "; @@ -78,7 +82,7 @@ "paused" = "󰏤"; "stopped" = "󰓛"; }; - "ignored-players" = [ ]; + "ignored-players" = []; }; pulseaudio = { scroll-step = 5; @@ -88,7 +92,7 @@ format-source-muted = "󰍭"; format-icons = { car = "󰄍"; - default = [ "󰕿" "󰖀" "󰕾" ]; + default = ["󰕿" "󰖀" "󰕾"]; hands-free = "󰥰"; headset = "󰋎"; phone = "󰏲"; @@ -109,11 +113,11 @@ format = "󰻠 {usage}%"; tooltip = false; }; - memory = { format = "󰍛 {}%"; }; + memory = {format = "󰍛 {}%";}; temperature = { critical-threshold = 80; format = "{icon} {temperatureC}°C"; - format-icons = [ "󱃃" "󰔏" "󱃂" ]; + format-icons = ["󱃃" "󰔏" "󱃂"]; }; clock = { format = "{:󰃭 %Y-%m-%d 󰥔 %R}"; @@ -142,7 +146,7 @@ backlight = { format = "{icon} "; tooltip-format = "{percent}%"; - format-icons = [ "" "" "" "" "" "" "" "" "" ]; + format-icons = ["" "" "" "" "" "" "" "" ""]; }; battery = { states = { @@ -153,9 +157,10 @@ format-charging = "󰂄 "; format-plugged = "󰚥 "; tooltip-format = "{capacity}% {time}"; - format-icons = [ "󱃍" "󰁺" "󰁻" "󰁼" "󰁽" "󰁾" "󰁿" "󰂀" "󰂁" "󰂂" "󰁹" ]; + format-icons = ["󱃍" "󰁺" "󰁻" "󰁼" "󰁽" "󰁾" "󰁿" "󰂀" "󰂁" "󰂂" "󰁹"]; }; - "custom/notification" = let swaync = pkgs.swaynotificationcenter; + "custom/notification" = let + swaync = pkgs.swaynotificationcenter; in { "tooltip" = false; "format" = "{icon}{}"; diff --git a/hosts/Legion/configuration.nix b/hosts/Legion/configuration.nix index 71fa8add..3da927b0 100644 --- a/hosts/Legion/configuration.nix +++ b/hosts/Legion/configuration.nix @@ -1,4 +1,4 @@ -{ ... }: { +{...}: { users.mutableUsers = false; system.autoUpgrade = { enable = true; diff --git a/hosts/Legion/home.nix b/hosts/Legion/home.nix index ffcd4415..0967ef42 100644 --- a/hosts/Legion/home.nix +++ b/hosts/Legion/home.nix @@ -1 +1 @@ -{ } +{} diff --git a/hosts/Northstar/configuration.nix b/hosts/Northstar/configuration.nix index 74a3b060..667cb648 100644 --- a/hosts/Northstar/configuration.nix +++ b/hosts/Northstar/configuration.nix @@ -1 +1,5 @@ -{ config, pkgs, ... }: { } +{ + config, + pkgs, + ... +}: {} diff --git a/hosts/Northstar/home.nix b/hosts/Northstar/home.nix index bfad44be..b1398219 100644 --- a/hosts/Northstar/home.nix +++ b/hosts/Northstar/home.nix @@ -1,4 +1,4 @@ -{ ... }: { +{...}: { wayland.windowManager.hyprland.settings.monitor = [ "eDP-1,preferred,0x0,1.00" "desc:Acer Technologies ED270R TJMEE0043W01,highrr,-192x-1080,1.00" diff --git a/hosts/Ronin/configuration.nix b/hosts/Ronin/configuration.nix index a265850e..3c10d7ee 100644 --- a/hosts/Ronin/configuration.nix +++ b/hosts/Ronin/configuration.nix @@ -1,17 +1,15 @@ -{ pkgs, ... }: { +{pkgs, ...}: { # Setup keyfile - boot.initrd.secrets = { "/crypto_keyfile.bin" = null; }; + boot.initrd.secrets = {"/crypto_keyfile.bin" = null;}; # Enable swap on luks - boot.initrd.luks.devices."luks-761eeb11-3091-4142-9232-4fb33165eccd".device = - "/dev/disk/by-uuid/761eeb11-3091-4142-9232-4fb33165eccd"; - boot.initrd.luks.devices."luks-761eeb11-3091-4142-9232-4fb33165eccd".keyFile = - "/crypto_keyfile.bin"; + boot.initrd.luks.devices."luks-761eeb11-3091-4142-9232-4fb33165eccd".device = "/dev/disk/by-uuid/761eeb11-3091-4142-9232-4fb33165eccd"; + boot.initrd.luks.devices."luks-761eeb11-3091-4142-9232-4fb33165eccd".keyFile = "/crypto_keyfile.bin"; environment = { etc."ppp/options".text = '' ipcp-accept-remote ''; - systemPackages = with pkgs; [ openfortivpn samba nomachine-client ]; + systemPackages = with pkgs; [openfortivpn samba nomachine-client]; }; } diff --git a/hosts/Ronin/home.nix b/hosts/Ronin/home.nix index 5cdc535f..632cb086 100644 --- a/hosts/Ronin/home.nix +++ b/hosts/Ronin/home.nix @@ -1,4 +1,4 @@ -{ ... }: { +{...}: { programs.git.userEmail = "evie.litherland-smith@ukaea.uk"; accounts.email.accounts = { proton.primary = false; diff --git a/hosts/Scorch/configuration.nix b/hosts/Scorch/configuration.nix index 52b439c3..8a61b39c 100644 --- a/hosts/Scorch/configuration.nix +++ b/hosts/Scorch/configuration.nix @@ -1,19 +1,17 @@ -{ pkgs, ... }: { +{pkgs, ...}: { boot.loader.efi.efiSysMountPoint = "/boot/efi"; # Setup keyfile - boot.initrd.secrets = { "/crypto_keyfile.bin" = null; }; + boot.initrd.secrets = {"/crypto_keyfile.bin" = null;}; # Enable swap on luks - boot.initrd.luks.devices."luks-47d34268-5100-4eba-b34d-220f4239c1cb".device = - "/dev/disk/by-uuid/47d34268-5100-4eba-b34d-220f4239c1cb"; - boot.initrd.luks.devices."luks-47d34268-5100-4eba-b34d-220f4239c1cb".keyFile = - "/crypto_keyfile.bin"; + boot.initrd.luks.devices."luks-47d34268-5100-4eba-b34d-220f4239c1cb".device = "/dev/disk/by-uuid/47d34268-5100-4eba-b34d-220f4239c1cb"; + boot.initrd.luks.devices."luks-47d34268-5100-4eba-b34d-220f4239c1cb".keyFile = "/crypto_keyfile.bin"; environment = { etc."ppp/options".text = '' ipcp-accept-remote ''; - systemPackages = with pkgs; [ openfortivpn samba nomachine-client ]; + systemPackages = with pkgs; [openfortivpn samba nomachine-client]; }; } diff --git a/hosts/Scorch/home.nix b/hosts/Scorch/home.nix index dd050a81..76682aa8 100644 --- a/hosts/Scorch/home.nix +++ b/hosts/Scorch/home.nix @@ -1,4 +1,4 @@ -{ ... }: { +{...}: { programs.git.userEmail = "evie.litherland-smith@ukaea.uk"; accounts.email.accounts = { proton.primary = false; @@ -6,6 +6,6 @@ }; wayland.windowManager.hyprland.settings = { misc.force_default_wallpaper = 0; - monitor = [ "desc:Dell Inc. DELL P3223QE CCG8YN3,highres,0x0,1.5" ]; + monitor = ["desc:Dell Inc. DELL P3223QE CCG8YN3,highres,0x0,1.5"]; }; } diff --git a/hosts/Vanguard/configuration.nix b/hosts/Vanguard/configuration.nix index 04437a75..9dc5ddec 100644 --- a/hosts/Vanguard/configuration.nix +++ b/hosts/Vanguard/configuration.nix @@ -1,9 +1,13 @@ -{ config, pkgs, ... }: { - boot.extraModulePackages = with config.boot.kernelPackages; [ v4l2loopback ]; +{ + config, + pkgs, + ... +}: { + boot.extraModulePackages = with config.boot.kernelPackages; [v4l2loopback]; boot.extraModprobeConfig = '' options v4l2loopback devices=1 video_nr=1 card_label="OBS Cam" exclusive_caps=1 ''; hardware.opengl.driSupport32Bit = true; - hardware.opengl.extraPackages = with pkgs; [ amdvlk rocmPackages.clr.icd ]; - hardware.opengl.extraPackages32 = [ pkgs.driversi686Linux.amdvlk ]; + hardware.opengl.extraPackages = with pkgs; [amdvlk rocmPackages.clr.icd]; + hardware.opengl.extraPackages32 = [pkgs.driversi686Linux.amdvlk]; } diff --git a/hosts/Vanguard/home.nix b/hosts/Vanguard/home.nix index 74866e74..12054139 100644 --- a/hosts/Vanguard/home.nix +++ b/hosts/Vanguard/home.nix @@ -1,4 +1,4 @@ -{ ... }: { +{...}: { wayland.windowManager.hyprland.settings.monitor = [ "desc:Acer Technologies ED270R TJMEE0043W01,highrr,0x0,1.00,vrr,2" "desc:Ancor Communications Inc VS278 FALMQS032358,preferred,-1920x0,1.00,vrr,0" diff --git a/services/adguardhome.nix b/services/adguardhome.nix index a76f3ba9..3e3d881e 100644 --- a/services/adguardhome.nix +++ b/services/adguardhome.nix @@ -1,14 +1,17 @@ -{ config, lib, pkgs, ... }: - { + config, + lib, + pkgs, + ... +}: { services.adguardhome = { enable = true; mutableSettings = false; settings = rec { http.address = "0.0.0.0:3200"; dns = { - bind_hosts = [ "127.0.0.1" "192.168.1.230" ]; - bootstrap_dns = [ "9.9.9.9" "149.112.112.10" ]; + bind_hosts = ["127.0.0.1" "192.168.1.230"]; + bootstrap_dns = ["9.9.9.9" "149.112.112.10"]; ratelimit = 0; safe_search.enabled = true; rewrites = [ @@ -21,20 +24,20 @@ answer = "192.168.1.230"; } ]; - blocked_services.ids = [ ]; + blocked_services.ids = []; }; - filtering = { inherit (dns) safe_search rewrites blocked_services; }; + filtering = {inherit (dns) safe_search rewrites blocked_services;}; querylog.ignored = [ "discovery.syncthing.net" "discovery-v6.syncthing.net" "matrix.tchncs.de" ]; - statistics = { inherit (querylog) ignored; }; + statistics = {inherit (querylog) ignored;}; }; openFirewall = true; }; networking.firewall = { - allowedTCPPorts = [ 53 ]; - allowedUDPPorts = [ 53 ]; + allowedTCPPorts = [53]; + allowedUDPPorts = [53]; }; } diff --git a/services/astroneer.nix b/services/astroneer.nix index 5f06c4e5..692c97b6 100644 --- a/services/astroneer.nix +++ b/services/astroneer.nix @@ -1,6 +1,5 @@ -{ pkgs, ... }: { - environment.systemPackages = with pkgs; [ steamcmd ]; - networking.firewall.allowedTCPPorts = [ 8777 ]; - services.caddy.virtualHosts."astro.xenia.me.uk".extraConfig = - "reverse_proxy http://localhost:8777"; +{pkgs, ...}: { + environment.systemPackages = with pkgs; [steamcmd]; + networking.firewall.allowedTCPPorts = [8777]; + services.caddy.virtualHosts."astro.xenia.me.uk".extraConfig = "reverse_proxy http://localhost:8777"; } diff --git a/services/caddy.nix b/services/caddy.nix index 917814e3..bb82ed4b 100644 --- a/services/caddy.nix +++ b/services/caddy.nix @@ -1,5 +1,5 @@ -{ ... }: { - networking.firewall.allowedTCPPorts = [ 80 443 ]; +{...}: { + networking.firewall.allowedTCPPorts = [80 443]; services.caddy = { enable = true; email = "evie@xenia.me.uk"; @@ -11,7 +11,7 @@ }; services.fail2ban = { enable = true; - ignoreIP = [ "127.0.0.1/8" "::1" "192.168.1.0/16" ]; - bantime-increment = { enable = true; }; + ignoreIP = ["127.0.0.1/8" "::1" "192.168.1.0/16"]; + bantime-increment = {enable = true;}; }; } diff --git a/services/gitea.nix b/services/gitea.nix index f0a0f88c..233215b6 100644 --- a/services/gitea.nix +++ b/services/gitea.nix @@ -1,5 +1,5 @@ -{ ... }: { - imports = [ ./caddy.nix ]; +{...}: { + imports = [./caddy.nix]; services.gitea = { enable = true; settings = { @@ -18,6 +18,5 @@ }; appName = "Gitea"; }; - services.caddy.virtualHosts."git.xenia.me.uk".extraConfig = - "reverse_proxy http://localhost:3100"; + services.caddy.virtualHosts."git.xenia.me.uk".extraConfig = "reverse_proxy http://localhost:3100"; } diff --git a/services/grafana.nix b/services/grafana.nix index 1c7a1c72..27e208a2 100644 --- a/services/grafana.nix +++ b/services/grafana.nix @@ -1,5 +1,5 @@ -{ ... }: { - imports = [ ./caddy.nix ]; +{...}: { + imports = [./caddy.nix]; services.grafana = { enable = true; settings = { @@ -16,16 +16,16 @@ exporters = { node = { enable = true; - enabledCollectors = [ "systemd" ]; + enabledCollectors = ["systemd"]; port = 9002; }; }; - scrapeConfigs = [{ - job_name = "legion"; - static_configs = - [{ targets = [ "127.0.0.1:${toString exporters.node.port}" ]; }]; - }]; + scrapeConfigs = [ + { + job_name = "legion"; + static_configs = [{targets = ["127.0.0.1:${toString exporters.node.port}"];}]; + } + ]; }; - services.caddy.virtualHosts."grafana.xenia.me.uk".extraConfig = - "reverse_proxy http://localhost:3000"; + services.caddy.virtualHosts."grafana.xenia.me.uk".extraConfig = "reverse_proxy http://localhost:3000"; } diff --git a/services/matrix.nix b/services/matrix.nix index c6bfd627..1217daba 100644 --- a/services/matrix.nix +++ b/services/matrix.nix @@ -1,5 +1,5 @@ -{ pkgs, ... }: { - imports = [ ./caddy.nix ]; +{pkgs, ...}: { + imports = [./caddy.nix]; services.postgresql.enable = true; services.postgresql.initialScript = pkgs.writeText "synapse-init.sql" '' CREATE ROLE "matrix-synapse" WITH LOGIN PASSWORD 'synapse'; @@ -13,18 +13,22 @@ matrix-synapse = { enable = true; settings.server_name = "xenia.me.uk"; - settings.listeners = [{ - bind_addresses = [ "127.0.0.1" ]; - port = 8008; - type = "http"; - tls = false; - x_forwarded = true; - resources = [{ - names = [ "client" "federation" ]; - compress = true; - }]; - }]; - extraConfigFiles = [ "/run/secrets/matrix-shared-secret" ]; + settings.listeners = [ + { + bind_addresses = ["127.0.0.1"]; + port = 8008; + type = "http"; + tls = false; + x_forwarded = true; + resources = [ + { + names = ["client" "federation"]; + compress = true; + } + ]; + } + ]; + extraConfigFiles = ["/run/secrets/matrix-shared-secret"]; }; caddy.virtualHosts."xenia.me.uk".extraConfig = '' header /.well-known/matrix/* Content-Type application/json diff --git a/services/navidrome.nix b/services/navidrome.nix index b88f7869..aec75ae7 100644 --- a/services/navidrome.nix +++ b/services/navidrome.nix @@ -1,6 +1,6 @@ -{ pkgs, ... }: { - imports = [ ./caddy.nix ]; - environment.systemPackages = with pkgs; [ ffmpeg ]; +{pkgs, ...}: { + imports = [./caddy.nix]; + environment.systemPackages = with pkgs; [ffmpeg]; services = { navidrome = { enable = true; @@ -10,7 +10,6 @@ MusicFolder = "/media/music"; }; }; - caddy.virtualHosts."music.xenia.me.uk".extraConfig = - "reverse_proxy http://localhost:4533"; + caddy.virtualHosts."music.xenia.me.uk".extraConfig = "reverse_proxy http://localhost:4533"; }; } diff --git a/services/ntfy-sh.nix b/services/ntfy-sh.nix index c0a539fc..054a95c0 100644 --- a/services/ntfy-sh.nix +++ b/services/ntfy-sh.nix @@ -1,7 +1,5 @@ -{ ... }: - -{ - imports = [ ./caddy.nix ]; +{...}: { + imports = [./caddy.nix]; services.ntfy-sh = { enable = true; settings = { @@ -12,6 +10,5 @@ enable-metrics = true; }; }; - services.caddy.virtualHosts."ntfy.xenia.me.uk".extraConfig = - "reverse_proxy http://localhost:8800"; + services.caddy.virtualHosts."ntfy.xenia.me.uk".extraConfig = "reverse_proxy http://localhost:8800"; } diff --git a/services/sshd.nix b/services/sshd.nix index 093a6272..3c886e71 100644 --- a/services/sshd.nix +++ b/services/sshd.nix @@ -1,9 +1,12 @@ -{ config, lib, pkgs, ... }: - { + config, + lib, + pkgs, + ... +}: { services.openssh = { enable = true; - ports = [ 22 ]; + ports = [22]; settings = { UseDns = true; PermitRootLogin = "without-password"; diff --git a/services/syncthing.nix b/services/syncthing.nix index 9b36ce51..de369fda 100644 --- a/services/syncthing.nix +++ b/services/syncthing.nix @@ -1,7 +1,7 @@ -{ ... }: -let devices = [ "Ion" "Legion" "Northstar" "Vanguard" ]; +{...}: let + devices = ["Ion" "Legion" "Northstar" "Vanguard"]; in { - imports = [ ./caddy.nix ]; + imports = [./caddy.nix]; services.syncthing = { enable = true; systemService = true; @@ -10,14 +10,10 @@ in { openDefaultPorts = true; settings = { devices = { - "Ion".id = - "7DD4NPH-6T2ET5A-4FCLFWW-CS6UR2W-IO5XQXC-DM5B2Q4-6X7DGU2-UKKVEAB"; - "Legion".id = - "3SSNCLP-ZZKNS65-7CKKGFY-KJYQU6S-P5BM7SB-MMW5ZLM-TMND6IV-ZMUO4AQ"; - "Northstar".id = - "DJVVFUX-QRJNEUZ-OVEQ63J-KJIGNY7-O4MEOMH-GDKYHOB-BQES3O4-C3BJHQ2"; - "Vanguard".id = - "NCJBYBK-JRVFAAN-XO4I5AS-B5L7QD2-5PAMWX7-PHD5FQH-Q2EI32H-U3GF5AA"; + "Ion".id = "7DD4NPH-6T2ET5A-4FCLFWW-CS6UR2W-IO5XQXC-DM5B2Q4-6X7DGU2-UKKVEAB"; + "Legion".id = "3SSNCLP-ZZKNS65-7CKKGFY-KJYQU6S-P5BM7SB-MMW5ZLM-TMND6IV-ZMUO4AQ"; + "Northstar".id = "DJVVFUX-QRJNEUZ-OVEQ63J-KJIGNY7-O4MEOMH-GDKYHOB-BQES3O4-C3BJHQ2"; + "Vanguard".id = "NCJBYBK-JRVFAAN-XO4I5AS-B5L7QD2-5PAMWX7-PHD5FQH-Q2EI32H-U3GF5AA"; }; folders = { "Music" = { diff --git a/system/chromium.nix b/system/chromium.nix index 70f2ab85..40c31191 100644 --- a/system/chromium.nix +++ b/system/chromium.nix @@ -1,5 +1,5 @@ -{ pkgs, ... }: { - environment.systemPackages = [ pkgs.chromium ]; +{pkgs, ...}: { + environment.systemPackages = [pkgs.chromium]; programs.chromium = rec { enable = true; defaultSearchProviderEnabled = true; @@ -25,7 +25,7 @@ "SyncDisabled" = true; "PasswordManagerEnabled" = false; "SpellcheckEnabled" = true; - "SpellcheckLanguage" = [ "en-GB" ]; + "SpellcheckLanguage" = ["en-GB"]; "AllowDinosaurEasterEgg" = true; "AllowSystemNotifications" = true; "AutoFillEnabled" = false; diff --git a/system/default.nix b/system/default.nix index c60688d1..8d68ef6a 100644 --- a/system/default.nix +++ b/system/default.nix @@ -1,7 +1,7 @@ -{ pkgs, ... }: { +{pkgs, ...}: { networking = { networkmanager.enable = true; - nameservers = [ "9.9.9.9" ]; + nameservers = ["9.9.9.9"]; }; environment = { systemPackages = with pkgs; [ @@ -38,7 +38,8 @@ }; virtualisation.podman.enable = true; time.timeZone = "Europe/London"; - i18n = let locale = "en_GB.UTF-8"; + i18n = let + locale = "en_GB.UTF-8"; in { # Select internationalisation properties. defaultLocale = locale; diff --git a/system/desktop.nix b/system/desktop.nix index ad1233dd..14a6c4e3 100644 --- a/system/desktop.nix +++ b/system/desktop.nix @@ -1,5 +1,9 @@ -{ pkgs, user, ... }: { - imports = [ ./default.nix ]; +{ + pkgs, + user, + ... +}: { + imports = [./default.nix]; environment.systemPackages = with pkgs; [ dex libnotify @@ -15,10 +19,10 @@ hardware.bluetooth.enable = true; services = { accounts-daemon.enable = true; - dbus.packages = with pkgs; [ gcr ]; + dbus.packages = with pkgs; [gcr]; greetd = { enable = true; - settings.initial_session = { inherit user; }; + settings.initial_session = {inherit user;}; }; pipewire = { enable = true; diff --git a/system/firefox.nix b/system/firefox.nix index ae260375..69e2cd2b 100644 --- a/system/firefox.nix +++ b/system/firefox.nix @@ -1,7 +1,7 @@ -{ ... }: { +{...}: { programs.firefox = { enable = true; - languagePacks = [ "en-GB" ]; + languagePacks = ["en-GB"]; policies = { Cookies = { Behavior = "reject-tracker-and-partition-foreign"; @@ -26,19 +26,16 @@ ExtensionSettings = { "queryamoid@kaply.com" = { installation_mode = "force_installed"; - install_url = - "https://github.com/mkaply/queryamoid/releases/download/v0.1/query_amo_addon_id-0.1-fx.xpi"; + install_url = "https://github.com/mkaply/queryamoid/releases/download/v0.1/query_amo_addon_id-0.1-fx.xpi"; }; "uBlock0@raymondhill.net" = { installation_mode = "force_installed"; - install_url = - "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi"; + install_url = "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi"; }; # Catppuccin Mocha (Lavender) theme "{8446b178-c865-4f5c-8ccc-1d7887811ae3}" = { installation_mode = "force_installed"; - install_url = - "https://addons.mozilla.org/firefox/downloads/latest/catppuccin-mocha-lavender-git/latest.xpi"; + install_url = "https://addons.mozilla.org/firefox/downloads/latest/catppuccin-mocha-lavender-git/latest.xpi"; }; }; FirefoxHome = { @@ -52,7 +49,7 @@ Locked = true; }; ManagedBookmarks = [ - { toplevel_name = "Managed Bookmarks"; } + {toplevel_name = "Managed Bookmarks";} { name = "Server"; children = [ @@ -120,9 +117,9 @@ NoDefaultBookmarks = true; OfferToSaveLogins = false; PasswordManagerEnabled = false; - PopupBlocking = { Default = true; }; - RequestedLocales = [ "en-GB" ]; - SearchEngines = { Default = "DuckDuckGo"; }; + PopupBlocking = {Default = true;}; + RequestedLocales = ["en-GB"]; + SearchEngines = {Default = "DuckDuckGo";}; ShowHomeButton = false; StartDownloadsInTempDirectory = true; }; diff --git a/system/games.nix b/system/games.nix index b49381fe..6d99419b 100644 --- a/system/games.nix +++ b/system/games.nix @@ -1,8 +1,8 @@ -{ pkgs, ... }: { +{pkgs, ...}: { environment.systemPackages = with pkgs; [ prismlauncher (retroarch.override { - cores = with libretro; [ dolphin mgba mupen64plus ]; + cores = with libretro; [dolphin mgba mupen64plus]; }) ]; hardware.steam-hardware.enable = true; diff --git a/system/gamescope.nix b/system/gamescope.nix index ce819082..01fa7d1e 100644 --- a/system/gamescope.nix +++ b/system/gamescope.nix @@ -1,5 +1,5 @@ -{ ... }: { - imports = [ ./desktop.nix ./games.nix ]; +{...}: { + imports = [./desktop.nix ./games.nix]; services = { greetd.settings = let command = '' @@ -9,8 +9,8 @@ --hide-cursor-delay 5 --steam -- steam -gamepadui ''; in { - default_session = { inherit command; }; - initial_session = { inherit command; }; + default_session = {inherit command;}; + initial_session = {inherit command;}; }; }; programs.steam.gamescopeSession.enable = true; diff --git a/system/hyprland.nix b/system/hyprland.nix index a948d6be..c65b818d 100644 --- a/system/hyprland.nix +++ b/system/hyprland.nix @@ -1,7 +1,6 @@ -{ pkgs, ... }: { - imports = [ ./desktop.nix ./chromium.nix ]; - nixpkgs.config.chromium.commandLineArgs = - "--enable-features=UseOzonePlatform --ozone-platform=wayland"; +{pkgs, ...}: { + imports = [./desktop.nix ./chromium.nix]; + nixpkgs.config.chromium.commandLineArgs = "--enable-features=UseOzonePlatform --ozone-platform=wayland"; environment = { sessionVariables = { NIXOS_OZONE_WL = "1"; @@ -35,58 +34,44 @@ webcord ]; }; - security.pam.services.swaylock = { }; + security.pam.services.swaylock = {}; services = { blueman.enable = true; udisks2.enable = true; gvfs.enable = true; tumbler.enable = true; xserver.enable = false; - greetd.settings = let command = "Hyprland"; + greetd.settings = let + command = "Hyprland"; in { - default_session = { inherit command; }; - initial_session = { inherit command; }; + default_session = {inherit command;}; + initial_session = {inherit command;}; }; }; xdg.mime = rec { enable = true; defaultApplications = { - "application/pdf" = [ "emacsclient.desktop" "emacs.desktop" ]; - "application/epub+zip" = [ "emacsclient.desktop" "emacs.desktop" ]; - "application/oxps" = [ "emacsclient.desktop" "emacs.desktop" ]; - "image/jpeg" = - [ "swayimg.desktop" "emacsclient.desktop" "emacs.desktop" ]; - "image/png" = [ "swayimg.desktop" "emacsclient.desktop" "emacs.desktop" ]; - "video/mp4" = [ "mpv.desktop" ]; - "text/csv" = [ "emacsclient.desktop" "emacs.desktop" ]; - "text/html" = - [ "firefox.desktop" "chromium-browser.desktop" "nyxt.desktop" ]; - "x-scheme-handler/http" = - [ "firefox.desktop" "chromium-browser.desktop" "nyxt.desktop" ]; - "x-scheme-handler/https" = - [ "firefox.desktop" "chromium-browser.desktop" "nyxt.desktop" ]; - "x-scheme-handler/about" = - [ "firefox.desktop" "chromium-browser.desktop" "nyxt.desktop" ]; - "x-scheme-handler/chrome" = - [ "firefox.desktop" "chromium-browser.desktop" "nyxt.desktop" ]; - "application/x-extension-htm" = - [ "firefox.desktop" "chromium-browser.desktop" "nyxt.desktop" ]; - "application/x-extension-html" = - [ "firefox.desktop" "chromium-browser.desktop" "nyxt.desktop" ]; - "application/x-extension-shtml" = - [ "firefox.desktop" "chromium-browser.desktop" "nyxt.desktop" ]; - "application/xhtml+xml" = - [ "firefox.desktop" "chromium-browser.desktop" "nyxt.desktop" ]; - "application/x-extension-xhtml" = - [ "firefox.desktop" "chromium-browser.desktop" "nyxt.desktop" ]; - "application/x-extension-xht" = - [ "firefox.desktop" "chromium-browser.desktop" "nyxt.desktop" ]; - "application/x-mozilla-bookmarks" = - [ "firefox.desktop" "chromium-browser.desktop" ]; - "x-scheme-handler/msteams" = - [ "firefox.desktop" "chromium-browser.desktop" ]; - "x-scheme-handler/zoomus" = - [ "firefox.desktop" "chromium-browser.desktop" ]; + "application/pdf" = ["emacsclient.desktop" "emacs.desktop"]; + "application/epub+zip" = ["emacsclient.desktop" "emacs.desktop"]; + "application/oxps" = ["emacsclient.desktop" "emacs.desktop"]; + "image/jpeg" = ["swayimg.desktop" "emacsclient.desktop" "emacs.desktop"]; + "image/png" = ["swayimg.desktop" "emacsclient.desktop" "emacs.desktop"]; + "video/mp4" = ["mpv.desktop"]; + "text/csv" = ["emacsclient.desktop" "emacs.desktop"]; + "text/html" = ["firefox.desktop" "chromium-browser.desktop" "nyxt.desktop"]; + "x-scheme-handler/http" = ["firefox.desktop" "chromium-browser.desktop" "nyxt.desktop"]; + "x-scheme-handler/https" = ["firefox.desktop" "chromium-browser.desktop" "nyxt.desktop"]; + "x-scheme-handler/about" = ["firefox.desktop" "chromium-browser.desktop" "nyxt.desktop"]; + "x-scheme-handler/chrome" = ["firefox.desktop" "chromium-browser.desktop" "nyxt.desktop"]; + "application/x-extension-htm" = ["firefox.desktop" "chromium-browser.desktop" "nyxt.desktop"]; + "application/x-extension-html" = ["firefox.desktop" "chromium-browser.desktop" "nyxt.desktop"]; + "application/x-extension-shtml" = ["firefox.desktop" "chromium-browser.desktop" "nyxt.desktop"]; + "application/xhtml+xml" = ["firefox.desktop" "chromium-browser.desktop" "nyxt.desktop"]; + "application/x-extension-xhtml" = ["firefox.desktop" "chromium-browser.desktop" "nyxt.desktop"]; + "application/x-extension-xht" = ["firefox.desktop" "chromium-browser.desktop" "nyxt.desktop"]; + "application/x-mozilla-bookmarks" = ["firefox.desktop" "chromium-browser.desktop"]; + "x-scheme-handler/msteams" = ["firefox.desktop" "chromium-browser.desktop"]; + "x-scheme-handler/zoomus" = ["firefox.desktop" "chromium-browser.desktop"]; }; addedAssociations = defaultApplications; }; @@ -95,7 +80,7 @@ light.enable = true; thunar = { enable = true; - plugins = with pkgs.xfce; [ thunar-archive-plugin thunar-volman ]; + plugins = with pkgs.xfce; [thunar-archive-plugin thunar-volman]; }; hyprland = { enable = true;