From 6a6d53cff5946d3213e0ae49e5a75c989f7a7886 Mon Sep 17 00:00:00 2001 From: Evie Litherland-Smith Date: Tue, 30 Jul 2024 15:06:34 +0100 Subject: [PATCH] Reformat all files using nixfmt --- flake.nix | 336 +++++----- home/Legion.nix | 5 +- home/Northstar.nix | 5 +- home/Scorch.nix | 5 +- home/Tone.nix | 56 +- home/Vanguard.nix | 7 +- home/alacritty/default.nix | 92 +-- home/browser/default.nix | 3 +- home/browser/firefox.nix | 72 +- home/browser/librewolf.nix | 7 +- home/browser/nyxt.nix | 115 ++-- home/default.nix | 5 +- home/desktop/base16/gtk.nix | 8 +- home/desktop/default.nix | 54 +- home/desktop/lib/to_capital.nix | 22 +- home/desktop/mimeapps.nix | 48 +- home/desktop/plasma/default.nix | 141 ++-- home/desktop/plasma/konsole.nix | 3 +- home/desktop/sway/avizo/default.nix | 28 +- home/desktop/sway/default.nix | 146 +++-- home/desktop/sway/foot/default.nix | 13 +- home/desktop/sway/fuzzel/default.nix | 35 +- home/desktop/sway/mako/default.nix | 43 +- home/desktop/sway/rofi/default.nix | 187 +++--- home/desktop/sway/swayidle/default.nix | 35 +- home/desktop/sway/swaylock/default.nix | 72 +- home/desktop/sway/swaylock/swaylockfx.nix | 6 +- home/desktop/sway/swaync/default.nix | 617 +++++++++--------- home/desktop/sway/waybar/default.nix | 340 +++++----- home/desktop/sway/wlogout/default.nix | 89 ++- home/emacs/emacs-packages.nix | 3 +- home/emacs/luarocks/graph-toolkit.nix | 44 +- home/emacs/luarocks/scilua.nix | 50 +- home/emacs/luarocks/xsys.nix | 5 +- home/games/default.nix | 5 +- home/personal.nix | 5 +- home/scripts/default.nix | 12 +- home/scripts/ukaea-vpn.nix | 4 +- home/services/email/default.nix | 248 +++---- home/services/password-store/default.nix | 15 +- home/shell/bottom.nix | 68 +- home/shell/default.nix | 5 +- home/shell/fastfetch.nix | 5 +- home/shell/git.nix | 83 +-- home/shell/ssh.nix | 6 +- home/shell/starship.nix | 36 +- home/shell/zellij.nix | 15 +- home/shell/zsh.nix | 8 +- home/streaming/default.nix | 17 +- home/work.nix | 5 +- system/Legion.nix | 3 +- system/Northstar.nix | 3 +- system/Scorch.nix | 14 +- system/Tone.nix | 9 +- system/Vanguard.nix | 9 +- system/default.nix | 44 +- system/desktop/default.nix | 3 +- system/desktop/plasma.nix | 7 +- system/desktop/sway.nix | 39 +- system/hardware-configuration/Legion.nix | 46 +- system/hardware-configuration/Northstar.nix | 43 +- system/hardware-configuration/Scorch.nix | 26 +- system/hardware-configuration/Tone.nix | 43 +- system/hardware-configuration/Vanguard.nix | 56 +- system/laptop.nix | 5 +- system/services/adguardhome.nix | 27 +- system/services/astroneer.nix | 7 +- system/services/caddy.nix | 20 +- system/services/forgejo.nix | 19 +- system/services/gitea.nix | 5 +- system/services/grafana.nix | 9 +- system/services/home-assistant.nix | 10 +- system/services/matrix-synapse.nix | 20 +- system/services/minecraft.nix | 25 +- system/services/navidrome.nix | 7 +- system/services/nix-serve.nix | 5 +- system/services/ntfy-sh.nix | 5 +- system/services/owncast.nix | 5 +- system/services/radicale.nix | 8 +- system/services/sshd.nix | 5 +- system/services/syncthing.nix | 15 +- .../terraria/windy_limbo_of_melancholy.nix | 5 +- system/services/znc.nix | 11 +- 83 files changed, 2092 insertions(+), 1700 deletions(-) diff --git a/flake.nix b/flake.nix index d3629689..26550af0 100644 --- a/flake.nix +++ b/flake.nix @@ -2,8 +2,8 @@ description = "Evie's machine configurations"; nixConfig = { - extra-substituters = ["https://nix.xenia.me.uk"]; - extra-trusted-public-keys = ["nix.xenia.me.uk:tlgwOaG5KMLjQUk2YaErS8mAG69ZCr3PaHXZYi+Y5eI="]; + extra-substituters = [ "https://nix.xenia.me.uk" ]; + extra-trusted-public-keys = [ "nix.xenia.me.uk:tlgwOaG5KMLjQUk2YaErS8mAG69ZCr3PaHXZYi+Y5eI=" ]; }; inputs = { @@ -27,158 +27,194 @@ }; }; - outputs = { - nixpkgs, - home-manager, - plasma-manager, - iosevka-custom, - base16, - tt-schemes, - ... - } @ inputs: let - defaultSpecialArgs = {system ? "x86_64-linux", ...}: { - inherit inputs; - iosevkaCustom = { - packages = iosevka-custom.outputs.packages.${system}; - names = iosevka-custom.outputs.names; - }; - }; - defaultExtraSpecialArgs = {system}: let - iosevkaCustom = { - packages = iosevka-custom.outputs.packages.${system}; - names = iosevka-custom.outputs.names; - }; - in { - inherit inputs iosevkaCustom; - inherit (plasma-manager.packages.${system}) rc2nix; - accentColourName = "base0E"; - fonts = with iosevkaCustom; rec { - sizes = { - applications = 12; - desktop = 10; - popups = 14; - terminal = 12; - }; - serif = sansSerif; - sansSerif = { - name = names.iosevka-custom-aile; - package = packages.iosevka-custom-aile; - }; - monospace = { - name = names.iosevka-custom-nerdfont; - package = packages.iosevka-custom-nerdfont; - }; - }; - }; - defaultModules = { - system ? "x86_64-linux", - username ? "pixelifytica", - hostName ? "Atlas", - loginShell ? "bash", + outputs = + { + nixpkgs, + home-manager, + plasma-manager, + iosevka-custom, + base16, + tt-schemes, ... - }: [ - home-manager.nixosModules.home-manager - ./system/default.nix - ./system/${hostName}.nix - ./system/hardware-configuration/${hostName}.nix - ({ - config, - lib, - pkgs, - ... - }: { - networking = {inherit hostName;}; - nix.settings.trusted-users = [username]; - services.greetd.settings.initial_session.user = username; - programs.${loginShell} = lib.mkIf (loginShell != "bash") {enable = true;}; - users.users.${username} = { - shell = pkgs.${loginShell}; - group = "users"; - isNormalUser = true; - description = "Evie Litherland-Smith"; - extraGroups = ["networkmanager" "wheel" "video" "input" "uinput" "dialout"]; - initialHashedPassword = "$y$j9T$tHIPQt09Kf3KH2eIRze3g/$2mwSlcq27DTGvHNPJ5EP9/1CfL3bXP0F6oS/Vuffmn3"; - openssh = {inherit (config.users.users.root.openssh) authorizedKeys;}; - }; - home-manager = { - extraSpecialArgs = defaultExtraSpecialArgs {inherit system;}; - useGlobalPkgs = true; - useUserPackages = true; - backupFileExtension = "backup"; - users.${username} = { - imports = [ - base16.homeManagerModule - {scheme = "${tt-schemes}/base16/one-light.yaml";} - ./home/${hostName}.nix - ]; - home = { - inherit username; - homeDirectory = "/home/${username}"; - stateVersion = "23.05"; - }; - programs.home-manager.enable = true; - nixpkgs.config.allowUnfree = true; + }@inputs: + let + defaultSpecialArgs = + { + system ? "x86_64-linux", + ... + }: + { + inherit inputs; + iosevkaCustom = { + packages = iosevka-custom.outputs.packages.${system}; + names = iosevka-custom.outputs.names; }; }; - }) - ]; - in { - devShells.x86_64-linux.default = let - pkgs = import nixpkgs {system = "x86_64-linux";}; + defaultExtraSpecialArgs = + { system }: + let + iosevkaCustom = { + packages = iosevka-custom.outputs.packages.${system}; + names = iosevka-custom.outputs.names; + }; + in + { + inherit inputs iosevkaCustom; + inherit (plasma-manager.packages.${system}) rc2nix; + accentColourName = "base0E"; + fonts = with iosevkaCustom; rec { + sizes = { + applications = 12; + desktop = 10; + popups = 14; + terminal = 12; + }; + serif = sansSerif; + sansSerif = { + name = names.iosevka-custom-aile; + package = packages.iosevka-custom-aile; + }; + monospace = { + name = names.iosevka-custom-nerdfont; + package = packages.iosevka-custom-nerdfont; + }; + }; + }; + defaultModules = + { + system ? "x86_64-linux", + username ? "pixelifytica", + hostName ? "Atlas", + loginShell ? "bash", + ... + }: + [ + home-manager.nixosModules.home-manager + ./system/default.nix + ./system/${hostName}.nix + ./system/hardware-configuration/${hostName}.nix + ( + { + config, + lib, + pkgs, + ... + }: + { + networking = { + inherit hostName; + }; + nix.settings.trusted-users = [ username ]; + services.greetd.settings.initial_session.user = username; + programs.${loginShell} = lib.mkIf (loginShell != "bash") { enable = true; }; + users.users.${username} = { + shell = pkgs.${loginShell}; + group = "users"; + isNormalUser = true; + description = "Evie Litherland-Smith"; + extraGroups = [ + "networkmanager" + "wheel" + "video" + "input" + "uinput" + "dialout" + ]; + initialHashedPassword = "$y$j9T$tHIPQt09Kf3KH2eIRze3g/$2mwSlcq27DTGvHNPJ5EP9/1CfL3bXP0F6oS/Vuffmn3"; + openssh = { + inherit (config.users.users.root.openssh) authorizedKeys; + }; + }; + home-manager = { + extraSpecialArgs = defaultExtraSpecialArgs { inherit system; }; + useGlobalPkgs = true; + useUserPackages = true; + backupFileExtension = "backup"; + users.${username} = { + imports = [ + base16.homeManagerModule + { scheme = "${tt-schemes}/base16/one-light.yaml"; } + ./home/${hostName}.nix + ]; + home = { + inherit username; + homeDirectory = "/home/${username}"; + stateVersion = "23.05"; + }; + programs.home-manager.enable = true; + nixpkgs.config.allowUnfree = true; + }; + }; + } + ) + ]; in - pkgs.mkShellNoCC { - packages = with pkgs; [nil pre-commit]; - shellHook = "pre-commit install --install-hooks"; + { + devShells.x86_64-linux.default = + let + pkgs = import nixpkgs { system = "x86_64-linux"; }; + in + pkgs.mkShellNoCC { + packages = with pkgs; [ + nil + pre-commit + ]; + shellHook = "pre-commit install --install-hooks"; + }; + nixosConfigurations = { + ## Server + Legion = + let + system = "x86_64-linux"; + username = "pixelifytica"; + hostName = "Legion"; + in + nixpkgs.lib.nixosSystem { + specialArgs = defaultSpecialArgs { inherit system; }; + modules = defaultModules { inherit system username hostName; }; + }; + ## Personal + Northstar = + let + system = "x86_64-linux"; + username = "pixelifytica"; + hostName = "Northstar"; + in + nixpkgs.lib.nixosSystem { + specialArgs = defaultSpecialArgs { inherit system; }; + modules = defaultModules { inherit system username hostName; }; + }; + Vanguard = + let + system = "x86_64-linux"; + username = "pixelifytica"; + hostName = "Vanguard"; + in + nixpkgs.lib.nixosSystem { + specialArgs = defaultSpecialArgs { inherit system; }; + modules = defaultModules { inherit system username hostName; }; + }; + ## Work + Tone = + let + system = "x86_64-linux"; + username = "elitherl"; + hostName = "Tone"; + in + nixpkgs.lib.nixosSystem { + specialArgs = defaultSpecialArgs { inherit system; }; + modules = defaultModules { inherit system username hostName; }; + }; + Scorch = + let + system = "x86_64-linux"; + username = "elitherl"; + hostName = "Scorch"; + in + nixpkgs.lib.nixosSystem { + specialArgs = defaultSpecialArgs { inherit system; }; + modules = defaultModules { inherit system username hostName; }; + }; }; - nixosConfigurations = { - ## Server - Legion = let - system = "x86_64-linux"; - username = "pixelifytica"; - hostName = "Legion"; - in - nixpkgs.lib.nixosSystem { - specialArgs = defaultSpecialArgs {inherit system;}; - modules = defaultModules {inherit system username hostName;}; - }; - ## Personal - Northstar = let - system = "x86_64-linux"; - username = "pixelifytica"; - hostName = "Northstar"; - in - nixpkgs.lib.nixosSystem { - specialArgs = defaultSpecialArgs {inherit system;}; - modules = defaultModules {inherit system username hostName;}; - }; - Vanguard = let - system = "x86_64-linux"; - username = "pixelifytica"; - hostName = "Vanguard"; - in - nixpkgs.lib.nixosSystem { - specialArgs = defaultSpecialArgs {inherit system;}; - modules = defaultModules {inherit system username hostName;}; - }; - ## Work - Tone = let - system = "x86_64-linux"; - username = "elitherl"; - hostName = "Tone"; - in - nixpkgs.lib.nixosSystem { - specialArgs = defaultSpecialArgs {inherit system;}; - modules = defaultModules {inherit system username hostName;}; - }; - Scorch = let - system = "x86_64-linux"; - username = "elitherl"; - hostName = "Scorch"; - in - nixpkgs.lib.nixosSystem { - specialArgs = defaultSpecialArgs {inherit system;}; - modules = defaultModules {inherit system username hostName;}; - }; }; - }; } diff --git a/home/Legion.nix b/home/Legion.nix index 56cc3661..46c1ed21 100644 --- a/home/Legion.nix +++ b/home/Legion.nix @@ -1 +1,4 @@ -{...}: {imports = [./shell/default.nix];} +{ ... }: +{ + imports = [ ./shell/default.nix ]; +} diff --git a/home/Northstar.nix b/home/Northstar.nix index df7c4d4f..91aefac3 100644 --- a/home/Northstar.nix +++ b/home/Northstar.nix @@ -3,12 +3,13 @@ lib, pkgs, ... -}: { +}: +{ imports = [ ./personal.nix ./desktop/plasma/default.nix ]; - home.packages = with pkgs; [prusa-slicer]; + home.packages = with pkgs; [ prusa-slicer ]; programs.plasma = lib.mkIf config.programs.plasma.enable { configFile.kcminputrc."Libinput/1739/52759/SYNA32AA:00 06CB:CE17 Touchpad".NaturalScroll = true; }; diff --git a/home/Scorch.nix b/home/Scorch.nix index 02df3516..2bb3befe 100644 --- a/home/Scorch.nix +++ b/home/Scorch.nix @@ -1,8 +1,5 @@ +{ config, lib, ... }: { - config, - lib, - ... -}: { imports = [ ./work.nix ./desktop/plasma/default.nix diff --git a/home/Tone.nix b/home/Tone.nix index d5f962f2..f3cb0353 100644 --- a/home/Tone.nix +++ b/home/Tone.nix @@ -1,8 +1,5 @@ +{ config, lib, ... }: { - config, - lib, - ... -}: { imports = [ ./work.nix ./desktop/plasma/default.nix @@ -25,30 +22,35 @@ }; services.kanshi = lib.mkIf config.wayland.windowManager.sway.enable { enable = true; - settings = let - laptopScreen = { - criteria = "eDP-1"; - scale = 1.25; - position = "2560,576"; - }; - monitor = { - criteria = "Dell Inc. DELL P3223QE CCG8YN3"; - scale = 1.5; - position = "0,0"; - }; - in [ - { - profile = { - name = "undocked"; - outputs = [laptopScreen]; + settings = + let + laptopScreen = { + criteria = "eDP-1"; + scale = 1.25; + position = "2560,576"; }; - } - { - profile = { - name = "docked"; - outputs = [laptopScreen monitor]; + monitor = { + criteria = "Dell Inc. DELL P3223QE CCG8YN3"; + scale = 1.5; + position = "0,0"; }; - } - ]; + in + [ + { + profile = { + name = "undocked"; + outputs = [ laptopScreen ]; + }; + } + { + profile = { + name = "docked"; + outputs = [ + laptopScreen + monitor + ]; + }; + } + ]; }; } diff --git a/home/Vanguard.nix b/home/Vanguard.nix index 6f5d7cf7..63f19706 100644 --- a/home/Vanguard.nix +++ b/home/Vanguard.nix @@ -3,7 +3,8 @@ lib, pkgs, ... -}: { +}: +{ imports = [ ./personal.nix ./games/default.nix @@ -34,9 +35,7 @@ workspace = "1"; } ]; - startup = [ - {command = "${pkgs.xorg.xrandr}/bin/xrandr --output DP-1 --primary";} - ]; + startup = [ { command = "${pkgs.xorg.xrandr}/bin/xrandr --output DP-1 --primary"; } ]; }; }; } diff --git a/home/alacritty/default.nix b/home/alacritty/default.nix index 4c77a90c..32c572a1 100644 --- a/home/alacritty/default.nix +++ b/home/alacritty/default.nix @@ -1,8 +1,5 @@ +{ config, fonts, ... }: { - config, - fonts, - ... -}: { programs.alacritty = { enable = true; settings = { @@ -23,47 +20,54 @@ live_config_reload = true; selection.save_to_clipboard = true; mouse.hide_when_typing = true; - colors = let - mapColours = isBright: (builtins.listToAttrs (builtins.map (col: { - # Alacritty uses Yellow instead of Orange for BASE09 - name = - if col == "orange" - then "yellow" - else col; - value = "0x${config - .scheme - .${ - if isBright - then "bright-${col}" - else col - }}"; - }) - ["red" "orange" "green" "cyan" "blue" "magenta"])); - mapNamedColours = mapColours false; - mapNamedBrightColours = mapColours true; - in { - draw_bold_text_with_bright_colors = false; - primary = with config.scheme; { - background = "0x${base00}"; - foreground = "0x${base05}"; + colors = + let + mapColours = + isBright: + (builtins.listToAttrs ( + builtins.map + (col: { + # Alacritty uses Yellow instead of Orange for BASE09 + name = if col == "orange" then "yellow" else col; + value = "0x${config.scheme.${if isBright then "bright-${col}" else col}}"; + }) + [ + "red" + "orange" + "green" + "cyan" + "blue" + "magenta" + ] + )); + mapNamedColours = mapColours false; + mapNamedBrightColours = mapColours true; + in + { + draw_bold_text_with_bright_colors = false; + primary = with config.scheme; { + background = "0x${base00}"; + foreground = "0x${base05}"; + }; + cursor = with config.scheme; { + cursor = "0x${base05}"; + text = "0x${base00}"; + }; + normal = + with config.scheme; + { + black = "0x${base00-hex}"; + white = "0x${base05-hex}"; + } + // mapNamedColours; + bright = + with config.scheme; + { + black = "0x${base03-hex}"; + white = "0x${base07-hex}"; + } + // mapNamedBrightColours; }; - cursor = with config.scheme; { - cursor = "0x${base05}"; - text = "0x${base00}"; - }; - normal = with config.scheme; - { - black = "0x${base00-hex}"; - white = "0x${base05-hex}"; - } - // mapNamedColours; - bright = with config.scheme; - { - black = "0x${base03-hex}"; - white = "0x${base07-hex}"; - } - // mapNamedBrightColours; - }; }; }; } diff --git a/home/browser/default.nix b/home/browser/default.nix index ed78698e..94c61e63 100644 --- a/home/browser/default.nix +++ b/home/browser/default.nix @@ -1,4 +1,5 @@ -{...}: { +{ ... }: +{ imports = [ ./nyxt.nix ./firefox.nix diff --git a/home/browser/firefox.nix b/home/browser/firefox.nix index 04b3b9f6..faa3d1f7 100644 --- a/home/browser/firefox.nix +++ b/home/browser/firefox.nix @@ -1,8 +1,9 @@ -{pkgs, ...}: { +{ pkgs, ... }: +{ programs = { browserpass = { enable = true; - browsers = ["firefox"]; + browsers = [ "firefox" ]; }; firefox = { enable = true; @@ -75,15 +76,21 @@ NoDefaultBookmarks = false; OfferToSaveLogins = false; PasswordManagerEnabled = false; - PDFjs = {Enabled = false;}; + PDFjs = { + Enabled = false; + }; Permissions = { Autoplay = { Default = "block-audio-video"; }; }; - PictureInPicture = {Enabled = true;}; - PopupBlocking = {Default = true;}; - RequestedLocales = ["en-GB"]; + PictureInPicture = { + Enabled = true; + }; + PopupBlocking = { + Default = true; + }; + RequestedLocales = [ "en-GB" ]; SearchBar = "unified"; ShowHomeButton = true; StartDownloadsInTempDirectory = true; @@ -131,37 +138,60 @@ default = "DuckDuckGo"; privateDefault = default; force = true; - order = ["DuckDuckGo" "Atlas SearXNG"]; + order = [ + "DuckDuckGo" + "Atlas SearXNG" + ]; engines = { "Atlas SearXNG" = { - urls = [{template = "https://search.atlas.engineer/searxng/search?q={searchTerms}";}]; - definedAliases = ["@atlas"]; + urls = [ { template = "https://search.atlas.engineer/searxng/search?q={searchTerms}"; } ]; + definedAliases = [ "@atlas" ]; }; "NixOS Wiki" = { - urls = [{template = "https://wiki.nixos.org/w/index.php?search={searchTerms}";}]; + urls = [ { template = "https://wiki.nixos.org/w/index.php?search={searchTerms}"; } ]; icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; - definedAliases = ["@nix" "@nixos" "@nixoswiki"]; + definedAliases = [ + "@nix" + "@nixos" + "@nixoswiki" + ]; }; "Arch Wiki" = { - urls = [{template = "https://wiki.archlinux.org/index.php?search={searchTerms}";}]; - definedAliases = ["@aw" "@arch" "@archwiki"]; + urls = [ { template = "https://wiki.archlinux.org/index.php?search={searchTerms}"; } ]; + definedAliases = [ + "@aw" + "@arch" + "@archwiki" + ]; }; "GitHub" = { - urls = [{template = "https://github.com/search?q={searchTerms}";}]; - definedAliases = ["@gh" "@git" "@github"]; + urls = [ { template = "https://github.com/search?q={searchTerms}"; } ]; + definedAliases = [ + "@gh" + "@git" + "@github" + ]; }; "FlatHub" = { - url = [{template = "https://flathub.org/apps/search?q={searchTerms}";}]; - definedAliases = ["@flat" "@fthub" "@flathub"]; + url = [ { template = "https://flathub.org/apps/search?q={searchTerms}"; } ]; + definedAliases = [ + "@flat" + "@fthub" + "@flathub" + ]; }; "NixOS Packages" = { - urls = [{template = "http://search.nixos.org/packages?channel=unstable&size=50&sort=relevance&type=packages&query={searchTerms}";}]; + urls = [ + { + template = "http://search.nixos.org/packages?channel=unstable&size=50&sort=relevance&type=packages&query={searchTerms}"; + } + ]; icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; - definedAliases = ["@nixpkgs"]; + definedAliases = [ "@nixpkgs" ]; }; "PyPI packages" = { - urls = [{template = "https://pypi.org/search/?q={searchTerms}";}]; - definedAliases = ["@pypi"]; + urls = [ { template = "https://pypi.org/search/?q={searchTerms}"; } ]; + definedAliases = [ "@pypi" ]; }; }; }; diff --git a/home/browser/librewolf.nix b/home/browser/librewolf.nix index fbd69da3..4c83fef7 100644 --- a/home/browser/librewolf.nix +++ b/home/browser/librewolf.nix @@ -1,9 +1,10 @@ -{...}: { +{ ... }: +{ programs = { - browserpass.browsers = ["librewolf"]; + browserpass.browsers = [ "librewolf" ]; librewolf = { enable = true; - settings = {}; + settings = { }; }; }; } diff --git a/home/browser/nyxt.nix b/home/browser/nyxt.nix index 0d441c09..c77e6f09 100644 --- a/home/browser/nyxt.nix +++ b/home/browser/nyxt.nix @@ -4,62 +4,69 @@ fonts, accentColourName, ... -}: { - home.packages = [pkgs.nyxt]; +}: +{ + home.packages = [ pkgs.nyxt ]; xdg = { configFile = { - "nyxt/config.lisp".text = let - sc = config.scheme.withHashtag; - in '' - ;; Import custom configuration - (nyxt::load-lisp "${./config.lisp}") - ;; Define custom theme - (define-configuration browser - ((theme (make-instance 'theme:theme - :dark-p t - :font-family "${fonts.sansSerif.name}" - :monospace-font-family "${fonts.monospace.name}" - :background-color "${sc.base00}" - :on-background-color "${sc.base05}" - :primary-color "${sc.base02}" - :on-primary-color "${sc.base05}" - :secondary-color "${sc.base03}" - :on-secondary-color "${sc.base05}" - :accent-color "${sc.${accentColourName}}" - :on-accent-color "${sc.base01}" - :action-color "${sc.cyan}" - :on-action-color "${sc.base01}" - :success-color "${sc.green}" - :on-success-color "${sc.base01}" - :highlight-color "${sc.magenta}" - :on-highlight-color "${sc.base01}" - :warning-color "${sc.yellow}" - :on-warning-color "${sc.base01}" - :codeblock-color "${sc.base02}" - :on-codeblock-color "${sc.base05}")))) - ''; + "nyxt/config.lisp".text = + let + sc = config.scheme.withHashtag; + in + '' + ;; Import custom configuration + (nyxt::load-lisp "${./config.lisp}") + ;; Define custom theme + (define-configuration browser + ((theme (make-instance 'theme:theme + :dark-p t + :font-family "${fonts.sansSerif.name}" + :monospace-font-family "${fonts.monospace.name}" + :background-color "${sc.base00}" + :on-background-color "${sc.base05}" + :primary-color "${sc.base02}" + :on-primary-color "${sc.base05}" + :secondary-color "${sc.base03}" + :on-secondary-color "${sc.base05}" + :accent-color "${sc.${accentColourName}}" + :on-accent-color "${sc.base01}" + :action-color "${sc.cyan}" + :on-action-color "${sc.base01}" + :success-color "${sc.green}" + :on-success-color "${sc.base01}" + :highlight-color "${sc.magenta}" + :on-highlight-color "${sc.base01}" + :warning-color "${sc.yellow}" + :on-warning-color "${sc.base01}" + :codeblock-color "${sc.base02}" + :on-codeblock-color "${sc.base05}")))) + ''; }; - dataFile."nyxt/bookmarks.lisp".text = let - # Make a string of lisp-style list of strings, from nix-style - # list - convertTags = tags: "(" + (builtins.foldl' (x: y: x + " \"" + y + "\"") "" tags) + " )"; - # Take bookmarks as returned from JSON file and convert to NYXT - # expected format - convertBookmark = { - name, - tags, - url, - }: "(:url \"${url}\" :title \"${name}\" :tags ${convertTags tags})\n"; - in ( - # Fold all entries in bookmarks.json into single string of NYXT - # format bookmarks, each entry on a new line and with 2 space - # indentation, just for visual clarity if reading the outputted - # file - "(\n" - + (builtins.foldl' - (x: y: x + " " + convertBookmark y) "" - (builtins.fromJSON (builtins.readFile ./bookmarks.json))) - + ")" - ); + dataFile."nyxt/bookmarks.lisp".text = + let + # Make a string of lisp-style list of strings, from nix-style + # list + convertTags = tags: "(" + (builtins.foldl' (x: y: x + " \"" + y + "\"") "" tags) + " )"; + # Take bookmarks as returned from JSON file and convert to NYXT + # expected format + convertBookmark = + { + name, + tags, + url, + }: + "(:url \"${url}\" :title \"${name}\" :tags ${convertTags tags})\n"; + in + ( + # Fold all entries in bookmarks.json into single string of NYXT + # format bookmarks, each entry on a new line and with 2 space + # indentation, just for visual clarity if reading the outputted + # file + "(\n" + + (builtins.foldl' (x: y: x + " " + convertBookmark y) "" ( + builtins.fromJSON (builtins.readFile ./bookmarks.json) + )) + + ")" + ); }; } diff --git a/home/default.nix b/home/default.nix index 56d4e0e9..ffb5f29c 100644 --- a/home/default.nix +++ b/home/default.nix @@ -1,4 +1,5 @@ -{pkgs, ...}: { +{ pkgs, ... }: +{ imports = [ # Programs ./desktop/default.nix @@ -28,7 +29,7 @@ followSystemTheme = true; notificationMethod = "electron"; optInTeamsV2 = true; - spellCheckerLanguages = ["en_GB"]; + spellCheckerLanguages = [ "en_GB" ]; }; }; } diff --git a/home/desktop/base16/gtk.nix b/home/desktop/base16/gtk.nix index 64cefaaa..fa882da7 100644 --- a/home/desktop/base16/gtk.nix +++ b/home/desktop/base16/gtk.nix @@ -1,8 +1,6 @@ -{ - scheme, - accentColourName, -}: -with scheme.withHashtag; '' +{ scheme, accentColourName }: +with scheme.withHashtag; +'' @define-color accent_color ${scheme.withHashtag."${accentColourName}-hex"}; @define-color accent_bg_color ${scheme.withHashtag."${accentColourName}-hex"}; @define-color accent_fg_color ${base00-hex}; diff --git a/home/desktop/default.nix b/home/desktop/default.nix index 09bca80c..fa149086 100644 --- a/home/desktop/default.nix +++ b/home/desktop/default.nix @@ -1,41 +1,39 @@ +{ config, pkgs, ... }: { - config, - pkgs, - ... -}: { home = { - pointerCursor = let - name = - if config.scheme.variant == "light" - then "volantes_cursors" - else "volantes_light_cursors"; - in { - inherit name; - package = pkgs.volantes-cursors; - size = 32; - gtk.enable = config.gtk.enable; - x11 = { - enable = true; - defaultCursor = name; + pointerCursor = + let + name = if config.scheme.variant == "light" then "volantes_cursors" else "volantes_light_cursors"; + in + { + inherit name; + package = pkgs.volantes-cursors; + size = 32; + gtk.enable = config.gtk.enable; + x11 = { + enable = true; + defaultCursor = name; + }; }; - }; }; services.syncthing.enable = true; programs.mpv.enable = true; xdg = { mime.enable = true; - mimeApps = let - defaultApplications = import ./mimeapps.nix; - in { - enable = true; - inherit defaultApplications; - associations = { - added = defaultApplications; - removed = { - "x-scheme-handler/zoomus" = config.xdg.mimeApps.defaultApplications."x-scheme-handler/http"; + mimeApps = + let + defaultApplications = import ./mimeapps.nix; + in + { + enable = true; + inherit defaultApplications; + associations = { + added = defaultApplications; + removed = { + "x-scheme-handler/zoomus" = config.xdg.mimeApps.defaultApplications."x-scheme-handler/http"; + }; }; }; - }; userDirs = { enable = true; createDirectories = true; diff --git a/home/desktop/lib/to_capital.nix b/home/desktop/lib/to_capital.nix index ef71b111..91620550 100644 --- a/home/desktop/lib/to_capital.nix +++ b/home/desktop/lib/to_capital.nix @@ -1,11 +1,13 @@ lib: string: -with lib; let - chars = let - lc = strings.splitString "" string; - in (lists.sublist 1 (lists.length lc - 2) lc); -in ( - strings.concatStringsSep "" ( - (lists.singleton (strings.toUpper (lists.elemAt chars 0))) - ++ (lists.sublist 1 (lists.length chars) chars) - ) -) +with lib; +let + chars = + let + lc = strings.splitString "" string; + in + (lists.sublist 1 (lists.length lc - 2) lc); +in +(strings.concatStringsSep "" ( + (lists.singleton (strings.toUpper (lists.elemAt chars 0))) + ++ (lists.sublist 1 (lists.length chars) chars) +)) diff --git a/home/desktop/mimeapps.nix b/home/desktop/mimeapps.nix index 513b45e4..2bedc12f 100644 --- a/home/desktop/mimeapps.nix +++ b/home/desktop/mimeapps.nix @@ -1,13 +1,21 @@ let - emacs = ["emacsclient.desktop" "emacs.desktop"]; - browser = ["firefox.desktop" "librewolf.desktop" "nyxt.desktop"]; -in { - "inode/directory" = ["thunar.desktop"]; - "inode/symlink" = ["thunar.desktop"]; + emacs = [ + "emacsclient.desktop" + "emacs.desktop" + ]; + browser = [ + "firefox.desktop" + "librewolf.desktop" + "nyxt.desktop" + ]; +in +{ + "inode/directory" = [ "thunar.desktop" ]; + "inode/symlink" = [ "thunar.desktop" ]; - "image/jpeg" = ["swayimg.desktop"]; - "image/png" = ["swayimg.desktop"]; - "video/mp4" = ["mpv.desktop"]; + "image/jpeg" = [ "swayimg.desktop" ]; + "image/png" = [ "swayimg.desktop" ]; + "video/mp4" = [ "mpv.desktop" ]; "text/plain" = emacs; "text/richtext" = emacs; @@ -44,10 +52,10 @@ in { "application/x-docbook+xml" = emacs; "application/x-yaml" = emacs; - "application/pdf" = ["evince.desktop"]; - "application/epub+zip" = ["evince.desktop"]; - "application/msword" = ["writer.desktop"]; - "application/zip" = ["xarchiver.desktop"]; + "application/pdf" = [ "evince.desktop" ]; + "application/epub+zip" = [ "evince.desktop" ]; + "application/msword" = [ "writer.desktop" ]; + "application/zip" = [ "xarchiver.desktop" ]; "application/x-extension-htm" = browser; "application/x-extension-html" = browser; @@ -55,23 +63,23 @@ in { "application/x-extension-xhtml" = browser; "application/x-extension-xht" = browser; "application/x-mozilla-bookmarks" = browser; - "application/x-zoom" = ["Zoom.desktop"] ++ browser; + "application/x-zoom" = [ "Zoom.desktop" ] ++ browser; "x-scheme-handler/http" = browser; "x-scheme-handler/https" = browser; "x-scheme-handler/about" = browser; "x-scheme-handler/chrome" = browser; "x-scheme-handler/webcal" = browser; - "x-scheme-handler/geo" = ["openstreetmap-geo-handler.desktop"]; - "x-scheme-handler/mailto" = ["emacsclient-mail.desktop"]; + "x-scheme-handler/geo" = [ "openstreetmap-geo-handler.desktop" ]; + "x-scheme-handler/mailto" = [ "emacsclient-mail.desktop" ]; "x-scheme-handler/unknown" = emacs; - "x-scheme-handler/prusaslicer" = ["PrusaSlicerURLProtocol.desktop"]; + "x-scheme-handler/prusaslicer" = [ "PrusaSlicerURLProtocol.desktop" ]; - "x-scheme-handler/ms-word" = ["writer.desktop"]; - "x-scheme-handler/ms-powerpoint" = ["impress.desktop"]; - "x-scheme-handler/ms-excel" = ["calc.desktop"]; - "x-scheme-handler/msteams" = ["teams-for-linux.desktop"] ++ browser; + "x-scheme-handler/ms-word" = [ "writer.desktop" ]; + "x-scheme-handler/ms-powerpoint" = [ "impress.desktop" ]; + "x-scheme-handler/ms-excel" = [ "calc.desktop" ]; + "x-scheme-handler/msteams" = [ "teams-for-linux.desktop" ] ++ browser; "x-scheme-handler/zoomus" = browser; "x-scheme-handler/zoommtg" = browser; } diff --git a/home/desktop/plasma/default.nix b/home/desktop/plasma/default.nix index ce708009..653c6d8c 100644 --- a/home/desktop/plasma/default.nix +++ b/home/desktop/plasma/default.nix @@ -7,59 +7,64 @@ rc2nix, accentColourName, ... -}: { +}: +{ imports = [ inputs.plasma-manager.homeManagerModules.plasma-manager ../default.nix ./konsole.nix ]; - home.packages = with pkgs; [ + home.packages = [ rc2nix - wl-clipboard - (papirus-icon-theme.override {color = "violet";}) + pkgs.wl-clipboard + (pkgs.papirus-icon-theme.override { color = "violet"; }) ]; services.gpg-agent.pinentryPackage = pkgs.pinentry-qt; programs.plasma = { enable = true; overrideConfig = true; - workspace = let - toCapital = import ../lib/to_capital.nix lib; - in { - clickItemTo = "open"; - theme = "default"; - colorScheme = "Breeze${toCapital config.scheme.variant}"; - iconTheme = "Papirus-${toCapital config.scheme.variant}"; - windowDecorations = { - library = "org.kde.breeze"; - theme = "Breeze"; + workspace = + let + toCapital = import ../lib/to_capital.nix lib; + in + { + clickItemTo = "open"; + theme = "default"; + colorScheme = "Breeze${toCapital config.scheme.variant}"; + iconTheme = "Papirus-${toCapital config.scheme.variant}"; + windowDecorations = { + library = "org.kde.breeze"; + theme = "Breeze"; + }; + cursor = { + inherit (config.home.pointerCursor) size; + theme = config.home.pointerCursor.name; + }; + wallpaper = "${../wallpapers/landscapes/tropic_island_day.jpg}"; }; - cursor = { - inherit (config.home.pointerCursor) size; - theme = config.home.pointerCursor.name; - }; - wallpaper = "${../wallpapers/landscapes/tropic_island_day.jpg}"; - }; - fonts = let - general = { - family = fonts.sansSerif.name; - pointSize = 12; + fonts = + let + general = { + family = fonts.sansSerif.name; + pointSize = 12; + }; + small = { + inherit (general) family; + pointSize = general.pointSize - 2; + }; + fixedWidth = { + family = fonts.monospace.name; + pointSize = 12; + }; + in + { + inherit general small fixedWidth; + menu = general; + toolbar = general; + windowTitle = small; }; - small = { - inherit (general) family; - pointSize = general.pointSize - 2; - }; - fixedWidth = { - family = fonts.monospace.name; - pointSize = 12; - }; - in { - inherit general small fixedWidth; - menu = general; - toolbar = general; - windowTitle = small; - }; hotkeys.commands = { "launch-emacs" = { @@ -103,14 +108,6 @@ ]; }; } - { - name = "org.kde.plasma.pager"; - config.General = { - showWindowIcons = "true"; - showOnlyCurrentScreen = "false"; - wrapPage = "true"; - }; - } "org.kde.plasma.cameraindicator" { systemTray = { @@ -149,7 +146,10 @@ shortcuts = { ksmserver = { - "Lock Session" = ["Screensaver" "Meta+Alt+L"]; + "Lock Session" = [ + "Screensaver" + "Meta+Alt+L" + ]; }; kwin = { "Walk Through Windows of Current Application" = "Alt+`"; @@ -162,9 +162,13 @@ "Switch Window Up" = "Meta+K"; "Invert" = "Meta+Ctrl+I"; "InvertWindow" = "Meta+Ctrl+U"; - "Invert Screen Colors" = []; + "Invert Screen Colors" = [ ]; }; - "services/org.kde.krunner.desktop"."_launch" = ["Meta+Space" "Search" "Alt+F2"]; + "services/org.kde.krunner.desktop"."_launch" = [ + "Meta+Space" + "Search" + "Alt+F2" + ]; }; kwin = { @@ -184,17 +188,6 @@ baloofilerc."Basic Settings"."Indexing-Enabled" = false; bluedevilglobalrc.Global.launchState.value = "disable"; kcminputrc.Keyboard.NumLock = 1; - # powerdevilrc = { - # AC = { - # Display = { - # TurnOffDisplayIdleTimeoutSec = "1800"; - # TurnOffDisplayIdleTimeoutWhenLockedSec = "120"; - # }; - # SuspendAndShutdown = { - # AutoSuspendIdleTimeoutSec = "3600"; - # }; - # }; - # }; plasmanotifyrc = { Notifications = { NormalAlwaysOnTop = true; @@ -219,18 +212,22 @@ }; }; kdeglobals = { - General = let - AccentColor = let - r = config.scheme."${accentColourName}-rgb-r"; - g = config.scheme."${accentColourName}-rgb-g"; - b = config.scheme."${accentColourName}-rgb-b"; - in "${r}, ${g}, ${b}"; - in { - inherit AccentColor; - LastUsedCustomAccentColor = AccentColor; - TerminalApplication = "konsole"; - TerminalService = "org.kde.konsole.desktop"; - }; + General = + let + AccentColor = + let + r = config.scheme."${accentColourName}-rgb-r"; + g = config.scheme."${accentColourName}-rgb-g"; + b = config.scheme."${accentColourName}-rgb-b"; + in + "${r}, ${g}, ${b}"; + in + { + inherit AccentColor; + LastUsedCustomAccentColor = AccentColor; + TerminalApplication = "konsole"; + TerminalService = "org.kde.konsole.desktop"; + }; WM = { # TODO convert to base16 colours at some point activeBackground = "227,229,231"; diff --git a/home/desktop/plasma/konsole.nix b/home/desktop/plasma/konsole.nix index 6ef94d12..5513f956 100644 --- a/home/desktop/plasma/konsole.nix +++ b/home/desktop/plasma/konsole.nix @@ -1,4 +1,5 @@ -{fonts, ...}: { +{ fonts, ... }: +{ programs.konsole = { enable = true; defaultProfile = "One-Light"; diff --git a/home/desktop/sway/avizo/default.nix b/home/desktop/sway/avizo/default.nix index b2b29f7c..5790cf47 100644 --- a/home/desktop/sway/avizo/default.nix +++ b/home/desktop/sway/avizo/default.nix @@ -1,19 +1,19 @@ +{ config, accentColourName, ... }: { - config, - accentColourName, - ... -}: { services.avizo = { enable = true; - settings.default = let - sc = config.scheme; - rgba = colourName: "${sc."${colourName}-rgb-r"}, ${sc."${colourName}-rgb-g"}, ${sc."${colourName}-rgb-b"}"; - in { - background = "rgba(${rgba "base00"}, 0.9)"; - bar-bg-color = "rgba(${rgba "base00"}, 0.9)"; - bar-fg-color = "rgba(${rgba "base05"}, 1.0)"; - border-color = "rgba(${rgba accentColourName}, 1.0)"; - image-opacity = "1.0"; - }; + settings.default = + let + sc = config.scheme; + rgba = + colourName: "${sc."${colourName}-rgb-r"}, ${sc."${colourName}-rgb-g"}, ${sc."${colourName}-rgb-b"}"; + in + { + background = "rgba(${rgba "base00"}, 0.9)"; + bar-bg-color = "rgba(${rgba "base00"}, 0.9)"; + bar-fg-color = "rgba(${rgba "base05"}, 1.0)"; + border-color = "rgba(${rgba accentColourName}, 1.0)"; + image-opacity = "1.0"; + }; }; } diff --git a/home/desktop/sway/default.nix b/home/desktop/sway/default.nix index 4ab827f4..48958818 100644 --- a/home/desktop/sway/default.nix +++ b/home/desktop/sway/default.nix @@ -5,11 +5,13 @@ fonts, accentColourName, ... -}: let +}: +let set-background = pkgs.writeShellScriptBin "set-background" '' ${pkgs.swaybg}/bin/swaybg -m fill -i ${../wallpapers/landscapes/tropic_island_day.jpg} ''; -in { +in +{ imports = [ ../default.nix ./avizo/default.nix @@ -64,24 +66,26 @@ in { tray = "never"; }; }; - gtk = let - toCapital = import ../lib/to_capital.nix lib; - in { - enable = true; - theme = { - package = pkgs.materia-theme; - name = "Materia-${config.scheme.variant}"; + gtk = + let + toCapital = import ../lib/to_capital.nix lib; + in + { + enable = true; + theme = { + package = pkgs.materia-theme; + name = "Materia-${config.scheme.variant}"; + }; + iconTheme = { + package = pkgs.papirus-icon-theme.override { color = "violet"; }; + name = "Papirus-${toCapital config.scheme.variant}"; + }; }; - iconTheme = { - package = pkgs.papirus-icon-theme.override {color = "violet";}; - name = "Papirus-${toCapital config.scheme.variant}"; - }; - }; wayland.windowManager.sway = { enable = true; - package = - pkgs.swayfx.overrideAttrs - (old: {passthru.providedSessions = ["sway"];}); + package = pkgs.swayfx.overrideAttrs (old: { + passthru.providedSessions = [ "sway" ]; + }); swaynag.enable = true; systemd.enable = true; xwayland = true; @@ -106,51 +110,81 @@ in { terminal = "${config.programs.alacritty.package}/bin/alacritty"; menu = "${config.programs.fuzzel.package}/bin/fuzzel"; workspaceAutoBackAndForth = true; - bars = []; + bars = [ ]; gaps = { inner = 5; outer = 0; }; fonts = { - names = [fonts.monospace.name]; + names = [ fonts.monospace.name ]; style = "regular"; size = fonts.sizes.desktop * 1.0; }; - colors = let - sc = config.scheme.withHashtag; - text = toString sc.base05; - indicator = toString sc.${accentColourName}; - background = toString sc.base00; - in { - inherit background; - focused = let - border = toString sc.${accentColourName}; - in { - inherit background text indicator border; - childBorder = border; + colors = + let + sc = config.scheme.withHashtag; + text = toString sc.base05; + indicator = toString sc.${accentColourName}; + background = toString sc.base00; + in + { + inherit background; + focused = + let + border = toString sc.${accentColourName}; + in + { + inherit + background + text + indicator + border + ; + childBorder = border; + }; + focusedInactive = + let + border = toString sc.base04; + in + { + inherit + background + text + indicator + border + ; + childBorder = border; + }; + unfocused = + let + border = toString sc.base03; + in + { + inherit + background + text + indicator + border + ; + childBorder = border; + }; + urgent = + let + border = toString sc.red; + in + { + inherit + background + text + indicator + border + ; + childBorder = border; + }; }; - focusedInactive = let - border = toString sc.base04; - in { - inherit background text indicator border; - childBorder = border; - }; - unfocused = let - border = toString sc.base03; - in { - inherit background text indicator border; - childBorder = border; - }; - urgent = let - border = toString sc.red; - in { - inherit background text indicator border; - childBorder = border; - }; - }; startup = [ - {command = "${pkgs.libsForQt5.polkit-kde-agent}/libexec/polkit-kde-authentication-agent-1";} - {command = "${set-background}/bin/set-background";} + { command = "${pkgs.libsForQt5.polkit-kde-agent}/libexec/polkit-kde-authentication-agent-1"; } + { command = "${set-background}/bin/set-background"; } ]; window = { border = 1; @@ -187,9 +221,11 @@ in { ]; }; floating.border = 1; - keybindings = with config; let - modifier = wayland.windowManager.sway.config.modifier; - in + keybindings = + with config; + let + modifier = wayland.windowManager.sway.config.modifier; + in lib.mkOptionDefault { # Movement "${modifier}+comma" = "workspace prev"; diff --git a/home/desktop/sway/foot/default.nix b/home/desktop/sway/foot/default.nix index 34e36ba4..7491e89a 100644 --- a/home/desktop/sway/foot/default.nix +++ b/home/desktop/sway/foot/default.nix @@ -1,8 +1,5 @@ +{ config, fonts, ... }: { - config, - fonts, - ... -}: { programs.foot = { enable = true; server.enable = true; @@ -19,8 +16,12 @@ notify = false; visual = false; }; - cursor = {blink = true;}; - mouse = {hide-when-typing = true;}; + cursor = { + blink = true; + }; + mouse = { + hide-when-typing = true; + }; colors = with config.scheme; rec { alpha = 0.85; background = base00; diff --git a/home/desktop/sway/fuzzel/default.nix b/home/desktop/sway/fuzzel/default.nix index 0279039c..25aea3c2 100644 --- a/home/desktop/sway/fuzzel/default.nix +++ b/home/desktop/sway/fuzzel/default.nix @@ -4,7 +4,8 @@ fonts, accentColourName, ... -}: { +}: +{ programs.fuzzel = { enable = true; settings = { @@ -16,27 +17,27 @@ fields = "filename,name,generic,categories"; fuzzy = true; filter-desktop = true; - terminal = with config.programs; "${ - if alacritty.enable - then alacritty.package - else pkgs.alacritty - }/bin/alacritty -e"; + terminal = + with config.programs; + "${if alacritty.enable then alacritty.package else pkgs.alacritty}/bin/alacritty -e"; lines = 24; width = 80; tabs = 4; layer = "overlay"; }; - colors = let - sc = config.scheme; - in { - background = "${sc.base00}cc"; # 80% Opacity - text = "${sc.base05}ff"; - match = "${sc.red}ff"; - selection = "${sc.base01}ff"; - selection-text = "${sc.base05}ff"; - selection-match = "${sc.red}ff"; - border = "${sc.${accentColourName}}ff"; - }; + colors = + let + sc = config.scheme; + in + { + background = "${sc.base00}cc"; # 80% Opacity + text = "${sc.base05}ff"; + match = "${sc.red}ff"; + selection = "${sc.base01}ff"; + selection-text = "${sc.base05}ff"; + selection-match = "${sc.red}ff"; + border = "${sc.${accentColourName}}ff"; + }; border = { width = 1; radius = 5; diff --git a/home/desktop/sway/mako/default.nix b/home/desktop/sway/mako/default.nix index 264ab892..2c4fd4bc 100644 --- a/home/desktop/sway/mako/default.nix +++ b/home/desktop/sway/mako/default.nix @@ -3,24 +3,27 @@ fonts, accentColourName, ... -}: { - services.mako = let - sc = config.scheme.withHashtag; - in { - enable = true; - anchor = "top-right"; - font = "${fonts.monospace.name} ${toString fonts.sizes.popups}"; - layer = "top"; - markup = true; - maxVisible = 10; - icons = true; - iconPath = with config.gtk.iconTheme; "${package}/share/icons/${name}"; - textColor = "${sc.base05}ff"; - progressColor = "over ${sc.red}ff"; - backgroundColor = "${sc.base00}cc"; - borderColor = "${sc.${accentColourName}}ff"; - borderRadius = 5; - borderSize = 1; - defaultTimeout = 0; - }; +}: +{ + services.mako = + let + sc = config.scheme.withHashtag; + in + { + enable = true; + anchor = "top-right"; + font = "${fonts.monospace.name} ${toString fonts.sizes.popups}"; + layer = "top"; + markup = true; + maxVisible = 10; + icons = true; + iconPath = with config.gtk.iconTheme; "${package}/share/icons/${name}"; + textColor = "${sc.base05}ff"; + progressColor = "over ${sc.red}ff"; + backgroundColor = "${sc.base00}cc"; + borderColor = "${sc.${accentColourName}}ff"; + borderRadius = 5; + borderSize = 1; + defaultTimeout = 0; + }; } diff --git a/home/desktop/sway/rofi/default.nix b/home/desktop/sway/rofi/default.nix index 429fbb08..d027d3f3 100644 --- a/home/desktop/sway/rofi/default.nix +++ b/home/desktop/sway/rofi/default.nix @@ -4,18 +4,17 @@ fonts, accentColourName, ... -}: { +}: +{ programs.rofi = { enable = true; package = pkgs.rofi-wayland; - terminal = with config.programs; "${ - if alacritty.enable - then alacritty.package - else pkgs.alacritty - }/bin/alacritty"; + terminal = + with config.programs; + "${if alacritty.enable then alacritty.package else pkgs.alacritty}/bin/alacritty"; font = fonts.monospace.name; location = "center"; - plugins = with pkgs; [rofi-emoji]; + plugins = with pkgs; [ rofi-emoji ]; extraConfig = { modi = "run,drun,ssh,window,emoji,combi"; combi-modi = "drun,ssh,window,emoji"; @@ -36,104 +35,110 @@ display-emoji = " 󰞅 Emoji "; display-combi = " 󰛡 Combi "; }; - theme = with builtins; let - inherit (config.lib.formats.rasi) mkLiteral; - sc = config.scheme; - bg = mkLiteral "rgba (${sc.base00-rgb-r}, ${sc.base00-rgb-g}, ${sc.base00-rgb-b}, 80%)"; - bg2 = mkLiteral "rgba (${sc.base01-rgb-r}, ${sc.base01-rgb-g}, ${sc.base01-rgb-b}, 100%)"; - fg = mkLiteral sc.withHashtag.base05; - fg2 = mkLiteral sc.withHashtag.base04; - border = mkLiteral sc.withHashtag.${accentColour}; - blue = mkLiteral sc.withHashtag.blue; - in { - "*" = { - background-color = mkLiteral "transparent"; - text-color = fg; - font = with fonts; "${monospace.name} ${toString sizes.popups}"; - }; + theme = + with builtins; + let + inherit (config.lib.formats.rasi) mkLiteral; + sc = config.scheme; + bg = mkLiteral "rgba (${sc.base00-rgb-r}, ${sc.base00-rgb-g}, ${sc.base00-rgb-b}, 80%)"; + bg2 = mkLiteral "rgba (${sc.base01-rgb-r}, ${sc.base01-rgb-g}, ${sc.base01-rgb-b}, 100%)"; + fg = mkLiteral sc.withHashtag.base05; + fg2 = mkLiteral sc.withHashtag.base04; + border = mkLiteral sc.withHashtag.${accentColour}; + blue = mkLiteral sc.withHashtag.blue; + in + { + "*" = { + background-color = mkLiteral "transparent"; + text-color = fg; + font = with fonts; "${monospace.name} ${toString sizes.popups}"; + }; - window = { - height = mkLiteral "75%"; - width = mkLiteral "75%"; - border = mkLiteral "1px"; - border-color = border; - border-radius = mkLiteral "5px"; - background-color = bg; - }; + window = { + height = mkLiteral "75%"; + width = mkLiteral "75%"; + border = mkLiteral "1px"; + border-color = border; + border-radius = mkLiteral "5px"; + background-color = bg; + }; - inputbar = { - children = map mkLiteral ["prompt" "entry"]; - padding = mkLiteral "2px"; - }; + inputbar = { + children = map mkLiteral [ + "prompt" + "entry" + ]; + padding = mkLiteral "2px"; + }; - prompt = { - background-color = bg2; - padding = mkLiteral "6px"; - text-color = blue; - border-radius = mkLiteral "5px"; - margin = mkLiteral "20px 0px 0px 20px"; - }; + prompt = { + background-color = bg2; + padding = mkLiteral "6px"; + text-color = blue; + border-radius = mkLiteral "5px"; + margin = mkLiteral "20px 0px 0px 20px"; + }; - textbox-prompt-colon = { - expand = false; - str = "="; - }; + textbox-prompt-colon = { + expand = false; + str = "="; + }; - entry = { - padding = mkLiteral "6px"; - margin = mkLiteral "20px 0px 0px 10px"; - }; + entry = { + padding = mkLiteral "6px"; + margin = mkLiteral "20px 0px 0px 10px"; + }; - listview = { - border = mkLiteral "0px 0px 0px"; - padding = mkLiteral "6px 0px 0px"; - margin = mkLiteral "10px 0px 0px 20px"; - columns = 2; - lines = 5; - }; + listview = { + border = mkLiteral "0px 0px 0px"; + padding = mkLiteral "6px 0px 0px"; + margin = mkLiteral "10px 0px 0px 20px"; + columns = 2; + lines = 5; + }; - element = { - padding = mkLiteral "5px"; - }; + element = { + padding = mkLiteral "5px"; + }; - "element-icon" = { - size = mkLiteral "25px"; - }; + "element-icon" = { + size = mkLiteral "25px"; + }; - "element selected" = { - background-color = bg2; - text-color = blue; - border-radius = mkLiteral "5px"; - }; + "element selected" = { + background-color = bg2; + text-color = blue; + border-radius = mkLiteral "5px"; + }; - mode-switcher = { - spacing = 0; - }; + mode-switcher = { + spacing = 0; + }; - button = { - padding = mkLiteral "10px"; - text-color = fg2; - border-radius = mkLiteral "5px"; - vertical-align = mkLiteral "0.5"; - horizontal-align = mkLiteral "0.5"; - }; + button = { + padding = mkLiteral "10px"; + text-color = fg2; + border-radius = mkLiteral "5px"; + vertical-align = mkLiteral "0.5"; + horizontal-align = mkLiteral "0.5"; + }; - "button selected" = { - background-color = bg2; - text-color = blue; - }; + "button selected" = { + background-color = bg2; + text-color = blue; + }; - message = { - margin = mkLiteral "2px"; - padding = mkLiteral "2px"; - border-radius = mkLiteral "5px"; - }; + message = { + margin = mkLiteral "2px"; + padding = mkLiteral "2px"; + border-radius = mkLiteral "5px"; + }; - textbox = { - padding = mkLiteral "6px"; - margin = mkLiteral "20px 0px 0px 20px"; - text-color = blue; + textbox = { + padding = mkLiteral "6px"; + margin = mkLiteral "20px 0px 0px 20px"; + text-color = blue; + }; }; - }; }; } diff --git a/home/desktop/sway/swayidle/default.nix b/home/desktop/sway/swayidle/default.nix index 469e6572..298a2a73 100644 --- a/home/desktop/sway/swayidle/default.nix +++ b/home/desktop/sway/swayidle/default.nix @@ -1,20 +1,19 @@ +{ config, pkgs, ... }: { - config, - pkgs, - ... -}: { - imports = [../swaylock/default.nix]; - services.swayidle = let - swaylockfx = - pkgs.callPackage ../swaylock/swaylockfx.nix - {swaylock-effects = config.programs.swaylock.package;}; - in { - enable = true; - timeouts = [ - { - timeout = 60 * 15; # 15 minutes - command = "${swaylockfx}/bin/swaylockfx"; - } - ]; - }; + imports = [ ../swaylock/default.nix ]; + services.swayidle = + let + swaylockfx = pkgs.callPackage ../swaylock/swaylockfx.nix { + swaylock-effects = config.programs.swaylock.package; + }; + in + { + enable = true; + timeouts = [ + { + timeout = 60 * 15; # 15 minutes + command = "${swaylockfx}/bin/swaylockfx"; + } + ]; + }; } diff --git a/home/desktop/sway/swaylock/default.nix b/home/desktop/sway/swaylock/default.nix index af8dfded..443fe794 100644 --- a/home/desktop/sway/swaylock/default.nix +++ b/home/desktop/sway/swaylock/default.nix @@ -3,46 +3,48 @@ pkgs, accentColourName, ... -}: { +}: +{ home.packages = with pkgs; [ - (callPackage ./swaylockfx.nix - {swaylock-effects = config.programs.swaylock.package;}) + (callPackage ./swaylockfx.nix { swaylock-effects = config.programs.swaylock.package; }) ]; programs.swaylock = { enable = true; package = pkgs.swaylock-effects; # Settings are specifically for swaylock-effects - settings = let - sc = config.scheme; - in { - indicator-radius = 100; - indicator-thickness = 10; - indicator-caps-lock = true; - ignore-empty-password = true; - show-failed-attempts = true; - effect-blur = "5x3"; - effect-vignette = "0.5:0.5"; - grace = 2; - fade-in = 0.2; - bs-hl-color = sc.base06; - caps-lock-bs-hl-color = sc.base06; - caps-lock-key-hl-color = sc.green; - inside-color = "${sc.base00}cc"; - key-hl-color = sc.green; - layout-bg-color = "${sc.base00}cc"; - layout-border-color = sc.${accentColourName}; - layout-text-color = sc.base05; - ring-color = sc.${accentColourName}; - ring-clear-color = sc.base06; - ring-caps-lock-color = sc.base09; - ring-ver-color = sc.blue; - ring-wrong-color = sc.red; - separator-color = sc.base01; - text-color = sc.base05; - text-clear-color = sc.base06; - text-caps-lock-color = sc.base09; - text-ver-color = sc.blue; - text-wrong-color = sc.red; - }; + settings = + let + sc = config.scheme; + in + { + indicator-radius = 100; + indicator-thickness = 10; + indicator-caps-lock = true; + ignore-empty-password = true; + show-failed-attempts = true; + effect-blur = "5x3"; + effect-vignette = "0.5:0.5"; + grace = 2; + fade-in = 0.2; + bs-hl-color = sc.base06; + caps-lock-bs-hl-color = sc.base06; + caps-lock-key-hl-color = sc.green; + inside-color = "${sc.base00}cc"; + key-hl-color = sc.green; + layout-bg-color = "${sc.base00}cc"; + layout-border-color = sc.${accentColourName}; + layout-text-color = sc.base05; + ring-color = sc.${accentColourName}; + ring-clear-color = sc.base06; + ring-caps-lock-color = sc.base09; + ring-ver-color = sc.blue; + ring-wrong-color = sc.red; + separator-color = sc.base01; + text-color = sc.base05; + text-clear-color = sc.base06; + text-caps-lock-color = sc.base09; + text-ver-color = sc.blue; + text-wrong-color = sc.red; + }; }; } diff --git a/home/desktop/sway/swaylock/swaylockfx.nix b/home/desktop/sway/swaylock/swaylockfx.nix index 0a4353ba..c4d7945b 100644 --- a/home/desktop/sway/swaylock/swaylockfx.nix +++ b/home/desktop/sway/swaylock/swaylockfx.nix @@ -1,6 +1,2 @@ -{ - writeShellScriptBin, - swaylock-effects, - ... -}: +{ writeShellScriptBin, swaylock-effects, ... }: writeShellScriptBin "swaylockfx" "${swaylock-effects}/bin/swaylock --screenshots --clock --indicator --grace-no-mouse" diff --git a/home/desktop/sway/swaync/default.nix b/home/desktop/sway/swaync/default.nix index 42f78b1c..2a234d6a 100644 --- a/home/desktop/sway/swaync/default.nix +++ b/home/desktop/sway/swaync/default.nix @@ -4,357 +4,360 @@ fonts, accentColourName, ... -}: { - home.packages = [pkgs.swaynotificationcenter]; - xdg.configFile."swaync/style.css".text = let - sc = config.scheme.withHashtag; - alpha = "0.85"; - alpha-background = "rgba(${config.scheme.base00-rgb-r}, ${config.scheme.base00-rgb-g}, ${config.scheme.base00-rgb-b}, ${alpha})"; - in '' - * { - all: unset; - font-size: 1.2rem; - font-family: "${fonts.monospace.name}"; - transition: 200ms; - box-shadow: none; - } +}: +{ + home.packages = [ pkgs.swaynotificationcenter ]; + xdg.configFile."swaync/style.css".text = + let + sc = config.scheme.withHashtag; + alpha = "0.85"; + alpha-background = "rgba(${config.scheme.base00-rgb-r}, ${config.scheme.base00-rgb-g}, ${config.scheme.base00-rgb-b}, ${alpha})"; + in + '' + * { + all: unset; + font-size: 1.2rem; + font-family: "${fonts.monospace.name}"; + transition: 200ms; + box-shadow: none; + } - .floating-notifications.background .notification-row .notification-background { - border-radius: 5px; - border: 1px solid ${sc.${accentColourName}}; - margin: 18px; - background-color: ${alpha-background}; - color: ${sc.base05}; - padding: 0; - } + .floating-notifications.background .notification-row .notification-background { + border-radius: 5px; + border: 1px solid ${sc.${accentColourName}}; + margin: 18px; + background-color: ${alpha-background}; + color: ${sc.base05}; + padding: 0; + } - .floating-notifications.background - .notification-row - .notification-background - .notification { - padding: 7px; - border-radius: 5px; - } + .floating-notifications.background + .notification-row + .notification-background + .notification { + padding: 7px; + border-radius: 5px; + } - .floating-notifications.background - .notification-row - .notification-background - .notification - .notification-content { - margin: 7px; - } + .floating-notifications.background + .notification-row + .notification-background + .notification + .notification-content { + margin: 7px; + } - .floating-notifications.background - .notification-row - .notification-background - .notification - .notification-content - .summary { - color: ${sc.base05}; - } + .floating-notifications.background + .notification-row + .notification-background + .notification + .notification-content + .summary { + color: ${sc.base05}; + } - .floating-notifications.background - .notification-row - .notification-background - .notification - .notification-content - .time { - color: ${sc.base04}; - } + .floating-notifications.background + .notification-row + .notification-background + .notification + .notification-content + .time { + color: ${sc.base04}; + } - .floating-notifications.background - .notification-row - .notification-background - .notification - .notification-content - .body { - color: ${sc.base05}; - } + .floating-notifications.background + .notification-row + .notification-background + .notification + .notification-content + .body { + color: ${sc.base05}; + } - .floating-notifications.background - .notification-row - .notification-background - .notification - > *:last-child - > * { - min-height: 3.4em; - } + .floating-notifications.background + .notification-row + .notification-background + .notification + > *:last-child + > * { + min-height: 3.4em; + } - .floating-notifications.background - .notification-row - .notification-background - .notification - > *:last-child - > * - .notification-action { - border-radius: 5px; - background-color: ${sc.base01}; - color: ${sc.base05}; - margin: 7px; - } + .floating-notifications.background + .notification-row + .notification-background + .notification + > *:last-child + > * + .notification-action { + border-radius: 5px; + background-color: ${sc.base01}; + color: ${sc.base05}; + margin: 7px; + } - .floating-notifications.background - .notification-row - .notification-background - .notification - > *:last-child - > * - .notification-action:hover { - background-color: ${sc.base01}; - color: ${sc.base05}; - } + .floating-notifications.background + .notification-row + .notification-background + .notification + > *:last-child + > * + .notification-action:hover { + background-color: ${sc.base01}; + color: ${sc.base05}; + } - .floating-notifications.background - .notification-row - .notification-background - .notification - > *:last-child - > * - .notification-action:active { - background-color: ${sc.blue}; - color: ${sc.base00}; - } + .floating-notifications.background + .notification-row + .notification-background + .notification + > *:last-child + > * + .notification-action:active { + background-color: ${sc.blue}; + color: ${sc.base00}; + } - .floating-notifications.background - .notification-row - .notification-background - .close-button { - margin: 7px; - padding: 2px; - border-radius: 5px; - background-color: ${sc.red}; - color: ${sc.base00}; - } + .floating-notifications.background + .notification-row + .notification-background + .close-button { + margin: 7px; + padding: 2px; + border-radius: 5px; + background-color: ${sc.red}; + color: ${sc.base00}; + } - .floating-notifications.background - .notification-row - .notification-background - .close-button:hover { - background-color: ${sc.red}; - color: ${sc.base00}; - } + .floating-notifications.background + .notification-row + .notification-background + .close-button:hover { + background-color: ${sc.red}; + color: ${sc.base00}; + } - .floating-notifications.background - .notification-row - .notification-background - .close-button:active { - background-color: ${sc.red}; - color: ${sc.base00}; - } + .floating-notifications.background + .notification-row + .notification-background + .close-button:active { + background-color: ${sc.red}; + color: ${sc.base00}; + } - .control-center { - border-radius: 5px; - border: 1px solid ${sc.${accentColourName}}; - margin: 18px; - background-color: ${alpha-background}; - color: ${sc.base05}; - padding: 14px; - } + .control-center { + border-radius: 5px; + border: 1px solid ${sc.${accentColourName}}; + margin: 18px; + background-color: ${alpha-background}; + color: ${sc.base05}; + padding: 14px; + } - .control-center .widget-title { - color: ${sc.base05}; - font-size: 1.3em; - } + .control-center .widget-title { + color: ${sc.base05}; + font-size: 1.3em; + } - .control-center .widget-title button { - border-radius: 7px; - background-color: ${sc.base01}; - color: ${sc.base05}; - padding: 8px; - } + .control-center .widget-title button { + border-radius: 7px; + background-color: ${sc.base01}; + color: ${sc.base05}; + padding: 8px; + } - .control-center .widget-title button:hover { - background-color: ${sc.base02}; - color: ${sc.base05}; - } + .control-center .widget-title button:hover { + background-color: ${sc.base02}; + color: ${sc.base05}; + } - .control-center .widget-title button:active { - background-color: ${sc.base03}; - color: ${sc.base05}; - } + .control-center .widget-title button:active { + background-color: ${sc.base03}; + color: ${sc.base05}; + } - .control-center .notification-row .notification-background { - border-radius: 5px; - background-color: ${sc.base01}; - color: ${sc.base05}; - margin-top: 14px; - } + .control-center .notification-row .notification-background { + border-radius: 5px; + background-color: ${sc.base01}; + color: ${sc.base05}; + margin-top: 14px; + } - .control-center .notification-row .notification-background .notification { - padding: 7px; - border-radius: 7px; - } + .control-center .notification-row .notification-background .notification { + padding: 7px; + border-radius: 7px; + } - .control-center - .notification-row - .notification-background - .notification - .notification-content { - margin: 7px; - } + .control-center + .notification-row + .notification-background + .notification + .notification-content { + margin: 7px; + } - .control-center - .notification-row - .notification-background - .notification - .notification-content - .summary { - color: ${sc.base05}; - } + .control-center + .notification-row + .notification-background + .notification + .notification-content + .summary { + color: ${sc.base05}; + } - .control-center - .notification-row - .notification-background - .notification - .notification-content - .time { - color: ${sc.base04}; - } + .control-center + .notification-row + .notification-background + .notification + .notification-content + .time { + color: ${sc.base04}; + } - .control-center - .notification-row - .notification-background - .notification - .notification-content - .body { - color: ${sc.base05}; - } + .control-center + .notification-row + .notification-background + .notification + .notification-content + .body { + color: ${sc.base05}; + } - .control-center - .notification-row - .notification-background - .notification - > *:last-child - > * { - min-height: 3.4em; - } + .control-center + .notification-row + .notification-background + .notification + > *:last-child + > * { + min-height: 3.4em; + } - .control-center - .notification-row - .notification-background - .notification - > *:last-child - > * - .notification-action { - border-radius: 7px; - background-color: ${sc.base00}; - color: ${sc.base05}; - margin: 7px; - } + .control-center + .notification-row + .notification-background + .notification + > *:last-child + > * + .notification-action { + border-radius: 7px; + background-color: ${sc.base00}; + color: ${sc.base05}; + margin: 7px; + } - .control-center - .notification-row - .notification-background - .notification - > *:last-child - > * - .notification-action:hover { - background-color: ${sc.base01};; - color: ${sc.base05}; - } + .control-center + .notification-row + .notification-background + .notification + > *:last-child + > * + .notification-action:hover { + background-color: ${sc.base01};; + color: ${sc.base05}; + } - .control-center - .notification-row - .notification-background - .notification - > *:last-child - > * - .notification-action:active { - background-color: ${sc.blue}; - color: ${sc.base05}; - } + .control-center + .notification-row + .notification-background + .notification + > *:last-child + > * + .notification-action:active { + background-color: ${sc.blue}; + color: ${sc.base05}; + } - .control-center .notification-row .notification-background .close-button { - margin: 7px; - padding: 2px; - border-radius: 6.3px; - background-color: ${sc.red}; - color: ${sc.base00}; - } + .control-center .notification-row .notification-background .close-button { + margin: 7px; + padding: 2px; + border-radius: 6.3px; + background-color: ${sc.red}; + color: ${sc.base00}; + } - .control-center .notification-row .notification-background .close-button:hover { - background-color: ${sc.red}; - color: ${sc.base00}; - } + .control-center .notification-row .notification-background .close-button:hover { + background-color: ${sc.red}; + color: ${sc.base00}; + } - .control-center - .notification-row - .notification-background - .close-button:active { - background-color: ${sc.red}; - color: ${sc.base00}; - } + .control-center + .notification-row + .notification-background + .close-button:active { + background-color: ${sc.red}; + color: ${sc.base00}; + } - .control-center .notification-row .notification-background:hover { - background-color: ${sc.base00}; - color: ${sc.base05}; - } + .control-center .notification-row .notification-background:hover { + background-color: ${sc.base00}; + color: ${sc.base05}; + } - .control-center .notification-row .notification-background:active { - background-color: ${sc.blue}; - color: ${sc.base05}; - } + .control-center .notification-row .notification-background:active { + background-color: ${sc.blue}; + color: ${sc.base05}; + } - progressbar, - progress, - trough { - border-radius: 12.6px; - } + progressbar, + progress, + trough { + border-radius: 12.6px; + } - .notification.critical progress { - background-color: ${sc.red}; - } + .notification.critical progress { + background-color: ${sc.red}; + } - .notification.low progress, - .notification.normal progress { - background-color: ${sc.blue}; - } + .notification.low progress, + .notification.normal progress { + background-color: ${sc.blue}; + } - trough { - background-color: ${sc.base00}; - } + trough { + background-color: ${sc.base00}; + } - .control-center trough { - background-color: ${sc.base03}; - } + .control-center trough { + background-color: ${sc.base03}; + } - .control-center-dnd { - margin-top: 5px; - border-radius: 8px; - background: ${sc.base00}; - border: 1px solid ${sc.base03}; - } + .control-center-dnd { + margin-top: 5px; + border-radius: 8px; + background: ${sc.base00}; + border: 1px solid ${sc.base03}; + } - .control-center-dnd:checked { - background: ${sc.base00}; - } + .control-center-dnd:checked { + background: ${sc.base00}; + } - .control-center-dnd slider { - background: ${sc.base03}; - border-radius: 8px; - } + .control-center-dnd slider { + background: ${sc.base03}; + border-radius: 8px; + } - .widget-dnd { - margin: 0px; - font-size: 1.1rem; - } + .widget-dnd { + margin: 0px; + font-size: 1.1rem; + } - .widget-dnd > switch { - font-size: initial; - border-radius: 8px; - background: ${sc.base00}; - border: 1px solid ${sc.base03}; - } + .widget-dnd > switch { + font-size: initial; + border-radius: 8px; + background: ${sc.base00}; + border: 1px solid ${sc.base03}; + } - .widget-dnd > switch:checked { - background: ${sc.base00}; - } + .widget-dnd > switch:checked { + background: ${sc.base00}; + } - .widget-dnd > switch slider { - background: ${sc.base01}; - border-radius: 8px; - border: 1px solid ${sc.${accentColourName}}; - } + .widget-dnd > switch slider { + background: ${sc.base01}; + border-radius: 8px; + border: 1px solid ${sc.${accentColourName}}; + } - ''; + ''; } diff --git a/home/desktop/sway/waybar/default.nix b/home/desktop/sway/waybar/default.nix index 54166499..51313064 100644 --- a/home/desktop/sway/waybar/default.nix +++ b/home/desktop/sway/waybar/default.nix @@ -4,10 +4,11 @@ fonts, accentColourName, ... -}: { +}: +{ systemd.user.targets.tray.Unit = { Description = "Home Manager System Tray"; - Requires = ["graphical-session.target"]; + Requires = [ "graphical-session.target" ]; }; programs.waybar = { enable = true; @@ -21,7 +22,7 @@ "sway/workspaces" "sway/window" ]; - "modules-center" = []; + "modules-center" = [ ]; "modules-right" = [ "mpris" "custom/notification" @@ -50,12 +51,12 @@ }; all-outputs = false; persistent-workspaces = { - "1" = []; - "2" = []; - "3" = []; - "4" = []; - "5" = []; - "6" = []; + "1" = [ ]; + "2" = [ ]; + "3" = [ ]; + "4" = [ ]; + "5" = [ ]; + "6" = [ ]; }; }; "sway/window" = { @@ -105,7 +106,7 @@ "paused" = "󰏤"; "stopped" = "󰓛"; }; - "ignored-players" = []; + "ignored-players" = [ ]; }; pulseaudio = { scroll-step = 5; @@ -115,7 +116,11 @@ format-source-muted = "󰍭 "; format-icons = { car = "󰄍 "; - default = ["󰕿 " "󰖀 " "󰕾 "]; + default = [ + "󰕿 " + "󰖀 " + "󰕾 " + ]; hands-free = "󰥰 "; headset = "󰋎 "; phone = "󰏲 "; @@ -135,14 +140,25 @@ format = "󰻠 {usage}%"; tooltip = false; }; - memory = {format = "󰍛 {}%";}; + memory = { + format = "󰍛 {}%"; + }; temperature = { critical-threshold = 80; format = "{icon} {temperatureC}°C"; - format-icons = ["󱃃" "󰔏" "󱃂"]; + format-icons = [ + "󱃃" + "󰔏" + "󱃂" + ]; }; network = { - format-icons = ["󰤟 " "󰤢 " "󰤥 " "󰤨 "]; + format-icons = [ + "󰤟 " + "󰤢 " + "󰤥 " + "󰤨 " + ]; format-wifi = "{icon}"; format-ethernet = "󰈁 "; format-linked = "󰈂 "; @@ -167,15 +183,17 @@ mode-mon-col = 3; weeks-pos = "left"; on-scroll = 1; - format = let - sc = config.scheme.withHashtag; - in { - months = "{}"; - weeks = "W{}"; - weekdays = "{}"; - days = "{}"; - today = "{}"; - }; + format = + let + sc = config.scheme.withHashtag; + in + { + months = "{}"; + weeks = "W{}"; + weekdays = "{}"; + days = "{}"; + today = "{}"; + }; }; actions = { on-scroll-up = "shift_up"; @@ -186,7 +204,17 @@ backlight = { format = "{icon}"; tooltip-format = "{percent}%"; - format-icons = [" " " " " " " " " " " " " " " " " "]; + format-icons = [ + " " + " " + " " + " " + " " + " " + " " + " " + " " + ]; }; battery = { states = { @@ -197,144 +225,162 @@ format-charging = "󰂄 "; format-plugged = "󰚥 "; tooltip-format = "{capacity}% {time}"; - format-icons = ["󱃍 " "󰁺 " "󰁻 " "󰁼 " "󰁽 " "󰁾 " "󰁿 " "󰂀 " "󰂁 " "󰂂 " "󰁹 "]; + format-icons = [ + "󱃍 " + "󰁺 " + "󰁻 " + "󰁼 " + "󰁽 " + "󰁾 " + "󰁿 " + "󰂀 " + "󰂁 " + "󰂂 " + "󰁹 " + ]; }; - "custom/notification" = let - swaync = pkgs.swaynotificationcenter; - in { - tooltip = false; - format = "{icon}{}"; - format-icons = { - notification = "󱅫 "; - none = "󰂚 "; - dnd-notification = "󰅸 "; - dnd-none = "󰂜 "; - inhibited-notification = "󰅸 "; - inhibited-none = "󰂜 "; - dnd-inhibited-notification = "󰅸 "; - dnd-inhibited-none = "󰂜 "; + "custom/notification" = + let + swaync = pkgs.swaynotificationcenter; + in + { + tooltip = false; + format = "{icon}{}"; + format-icons = { + notification = "󱅫 "; + none = "󰂚 "; + dnd-notification = "󰅸 "; + dnd-none = "󰂜 "; + inhibited-notification = "󰅸 "; + inhibited-none = "󰂜 "; + dnd-inhibited-notification = "󰅸 "; + dnd-inhibited-none = "󰂜 "; + }; + return-type = "json"; + exec-if = "which ${swaync}/bin/swaync-client"; + exec = "${swaync}/bin/swaync-client -swb"; + on-click = "${swaync}/bin/swaync-client -t -sw"; + on-click-right = "${swaync}/bin/swaync-client -d -sw"; + escape = true; + }; + "custom/weather" = + let + date-format = "%Y-%m-%d"; + custom-indicator = "{ICON}{temp_C}({FeelsLikeC})"; + in + { + format = "{}°"; + tooltip = true; + interval = 900; # Every 15 minutes + exec = ''${pkgs.wttrbar}/bin/wttrbar --location Didcot --date-format "${date-format}" --custom-indicator "${custom-indicator}"''; + return-type = "json"; }; - return-type = "json"; - exec-if = "which ${swaync}/bin/swaync-client"; - exec = "${swaync}/bin/swaync-client -swb"; - on-click = "${swaync}/bin/swaync-client -t -sw"; - on-click-right = "${swaync}/bin/swaync-client -d -sw"; - escape = true; - }; - "custom/weather" = let - date-format = "%Y-%m-%d"; - custom-indicator = "{ICON}{temp_C}({FeelsLikeC})"; - in { - format = "{}°"; - tooltip = true; - interval = 900; # Every 15 minutes - exec = ''${pkgs.wttrbar}/bin/wttrbar --location Didcot --date-format "${date-format}" --custom-indicator "${custom-indicator}"''; - return-type = "json"; - }; tray = { icon-size = builtins.floor fonts.sizes.popups; show-passive-items = true; spacing = 5; }; }; - style = let - sc = config.scheme.withHashtag; - alpha = "0.85"; - in '' - * { - all: unset; - font-size: ${toString fonts.sizes.popups}px; - font-family: ${fonts.monospace.name}; - } + style = + let + sc = config.scheme.withHashtag; + alpha = "0.85"; + in + '' + * { + all: unset; + font-size: ${toString fonts.sizes.popups}px; + font-family: ${fonts.monospace.name}; + } - window { - background: transparent; - box-shadow: none; - } + window { + background: transparent; + box-shadow: none; + } - window > box { - color: ${sc.base05}; - background: alpha(${sc.base00}, ${alpha}); - margin: 5px 5px 0px; - padding: 0px; - border-top: 1px solid ${sc.base04}; - border-radius: 5px; - } + window > box { + color: ${sc.base05}; + background: alpha(${sc.base00}, ${alpha}); + margin: 5px 5px 0px; + padding: 0px; + border-top: 1px solid ${sc.base04}; + border-radius: 5px; + } - tooltip { - background: ${sc.base00}; - border: 1px solid ${sc.${accentColourName}}; - border-radius: 5px; - box-shadow: none; - } + tooltip { + background: ${sc.base00}; + border: 1px solid ${sc.${accentColourName}}; + border-radius: 5px; + box-shadow: none; + } - tooltip label { - color: ${sc.base05}; - border: none; - padding: 5px; - margin: 0px; - } + tooltip label { + color: ${sc.base05}; + border: none; + padding: 5px; + margin: 0px; + } - #workspaces, - #window, - #mpris, - #pulseaudio, - #network, - #bluetooth, - #backlight, - #battery, - #clock, - #custom-notification, - #custom-weather, - #tray { - margin: 0px; - padding: 1px 5px; - } + #workspaces, + #window, + #mpris, + #pulseaudio, + #network, + #bluetooth, + #backlight, + #battery, + #clock, + #custom-notification, + #custom-weather, + #tray { + margin: 0px; + padding: 1px 5px; + } - #workspaces, - #window, - #mpris, - #tray, - #backlight, - #battery, - #custom-weather { - color: ${sc.base05}; - } + #workspaces, + #window, + #mpris, + #tray, + #backlight, + #battery, + #custom-weather { + color: ${sc.base05}; + } - #workspaces button { - background: transparent; - color: ${sc.base05}; - margin: 0px; - padding: 0px 5px; - } - #workspaces button.persistent { - color: ${sc.base03}; - } - #workspaces button.focused { - color: ${sc.${accentColourName}}; - } - #workspaces button.urgent { - color: ${sc.base09}; - } + #workspaces button { + background: transparent; + color: ${sc.base05}; + margin: 0px; + padding: 0px 5px; + } + #workspaces button.persistent { + color: ${sc.base03}; + } + #workspaces button.focused { + color: ${sc.${accentColourName}}; + } + #workspaces button.urgent { + color: ${sc.base09}; + } - #custom-notification { - color: ${sc.base08}; - } - #pulseaudio { - color: ${sc.base09}; - } - #network { - color: ${sc.base0A}; - } - #bluetooth { - color: ${sc.base0B}; - } - #clock.calendar { - color: ${sc.base0C}; - } - #clock { - color: ${sc.base0D}; - } - ''; + #custom-notification { + color: ${sc.base08}; + } + #pulseaudio { + color: ${sc.base09}; + } + #network { + color: ${sc.base0A}; + } + #bluetooth { + color: ${sc.base0B}; + } + #clock.calendar { + color: ${sc.base0C}; + } + #clock { + color: ${sc.base0D}; + } + ''; }; } diff --git a/home/desktop/sway/wlogout/default.nix b/home/desktop/sway/wlogout/default.nix index 730d0025..c0ef7c8b 100644 --- a/home/desktop/sway/wlogout/default.nix +++ b/home/desktop/sway/wlogout/default.nix @@ -1,8 +1,5 @@ +{ config, fonts, ... }: { - config, - fonts, - ... -}: { programs.wlogout = { enable = true; layout = [ @@ -25,53 +22,55 @@ keybind = "l"; } ]; - style = let - sc = config.scheme.withHashtag; - shutdownIcon = ./icons/shutdown.png; - rebootIcon = ./icons/reboot.png; - logoutIcon = ./icons/logout.png; - in '' - * { - font-size: ${toString fonts.sizes.popups}px; - font-family: "${fonts.sansSerif.name}"; - } + style = + let + sc = config.scheme.withHashtag; + shutdownIcon = ./icons/shutdown.png; + rebootIcon = ./icons/reboot.png; + logoutIcon = ./icons/logout.png; + in + '' + * { + font-size: ${toString fonts.sizes.popups}px; + font-family: "${fonts.sansSerif.name}"; + } - window { - border: none; - background-color: transparent; - } + window { + border: none; + background-color: transparent; + } - button { - background-color: ${sc.base00}; - background-repeat: no-repeat; - background-position: center; - background-size: 25%; - box-shadow: none; - margin: 5px; - color: ${sc.base05}; - } + button { + background-color: ${sc.base00}; + background-repeat: no-repeat; + background-position: center; + background-size: 25%; + box-shadow: none; + margin: 5px; + color: ${sc.base05}; + } - button:hover { - background-color: ${sc.base01}; - color: ${sc.base05}; - } + button:hover { + background-color: ${sc.base01}; + color: ${sc.base05}; + } - button:focus { - background-color: ${sc.base02}; - color: ${sc.base05}; - } + button:focus { + background-color: ${sc.base02}; + color: ${sc.base05}; + } - #shutdown { - background-image: url("${shutdownIcon}"); - } + #shutdown { + background-image: url("${shutdownIcon}"); + } - #reboot { - background-image: url("${rebootIcon}"); - } + #reboot { + background-image: url("${rebootIcon}"); + } - #logout { - background-image: url("${logoutIcon}"); - } - ''; + #logout { + background-image: url("${logoutIcon}"); + } + ''; }; } diff --git a/home/emacs/emacs-packages.nix b/home/emacs/emacs-packages.nix index d85957d1..2da2a60b 100644 --- a/home/emacs/emacs-packages.nix +++ b/home/emacs/emacs-packages.nix @@ -1,5 +1,4 @@ -epkgs: -with epkgs; [ +epkgs: with epkgs; [ # UI base16-theme all-the-icons diff --git a/home/emacs/luarocks/graph-toolkit.nix b/home/emacs/luarocks/graph-toolkit.nix index c0c8dd54..78c5eb05 100644 --- a/home/emacs/luarocks/graph-toolkit.nix +++ b/home/emacs/luarocks/graph-toolkit.nix @@ -14,24 +14,36 @@ buildLuarocksPackage { (fetchurl { url = "mirror://luarocks/graph-toolkit-scm-1.rockspec"; sha256 = "0hsrf7k45w8ri18mdrx44mv1kr4zfr5mg76cxi8nnr30ssrblvgb"; - }) - .outPath; - src = fetchgit (removeAttrs (builtins.fromJSON '' { - "url": "https://github.com/franko/graph-toolkit", - "rev": "126a11bdbb98faf785c373516a288b7fa609f824", - "date": "2015-01-02T08:44:01-08:00", - "path": "/nix/store/gbwbjrl4j42kaqk3pjzvmckmr6dimkd0-graph-toolkit", - "sha256": "1pqjpqfandi7brk2213vlq891bl8drb0q32m5wmf0l21li0l4zrp", - "hash": "sha256-N39CQaRBUOAqL1UMDFZuiK6QEKZ7BCFmXic2qxy+Et8=", - "fetchLFS": false, - "fetchSubmodules": true, - "deepClone": false, - "leaveDotGit": false - } - '') ["date" "path" "sha256"]); + }).outPath; + src = fetchgit ( + removeAttrs + (builtins.fromJSON '' + { + "url": "https://github.com/franko/graph-toolkit", + "rev": "126a11bdbb98faf785c373516a288b7fa609f824", + "date": "2015-01-02T08:44:01-08:00", + "path": "/nix/store/gbwbjrl4j42kaqk3pjzvmckmr6dimkd0-graph-toolkit", + "sha256": "1pqjpqfandi7brk2213vlq891bl8drb0q32m5wmf0l21li0l4zrp", + "hash": "sha256-N39CQaRBUOAqL1UMDFZuiK6QEKZ7BCFmXic2qxy+Et8=", + "fetchLFS": false, + "fetchSubmodules": true, + "deepClone": false, + "leaveDotGit": false + } + '') + [ + "date" + "path" + "sha256" + ] + ); disabled = luaOlder "5.1"; - propagatedBuildInputs = [lua agg freetype]; + propagatedBuildInputs = [ + lua + agg + freetype + ]; meta = { homepage = "http://franko.github.io/graph-toolkit/"; diff --git a/home/emacs/luarocks/scilua.nix b/home/emacs/luarocks/scilua.nix index bb46baa8..b423e1a2 100644 --- a/home/emacs/luarocks/scilua.nix +++ b/home/emacs/luarocks/scilua.nix @@ -6,29 +6,33 @@ callPackage, luajit, openblas, -}: let - xsys = callPackage ./xsys.nix {}; +}: +let + xsys = callPackage ./xsys.nix { }; in - buildLuarocksPackage { - pname = "sci"; - version = "1.0.0.beta12-1"; - knownRockspec = - (fetchurl { - url = "mirror://luarocks/sci-1.0.0.beta12-1.rockspec"; - sha256 = "0lprn9x4zw767hdz8lyxmwrrfyn5xj3x50pm9b4qiwy8992mg00r"; - }) - .outPath; - src = fetchurl { - url = "https://github.com/stepelu/lua-sci/archive/v1.0.0-beta12.tar.gz"; - sha256 = "0a45r7n13gfqckpdp1bmizqvjadn8nc5d6ff9gjw860g3i75sy2h"; - }; +buildLuarocksPackage { + pname = "sci"; + version = "1.0.0.beta12-1"; + knownRockspec = + (fetchurl { + url = "mirror://luarocks/sci-1.0.0.beta12-1.rockspec"; + sha256 = "0lprn9x4zw767hdz8lyxmwrrfyn5xj3x50pm9b4qiwy8992mg00r"; + }).outPath; + src = fetchurl { + url = "https://github.com/stepelu/lua-sci/archive/v1.0.0-beta12.tar.gz"; + sha256 = "0a45r7n13gfqckpdp1bmizqvjadn8nc5d6ff9gjw860g3i75sy2h"; + }; - disabled = (luaOlder "5.1") || (luaAtLeast "5.4"); - propagatedBuildInputs = [luajit xsys openblas]; + disabled = (luaOlder "5.1") || (luaAtLeast "5.4"); + propagatedBuildInputs = [ + luajit + xsys + openblas + ]; - meta = { - homepage = "https://github.com/stepelu/lua-sci"; - description = "Scientific Computing with LuaJIT"; - license.fullName = "MIT"; - }; - } + meta = { + homepage = "https://github.com/stepelu/lua-sci"; + description = "Scientific Computing with LuaJIT"; + license.fullName = "MIT"; + }; +} diff --git a/home/emacs/luarocks/xsys.nix b/home/emacs/luarocks/xsys.nix index 6dc41c2c..a43daac3 100644 --- a/home/emacs/luarocks/xsys.nix +++ b/home/emacs/luarocks/xsys.nix @@ -12,15 +12,14 @@ buildLuarocksPackage { (fetchurl { url = "mirror://luarocks/xsys-1.0.2-1.rockspec"; sha256 = "0jlyrwbzh6fi68msdynp4bbihyww4i3yk0qh859xlwqhfy5cza7p"; - }) - .outPath; + }).outPath; src = fetchurl { url = "https://github.com/stepelu/lua-xsys/archive/v1.0.2.tar.gz"; sha256 = "1zwrlp6bghq8c12kyqc1ic7mrn8lf3d42755h8q2wxwhy1i3xqyh"; }; disabled = (luaOlder "5.1") || (luaAtLeast "5.4"); - propagatedBuildInputs = [luajit]; + propagatedBuildInputs = [ luajit ]; meta = { homepage = "http://scilua.org/xsys.html"; diff --git a/home/games/default.nix b/home/games/default.nix index 5acf67a2..a3bbfbb3 100644 --- a/home/games/default.nix +++ b/home/games/default.nix @@ -1,10 +1,11 @@ -{pkgs, ...}: { +{ pkgs, ... }: +{ home.packages = with pkgs; [ prismlauncher cartridges (lutris.override { steamSupport = false; - extraPkgs = pkgs: with pkgs; [wineWowPackages.waylandFull]; + extraPkgs = pkgs: with pkgs; [ wineWowPackages.waylandFull ]; }) ]; } diff --git a/home/personal.nix b/home/personal.nix index f1c002ef..c448f4f9 100644 --- a/home/personal.nix +++ b/home/personal.nix @@ -1,5 +1,6 @@ -{pkgs, ...}: { - imports = [./default.nix]; +{ pkgs, ... }: +{ + imports = [ ./default.nix ]; home.packages = with pkgs; [ kdePackages.ktorrent prusa-slicer diff --git a/home/scripts/default.nix b/home/scripts/default.nix index e6d5319c..74a264a8 100644 --- a/home/scripts/default.nix +++ b/home/scripts/default.nix @@ -1,12 +1,10 @@ -{pkgs, ...}: { +{ pkgs, ... }: +{ home = { packages = [ - (pkgs.writeShellScriptBin "git-sync-all" - (builtins.readFile ./shell/git-sync-all.sh)) - (pkgs.writeShellScriptBin "rsync-local-config" - (builtins.readFile ./shell/rsync-local-config.sh)) - (pkgs.writeShellScriptBin "xdg-query-program" - (builtins.readFile ./shell/xdg-query-program.sh)) + (pkgs.writeShellScriptBin "git-sync-all" (builtins.readFile ./shell/git-sync-all.sh)) + (pkgs.writeShellScriptBin "rsync-local-config" (builtins.readFile ./shell/rsync-local-config.sh)) + (pkgs.writeShellScriptBin "xdg-query-program" (builtins.readFile ./shell/xdg-query-program.sh)) ]; shellAliases = { gsa = "git-sync-all"; diff --git a/home/scripts/ukaea-vpn.nix b/home/scripts/ukaea-vpn.nix index dfad4f74..aab811bc 100644 --- a/home/scripts/ukaea-vpn.nix +++ b/home/scripts/ukaea-vpn.nix @@ -1,2 +1,2 @@ -pkgs: (pkgs.writeShellScriptBin "ukaea-vpn-connect" - "sudo ${pkgs.openfortivpn}/bin/openfortivpn -c ${./ukaea-vpn.conf}") +pkgs: +(pkgs.writeShellScriptBin "ukaea-vpn-connect" "sudo ${pkgs.openfortivpn}/bin/openfortivpn -c ${./ukaea-vpn.conf}") diff --git a/home/services/email/default.nix b/home/services/email/default.nix index 50f605c5..1582376e 100644 --- a/home/services/email/default.nix +++ b/home/services/email/default.nix @@ -1,12 +1,8 @@ +{ config, pkgs, ... }: { - config, - pkgs, - ... -}: { home.packages = with pkgs; [ protonmail-bridge-gui - (writeShellScriptBin "mbsync-ensure-pass" - (builtins.readFile ./mbsync-ensure-pass.sh)) + (writeShellScriptBin "mbsync-ensure-pass" (builtins.readFile ./mbsync-ensure-pass.sh)) (writeShellScriptBin "davmail-setup" '' systemctl --user restart davmail # Ensure config file is present systemctl --user stop davmail @@ -19,112 +15,132 @@ }; accounts.email = { maildirBasePath = "Mail"; - accounts = let - realName = "Evie Litherland-Smith"; - in { - proton = let - address = "e.litherlandsmith@proton.me"; - host = "127.0.0.1"; - tls.enable = false; - in { - inherit realName address; - primary = true; - maildir.path = "Proton"; - imap = { - inherit host tls; - port = 1143; - }; - smtp = { - inherit host tls; - port = 1025; - }; - aliases = ["evie@xenia.me.uk" "evie@litherlandsmith.slmail.me"]; - userName = address; - passwordCommand = "${pkgs.libsecret}/bin/secret-tool lookup email ${address}"; - mu.enable = true; - msmtp = { - enable = true; - extraConfig = { - tls = "off"; - auth = "login"; + accounts = + let + realName = "Evie Litherland-Smith"; + in + { + proton = + let + address = "e.litherlandsmith@proton.me"; + host = "127.0.0.1"; + tls.enable = false; + in + { + inherit realName address; + primary = true; + maildir.path = "Proton"; + imap = { + inherit host tls; + port = 1143; + }; + smtp = { + inherit host tls; + port = 1025; + }; + aliases = [ + "evie@xenia.me.uk" + "evie@litherlandsmith.slmail.me" + ]; + userName = address; + passwordCommand = "${pkgs.libsecret}/bin/secret-tool lookup email ${address}"; + mu.enable = true; + msmtp = { + enable = true; + extraConfig = { + tls = "off"; + auth = "login"; + }; + }; + mbsync = { + enable = true; + create = "both"; + expunge = "both"; + remove = "both"; + patterns = [ + "*" + "!All Mail" + "!Labels*" + "!Starred" + "!Recovered Messages" + ]; + subFolders = "Verbatim"; + extraConfig.account.AuthMechs = "LOGIN"; + }; }; - }; - mbsync = { - enable = true; - create = "both"; - expunge = "both"; - remove = "both"; - patterns = ["*" "!All Mail" "!Labels*" "!Starred" "!Recovered Messages"]; - subFolders = "Verbatim"; - extraConfig.account.AuthMechs = "LOGIN"; - }; - }; - icloud = let - address = "e.litherlandsmith@icloud.com"; - in { - inherit realName address; - primary = false; - maildir.path = "iCloud"; - imap.host = "imap.mail.me.com"; - smtp.host = "smtp.mail.me.com"; - userName = address; - passwordCommand = "${pkgs.libsecret}/bin/secret-tool lookup email ${address}"; - mu.enable = true; - msmtp.enable = true; - mbsync = { - enable = true; - create = "both"; - expunge = "both"; - remove = "both"; - patterns = ["*" "!Notes"]; - subFolders = "Verbatim"; - }; - }; - outlook = let - address = "evie.litherland-smith@ukaea.uk"; - host = "127.0.0.1"; - tls.enable = false; - in { - inherit realName address; - primary = false; - maildir.path = "Outlook"; - imap = { - inherit host tls; - port = 1144; - }; - smtp = { - inherit host tls; - port = 1026; - }; - aliases = ["elitherl@jet.uk"]; - userName = address; - passwordCommand = "${pkgs.libsecret}/bin/secret-tool lookup email ${address}"; - mu.enable = true; - msmtp = { - enable = true; - extraConfig = { - tls = "off"; - auth = "login"; + icloud = + let + address = "e.litherlandsmith@icloud.com"; + in + { + inherit realName address; + primary = false; + maildir.path = "iCloud"; + imap.host = "imap.mail.me.com"; + smtp.host = "smtp.mail.me.com"; + userName = address; + passwordCommand = "${pkgs.libsecret}/bin/secret-tool lookup email ${address}"; + mu.enable = true; + msmtp.enable = true; + mbsync = { + enable = true; + create = "both"; + expunge = "both"; + remove = "both"; + patterns = [ + "*" + "!Notes" + ]; + subFolders = "Verbatim"; + }; + }; + outlook = + let + address = "evie.litherland-smith@ukaea.uk"; + host = "127.0.0.1"; + tls.enable = false; + in + { + inherit realName address; + primary = false; + maildir.path = "Outlook"; + imap = { + inherit host tls; + port = 1144; + }; + smtp = { + inherit host tls; + port = 1026; + }; + aliases = [ "elitherl@jet.uk" ]; + userName = address; + passwordCommand = "${pkgs.libsecret}/bin/secret-tool lookup email ${address}"; + mu.enable = true; + msmtp = { + enable = true; + extraConfig = { + tls = "off"; + auth = "login"; + }; + }; + mbsync = { + enable = true; + create = "both"; + expunge = "both"; + remove = "both"; + patterns = [ + "*" + "!Conversation History" + "!Snoozed" + "!Social Activity Notifications" + "!Sync Issues*" + "!Unsent Messages" + ]; + subFolders = "Verbatim"; + extraConfig.account.AuthMechs = "LOGIN"; + }; }; - }; - mbsync = { - enable = true; - create = "both"; - expunge = "both"; - remove = "both"; - patterns = [ - "*" - "!Conversation History" - "!Snoozed" - "!Social Activity Notifications" - "!Sync Issues*" - "!Unsent Messages" - ]; - subFolders = "Verbatim"; - extraConfig.account.AuthMechs = "LOGIN"; - }; }; - }; }; programs = { mu.enable = true; @@ -132,26 +148,26 @@ mbsync = { enable = true; groups.inboxes = { - proton = ["INBOX"]; - icloud = ["INBOX"]; - outlook = ["INBOX"]; + proton = [ "INBOX" ]; + icloud = [ "INBOX" ]; + outlook = [ "INBOX" ]; }; }; }; systemd.user.services.davmail = { 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" ''; ExecStart = "${pkgs.davmail}/bin/davmail -notray ${config.home.homeDirectory}/.davmail.properties"; }; - Install.WantedBy = ["default.target"]; + Install.WantedBy = [ "default.target" ]; }; } diff --git a/home/services/password-store/default.nix b/home/services/password-store/default.nix index 0eec40d8..278fd499 100644 --- a/home/services/password-store/default.nix +++ b/home/services/password-store/default.nix @@ -3,16 +3,19 @@ lib, pkgs, ... -}: { - xdg.configFile."pass-git-helper/git-pass-mapping.ini".source = - ./git-pass-mapping.ini; +}: +{ + 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-update pass-import]); # pass-audit + package = pkgs.pass-nodmenu.withExtensions ( + exts: with exts; [ + pass-update + pass-import + ] + ); # pass-audit settings = { PASSWORD_STORE_DIR = "${config.home.homeDirectory}/.password-store"; PASSWORD_STORE_ENABLE_EXTENSIONS = "true"; diff --git a/home/shell/bottom.nix b/home/shell/bottom.nix index cb606628..816f8c39 100644 --- a/home/shell/bottom.nix +++ b/home/shell/bottom.nix @@ -1,8 +1,5 @@ +{ config, accentColourName, ... }: { - config, - accentColourName, - ... -}: { programs.bottom = { enable = true; settings = { @@ -13,33 +10,42 @@ enable_gpu = true; enable_cache_memory = true; }; - colors = let - sc = config.scheme.withHashtag; - rainbow = with sc; [red yellow green cyan blue magenta]; - in { - table_header_color = sc.base05; - all_cpu_color = sc.base05; - avg_cpu_color = sc.base05; - cpu_core_colors = rainbow; - ram_color = sc.red; - cache_color = sc.green; - swap_color = sc.blue; - rx_color = sc.green; - tx_color = sc.blue; - widget_title_color = sc.${accentColourName}; - border_color = sc.base02; - highlighted_border_color = sc.${accentColourName}; - text_color = sc.base05; - graph_color = sc.base04; - cursor_color = sc.base02; - selected_text_color = sc.base05; - selected_bg_color = sc.base01; - high_battery_color = sc.green; - medium_battery_color = sc.yellow; - low_battery_color = sc.red; - gpu_core_colors = rainbow; - arc_color = sc.cyan; - }; + colors = + let + sc = config.scheme.withHashtag; + rainbow = with sc; [ + red + yellow + green + cyan + blue + magenta + ]; + in + { + table_header_color = sc.base05; + all_cpu_color = sc.base05; + avg_cpu_color = sc.base05; + cpu_core_colors = rainbow; + ram_color = sc.red; + cache_color = sc.green; + swap_color = sc.blue; + rx_color = sc.green; + tx_color = sc.blue; + widget_title_color = sc.${accentColourName}; + border_color = sc.base02; + highlighted_border_color = sc.${accentColourName}; + text_color = sc.base05; + graph_color = sc.base04; + cursor_color = sc.base02; + selected_text_color = sc.base05; + selected_bg_color = sc.base01; + high_battery_color = sc.green; + medium_battery_color = sc.yellow; + low_battery_color = sc.red; + gpu_core_colors = rainbow; + arc_color = sc.cyan; + }; }; }; } diff --git a/home/shell/default.nix b/home/shell/default.nix index 55eb98c9..4079c032 100644 --- a/home/shell/default.nix +++ b/home/shell/default.nix @@ -1,4 +1,5 @@ -{pkgs, ...}: { +{ pkgs, ... }: +{ imports = [ ./bottom.nix ./fastfetch.nix @@ -28,7 +29,7 @@ enable = true; git = true; icons = true; - extraOptions = ["--octal-permissions"]; + extraOptions = [ "--octal-permissions" ]; }; direnv = { enable = true; diff --git a/home/shell/fastfetch.nix b/home/shell/fastfetch.nix index f704a0dd..8429298b 100644 --- a/home/shell/fastfetch.nix +++ b/home/shell/fastfetch.nix @@ -1,6 +1,7 @@ -{...}: { +{ ... }: +{ programs.fastfetch = { enable = true; - settings = {}; + settings = { }; }; } diff --git a/home/shell/git.nix b/home/shell/git.nix index a5f53375..a462f258 100644 --- a/home/shell/git.nix +++ b/home/shell/git.nix @@ -3,45 +3,54 @@ lib, pkgs, ... -}: { +}: +{ services.git-sync.enable = false; # Can't find pass for some reason... - programs.git = let - package = pkgs.git.override { - withLibsecret = true; - withSsh = true; - }; - in { - inherit package; - enable = true; - userName = "Evie Litherland-Smith"; - userEmail = lib.mkDefault "evie@xenia.me.uk"; - delta = { + programs.git = + let + package = pkgs.git.override { + withLibsecret = true; + withSsh = true; + }; + in + { + inherit package; enable = true; - options = { - line-numbers = true; - hyprlinks = true; - navigate = true; - side-by-side = true; - syntax-theme = with config.programs; lib.mkIf bat.enable bat.config.theme; + userName = "Evie Litherland-Smith"; + userEmail = lib.mkDefault "evie@xenia.me.uk"; + delta = { + enable = true; + options = { + line-numbers = true; + hyprlinks = true; + navigate = true; + side-by-side = true; + syntax-theme = with config.programs; lib.mkIf bat.enable bat.config.theme; + }; }; + attributes = [ + "*.gpg filter=gpg diff=gpg" + "*.asc filter=gpg diff=gpg" + ]; + extraConfig = + let + user = "pixelifytica"; + in + { + github = { + inherit user; + }; + gitea = { + inherit user; + }; + pull.rebase = false; + init.defaultBranch = "main"; + merge.conflictstyle = "diff3"; + credential.helper = "${package}/bin/git-credential-libsecret"; + diff = { + colorMoved = "default"; + gpg.textconv = "gpg --no-tty --decrypt"; + }; + }; }; - attributes = [ - "*.gpg filter=gpg diff=gpg" - "*.asc filter=gpg diff=gpg" - ]; - extraConfig = let - user = "pixelifytica"; - in { - github = {inherit user;}; - gitea = {inherit user;}; - pull.rebase = false; - init.defaultBranch = "main"; - merge.conflictstyle = "diff3"; - credential.helper = "${package}/bin/git-credential-libsecret"; - diff = { - colorMoved = "default"; - gpg.textconv = "gpg --no-tty --decrypt"; - }; - }; - }; } diff --git a/home/shell/ssh.nix b/home/shell/ssh.nix index 5a63b079..19a35668 100644 --- a/home/shell/ssh.nix +++ b/home/shell/ssh.nix @@ -1,7 +1,7 @@ -{pkgs, ...}: { +{ pkgs, ... }: +{ home.packages = with pkgs; [ - (writeShellScriptBin "ssh-keygen-defaults" - ''ssh-keygen -t ed25519 -C "$(whoami)@$(hostname)"'') + (writeShellScriptBin "ssh-keygen-defaults" ''ssh-keygen -t ed25519 -C "$(whoami)@$(hostname)"'') ]; programs.ssh = { enable = true; diff --git a/home/shell/starship.nix b/home/shell/starship.nix index f5175a48..29fa4fb3 100644 --- a/home/shell/starship.nix +++ b/home/shell/starship.nix @@ -1,4 +1,5 @@ -{...}: { +{ ... }: +{ programs.starship = { enable = true; enableTransience = false; @@ -15,17 +16,24 @@ fish_style_pwd_dir_length = 1; truncate_to_repo = false; }; - direnv = {disabled = false;}; + direnv = { + disabled = false; + }; git_branch = { only_attached = true; - ignore_branches = ["master" "main"]; + ignore_branches = [ + "master" + "main" + ]; }; git_commit = { format = "[ $hash | $tag]($style) "; tag_symbol = " "; tag_disabled = false; }; - git_metrics = {disabled = false;}; + git_metrics = { + disabled = false; + }; git_status = { stashed = " "; ahead = " "; @@ -44,10 +52,18 @@ ssh_only = false; ssh_symbol = "󰢹 "; }; - jobs = {symbol = "󰈏 ";}; - line_break = {disabled = false;}; - localip = {disabled = false;}; - memory_usage = {disabled = false;}; + jobs = { + symbol = "󰈏 "; + }; + line_break = { + disabled = false; + }; + localip = { + disabled = false; + }; + memory_usage = { + disabled = false; + }; os = { disabled = false; format = "on [$symbol]($style) "; @@ -69,7 +85,9 @@ map_symbol = true; pipestatus = true; }; - sudo = {disabled = false;}; + sudo = { + disabled = false; + }; }; }; } diff --git a/home/shell/zellij.nix b/home/shell/zellij.nix index bbdfe5eb..5c864e43 100644 --- a/home/shell/zellij.nix +++ b/home/shell/zellij.nix @@ -1,13 +1,18 @@ +{ config, lib, ... }: { - config, - lib, - ... -}: { programs.zellij = { enable = true; settings = { themes.base16 = with config.scheme.withHashtag; rec { - inherit red green yellow blue magenta cyan orange; + inherit + red + green + yellow + blue + magenta + cyan + orange + ; black = base00; bg = black; white = base05; diff --git a/home/shell/zsh.nix b/home/shell/zsh.nix index 3f9a83c6..640e9be8 100644 --- a/home/shell/zsh.nix +++ b/home/shell/zsh.nix @@ -1,4 +1,5 @@ -{...}: { +{ ... }: +{ programs.zsh = { enable = true; enableCompletion = true; @@ -7,7 +8,10 @@ defaultKeymap = "emacs"; syntaxHighlighting = { enable = true; - highlighters = ["brackets" "cursor"]; + highlighters = [ + "brackets" + "cursor" + ]; }; historySubstringSearch.enable = true; history = { diff --git a/home/streaming/default.nix b/home/streaming/default.nix index d5cc4ea2..5fb7e44a 100644 --- a/home/streaming/default.nix +++ b/home/streaming/default.nix @@ -1,10 +1,13 @@ -{pkgs, ...}: { - home.packages = with pkgs; - with kdePackages; [ - helvum - kdenlive - krita - ]; +{ pkgs, ... }: +{ + home.packages = + with pkgs; + with kdePackages; + [ + helvum + kdenlive + krita + ]; programs.obs-studio = { enable = true; plugins = with pkgs.obs-studio-plugins; [ diff --git a/home/work.nix b/home/work.nix index 8e4578af..dd39a7d4 100644 --- a/home/work.nix +++ b/home/work.nix @@ -3,8 +3,9 @@ lib, pkgs, ... -}: { - imports = [./default.nix]; +}: +{ + imports = [ ./default.nix ]; home.packages = with pkgs; [ twinkle (import ./scripts/ukaea-vpn.nix pkgs) diff --git a/system/Legion.nix b/system/Legion.nix index bf79d8ae..e765b26f 100644 --- a/system/Legion.nix +++ b/system/Legion.nix @@ -1,4 +1,5 @@ -{...}: { +{ ... }: +{ imports = [ ./services/caddy.nix ./services/forgejo.nix diff --git a/system/Northstar.nix b/system/Northstar.nix index b433d6e4..56577ee6 100644 --- a/system/Northstar.nix +++ b/system/Northstar.nix @@ -1,4 +1,5 @@ -{...}: { +{ ... }: +{ imports = [ ./laptop.nix ./desktop/plasma.nix diff --git a/system/Scorch.nix b/system/Scorch.nix index 4fb32e16..bba0c7be 100644 --- a/system/Scorch.nix +++ b/system/Scorch.nix @@ -1,9 +1,12 @@ -{pkgs, ...}: { - imports = [./desktop/plasma.nix]; +{ pkgs, ... }: +{ + imports = [ ./desktop/plasma.nix ]; boot = { loader.efi.efiSysMountPoint = "/boot/efi"; initrd = { - secrets = {"/crypto_keyfile.bin" = null;}; + secrets = { + "/crypto_keyfile.bin" = null; + }; luks.devices."luks-47d34268-5100-4eba-b34d-220f4239c1cb" = { device = "/dev/disk/by-uuid/47d34268-5100-4eba-b34d-220f4239c1cb"; keyFile = "/crypto_keyfile.bin"; @@ -14,6 +17,9 @@ etc."ppp/options".text = '' ipcp-accept-remote ''; - systemPackages = with pkgs; [openfortivpn samba]; + systemPackages = with pkgs; [ + openfortivpn + samba + ]; }; } diff --git a/system/Tone.nix b/system/Tone.nix index 02504e20..c96fa292 100644 --- a/system/Tone.nix +++ b/system/Tone.nix @@ -1,10 +1,13 @@ -{pkgs, ...}: { +{ pkgs, ... }: +{ imports = [ ./laptop.nix ./desktop/plasma.nix ]; boot.initrd = { - secrets = {"/crypto_keyfile.bin" = null;}; + secrets = { + "/crypto_keyfile.bin" = null; + }; luks.devices."luks-761eeb11-3091-4142-9232-4fb33165eccd" = { device = "/dev/disk/by-uuid/761eeb11-3091-4142-9232-4fb33165eccd"; keyFile = "/crypto_keyfile.bin"; @@ -14,7 +17,7 @@ etc."ppp/options".text = '' ipcp-accept-remote ''; - systemPackages = with pkgs; [openfortivpn]; + systemPackages = with pkgs; [ openfortivpn ]; }; services = { samba.enable = true; diff --git a/system/Vanguard.nix b/system/Vanguard.nix index 62d7fcdd..b224ef5a 100644 --- a/system/Vanguard.nix +++ b/system/Vanguard.nix @@ -1,8 +1,9 @@ -{config, ...}: { - imports = [./desktop/plasma.nix]; +{ config, ... }: +{ + imports = [ ./desktop/plasma.nix ]; boot = { - initrd.kernelModules = ["amdgpu"]; - extraModulePackages = with config.boot.kernelPackages; [v4l2loopback]; + initrd.kernelModules = [ "amdgpu" ]; + extraModulePackages = with config.boot.kernelPackages; [ v4l2loopback ]; extraModprobeConfig = '' options v4l2loopback devices=1 video_nr=1 card_label="OBS Cam" exclusive_caps=1 ''; diff --git a/system/default.nix b/system/default.nix index 2721ea19..cdea3bd0 100644 --- a/system/default.nix +++ b/system/default.nix @@ -3,14 +3,18 @@ pkgs, iosevkaCustom, ... -}: { +}: +{ nix = { enable = true; settings = { cores = 0; max-jobs = "auto"; - trusted-users = ["root"]; - experimental-features = ["nix-command" "flakes"]; + trusted-users = [ "root" ]; + experimental-features = [ + "nix-command" + "flakes" + ]; auto-optimise-store = true; }; channel.enable = true; @@ -64,7 +68,7 @@ networking = { networkmanager.enable = true; firewall.enable = true; - nameservers = ["9.9.9.9"]; + nameservers = [ "9.9.9.9" ]; }; users.users.root.openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINI1dWlS16Keil0MGPWmMsBzx8F9ylfz+fRwxUr8/tZ/ ion" @@ -72,7 +76,7 @@ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICPypUUGVAdpl0SHrUDVw0RureuFNsljrXQvrf0uc055 pixelifytica@Northstar" ]; environment = { - pathsToLink = ["/share/zsh"]; + pathsToLink = [ "/share/zsh" ]; sessionVariables = { XDG_CONFIG_HOME = "$HOME/.config"; XDG_CACHE_HOME = "$HOME/.cache"; @@ -121,23 +125,25 @@ i18n.defaultLocale = "en_GB.UTF-8"; console.useXkbConfig = true; fonts = { - packages = with pkgs; - with iosevkaCustom.packages; [ - iosevka-custom-nerdfont - iosevka-custom-aile - emacs-all-the-icons-fonts # Emacs - weather-icons # Emacs - lmodern # LaTeX - noto-fonts-emoji # Emoji - (nerdfonts.override {fonts = ["NerdFontsSymbolsOnly"];}) - ]; + packages = + with pkgs; + with iosevkaCustom.packages; + [ + iosevka-custom-nerdfont + iosevka-custom-aile + emacs-all-the-icons-fonts # Emacs + weather-icons # Emacs + lmodern # LaTeX + noto-fonts-emoji # Emoji + (nerdfonts.override { fonts = [ "NerdFontsSymbolsOnly" ]; }) + ]; fontconfig = { enable = true; defaultFonts = with iosevkaCustom.names; { - serif = [iosevka-custom-aile]; - sansSerif = [iosevka-custom-aile]; - monospace = [iosevka-custom-nerdfont]; - emoji = ["Noto Color Emoji"]; + serif = [ iosevka-custom-aile ]; + sansSerif = [ iosevka-custom-aile ]; + monospace = [ iosevka-custom-nerdfont ]; + emoji = [ "Noto Color Emoji" ]; }; }; }; diff --git a/system/desktop/default.nix b/system/desktop/default.nix index dfd633a7..a288f465 100644 --- a/system/desktop/default.nix +++ b/system/desktop/default.nix @@ -3,7 +3,8 @@ lib, pkgs, ... -}: { +}: +{ nixpkgs.config.chromium.commandLineArgs = "--enable-features=UseOzonePlatform --ozone-platform=wayland"; system.autoUpgrade.operation = "boot"; hardware.bluetooth.enable = true; diff --git a/system/desktop/plasma.nix b/system/desktop/plasma.nix index 6acc6a53..f1048447 100644 --- a/system/desktop/plasma.nix +++ b/system/desktop/plasma.nix @@ -1,6 +1,7 @@ -{pkgs, ...}: { - imports = [./default.nix]; - environment.plasma6.excludePackages = with pkgs.kdePackages; [plasma-browser-integration]; +{ pkgs, ... }: +{ + imports = [ ./default.nix ]; + environment.plasma6.excludePackages = with pkgs.kdePackages; [ plasma-browser-integration ]; services = { displayManager.sddm = { enable = true; diff --git a/system/desktop/sway.nix b/system/desktop/sway.nix index 5c938ad6..44348235 100644 --- a/system/desktop/sway.nix +++ b/system/desktop/sway.nix @@ -1,9 +1,6 @@ +{ lib, pkgs, ... }: { - lib, - pkgs, - ... -}: { - imports = [./default.nix]; + imports = [ ./default.nix ]; environment = { sessionVariables.GRIM_DEFAULT_DIR = "$HOME/Pictures/Grim"; systemPackages = with pkgs; [ @@ -19,7 +16,7 @@ brightnessctl ]; }; - security.pam.services.swaylock = {}; + security.pam.services.swaylock = { }; programs = { light.enable = true; nm-applet.enable = true; @@ -33,16 +30,16 @@ }; sway = { enable = true; - package = - pkgs.swayfx.overrideAttrs - (old: {passthru.providedSessions = ["sway"];}); - extraPackages = []; + package = pkgs.swayfx.overrideAttrs (old: { + passthru.providedSessions = [ "sway" ]; + }); + extraPackages = [ ]; wrapperFeatures.gtk = true; xwayland.enable = true; }; }; services = { - dbus.packages = with pkgs; [gcr]; + dbus.packages = with pkgs; [ gcr ]; gnome.gnome-keyring.enable = true; blueman.enable = true; accounts-daemon.enable = true; @@ -54,12 +51,18 @@ }; greetd = { enable = true; - settings = let - command = "sway"; - in { - initial_session = {inherit command;}; - default_session = {inherit command;}; - }; + settings = + let + command = "sway"; + in + { + initial_session = { + inherit command; + }; + default_session = { + inherit command; + }; + }; }; }; qt = { @@ -70,6 +73,6 @@ xdg.portal = { enable = true; config.common.default = "*"; # TODO change for xdg-desktop-portal > 1.17 changes - extraPortals = [pkgs.xdg-desktop-portal-gtk]; + extraPortals = [ pkgs.xdg-desktop-portal-gtk ]; }; } diff --git a/system/hardware-configuration/Legion.nix b/system/hardware-configuration/Legion.nix index 6558c46f..860486e0 100644 --- a/system/hardware-configuration/Legion.nix +++ b/system/hardware-configuration/Legion.nix @@ -1,32 +1,44 @@ # Do not modify this file! It was generated by ‘nixos-generate-config’ # and may be overwritten by future invocations. Please make changes # to /etc/nixos/configuration.nix instead. -{ config, lib, pkgs, modulesPath, ... }: +{ + config, + lib, + pkgs, + modulesPath, + ... +}: { - imports = - [ (modulesPath + "/installer/scan/not-detected.nix") - ]; + imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; - boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ]; + boot.initrd.availableKernelModules = [ + "xhci_pci" + "ahci" + "nvme" + "usbhid" + "usb_storage" + "sd_mod" + ]; boot.initrd.kernelModules = [ ]; boot.kernelModules = [ "kvm-intel" ]; boot.extraModulePackages = [ ]; - fileSystems."/" = - { device = "/dev/disk/by-uuid/b9d4ba04-a867-4ca6-88f9-79dc6a982e94"; - fsType = "ext4"; - }; + fileSystems."/" = { + device = "/dev/disk/by-uuid/b9d4ba04-a867-4ca6-88f9-79dc6a982e94"; + fsType = "ext4"; + }; - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/8F05-4C3A"; - fsType = "vfat"; - options = [ "fmask=0022" "dmask=0022" ]; - }; - - swapDevices = - [ { device = "/dev/disk/by-uuid/a10ee1da-3b0d-4f6b-b20a-d6a32ae1f668"; } + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/8F05-4C3A"; + fsType = "vfat"; + options = [ + "fmask=0022" + "dmask=0022" ]; + }; + + swapDevices = [ { device = "/dev/disk/by-uuid/a10ee1da-3b0d-4f6b-b20a-d6a32ae1f668"; } ]; # Enables DHCP on each ethernet and wireless interface. In case of scripted networking # (the default) this is the recommended approach. When using systemd-networkd it's diff --git a/system/hardware-configuration/Northstar.nix b/system/hardware-configuration/Northstar.nix index 1c73cd98..2b46114e 100644 --- a/system/hardware-configuration/Northstar.nix +++ b/system/hardware-configuration/Northstar.nix @@ -1,34 +1,43 @@ # Do not modify this file! It was generated by ‘nixos-generate-config’ # and may be overwritten by future invocations. Please make changes # to /etc/nixos/configuration.nix instead. -{ config, lib, pkgs, modulesPath, ... }: +{ + config, + lib, + pkgs, + modulesPath, + ... +}: { - imports = - [ (modulesPath + "/installer/scan/not-detected.nix") - ]; + imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; - boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "rtsx_pci_sdmmc" ]; + boot.initrd.availableKernelModules = [ + "nvme" + "xhci_pci" + "rtsx_pci_sdmmc" + ]; boot.initrd.kernelModules = [ ]; boot.kernelModules = [ "kvm-amd" ]; boot.extraModulePackages = [ ]; - fileSystems."/" = - { device = "/dev/disk/by-uuid/84b28760-3643-4ad8-9ff6-ff78b57067f8"; - fsType = "ext4"; - }; + fileSystems."/" = { + device = "/dev/disk/by-uuid/84b28760-3643-4ad8-9ff6-ff78b57067f8"; + fsType = "ext4"; + }; boot.initrd.luks.devices."luks-d1062931-ee58-4848-adf9-09452daeb6eb".device = "/dev/disk/by-uuid/d1062931-ee58-4848-adf9-09452daeb6eb"; - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/ABE3-88E7"; - fsType = "vfat"; - options = [ "fmask=0022" "dmask=0022" ]; - }; - - swapDevices = - [ { device = "/dev/disk/by-uuid/ba43345c-a652-497f-84d0-86064805446b"; } + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/ABE3-88E7"; + fsType = "vfat"; + options = [ + "fmask=0022" + "dmask=0022" ]; + }; + + swapDevices = [ { device = "/dev/disk/by-uuid/ba43345c-a652-497f-84d0-86064805446b"; } ]; # Enables DHCP on each ethernet and wireless interface. In case of scripted networking # (the default) this is the recommended approach. When using systemd-networkd it's diff --git a/system/hardware-configuration/Scorch.nix b/system/hardware-configuration/Scorch.nix index 49a4b082..ee32fc32 100644 --- a/system/hardware-configuration/Scorch.nix +++ b/system/hardware-configuration/Scorch.nix @@ -1,13 +1,24 @@ # Do not modify this file! It was generated by ‘nixos-generate-config’ # and may be overwritten by future invocations. Please make changes # to /etc/nixos/configuration.nix instead. -{ config, lib, pkgs, modulesPath, ... }: +{ + config, + lib, + pkgs, + modulesPath, + ... +}: { imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; - boot.initrd.availableKernelModules = - [ "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ]; + boot.initrd.availableKernelModules = [ + "xhci_pci" + "ahci" + "usb_storage" + "usbhid" + "sd_mod" + ]; boot.initrd.kernelModules = [ ]; boot.kernelModules = [ "kvm-intel" ]; boot.extraModulePackages = [ ]; @@ -17,16 +28,14 @@ fsType = "ext4"; }; - boot.initrd.luks.devices."luks-08822b9c-e9d6-424c-bc75-373f8667526d".device = - "/dev/disk/by-uuid/08822b9c-e9d6-424c-bc75-373f8667526d"; + boot.initrd.luks.devices."luks-08822b9c-e9d6-424c-bc75-373f8667526d".device = "/dev/disk/by-uuid/08822b9c-e9d6-424c-bc75-373f8667526d"; fileSystems."/boot/efi" = { device = "/dev/disk/by-uuid/6009-89FC"; fsType = "vfat"; }; - swapDevices = - [{ device = "/dev/disk/by-uuid/ff9627a7-820c-4628-a040-2b665688b893"; }]; + swapDevices = [ { device = "/dev/disk/by-uuid/ff9627a7-820c-4628-a040-2b665688b893"; } ]; # Enables DHCP on each ethernet and wireless interface. In case of scripted networking # (the default) this is the recommended approach. When using systemd-networkd it's @@ -37,6 +46,5 @@ nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; - hardware.cpu.intel.updateMicrocode = - lib.mkDefault config.hardware.enableRedistributableFirmware; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; } diff --git a/system/hardware-configuration/Tone.nix b/system/hardware-configuration/Tone.nix index dd1ba100..14f1cd58 100644 --- a/system/hardware-configuration/Tone.nix +++ b/system/hardware-configuration/Tone.nix @@ -1,33 +1,44 @@ # Do not modify this file! It was generated by ‘nixos-generate-config’ # and may be overwritten by future invocations. Please make changes # to /etc/nixos/configuration.nix instead. -{ config, lib, pkgs, modulesPath, ... }: +{ + config, + lib, + pkgs, + modulesPath, + ... +}: { - imports = - [ (modulesPath + "/installer/scan/not-detected.nix") - ]; + imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; - boot.initrd.availableKernelModules = [ "xhci_pci" "thunderbolt" "vmd" "nvme" "usbhid" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ]; + boot.initrd.availableKernelModules = [ + "xhci_pci" + "thunderbolt" + "vmd" + "nvme" + "usbhid" + "usb_storage" + "sd_mod" + "rtsx_pci_sdmmc" + ]; boot.initrd.kernelModules = [ ]; boot.kernelModules = [ "kvm-intel" ]; boot.extraModulePackages = [ ]; - fileSystems."/" = - { device = "/dev/disk/by-uuid/44c11386-0af8-4954-93bc-963a8e071672"; - fsType = "ext4"; - }; + fileSystems."/" = { + device = "/dev/disk/by-uuid/44c11386-0af8-4954-93bc-963a8e071672"; + fsType = "ext4"; + }; boot.initrd.luks.devices."luks-bf1eab3a-6d92-430d-a282-8dd4c9efe2c7".device = "/dev/disk/by-uuid/bf1eab3a-6d92-430d-a282-8dd4c9efe2c7"; - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/85D5-B6EC"; - fsType = "vfat"; - }; + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/85D5-B6EC"; + fsType = "vfat"; + }; - swapDevices = - [ { device = "/dev/disk/by-uuid/e65e5e4d-2084-4e6b-9255-3b36cba1529f"; } - ]; + swapDevices = [ { device = "/dev/disk/by-uuid/e65e5e4d-2084-4e6b-9255-3b36cba1529f"; } ]; # Enables DHCP on each ethernet and wireless interface. In case of scripted networking # (the default) this is the recommended approach. When using systemd-networkd it's diff --git a/system/hardware-configuration/Vanguard.nix b/system/hardware-configuration/Vanguard.nix index 91770e04..a4c4b705 100644 --- a/system/hardware-configuration/Vanguard.nix +++ b/system/hardware-configuration/Vanguard.nix @@ -1,39 +1,51 @@ # Do not modify this file! It was generated by ‘nixos-generate-config’ # and may be overwritten by future invocations. Please make changes # to /etc/nixos/configuration.nix instead. -{ config, lib, pkgs, modulesPath, ... }: +{ + config, + lib, + pkgs, + modulesPath, + ... +}: { - imports = - [ (modulesPath + "/installer/scan/not-detected.nix") - ]; + imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; - boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" "sd_mod" "sr_mod" ]; + boot.initrd.availableKernelModules = [ + "xhci_pci" + "ahci" + "nvme" + "usbhid" + "sd_mod" + "sr_mod" + ]; boot.initrd.kernelModules = [ "dm-snapshot" ]; boot.kernelModules = [ "kvm-amd" ]; boot.extraModulePackages = [ ]; - fileSystems."/" = - { device = "/dev/disk/by-uuid/379a999a-0753-4cbf-b868-e275902f0f73"; - fsType = "ext4"; - }; + fileSystems."/" = { + device = "/dev/disk/by-uuid/379a999a-0753-4cbf-b868-e275902f0f73"; + fsType = "ext4"; + }; boot.initrd.luks.devices."luks-0d50df5f-9456-4296-9156-f5b818e11552".device = "/dev/disk/by-uuid/0d50df5f-9456-4296-9156-f5b818e11552"; - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/3297-A70D"; - fsType = "vfat"; - options = [ "fmask=0022" "dmask=0022" ]; - }; - - fileSystems."/mnt/secondary" = - { device = "/dev/disk/by-uuid/036f1fcb-0674-4ae5-a2fe-cb4f7ada001d"; - fsType = "ext4"; - }; - - swapDevices = - [ { device = "/dev/disk/by-uuid/26a8690a-70f9-4701-b224-b212f76a7035"; } + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/3297-A70D"; + fsType = "vfat"; + options = [ + "fmask=0022" + "dmask=0022" ]; + }; + + fileSystems."/mnt/secondary" = { + device = "/dev/disk/by-uuid/036f1fcb-0674-4ae5-a2fe-cb4f7ada001d"; + fsType = "ext4"; + }; + + swapDevices = [ { device = "/dev/disk/by-uuid/26a8690a-70f9-4701-b224-b212f76a7035"; } ]; # Enables DHCP on each ethernet and wireless interface. In case of scripted networking # (the default) this is the recommended approach. When using systemd-networkd it's diff --git a/system/laptop.nix b/system/laptop.nix index 9f357577..c56fe686 100644 --- a/system/laptop.nix +++ b/system/laptop.nix @@ -1,5 +1,6 @@ -{...}: { - imports = [./desktop/default.nix]; +{ ... }: +{ + imports = [ ./desktop/default.nix ]; powerManagement.enable = true; services.auto-cpufreq = { enable = true; diff --git a/system/services/adguardhome.nix b/system/services/adguardhome.nix index 3e3d881e..4a07e42a 100644 --- a/system/services/adguardhome.nix +++ b/system/services/adguardhome.nix @@ -3,15 +3,22 @@ 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 = [ @@ -24,20 +31,24 @@ 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/system/services/astroneer.nix b/system/services/astroneer.nix index 692c97b6..836dd0c1 100644 --- a/system/services/astroneer.nix +++ b/system/services/astroneer.nix @@ -1,5 +1,6 @@ -{pkgs, ...}: { - environment.systemPackages = with pkgs; [steamcmd]; - networking.firewall.allowedTCPPorts = [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/system/services/caddy.nix b/system/services/caddy.nix index 07848895..be3179d6 100644 --- a/system/services/caddy.nix +++ b/system/services/caddy.nix @@ -1,10 +1,14 @@ -{...}: { - networking.firewall.allowedTCPPorts = [80 443]; +{ ... }: +{ + networking.firewall.allowedTCPPorts = [ + 80 + 443 + ]; services.caddy = { enable = true; email = "evie@xenia.me.uk"; virtualHosts."xenia.me.uk" = { - serverAliases = ["www.xenia.me.uk"]; + serverAliases = [ "www.xenia.me.uk" ]; extraConfig = '' file_server * { root /var/www/xenia.me.uk/ @@ -14,7 +18,13 @@ }; 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/system/services/forgejo.nix b/system/services/forgejo.nix index f9a46a86..3c868c4c 100644 --- a/system/services/forgejo.nix +++ b/system/services/forgejo.nix @@ -1,9 +1,6 @@ +{ config, pkgs, ... }: { - config, - pkgs, - ... -}: { - imports = [./caddy.nix]; + imports = [ ./caddy.nix ]; services = { forgejo = { enable = true; @@ -15,9 +12,15 @@ HTTP_PORT = 3100; DISABLE_SSH = true; }; - ui = {DEFAULT_THEME = "forgejo-auto";}; - admin = {DISABLE_REGULAR_ORG_CREATION = true;}; - service = {DISABLE_REGISTRATION = true;}; + ui = { + DEFAULT_THEME = "forgejo-auto"; + }; + admin = { + DISABLE_REGULAR_ORG_CREATION = true; + }; + service = { + DISABLE_REGISTRATION = true; + }; }; }; # gitea-actions-runner = { diff --git a/system/services/gitea.nix b/system/services/gitea.nix index ee7a84f9..5eb786f5 100644 --- a/system/services/gitea.nix +++ b/system/services/gitea.nix @@ -1,5 +1,6 @@ -{...}: { - imports = [./caddy.nix]; +{ ... }: +{ + imports = [ ./caddy.nix ]; services.gitea = { enable = true; settings = { diff --git a/system/services/grafana.nix b/system/services/grafana.nix index 74e4fa52..98b9ec39 100644 --- a/system/services/grafana.nix +++ b/system/services/grafana.nix @@ -1,5 +1,6 @@ -{...}: { - imports = [./caddy.nix]; +{ ... }: +{ + imports = [ ./caddy.nix ]; services.grafana = { enable = true; settings = { @@ -16,14 +17,14 @@ 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}"];}]; + static_configs = [ { targets = [ "127.0.0.1:${toString exporters.node.port}" ]; } ]; } # { # job_name = "minecraft"; diff --git a/system/services/home-assistant.nix b/system/services/home-assistant.nix index 26c88ccc..9e182739 100644 --- a/system/services/home-assistant.nix +++ b/system/services/home-assistant.nix @@ -1,11 +1,15 @@ -{config, ...}: { +{ config, ... }: +{ virtualisation.oci-containers = { backend = "podman"; containers.homeassistant = { - volumes = ["home-assistant:/config" "/run/dbus:/run/dbus:ro"]; + volumes = [ + "home-assistant:/config" + "/run/dbus:/run/dbus:ro" + ]; environment.TZ = config.time.timeZone; image = "ghcr.io/home-assistant/home-assistant:2024.8.0.dev202407210221"; - extraOptions = ["--network=host"]; + extraOptions = [ "--network=host" ]; }; }; services.caddy.virtualHosts."home.xenia.me.uk".extraConfig = "reverse_proxy http://localhost:8123"; diff --git a/system/services/matrix-synapse.nix b/system/services/matrix-synapse.nix index c310cfad..18775fb2 100644 --- a/system/services/matrix-synapse.nix +++ b/system/services/matrix-synapse.nix @@ -1,8 +1,10 @@ -{...}: let +{ ... }: +let baseUrl = "xenia.me.uk"; port = 8008; -in { - imports = [./caddy.nix]; +in +{ + imports = [ ./caddy.nix ]; services = { matrix-synapse = { enable = true; @@ -12,20 +14,26 @@ in { listeners = [ { inherit port; - bind_addresses = ["127.0.0.1" "::1"]; + bind_addresses = [ + "127.0.0.1" + "::1" + ]; type = "http"; tls = false; x_forwarded = true; resources = [ { - names = ["client" "federation"]; + names = [ + "client" + "federation" + ]; compress = true; } ]; } ]; }; - extraConfigFiles = ["/run/secrets/matrix-shared-secret"]; + extraConfigFiles = [ "/run/secrets/matrix-shared-secret" ]; }; caddy.virtualHosts."xenia.me.uk".extraConfig = '' header /.well-known/matrix/* Content-Type application/json diff --git a/system/services/minecraft.nix b/system/services/minecraft.nix index 68a7d0a1..a37e9b4d 100644 --- a/system/services/minecraft.nix +++ b/system/services/minecraft.nix @@ -1,18 +1,19 @@ +{ config, pkgs, ... }: { - config, - pkgs, - ... -}: { nixpkgs.overlays = [ # Fetch papermc v1.21 from unstable branch of nixpkgs - (final: prev: let - pinnedPkgs = import (builtins.fetchTarball { - url = "https://github.com/NixOS/nixpkgs/archive/03a94c776f261b78b95de0971a94dea0199b4cd8.tar.gz"; - sha256 = "0vngf4g468qd5fqch85nzyvn7bpa6p2i6rdmzc6ws2653x868w3g"; - }) {inherit (pkgs) system;}; - in { - inherit (pinnedPkgs) papermc papermcServers; - }) + ( + final: prev: + let + pinnedPkgs = import (builtins.fetchTarball { + url = "https://github.com/NixOS/nixpkgs/archive/03a94c776f261b78b95de0971a94dea0199b4cd8.tar.gz"; + sha256 = "0vngf4g468qd5fqch85nzyvn7bpa6p2i6rdmzc6ws2653x868w3g"; + }) { inherit (pkgs) system; }; + in + { + inherit (pinnedPkgs) papermc papermcServers; + } + ) ]; services.minecraft-server = { enable = true; diff --git a/system/services/navidrome.nix b/system/services/navidrome.nix index aec75ae7..db334a88 100644 --- a/system/services/navidrome.nix +++ b/system/services/navidrome.nix @@ -1,6 +1,7 @@ -{pkgs, ...}: { - imports = [./caddy.nix]; - environment.systemPackages = with pkgs; [ffmpeg]; +{ pkgs, ... }: +{ + imports = [ ./caddy.nix ]; + environment.systemPackages = with pkgs; [ ffmpeg ]; services = { navidrome = { enable = true; diff --git a/system/services/nix-serve.nix b/system/services/nix-serve.nix index ff99abe1..5ba93de5 100644 --- a/system/services/nix-serve.nix +++ b/system/services/nix-serve.nix @@ -1,5 +1,6 @@ -{config, ...}: { - imports = [./caddy.nix]; +{ config, ... }: +{ + imports = [ ./caddy.nix ]; services.nix-serve = { enable = true; openFirewall = true; diff --git a/system/services/ntfy-sh.nix b/system/services/ntfy-sh.nix index 054a95c0..02ce1c7c 100644 --- a/system/services/ntfy-sh.nix +++ b/system/services/ntfy-sh.nix @@ -1,5 +1,6 @@ -{...}: { - imports = [./caddy.nix]; +{ ... }: +{ + imports = [ ./caddy.nix ]; services.ntfy-sh = { enable = true; settings = { diff --git a/system/services/owncast.nix b/system/services/owncast.nix index 86d30e52..924d9ac5 100644 --- a/system/services/owncast.nix +++ b/system/services/owncast.nix @@ -1,5 +1,6 @@ -{config, ...}: { - imports = [./caddy.nix]; +{ config, ... }: +{ + imports = [ ./caddy.nix ]; services.owncast = { enable = true; port = 9090; diff --git a/system/services/radicale.nix b/system/services/radicale.nix index f3763efb..028a0389 100644 --- a/system/services/radicale.nix +++ b/system/services/radicale.nix @@ -1,11 +1,13 @@ -{...}: let +{ ... }: +let port = "5232"; -in { +in +{ services.radicale = { enable = true; settings = { server = { - hosts = ["0.0.0.0:${port}"]; + hosts = [ "0.0.0.0:${port}" ]; }; auth = { type = "htpasswd"; diff --git a/system/services/sshd.nix b/system/services/sshd.nix index f430871e..b98c0a00 100644 --- a/system/services/sshd.nix +++ b/system/services/sshd.nix @@ -1,7 +1,8 @@ -{...}: { +{ ... }: +{ services.openssh = { enable = true; - ports = [22]; + ports = [ 22 ]; settings = { UseDns = true; PermitRootLogin = "no"; diff --git a/system/services/syncthing.nix b/system/services/syncthing.nix index 363f497c..f0ea26f5 100644 --- a/system/services/syncthing.nix +++ b/system/services/syncthing.nix @@ -1,7 +1,14 @@ -{...}: let - devices = ["Ion" "Legion" "Northstar" "Vanguard"]; -in { - imports = [./caddy.nix]; +{ ... }: +let + devices = [ + "Ion" + "Legion" + "Northstar" + "Vanguard" + ]; +in +{ + imports = [ ./caddy.nix ]; services.syncthing = { enable = true; systemService = true; diff --git a/system/services/terraria/windy_limbo_of_melancholy.nix b/system/services/terraria/windy_limbo_of_melancholy.nix index d8282f2e..e79ff2f6 100644 --- a/system/services/terraria/windy_limbo_of_melancholy.nix +++ b/system/services/terraria/windy_limbo_of_melancholy.nix @@ -1,5 +1,6 @@ -{pkgs, ...}: { - environment.systemPackages = with pkgs; [tmux]; +{ pkgs, ... }: +{ + environment.systemPackages = with pkgs; [ tmux ]; services.terraria = { enable = true; maxPlayers = 10; diff --git a/system/services/znc.nix b/system/services/znc.nix index f12eda02..a299a123 100644 --- a/system/services/znc.nix +++ b/system/services/znc.nix @@ -1,12 +1,15 @@ -{...}: { +{ ... }: +{ services.znc = { enable = true; mutable = false; useLegacyConfig = false; openFirewall = true; config = { - LoadModule = ["adminlog"]; - Listener.l = {Port = 6697;}; + LoadModule = [ "adminlog" ]; + Listener.l = { + Port = 6697; + }; User.pixelifytica = { Admin = true; Pass.password = { @@ -18,7 +21,7 @@ liberachat = { Server = "irc.libera.chat +6697"; Nick = "pixelifytica"; - Chan = {}; + Chan = { }; JoinDelay = 2; }; };