From 606e38208337ad7615edf65e1829b1cba13bed0b Mon Sep 17 00:00:00 2001 From: twoneis Date: Fri, 28 Feb 2025 19:32:44 +0100 Subject: [PATCH] format --- devices/ellaca/default.nix | 8 +- devices/ellaca/disko.nix | 8 +- devices/ellaca/options.nix | 2 +- devices/inkvine/default.nix | 20 +- devices/inkvine/disko.nix | 15 +- devices/inkvine/options.nix | 2 +- flake.lock | 79 ++++++ flake.nix | 5 + modules/apps/alacritty.conf.nix | 2 +- modules/apps/android.nix | 15 +- modules/apps/default.nix | 9 +- modules/apps/firefox.nix | 330 +++++++++++++++---------- modules/apps/media.nix | 31 ++- modules/apps/notes.nix | 44 ++-- modules/apps/programs.nix | 120 +++++---- modules/apps/themes.nix | 99 ++++---- modules/containers/default.nix | 22 +- modules/default.nix | 6 +- modules/fedi/blobfox.nix | 2 +- modules/fedi/blobhaj.nix | 4 +- modules/fedi/blobhajFlags.nix | 4 +- modules/fedi/default.nix | 232 ++++++++--------- modules/firewall/default.nix | 2 +- modules/fonts/default.nix | 40 +-- modules/games/default.nix | 56 +++-- modules/git/default.nix | 65 ++--- modules/home/default.nix | 4 +- modules/layout/default.nix | 29 ++- modules/mail/default.nix | 167 +++++++------ modules/matrix/default.nix | 91 +++---- modules/networking/default.nix | 31 ++- modules/nginx/default.nix | 89 +++---- modules/niri/default.nix | 45 ++-- modules/niri/fuzzel.conf.nix | 24 +- modules/niri/niri.conf.nix | 157 +++++++----- modules/niri/sddm.theme.nix | 2 +- modules/niri/sddm.wallpaper.png | Bin 67948 -> 67950 bytes modules/niri/swaylock.conf.nix | 20 +- modules/niri/swayosd.css.nix | 48 ++-- modules/niri/waybar.conf.nix | 2 +- modules/niri/waybar.css.nix | 114 ++++----- modules/niri/xwl-wrapper.nix | 21 +- modules/nix/default.nix | 9 +- modules/secureboot/default.nix | 24 +- modules/ssh/default.nix | 33 +-- modules/utils/default.nix | 25 +- modules/utils/helix-languages.conf.nix | 4 + modules/utils/helix.conf.nix | 12 +- modules/utils/hyfetch.conf.nix | 4 +- modules/vm/default.nix | 36 +-- modules/website/default.nix | 27 +- options.nix | 6 +- outputs.nix | 40 +-- 53 files changed, 1319 insertions(+), 967 deletions(-) diff --git a/devices/ellaca/default.nix b/devices/ellaca/default.nix index bee15ae..5961214 100644 --- a/devices/ellaca/default.nix +++ b/devices/ellaca/default.nix @@ -1,5 +1,4 @@ -{ pkgs, ... }: -{ +{pkgs, ...}: { imports = [ ./options.nix ./disko.nix @@ -13,16 +12,15 @@ }; boot = { - initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "virtio_pci" "virtio_scsi" "sd_mod" ]; + initrd.availableKernelModules = ["ata_piix" "uhci_hcd" "virtio_pci" "virtio_scsi" "sd_mod"]; kernelPackages = pkgs.linuxPackages_latest; loader = { grub = { - devices = [ "/dev/sda" ]; + devices = ["/dev/sda"]; useOSProber = true; efiSupport = true; efiInstallAsRemovable = true; }; }; }; - } diff --git a/devices/ellaca/disko.nix b/devices/ellaca/disko.nix index da1ed55..649131c 100644 --- a/devices/ellaca/disko.nix +++ b/devices/ellaca/disko.nix @@ -20,21 +20,21 @@ type = "filesystem"; format = "vfat"; mountpoint = "/boot"; - mountOptions = [ "umask=0077" ]; + mountOptions = ["umask=0077"]; }; }; root = { size = "100%"; content = { type = "btrfs"; - extraArgs = [ "-f" ]; # Override existing partition + extraArgs = ["-f"]; # Override existing partition subvolumes = { "/root" = { - mountOptions = [ "compress=zstd" "noatime" ]; + mountOptions = ["compress=zstd" "noatime"]; mountpoint = "/"; }; "/nix" = { - mountOptions = [ "compress=zstd" "noatime" ]; + mountOptions = ["compress=zstd" "noatime"]; mountpoint = "/nix"; }; "/swap" = { diff --git a/devices/ellaca/options.nix b/devices/ellaca/options.nix index 6053270..bdc1a55 100644 --- a/devices/ellaca/options.nix +++ b/devices/ellaca/options.nix @@ -1,4 +1,4 @@ -{ ... }: { +{...}: { conf = { ssh.enable = true; nginx.enable = true; diff --git a/devices/inkvine/default.nix b/devices/inkvine/default.nix index 26e4555..a9199ff 100644 --- a/devices/inkvine/default.nix +++ b/devices/inkvine/default.nix @@ -1,4 +1,8 @@ -{ lib, pkgs, ... }: let +{ + lib, + pkgs, + ... +}: let inherit (lib) mkDefault; in { imports = [ @@ -11,9 +15,9 @@ in { boot = { initrd = { - availableKernelModules = [ "nvme" "xhci_pci" "thunderbolt" "usb_storage" "sd_mod" ]; + availableKernelModules = ["nvme" "xhci_pci" "thunderbolt" "usb_storage" "sd_mod"]; luks.devices.root.device = "/dev/disk/by-label/CRYPT"; - kernelModules = [ "amdgpu" ]; + kernelModules = ["amdgpu"]; }; kernelPackages = pkgs.linuxPackages_latest; loader = { @@ -33,28 +37,28 @@ in { "/" = { device = "/dev/disk/by-label/ROOT"; fsType = "btrfs"; - options = [ "subvol=root" "compress=zstd" "noatime" ]; + options = ["subvol=root" "compress=zstd" "noatime"]; }; "/nix" = { device = "/dev/disk/by-label/ROOT"; fsType = "btrfs"; - options = [ "subvol=nix" "compress=zstd" "noatime" ]; + options = ["subvol=nix" "compress=zstd" "noatime"]; neededForBoot = true; }; "/swap" = { device = "/dev/disk/by-label/ROOT"; fsType = "btrfs"; - options = [ "subvol=swap" "noatime" ]; + options = ["subvol=swap" "noatime"]; }; }; - swapDevices = [ { device = "/swap/swapfile"; } ]; + swapDevices = [{device = "/swap/swapfile";}]; services = { fwupd.enable = true; power-profiles-daemon.enable = true; btrfs.autoScrub = { enable = true; - fileSystems = [ "/" ]; + fileSystems = ["/"]; }; }; diff --git a/devices/inkvine/disko.nix b/devices/inkvine/disko.nix index db53861..6b4dbbf 100644 --- a/devices/inkvine/disko.nix +++ b/devices/inkvine/disko.nix @@ -1,4 +1,4 @@ -{ ... }: { +{...}: { disko.devices = { disk = { main = { @@ -14,7 +14,7 @@ type = "filesystem"; format = "vfat"; mountpoint = "/boot"; - mountOptions = [ "umask=0077" ]; + mountOptions = ["umask=0077"]; }; }; luks = { @@ -27,19 +27,19 @@ }; content = { type = "btrfs"; - extraArgs = [ "-f" ]; + extraArgs = ["-f"]; subvolumes = { "root" = { mountpoint = "/"; - mountOptions = [ "compress=zstd" "noatime" ]; + mountOptions = ["compress=zstd" "noatime"]; }; "nix" = { mountpoint = "/nix"; - mountOptions = [ "compress=zstd" "noatime" ]; + mountOptions = ["compress=zstd" "noatime"]; }; "persist" = { mountpoint = "/persist"; - mountOptions = [ "compress=zstd" "noatime" ]; + mountOptions = ["compress=zstd" "noatime"]; }; "swap" = { mountpoint = "/.swapvol"; @@ -54,5 +54,4 @@ }; }; }; -} - +} diff --git a/devices/inkvine/options.nix b/devices/inkvine/options.nix index e08e6e2..e40db05 100644 --- a/devices/inkvine/options.nix +++ b/devices/inkvine/options.nix @@ -1,4 +1,4 @@ -{ ... }: { +{...}: { conf = { apps.enable = true; niri.enable = true; diff --git a/flake.lock b/flake.lock index b2293a8..a6fe814 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,28 @@ { "nodes": { + "alejandra": { + "inputs": { + "fenix": "fenix", + "flakeCompat": "flakeCompat", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1730688725, + "narHash": "sha256-g0SSfTWZ5mtMOpQic+eqq9sXMy1E/7yKxxfupZd9V4A=", + "owner": "kamadorueda", + "repo": "alejandra", + "rev": "2bb91e309ca99656addff5c74545acbf5813636d", + "type": "github" + }, + "original": { + "owner": "kamadorueda", + "ref": "3.1.0", + "repo": "alejandra", + "type": "github" + } + }, "crane": { "locked": { "lastModified": 1731098351, @@ -36,6 +59,28 @@ "type": "github" } }, + "fenix": { + "inputs": { + "nixpkgs": [ + "alejandra", + "nixpkgs" + ], + "rust-analyzer-src": "rust-analyzer-src" + }, + "locked": { + "lastModified": 1730615655, + "narHash": "sha256-2HBR3zLn57LXKNRtxBb+O+uDqHM4n0pz51rPayMl4cg=", + "owner": "nix-community", + "repo": "fenix", + "rev": "efeb50e2535b17ffd4a135e6e3e5fd60a525180c", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "fenix", + "type": "github" + } + }, "flake-compat": { "flake": false, "locked": { @@ -109,6 +154,22 @@ "type": "github" } }, + "flakeCompat": { + "flake": false, + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, "gitignore": { "inputs": { "nixpkgs": [ @@ -420,6 +481,7 @@ }, "root": { "inputs": { + "alejandra": "alejandra", "disko": "disko", "home-manager": "home-manager", "lanzaboote": "lanzaboote", @@ -430,6 +492,23 @@ "nur": "nur" } }, + "rust-analyzer-src": { + "flake": false, + "locked": { + "lastModified": 1730555913, + "narHash": "sha256-KNHZUlqsEibg3YtfUyOFQSofP8hp1HKoY+laoesBxRM=", + "owner": "rust-lang", + "repo": "rust-analyzer", + "rev": "f17a5bbfd0969ba2e63a74505a80e55ecb174ed9", + "type": "github" + }, + "original": { + "owner": "rust-lang", + "ref": "nightly", + "repo": "rust-analyzer", + "type": "github" + } + }, "rust-overlay": { "inputs": { "nixpkgs": [ diff --git a/flake.nix b/flake.nix index 2dbfb19..7d803b0 100644 --- a/flake.nix +++ b/flake.nix @@ -9,6 +9,11 @@ inputs.nixpkgs.follows = "nixpkgs"; }; + alejandra = { + url = "github:kamadorueda/alejandra/3.1.0"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + nixos-hardware = { url = "github:nixos/nixos-hardware"; }; diff --git a/modules/apps/alacritty.conf.nix b/modules/apps/alacritty.conf.nix index b4f4ff0..b8caf43 100644 --- a/modules/apps/alacritty.conf.nix +++ b/modules/apps/alacritty.conf.nix @@ -1,4 +1,4 @@ -{ config, ... }: let +{config, ...}: let inherit (config) theme; in { # Rose Pine diff --git a/modules/apps/android.nix b/modules/apps/android.nix index c605539..5114030 100644 --- a/modules/apps/android.nix +++ b/modules/apps/android.nix @@ -1,7 +1,12 @@ -{ config, lib, ... }: let +{ + config, + lib, + ... +}: let inherit (lib) mkIf; inherit (config) conf; -in mkIf conf.apps.enable { - programs.adb.enable = true; - users.users.${conf.username}.extraGroups = [ "adbusers" ]; -} +in + mkIf conf.apps.enable { + programs.adb.enable = true; + users.users.${conf.username}.extraGroups = ["adbusers"]; + } diff --git a/modules/apps/default.nix b/modules/apps/default.nix index 8a6bc77..8e957d4 100644 --- a/modules/apps/default.nix +++ b/modules/apps/default.nix @@ -1,4 +1,9 @@ -{ lib, config, pkgs, ... }: let +{ + lib, + config, + pkgs, + ... +}: let inherit (lib) mkIf mkForce; inherit (config) conf; in { @@ -45,7 +50,7 @@ in { # Regularly clean download folder systemd = { timers."clean-download" = { - wantedBy = [ "timers.target" ]; + wantedBy = ["timers.target"]; timerConfig = { OnCalendar = "*-*-* 03:00:00"; Unit = "clean-download.service"; diff --git a/modules/apps/firefox.nix b/modules/apps/firefox.nix index 3e60280..671342d 100644 --- a/modules/apps/firefox.nix +++ b/modules/apps/firefox.nix @@ -1,151 +1,215 @@ -{ lib, config, pkgs, ... }: let +{ + lib, + config, + pkgs, + ... +}: let inherit (lib) mkIf; inherit (config) conf; -in mkIf conf.apps.enable { - home-manager.users.${conf.username} = { - programs.firefox = { - enable = true; - profiles = { - "default" = { - id = 0; +in + mkIf conf.apps.enable { + home-manager.users.${conf.username} = { + programs.firefox = { + enable = true; + profiles = { + "default" = { + id = 0; - search = { - default = "DuckDuckGoo"; - privateDefault = "DuckDuckGoo"; - engines = { - "DuckDuckGo".metaData.hidden = true; - "Google".metaData.hidden = true; - "Amazon.com".metaData.hidden = true; - "Bing".metaData.hidden = true; - "Wikipedia (en)".metaData.hidden = true; - "DuckDuckGoo" = { - urls = [{ - template = "https://duckduckgo.com/"; - params = [ - { name = "q"; value = "{searchTerms}"; } + search = { + default = "DuckDuckGoo"; + privateDefault = "DuckDuckGoo"; + engines = { + "DuckDuckGo".metaData.hidden = true; + "Google".metaData.hidden = true; + "Amazon.com".metaData.hidden = true; + "Bing".metaData.hidden = true; + "Wikipedia (en)".metaData.hidden = true; + "DuckDuckGoo" = { + urls = [ + { + template = "https://duckduckgo.com/"; + params = [ + { + name = "q"; + value = "{searchTerms}"; + } + ]; + } ]; - }]; - definedAliases = [ "@ddg" ]; - }; - "Googlee" = { - urls = [{ - template = "https://google.com/search"; - params = [ - { name = "q"; value = "{searchTerms}"; } + definedAliases = ["@ddg"]; + }; + "Googlee" = { + urls = [ + { + template = "https://google.com/search"; + params = [ + { + name = "q"; + value = "{searchTerms}"; + } + ]; + } ]; - }]; - definedAliases = [ "@g" ]; - }; - "Wikipedia" = { - urls = [{ - template = "https://en.wikipedia.org/wiki/Special:Search"; - params = [ - { name = "search"; value = "{searchTerms}"; } + definedAliases = ["@g"]; + }; + "Wikipedia" = { + urls = [ + { + template = "https://en.wikipedia.org/wiki/Special:Search"; + params = [ + { + name = "search"; + value = "{searchTerms}"; + } + ]; + } ]; - }]; - definedAliases = [ "@wiki" ]; - }; - "YouTube" = { - urls = [{ - template = "https://youtube.com/results"; - params = [ - { name = "search_query"; value = "{searchTerms}"; } + definedAliases = ["@wiki"]; + }; + "YouTube" = { + urls = [ + { + template = "https://youtube.com/results"; + params = [ + { + name = "search_query"; + value = "{searchTerms}"; + } + ]; + } ]; - }]; - definedAliases = [ "@yt" ]; - }; - "Nix Packages" = { - urls = [{ - template = "https://search.nixos.org/packages"; - params = [ - { name = "channel"; value = "unstable"; } - { name = "type"; value = "packages"; } - { name = "query"; value = "{searchTerms}"; } + definedAliases = ["@yt"]; + }; + "Nix Packages" = { + urls = [ + { + template = "https://search.nixos.org/packages"; + params = [ + { + name = "channel"; + value = "unstable"; + } + { + name = "type"; + value = "packages"; + } + { + name = "query"; + value = "{searchTerms}"; + } + ]; + } ]; - }]; - definedAliases = [ "@np" ]; - }; - "Nix Options" = { - urls = [{ - template = "https://search.nixos.org/options"; - params = [ - { name = "channel"; value = "unstable"; } - { name = "type"; value = "packages"; } - { name = "query"; value = "{searchTerms}"; } + definedAliases = ["@np"]; + }; + "Nix Options" = { + urls = [ + { + template = "https://search.nixos.org/options"; + params = [ + { + name = "channel"; + value = "unstable"; + } + { + name = "type"; + value = "packages"; + } + { + name = "query"; + value = "{searchTerms}"; + } + ]; + } ]; - }]; - definedAliases = [ "@no" ]; - }; - "Arch Wiki" = { - urls = [{ - template = "https://wiki.archlinux.org/index.php"; - params = [ - { name = "search"; value = "{searchTerms}"; } - { name = "fulltext"; value = "1"; } + definedAliases = ["@no"]; + }; + "Arch Wiki" = { + urls = [ + { + template = "https://wiki.archlinux.org/index.php"; + params = [ + { + name = "search"; + value = "{searchTerms}"; + } + { + name = "fulltext"; + value = "1"; + } + ]; + } ]; - }]; - definedAliases = [ "@aw" ]; - }; - "Github" = { - urls = [{ - template = "https://github.com/search"; - params = [ - { name = "q"; value = "{searchTerms}"; } - { name = "type"; value = "repositories"; } + definedAliases = ["@aw"]; + }; + "Github" = { + urls = [ + { + template = "https://github.com/search"; + params = [ + { + name = "q"; + value = "{searchTerms}"; + } + { + name = "type"; + value = "repositories"; + } + ]; + } ]; - }]; - definedAliases = [ "@gh" ]; + definedAliases = ["@gh"]; + }; }; + force = true; + order = [ + "DuckDuckGoo" + "Googlee" + "Wikipedia" + "YouTube" + "Nix Packages" + "Nix Options" + "Arch Wiki" + "Github" + ]; }; - force = true; - order = [ - "DuckDuckGoo" - "Googlee" - "Wikipedia" - "YouTube" - "Nix Packages" - "Nix Options" - "Arch Wiki" - "Github" + + bookmarks = {}; + + settings = { + "browser.aboutConfig.showWarning" = false; + "browser.bookmarks.addedImportButton" = false; + "browser.newtabpage.enabled" = false; + "browser.preferences.moreFromMozilla" = false; + "browser.shell.checkDefaultBrowser" = false; + "browser.startup.blankWindow" = true; + "browser.startup.page" = 3; + "browser.tabs.closeWindowWithLastTab" = false; + "browser.toolbars.bookmarks.visibility" = "never"; + "browser.translation.enable" = false; + "dom.security.https_only_mode" = true; + "extensions.pocket.enabled" = false; + "gfx.webrender.all" = true; + "identity.fxaccounts.enabled" = false; + "media.cache_readhead_limit" = 9999; + "media.cache_resume_threshold" = 9999; + "medai.ffmpeg.vaapi.enabled" = true; + "media.videocontrols.picture-in-picture.enabled" = false; + "signon.rememberSignons" = false; + }; + + extensions.packages = with pkgs.nur.repos.rycee.firefox-addons; [ + bitwarden + sponsorblock + ublock-origin + pronoundb + youtube-nonstop + enhancer-for-youtube + firefox-color + purpleadblock ]; }; - - bookmarks = { }; - - settings = { - "browser.aboutConfig.showWarning" = false; - "browser.bookmarks.addedImportButton" = false; - "browser.newtabpage.enabled" = false; - "browser.preferences.moreFromMozilla" = false; - "browser.shell.checkDefaultBrowser" = false; - "browser.startup.blankWindow" = true; - "browser.startup.page" = 3; - "browser.tabs.closeWindowWithLastTab" = false; - "browser.toolbars.bookmarks.visibility" = "never"; - "browser.translation.enable" = false; - "dom.security.https_only_mode" = true; - "extensions.pocket.enabled" = false; - "gfx.webrender.all" = true; - "identity.fxaccounts.enabled" = false; - "media.cache_readhead_limit" = 9999; - "media.cache_resume_threshold" = 9999; - "medai.ffmpeg.vaapi.enabled" = true; - "media.videocontrols.picture-in-picture.enabled" = false; - "signon.rememberSignons" = false; - }; - - extensions.packages = with pkgs.nur.repos.rycee.firefox-addons; [ - bitwarden - sponsorblock - ublock-origin - pronoundb - youtube-nonstop - enhancer-for-youtube - firefox-color - purpleadblock - ]; }; }; }; - }; -} + } diff --git a/modules/apps/media.nix b/modules/apps/media.nix index 7cf9edd..e533e16 100644 --- a/modules/apps/media.nix +++ b/modules/apps/media.nix @@ -1,17 +1,22 @@ -{ config, lib, pkgs, ... }: let +{ + config, + lib, + pkgs, + ... +}: let inherit (lib) mkIf; inherit (config) conf; -in mkIf conf.apps.enable { +in + mkIf conf.apps.enable { + home-manager.users.${conf.username} = { + home.packages = with pkgs; [ + loupe + spotify + amberol + ]; - home-manager.users.${conf.username} = { - home.packages = with pkgs; [ - loupe - spotify - amberol - ]; - - programs.mpv = { - enable = true; + programs.mpv = { + enable = true; + }; }; - }; -} + } diff --git a/modules/apps/notes.nix b/modules/apps/notes.nix index a394446..d5a3567 100644 --- a/modules/apps/notes.nix +++ b/modules/apps/notes.nix @@ -1,25 +1,31 @@ -{ lib, config, pkgs, ... }: let +{ + lib, + config, + pkgs, + ... +}: let inherit (lib) mkIf; inherit (config) conf; inherit (config.conf) keys; -in mkIf conf.apps.enable { - home-manager.users.${conf.username} = { - home.packages = with pkgs; [ - rnote - ]; +in + mkIf conf.apps.enable { + home-manager.users.${conf.username} = { + home.packages = with pkgs; [ + rnote + ]; - programs.sioyek = { - enable = true; - bindings = { - "move_up" = keys.up; - "move_down" = keys.down; - "move_left" = keys.left; - "move_right" = keys.right; + programs.sioyek = { + enable = true; + bindings = { + "move_up" = keys.up; + "move_down" = keys.down; + "move_left" = keys.left; + "move_right" = keys.right; + }; + }; + + programs.fish.shellAbbrs = { + pdf = "sioyek"; }; }; - - programs.fish.shellAbbrs = { - pdf = "sioyek"; - }; - }; -} + } diff --git a/modules/apps/programs.nix b/modules/apps/programs.nix index 7427ceb..d4a3dbf 100644 --- a/modules/apps/programs.nix +++ b/modules/apps/programs.nix @@ -1,4 +1,9 @@ -{ lib, config, pkgs, ... }: let +{ + lib, + config, + pkgs, + ... +}: let inherit (lib) mkIf; inherit (config) conf; mkXwlWrapper = import ../niri/xwl-wrapper.nix; @@ -7,61 +12,72 @@ desktopName = "Time"; exec = "alacritty -e ${pkgs.peaclock}/bin/peaclock"; }; -in mkIf conf.apps.enable { - services = { - # Needed for some features in nautilus such as auto-mounting and trash - gvfs.enable = true; - }; - - home-manager.users.${conf.username} = { - home.packages = with pkgs; [ - signal-desktop - vesktop - snapshot - nautilus - inkscape - libresprite - # blender - gnome-disk-utility - fragments - element-desktop - tor-browser - libreoffice-qt6 - chromium - peaclock - fractal - element-desktop - ] ++ [ - time - (mkXwlWrapper { pkgs = pkgs; name = "Prusa"; pkg = "prusa-slicer"; }) - (mkXwlWrapper { pkgs = pkgs; name = "Vial"; pkg = "vial"; }) - ]; - - home.file = { - ".config/vesktop/settings.json" = { - source = ./vesktop.conf.json; - }; - ".config/vesktop/settings/settings.json" = { - source = ./vencord.conf.json; - }; +in + mkIf conf.apps.enable { + services = { + # Needed for some features in nautilus such as auto-mounting and trash + gvfs.enable = true; }; - programs.pandoc = { - enable = true; - }; + home-manager.users.${conf.username} = { + home.packages = with pkgs; + [ + signal-desktop + vesktop + snapshot + nautilus + inkscape + libresprite + # blender + gnome-disk-utility + fragments + element-desktop + tor-browser + libreoffice-qt6 + chromium + peaclock + fractal + element-desktop + ] + ++ [ + time + (mkXwlWrapper { + pkgs = pkgs; + name = "Prusa"; + pkg = "prusa-slicer"; + }) + (mkXwlWrapper { + pkgs = pkgs; + name = "Vial"; + pkg = "vial"; + }) + ]; - programs.thunderbird = { - enable = true; - profiles = { - "default" = { - isDefault = true; + home.file = { + ".config/vesktop/settings.json" = { + source = ./vesktop.conf.json; + }; + ".config/vesktop/settings/settings.json" = { + source = ./vencord.conf.json; }; }; - }; - programs.alacritty = { - enable = true; - settings = import ./alacritty.conf.nix { config = config; }; + programs.pandoc = { + enable = true; + }; + + programs.thunderbird = { + enable = true; + profiles = { + "default" = { + isDefault = true; + }; + }; + }; + + programs.alacritty = { + enable = true; + settings = import ./alacritty.conf.nix {config = config;}; + }; }; - }; -} + } diff --git a/modules/apps/themes.nix b/modules/apps/themes.nix index c775e7f..ddf067b 100644 --- a/modules/apps/themes.nix +++ b/modules/apps/themes.nix @@ -1,53 +1,62 @@ -{ lib, config, pkgs, ... }: let +{ + lib, + config, + pkgs, + ... +}: let inherit (lib) mkIf; inherit (config) conf; -in mkIf conf.apps.enable { - home-manager.users.${conf.username} = { - home.packages = with pkgs; [ - adwaita-icon-theme - adwaita-qt - adwaita-qt6 - ]; +in + mkIf conf.apps.enable { + home-manager.users.${conf.username} = { + home.packages = with pkgs; [ + adwaita-icon-theme + adwaita-qt + adwaita-qt6 + ]; - qt = { - enable = true; - platformTheme.name = "adwaita"; - style.name = "adwaita-dark"; - }; - - gtk = { - enable = true; - gtk4.extraConfig = { - gtk-application-prefer-dark-theme = true; + qt = { + enable = true; + platformTheme.name = "adwaita"; + style.name = "adwaita-dark"; }; - gtk3.extraConfig = { - gtk-application-prefer-dark-theme = true; - }; - gtk2.extraConfig = "gtk-application-prefer-dark-theme=1\n"; - theme.name = "Adwaita Dark"; - }; - dconf = { - enable = true; - settings = { - "org/gnome/desktop/interface" = { - color-scheme = "prefer-dark"; + gtk = { + enable = true; + gtk4.extraConfig = { + gtk-application-prefer-dark-theme = true; + }; + gtk3.extraConfig = { + gtk-application-prefer-dark-theme = true; + }; + gtk2.extraConfig = "gtk-application-prefer-dark-theme=1\n"; + theme.name = "Adwaita Dark"; + }; + + dconf = { + enable = true; + settings = { + "org/gnome/desktop/interface" = { + color-scheme = "prefer-dark"; + }; }; }; - }; - home.pointerCursor = let getFrom = url: hash: name: { - gtk.enable = true; - x11.enable = true; - name = name; - size = 24; - package = pkgs.runCommand "moveUp" {} '' - mkdir -p $out/share/icons - ln -s ${pkgs.fetchzip{ - url = url; - hash = hash; - }} $out/share/icons/${name} - ''; - }; in getFrom "https://github.com/rose-pine/cursor/releases/download/v1.1.0/BreezeX-RosePine-Linux.tar.xz" "sha256-t5xwAPGhuQUfGThedLsmtZEEp1Ljjo3Udhd5Ql3O67c=" "BreezX-RosePine-Linux"; - }; -} + home.pointerCursor = let + getFrom = url: hash: name: { + gtk.enable = true; + x11.enable = true; + name = name; + size = 24; + package = pkgs.runCommand "moveUp" {} '' + mkdir -p $out/share/icons + ln -s ${pkgs.fetchzip { + url = url; + hash = hash; + }} $out/share/icons/${name} + ''; + }; + in + getFrom "https://github.com/rose-pine/cursor/releases/download/v1.1.0/BreezeX-RosePine-Linux.tar.xz" "sha256-t5xwAPGhuQUfGThedLsmtZEEp1Ljjo3Udhd5Ql3O67c=" "BreezX-RosePine-Linux"; + }; + } diff --git a/modules/containers/default.nix b/modules/containers/default.nix index 9dff044..985ba17 100644 --- a/modules/containers/default.nix +++ b/modules/containers/default.nix @@ -1,11 +1,17 @@ -{ lib, config, pkgs, ... }: let +{ + lib, + config, + pkgs, + ... +}: let inherit (lib) mkIf; inherit (config) conf; -in mkIf conf.containers.enable { - virtualisation.podman = { - enable = true; - dockerCompat = true; - }; +in + mkIf conf.containers.enable { + virtualisation.podman = { + enable = true; + dockerCompat = true; + }; - environment.systemPackages = [ pkgs.distrobox ]; -} + environment.systemPackages = [pkgs.distrobox]; + } diff --git a/modules/default.nix b/modules/default.nix index d9a4e8f..cc440ad 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -1,4 +1,4 @@ -{ config, ... }: let +{config, ...}: let inherit (config) conf; in { imports = [ @@ -31,10 +31,10 @@ in { defaultLocale = "en_US.UTF-8"; }; - users.users.${conf.username}= { + users.users.${conf.username} = { isNormalUser = true; description = conf.username; - extraGroups = [ "networkmanager" "wheel" ]; + extraGroups = ["networkmanager" "wheel"]; }; system.stateVersion = conf.stateVersion; diff --git a/modules/fedi/blobfox.nix b/modules/fedi/blobfox.nix index 2c39fe9..6fc9148 100644 --- a/modules/fedi/blobfox.nix +++ b/modules/fedi/blobfox.nix @@ -14,7 +14,7 @@ stdenvNoCC.mkDerivation { sourceRoot = "."; - nativeBuildInputs = [ unzip ]; + nativeBuildInputs = [unzip]; installPhase = '' runHook preInstall diff --git a/modules/fedi/blobhaj.nix b/modules/fedi/blobhaj.nix index 22f3192..509d0dd 100644 --- a/modules/fedi/blobhaj.nix +++ b/modules/fedi/blobhaj.nix @@ -1,6 +1,4 @@ -{ - stdenvNoCC, -}: +{stdenvNoCC}: stdenvNoCC.mkDerivation { pname = "blobhaj"; version = "13.12.2022"; diff --git a/modules/fedi/blobhajFlags.nix b/modules/fedi/blobhajFlags.nix index 0a770c3..0d0b135 100644 --- a/modules/fedi/blobhajFlags.nix +++ b/modules/fedi/blobhajFlags.nix @@ -1,6 +1,4 @@ -{ - stdenvNoCC, -}: +{stdenvNoCC}: stdenvNoCC.mkDerivation { pname = "blobhajFlags"; version = "1.0"; diff --git a/modules/fedi/default.nix b/modules/fedi/default.nix index 0c2a038..c906c9e 100644 --- a/modules/fedi/default.nix +++ b/modules/fedi/default.nix @@ -1,120 +1,126 @@ -{ lib, pkgs, config, ... }: let +{ + lib, + pkgs, + config, + ... +}: let inherit (lib) mkIf; inherit (config) conf; - inherit ((pkgs.formats.elixirConf { }).lib) mkMap; - neocat = (pkgs.callPackage ./neocat.nix { }); - neofox = (pkgs.callPackage ./neofox.nix { }); - blobfox = (pkgs.callPackage ./blobfox.nix { }); - blobhaj = (pkgs.callPackage ./blobhaj.nix { }); - blobhajFlags = (pkgs.callPackage ./blobhajFlags.nix { }); -in mkIf conf.fedi.enable { - services.akkoma = { - enable = true; - config = { - ":pleroma" = { - ":instance" = { - name = "miras fedi"; - description = "miras akkoma instance"; - email = "fedi@chpu.eu"; - registration_open = false; - }; + inherit ((pkgs.formats.elixirConf {}).lib) mkMap; + neocat = pkgs.callPackage ./neocat.nix {}; + neofox = pkgs.callPackage ./neofox.nix {}; + blobfox = pkgs.callPackage ./blobfox.nix {}; + blobhaj = pkgs.callPackage ./blobhaj.nix {}; + blobhajFlags = pkgs.callPackage ./blobhajFlags.nix {}; +in + mkIf conf.fedi.enable { + services.akkoma = { + enable = true; + config = { + ":pleroma" = { + ":instance" = { + name = "miras fedi"; + description = "miras akkoma instance"; + email = "fedi@chpu.eu"; + registration_open = false; + }; - # Initial block list copied from void.rehab - ":mrf_simple" = { - reject = mkMap { - "1611.social" = "antisemitism"; - "5dollah.click" = "racism"; - "aspublic.org" = "privacy violation"; - "annihilation.social" = "bigotry"; - "bae.st" = "racism"; - "baraag.net" = "unmarked lolisho"; - "boymoder.biz" = "spam"; - "bv.umbrellix.org" = "harassment"; - "catposter.club" = "bigotry"; - "cawfee.club" = "racism"; - "childlove.space" = "csam"; - "clew.lol" = "racism"; - "clubcyberia.co" = "racism"; - "cum.salon" = "spam, privacy violation"; - "decayable.ink" = "racism"; - "detroitriotcity.com" = "racism"; - "eientei.org" = "racism"; - "eveningzoo.club" = "transphobia"; - "fluf.club" = "bigotry"; - "freeatlantis.com" = "transphobia"; - "freespeechextremist.com" = "racism"; - "freesoftwareextremist.com" = "racism"; - "fsebugoutzone.org" = "transphobia"; - "gameliberty.club" = "racism"; - "genderheretics.xyz" = "transphobia"; - "geofront.rocks" = "transphobia"; - "gleasonator.com" = "transphobia"; - "gh0st.live" = "bigotry"; - "h5q.net" = "unmarked lolisho"; - "h-i.social" = "antisemitism"; - "iddqd.social" = "racism"; - "lab.nyanide.com" = "racism"; - "linuxrocks.online" = ""; - "minds.com" = "racism"; - "momostr.pink" = "nostr bridge"; - "mostr.pub" = "nostr bridge"; - "mrhands.horse" = "racism"; - "mugicha.club" = "racism"; - "na.social" = "bigotry"; - "nationalist.social" = "racism"; - "newsmast.community" = "privacy violation"; - "nicecrew.digital" = "racism"; - "noauthority.social" = "racism"; - "norwoodzero.net" = "racism"; - "parcero.bond" = "racism"; - "pawoo.net" = "csam"; - "starnix.network" = "racism"; - "plagu.ee" = "racism"; - "pleroma.adachi.party" = "racism"; - "poa.st" = "racism"; - "probablyfreespeech.com" = "no incoming deletes"; - "rape.pet" = "i really don't want to have to explain this to you"; - "rebased.taihou.website" = "racism"; - "ryona.agency" = "antisemitism"; - "sacred.harpy.faith" = "racism"; - "seal.cafe" = "transphobia"; - "soc0.outrnat.nl" = "antisemitism"; - "strelizia.net" = "racism"; - "taihou.website" = "racism"; - "the.asbestos.cafe" = "bigotry"; - "thebag.social" = "bigotry"; - "threads.net" = "i mean"; - "tsundere.love" = "bigotry"; - "ubiqueros.com" = "antisemitism"; - "whinge.town" = "racism"; - "youjo.love" = "unlabelled nsfw"; - "youjo.observer" = "sexual harassment"; - "qoto.org" = "everything"; - "quietplace.xyz" = "slurs"; - "zhub.link" = "homophobia"; + # Initial block list copied from void.rehab + ":mrf_simple" = { + reject = mkMap { + "1611.social" = "antisemitism"; + "5dollah.click" = "racism"; + "aspublic.org" = "privacy violation"; + "annihilation.social" = "bigotry"; + "bae.st" = "racism"; + "baraag.net" = "unmarked lolisho"; + "boymoder.biz" = "spam"; + "bv.umbrellix.org" = "harassment"; + "catposter.club" = "bigotry"; + "cawfee.club" = "racism"; + "childlove.space" = "csam"; + "clew.lol" = "racism"; + "clubcyberia.co" = "racism"; + "cum.salon" = "spam, privacy violation"; + "decayable.ink" = "racism"; + "detroitriotcity.com" = "racism"; + "eientei.org" = "racism"; + "eveningzoo.club" = "transphobia"; + "fluf.club" = "bigotry"; + "freeatlantis.com" = "transphobia"; + "freespeechextremist.com" = "racism"; + "freesoftwareextremist.com" = "racism"; + "fsebugoutzone.org" = "transphobia"; + "gameliberty.club" = "racism"; + "genderheretics.xyz" = "transphobia"; + "geofront.rocks" = "transphobia"; + "gleasonator.com" = "transphobia"; + "gh0st.live" = "bigotry"; + "h5q.net" = "unmarked lolisho"; + "h-i.social" = "antisemitism"; + "iddqd.social" = "racism"; + "lab.nyanide.com" = "racism"; + "linuxrocks.online" = ""; + "minds.com" = "racism"; + "momostr.pink" = "nostr bridge"; + "mostr.pub" = "nostr bridge"; + "mrhands.horse" = "racism"; + "mugicha.club" = "racism"; + "na.social" = "bigotry"; + "nationalist.social" = "racism"; + "newsmast.community" = "privacy violation"; + "nicecrew.digital" = "racism"; + "noauthority.social" = "racism"; + "norwoodzero.net" = "racism"; + "parcero.bond" = "racism"; + "pawoo.net" = "csam"; + "starnix.network" = "racism"; + "plagu.ee" = "racism"; + "pleroma.adachi.party" = "racism"; + "poa.st" = "racism"; + "probablyfreespeech.com" = "no incoming deletes"; + "rape.pet" = "i really don't want to have to explain this to you"; + "rebased.taihou.website" = "racism"; + "ryona.agency" = "antisemitism"; + "sacred.harpy.faith" = "racism"; + "seal.cafe" = "transphobia"; + "soc0.outrnat.nl" = "antisemitism"; + "strelizia.net" = "racism"; + "taihou.website" = "racism"; + "the.asbestos.cafe" = "bigotry"; + "thebag.social" = "bigotry"; + "threads.net" = "i mean"; + "tsundere.love" = "bigotry"; + "ubiqueros.com" = "antisemitism"; + "whinge.town" = "racism"; + "youjo.love" = "unlabelled nsfw"; + "youjo.observer" = "sexual harassment"; + "qoto.org" = "everything"; + "quietplace.xyz" = "slurs"; + "zhub.link" = "homophobia"; + }; + }; + + "Pleroma.Web.Endpoint" = { + url.host = "fedi.twoneis.site"; + }; + + "Pleroma.Upload" = { + base_url = "https://fedi.twoneis.site/media/"; }; }; - - "Pleroma.Web.Endpoint" = { - url.host = "fedi.twoneis.site"; - }; - - "Pleroma.Upload" = { - base_url = "https://fedi.twoneis.site/media/"; - }; + }; + extraStatic = { + "emoji/neocat" = neocat; + "emoji/neofox" = neofox; + "emoji/blobfox" = blobfox; + "emoji/blobhaj" = blobhaj; + "emoji/blobhajFlags" = blobhajFlags; + }; + nginx = { + serverName = "fedi.twoneis.site"; + useACMEHost = "twoneis.site"; + forceSSL = true; }; }; - extraStatic = { - "emoji/neocat" = neocat; - "emoji/neofox" = neofox; - "emoji/blobfox" = blobfox; - "emoji/blobhaj" = blobhaj; - "emoji/blobhajFlags" = blobhajFlags; - }; - nginx = { - serverName = "fedi.twoneis.site"; - useACMEHost = "twoneis.site"; - forceSSL = true; - }; - }; -} + } diff --git a/modules/firewall/default.nix b/modules/firewall/default.nix index 89e0871..1235c84 100644 --- a/modules/firewall/default.nix +++ b/modules/firewall/default.nix @@ -1,4 +1,4 @@ -{ ... }: { +{...}: { networking = { nftables.enable = true; firewall.enable = true; diff --git a/modules/fonts/default.nix b/modules/fonts/default.nix index 145f911..05d41ec 100644 --- a/modules/fonts/default.nix +++ b/modules/fonts/default.nix @@ -1,21 +1,27 @@ -{ lib, config, pkgs, ... }: let +{ + lib, + config, + pkgs, + ... +}: let inherit (lib) mkIf; inherit (config) conf; -in mkIf conf.fonts.enable { - fonts = { - packages = with pkgs; [ - alegreya - alegreya-sans - nerd-fonts.fira-code - roboto - ubuntu_font_family - ]; - fontconfig = { - defaultFonts = { - serif = [ "Alegreya" ]; - sansSerif = [ "Alegreya Sans" ]; - monospace = [ "Fira Code Nerd Font" ]; +in + mkIf conf.fonts.enable { + fonts = { + packages = with pkgs; [ + alegreya + alegreya-sans + nerd-fonts.fira-code + roboto + ubuntu_font_family + ]; + fontconfig = { + defaultFonts = { + serif = ["Alegreya"]; + sansSerif = ["Alegreya Sans"]; + monospace = ["Fira Code Nerd Font"]; + }; }; }; - }; -} + } diff --git a/modules/games/default.nix b/modules/games/default.nix index 57664ca..eb82243 100644 --- a/modules/games/default.nix +++ b/modules/games/default.nix @@ -1,10 +1,15 @@ -{ lib, config, pkgs, ... }: let +{ + lib, + config, + pkgs, + ... +}: let inherit (lib) mkIf; inherit (config) conf; mkXwlWrapper = import ../niri/xwl-wrapper.nix; holo-script = pkgs.writeShellApplication { name = "holo-script"; - runtimeInputs = [ pkgs.steam pkgs.gamescope ]; + runtimeInputs = [pkgs.steam pkgs.gamescope]; text = '' gamescope -f -r 60 -h 900 -F fsr -e --mangoapp -- steam -tenfoot ''; @@ -19,31 +24,32 @@ name = "Steam Wrapped"; pkg = "steam"; }; -in mkIf conf.games.enable { - programs.steam.enable = true; - programs.gamescope.enable = true; - programs.gamemode.enable = true; +in + mkIf conf.games.enable { + programs.steam.enable = true; + programs.gamescope.enable = true; + programs.gamemode.enable = true; - environment.sessionVariables = { - MANGOHUD_CONFIGFILE = "$HOME/.config/MangoHud/MangoHud.conf"; - MANGOHUD_CONFIG = "read_cfg"; - }; + environment.sessionVariables = { + MANGOHUD_CONFIGFILE = "$HOME/.config/MangoHud/MangoHud.conf"; + MANGOHUD_CONFIG = "read_cfg"; + }; - home-manager.users.${conf.username} = { - home.packages = [ - pkgs.prismlauncher - holo - steam-wrapped - ]; + home-manager.users.${conf.username} = { + home.packages = [ + pkgs.prismlauncher + holo + steam-wrapped + ]; - programs.mangohud = { - enable = true; - settings = { - gamemode = true; - refresh_rate = true; - fsr = true; - resolution = true; + programs.mangohud = { + enable = true; + settings = { + gamemode = true; + refresh_rate = true; + fsr = true; + resolution = true; + }; }; }; - }; -} + } diff --git a/modules/git/default.nix b/modules/git/default.nix index aace3c0..7830cc8 100644 --- a/modules/git/default.nix +++ b/modules/git/default.nix @@ -1,39 +1,44 @@ -{ lib, config, ... }: let +{ + lib, + config, + ... +}: let inherit (lib) mkIf; inherit (config) conf; cfg = config.services.forgejo.settings.server; -in mkIf conf.git.enable { - services = { - nginx = { - virtualHosts.${cfg.DOMAIN} = { - forceSSL = true; - useACMEHost = "twoneis.site"; - extraConfig = '' - client_max_body_size 512M; - ''; - locations."/".proxyPass = "http://localhost:${toString cfg.HTTP_PORT}"; +in + mkIf conf.git.enable { + services = { + nginx = { + virtualHosts.${cfg.DOMAIN} = { + forceSSL = true; + useACMEHost = "twoneis.site"; + extraConfig = '' + client_max_body_size 512M; + ''; + locations."/".proxyPass = "http://localhost:${toString cfg.HTTP_PORT}"; + }; }; - }; - forgejo = { - enable = true; - database = { - type = "postgres"; - }; - user = "forgejo"; - lfs.enable = true; - settings = { - server = { - DOMAIN = "git.twoneis.site"; - ROOT_URL = "https://${cfg.DOMAIN}"; - HTTP_PORT = 3000; + forgejo = { + enable = true; + database = { + type = "postgres"; }; - service.DISABLE_REGISTRATION = true; - actions = { - ENABLED = true; - DEFAULT_ACTIONS_URL = "github"; + user = "forgejo"; + lfs.enable = true; + settings = { + server = { + DOMAIN = "git.twoneis.site"; + ROOT_URL = "https://${cfg.DOMAIN}"; + HTTP_PORT = 3000; + }; + service.DISABLE_REGISTRATION = true; + actions = { + ENABLED = true; + DEFAULT_ACTIONS_URL = "github"; + }; }; }; }; - }; -} + } diff --git a/modules/home/default.nix b/modules/home/default.nix index 33c0949..d553d8f 100644 --- a/modules/home/default.nix +++ b/modules/home/default.nix @@ -1,6 +1,6 @@ -{ config, ... }: let +{config, ...}: let inherit (config) conf; -in{ +in { home-manager = { useGlobalPkgs = true; useUserPackages = true; diff --git a/modules/layout/default.nix b/modules/layout/default.nix index 8748d27..8ff6863 100644 --- a/modules/layout/default.nix +++ b/modules/layout/default.nix @@ -1,17 +1,22 @@ -{ lib, config, ... }: let +{ + lib, + config, + ... +}: let inherit (lib) mkIf; inherit (config.conf) extraLayout; -in mkIf extraLayout.enable { - services.xserver.xkb = { - layout = "custom,us"; - options = "compose:ralt"; +in + mkIf extraLayout.enable { + services.xserver.xkb = { + layout = "custom,us"; + options = "compose:ralt"; - extraLayouts."custom" = { - description = "custom dvorak-like layout."; - languages = [ "en" ]; - symbolsFile = ./custom.xkb; + extraLayouts."custom" = { + description = "custom dvorak-like layout."; + languages = ["en"]; + symbolsFile = ./custom.xkb; + }; }; - }; - console.keyMap = "us"; -} + console.keyMap = "us"; + } diff --git a/modules/mail/default.nix b/modules/mail/default.nix index 4b2ae86..e61af62 100644 --- a/modules/mail/default.nix +++ b/modules/mail/default.nix @@ -1,93 +1,98 @@ -{ config, lib, ... }: let +{ + config, + lib, + ... +}: let inherit (config) conf; inherit (lib) mkIf; -in mkIf conf.mail.enable { - services.nginx = { - virtualHosts."chpu.eu" = { - serverName = "chpu.eu"; - serverAliases = [ - "webadmin.chpu.eu" - "autoconfig.chpu.eu" - "autodiscover.chpu.eu" - ]; - forceSSL = true; - useACMEHost = "chpu.eu"; - locations = { - "/" = { - proxyPass = "http://localhost:9090"; +in + mkIf conf.mail.enable { + services.nginx = { + virtualHosts."chpu.eu" = { + serverName = "chpu.eu"; + serverAliases = [ + "webadmin.chpu.eu" + "autoconfig.chpu.eu" + "autodiscover.chpu.eu" + ]; + forceSSL = true; + useACMEHost = "chpu.eu"; + locations = { + "/" = { + proxyPass = "http://localhost:9090"; + }; }; }; }; - }; - users.users."stalwart-mail".extraGroups = [ "nginx" ]; + users.users."stalwart-mail".extraGroups = ["nginx"]; - services.stalwart-mail = { - enable = true; - settings = { - config.local-keys = [ - "certificate.default.cert" - "certificate.default.private-key" - "authentication.fallback-admin.secret" - ]; - server = { - hostname = "chpu.eu"; - tls = { + services.stalwart-mail = { + enable = true; + settings = { + config.local-keys = [ + "certificate.default.cert" + "certificate.default.private-key" + "authentication.fallback-admin.secret" + ]; + server = { + hostname = "chpu.eu"; + tls = { + enable = true; + implicit = true; + }; + listener = { + submissions = { + protocol = "smtp"; + bind = "[::]:465"; + }; + smtp = { + protocol = "smtp"; + bind = "[::]:25"; + }; + imaps = { + protocol = "imap"; + bind = "[::]:993"; + }; + management = { + protocol = "http"; + bind = "127.0.0.1:9090"; + }; + }; + }; + lookup.default = { + hostname = "chpu.eu"; + domain = "chpu.eu"; + }; + certificate.default = { + default = true; + cert = "%{file:/var/lib/acme/chpu.eu/cert.pem}%"; + private-key = "%{file:/var/lib/acme/chpu.eu/key.pem}%"; + }; + storage = { + data = "db"; + fts = "db"; + block = "db"; + lookup = "db"; + directory = "internal"; + }; + directory."internal" = { + type = "internal"; + store = "db"; + }; + tracer."stdout" = { + type = "stdout"; + level = "info"; + ansi = false; enable = true; - implicit = true; }; - listener = { - submissions = { - protocol = "smtp"; - bind = "[::]:465"; - }; - smtp = { - protocol = "smtp"; - bind = "[::]:25"; - }; - imaps = { - protocol = "imap"; - bind = "[::]:993"; - }; - management = { - protocol = "http"; - bind = "127.0.0.1:9090"; - }; + session.rcpt = { + directory = "'internal'"; + }; + authentication.fallback-admin = { + user = "admin"; + secret = "%{file:/var/lib/stalwart-mail/secret/admin}%"; }; - }; - lookup.default = { - hostname = "chpu.eu"; - domain = "chpu.eu"; - }; - certificate.default = { - default = true; - cert = "%{file:/var/lib/acme/chpu.eu/cert.pem}%"; - private-key = "%{file:/var/lib/acme/chpu.eu/key.pem}%"; - }; - storage = { - data = "db"; - fts = "db"; - block = "db"; - lookup = "db"; - directory = "internal"; - }; - directory."internal" = { - type = "internal"; - store = "db"; - }; - tracer."stdout" = { - type = "stdout"; - level = "info"; - ansi = false; - enable = true; - }; - session.rcpt = { - directory = "'internal'"; - }; - authentication.fallback-admin = { - user = "admin"; - secret = "%{file:/var/lib/stalwart-mail/secret/admin}%"; }; }; - }; -} + } diff --git a/modules/matrix/default.nix b/modules/matrix/default.nix index ce11a5c..18bcadb 100644 --- a/modules/matrix/default.nix +++ b/modules/matrix/default.nix @@ -1,52 +1,57 @@ -{ config, lib, ... }: let +{ + config, + lib, + ... +}: let inherit (config) conf; inherit (lib) mkIf; -in mkIf conf.matrix.enable { - services.nginx.virtualHosts = { - "twoneis.site" = { - serverName = "twoneis.site"; - useACMEHost = "twoneis.site"; - forceSSL = true; - locations = { - "/.well-known/matrix/server" = { - return = "200 '{\"m.server\": \"matrix.twoneis.site:443\"}'"; +in + mkIf conf.matrix.enable { + services.nginx.virtualHosts = { + "twoneis.site" = { + serverName = "twoneis.site"; + useACMEHost = "twoneis.site"; + forceSSL = true; + locations = { + "/.well-known/matrix/server" = { + return = "200 '{\"m.server\": \"matrix.twoneis.site:443\"}'"; + }; + "/.well-known/matrix/client" = { + return = "200 '{\"m.homeserver\": {\"base_url\": \"https://matrix.twoneis.site\"}, \"org.matrix.msc3575.proxy\": {\"url\": \"https://matrix.twoneis.site\"}}'"; + }; + "/.well-known/matrix/support" = { + return = "200 '{\"contacts\": [{\"matrix_id\": \"@mira:twoneis.site\", \"email_address\": \"matrix@chpu.eu\", \"role\": \"m.role.admin\"}]}'"; + }; }; - "/.well-known/matrix/client" = { - return = "200 '{\"m.homeserver\": {\"base_url\": \"https://matrix.twoneis.site\"}, \"org.matrix.msc3575.proxy\": {\"url\": \"https://matrix.twoneis.site\"}}'"; - }; - "/.well-known/matrix/support" = { - return = "200 '{\"contacts\": [{\"matrix_id\": \"@mira:twoneis.site\", \"email_address\": \"matrix@chpu.eu\", \"role\": \"m.role.admin\"}]}'"; + }; + "matrix.twoneis.site" = { + serverName = "matrix.twoneis.site"; + forceSSL = true; + useACMEHost = "twoneis.site"; + locations = { + "/" = { + proxyPass = "http://localhost:6167"; + }; + "/.well-known/matrix/server" = { + return = "200 '{\"m.server\": \"matrix.twoneis.site:443\"}'"; + }; + "/.well-known/matrix/client" = { + return = "200 '{\"m.homeserver\": {\"base_url\": \"https://matrix.twoneis.site\"}, \"org.matrix.msc3575.proxy\": {\"url\": \"https://matrix.twoneis.site\"}}'"; + }; + "/.well-known/matrix/support" = { + return = "200 '{\"contacts\": [{\"matrix_id\": \"@mira:twoneis.site\", \"email_address\": \"matrix@chpu.eu\", \"role\": \"m.role.admin\"}]}'"; + }; }; }; }; - "matrix.twoneis.site" = { - serverName = "matrix.twoneis.site"; - forceSSL = true; - useACMEHost = "twoneis.site"; - locations = { - "/" = { - proxyPass = "http://localhost:6167"; - }; - "/.well-known/matrix/server" = { - return = "200 '{\"m.server\": \"matrix.twoneis.site:443\"}'"; - }; - "/.well-known/matrix/client" = { - return = "200 '{\"m.homeserver\": {\"base_url\": \"https://matrix.twoneis.site\"}, \"org.matrix.msc3575.proxy\": {\"url\": \"https://matrix.twoneis.site\"}}'"; - }; - "/.well-known/matrix/support" = { - return = "200 '{\"contacts\": [{\"matrix_id\": \"@mira:twoneis.site\", \"email_address\": \"matrix@chpu.eu\", \"role\": \"m.role.admin\"}]}'"; - }; + + services.conduwuit = { + enable = true; + settings.global = { + server_name = "matrix.twoneis.site"; + allow_registration = false; }; }; - }; - services.conduwuit = { - enable = true; - settings.global = { - server_name = "matrix.twoneis.site"; - allow_registration = false; - }; - }; - - networking.firewall.allowedTCPPorts = [ 443 8448 ]; -} + networking.firewall.allowedTCPPorts = [443 8448]; + } diff --git a/modules/networking/default.nix b/modules/networking/default.nix index f0ccad0..5cb6c07 100644 --- a/modules/networking/default.nix +++ b/modules/networking/default.nix @@ -1,16 +1,21 @@ -{ config, lib, pkgs, ... }: let +{ + config, + lib, + pkgs, + ... +}: let inherit (config) conf; inherit (lib) mkIf; -in mkIf conf.networkmanager.enable { - home-manager.users.${conf.username}.home.packages = [ pkgs.networkmanagerapplet ]; - networking = { - networkmanager = { - enable = true; - wifi.backend = "iwd"; +in + mkIf conf.networkmanager.enable { + home-manager.users.${conf.username}.home.packages = [pkgs.networkmanagerapplet]; + networking = { + networkmanager = { + enable = true; + wifi.backend = "iwd"; + }; + extraHosts = '' + 10.10.11.245 surveillance.htb + ''; }; - extraHosts = - '' - 10.10.11.245 surveillance.htb - ''; - }; -} + } diff --git a/modules/nginx/default.nix b/modules/nginx/default.nix index faea128..32f5bfc 100644 --- a/modules/nginx/default.nix +++ b/modules/nginx/default.nix @@ -1,52 +1,57 @@ -{ config, lib, ... }: let +{ + config, + lib, + ... +}: let inherit (config) conf; inherit (lib) mkIf; -in mkIf conf.nginx.enable { - security.acme = { - acceptTerms = true; - defaults.email = "mira.cp.0909@gmail.com"; - certs = { - "twoneis.site" = { - group = "nginx"; - domain = "twoneis.site"; - extraDomainNames = [ "*.twoneis.site" ]; - dnsProvider = "porkbun"; - email = "mira.cp.0909@gmail.com"; - environmentFile = "/root/porkbun-creds"; - }; +in + mkIf conf.nginx.enable { + security.acme = { + acceptTerms = true; + defaults.email = "mira.cp.0909@gmail.com"; + certs = { + "twoneis.site" = { + group = "nginx"; + domain = "twoneis.site"; + extraDomainNames = ["*.twoneis.site"]; + dnsProvider = "porkbun"; + email = "mira.cp.0909@gmail.com"; + environmentFile = "/root/porkbun-creds"; + }; - "chpu.eu" = { - group = "nginx"; - domain = "chpu.eu"; - extraDomainNames = [ "*.chpu.eu" ]; - dnsProvider = "porkbun"; - email = "mira.cp.0909@gmail.com"; - environmentFile = "/root/porkbun-creds"; + "chpu.eu" = { + group = "nginx"; + domain = "chpu.eu"; + extraDomainNames = ["*.chpu.eu"]; + dnsProvider = "porkbun"; + email = "mira.cp.0909@gmail.com"; + environmentFile = "/root/porkbun-creds"; + }; }; }; - }; - users.users.nginx.extraGroups = [ "acme" ]; + users.users.nginx.extraGroups = ["acme"]; - services.nginx = { - enable = true; - recommendedProxySettings = true; - virtualHosts = { - "chpu.eu" = { - serverName = "chpu.eu"; - useACMEHost = "chpu.eu"; - forceSSL = true; - }; - "twoneis.site" = { - serverName = "twoneis.site"; - useACMEHost = "twoneis.site"; - forceSSL = true; + services.nginx = { + enable = true; + recommendedProxySettings = true; + virtualHosts = { + "chpu.eu" = { + serverName = "chpu.eu"; + useACMEHost = "chpu.eu"; + forceSSL = true; + }; + "twoneis.site" = { + serverName = "twoneis.site"; + useACMEHost = "twoneis.site"; + forceSSL = true; + }; }; }; - }; - networking.firewall.allowedTCPPorts = [ - 80 - 443 - ]; -} + networking.firewall.allowedTCPPorts = [ + 80 + 443 + ]; + } diff --git a/modules/niri/default.nix b/modules/niri/default.nix index 0ab1c32..8187a0f 100644 --- a/modules/niri/default.nix +++ b/modules/niri/default.nix @@ -1,8 +1,14 @@ -{ lib, config, pkgs, ... }: let +{ + lib, + config, + pkgs, + ... +}: let inherit (lib) mkIf; inherit (config) conf; - swayosd-style = pkgs.writeText "swayosd.css" - (import ./swayosd.css.nix { config = config; }).style; + swayosd-style = + pkgs.writeText "swayosd.css" + (import ./swayosd.css.nix {config = config;}).style; in { config = mkIf conf.niri.enable { environment.sessionVariables = { @@ -10,12 +16,12 @@ in { }; environment.systemPackages = [ - (pkgs.catppuccin-sddm.override ({ + (pkgs.catppuccin-sddm.override { flavor = "mocha"; font = "Fira Code Nerd Font"; background = "${./sddm.wallpaper.png}"; loginBackground = true; - })) + }) ]; services.displayManager.sddm = { @@ -51,30 +57,39 @@ in { services.swayosd = { enable = true; topMargin = 0.8; - stylePath = swayosd-style; + stylePath = swayosd-style; }; programs.niri = { - settings = import ./niri.conf.nix { lib = lib; config = config; }; + settings = import ./niri.conf.nix { + lib = lib; + config = config; + }; }; - programs.fuzzel= { + programs.fuzzel = { enable = true; - settings = import ./fuzzel.conf.nix { lib = lib; config = config; }; + settings = import ./fuzzel.conf.nix { + lib = lib; + config = config; + }; }; programs.waybar = { enable = true; - settings = import ./waybar.conf.nix { }; - style = (import ./waybar.css.nix { config = config; }).style; + settings = import ./waybar.conf.nix {}; + style = (import ./waybar.css.nix {config = config;}).style; }; programs.swaylock = { enable = true; - package = (pkgs.swaylock-effects.overrideAttrs (final: prev: { - buildInputs = prev.buildInputs ++ [ pkgs.wayland-scanner ]; - })); - settings = import ./swaylock.conf.nix { lib = lib; config = config; }; + package = pkgs.swaylock-effects.overrideAttrs (final: prev: { + buildInputs = prev.buildInputs ++ [pkgs.wayland-scanner]; + }); + settings = import ./swaylock.conf.nix { + lib = lib; + config = config; + }; }; services.mako = { diff --git a/modules/niri/fuzzel.conf.nix b/modules/niri/fuzzel.conf.nix index 9d8e0cd..c7a88c9 100644 --- a/modules/niri/fuzzel.conf.nix +++ b/modules/niri/fuzzel.conf.nix @@ -1,4 +1,8 @@ -{ lib, config, ... }: let +{ + lib, + config, + ... +}: let inherit (lib.strings) concatStrings; inherit (config) theme; in { @@ -10,15 +14,15 @@ in { prompt = "'󱄅 '"; }; colors = { - background = concatStrings [ theme.surface "ee" ]; - prompt = concatStrings [ theme.text "ff" ]; - input = concatStrings [ theme.text "ff" ]; - text = concatStrings [ theme.text "ff" ]; - match = concatStrings [ theme.gold "ff" ]; - selection = concatStrings [ theme.highlight-med "ee" ]; - selection-text = concatStrings [ theme.text "ff" ]; - selection-match = concatStrings [ theme.gold "ff" ]; - }; + background = concatStrings [theme.surface "ee"]; + prompt = concatStrings [theme.text "ff"]; + input = concatStrings [theme.text "ff"]; + text = concatStrings [theme.text "ff"]; + match = concatStrings [theme.gold "ff"]; + selection = concatStrings [theme.highlight-med "ee"]; + selection-text = concatStrings [theme.text "ff"]; + selection-match = concatStrings [theme.gold "ff"]; + }; border = { width = 0; radius = 8; diff --git a/modules/niri/niri.conf.nix b/modules/niri/niri.conf.nix index 117ec9e..61fc139 100644 --- a/modules/niri/niri.conf.nix +++ b/modules/niri/niri.conf.nix @@ -1,53 +1,60 @@ -{ lib, config, ... }: let +{ + lib, + config, + ... +}: let inherit (config.conf) keys extraLayout; inherit (lib.attrsets) genAttrs; inherit (lib) mkMerge; in { input = { - keyboard = { - xkb = { - layout = if extraLayout.enable then "custom,us" else "us"; - options = "compose:ralt"; - }; + keyboard = { + xkb = { + layout = + if extraLayout.enable + then "custom,us" + else "us"; + options = "compose:ralt"; }; - touchpad = { - tap = true; - natural-scroll = true; - dwt = true; - }; - power-key-handling.enable = false; + }; + touchpad = { + tap = true; + natural-scroll = true; + dwt = true; + }; + power-key-handling.enable = false; }; outputs = mkMerge [ { # Framework builtin Display "BOE 0x0BCA Unknown" = { - scale = 1; - mode = { - width = 2256; - height = 1504; - refresh = 59.999; - }; - position = { - x = 0; - y = 0; - }; - background-color = config.theme.base; + scale = 1; + mode = { + width = 2256; + height = 1504; + refresh = 59.999; + }; + position = { + x = 0; + y = 0; + }; + background-color = config.theme.base; }; # Home Monitor - "Microstep MSI PS341WU 0000000000000" = { - scale = 1; - mode = { - width = 5120; - height = 2160; - refresh = 59.940; - }; - position = { - x = -1280; - y = -2160; - }; - background-color = config.theme.base; + "Microstep MSI PS341WU 0000000000000" = { + scale = 1; + mode = { + width = 5120; + height = 2160; + refresh = 59.940; + }; + position = { + x = -1280; + y = -2160; + }; + background-color = config.theme.base; }; # Uni Monitors @@ -76,29 +83,29 @@ in { ]; layout = { - focus-ring = { - width = 2; - active.gradient = { - to = config.theme.rose; - from = config.theme.pine; - in' = "oklch shorter hue"; - angle=135; - }; - inactive.color = config.theme.iris; + focus-ring = { + width = 2; + active.gradient = { + to = config.theme.rose; + from = config.theme.pine; + in' = "oklch shorter hue"; + angle = 135; }; + inactive.color = config.theme.iris; + }; - preset-column-widths = [ - { proportion = 0.25; } - { proportion = 0.5; } - { proportion = 0.75; } - ]; + preset-column-widths = [ + {proportion = 0.25;} + {proportion = 0.5;} + {proportion = 0.75;} + ]; - default-column-width = { }; + default-column-width = {}; - gaps = 4; - struts = { - top = 2; - }; + gaps = 4; + struts = { + top = 2; + }; }; window-rules = [ @@ -107,7 +114,7 @@ in { top-left = 8.0; top-right = 8.0; bottom-left = 8.0; - bottom-right= 8.0; + bottom-right = 8.0; }; clip-to-geometry = true; } @@ -120,8 +127,8 @@ in { hotkey-overlay.skip-at-startup = true; spawn-at-startup = [ - { command = [ "waybar" ]; } - { command = [ "swayidle" "-w" "before-sleep" "swaylock" ]; } + {command = ["waybar"];} + {command = ["swayidle" "-w" "before-sleep" "swaylock"];} ]; binds = { @@ -130,31 +137,47 @@ in { "Mod+B".action.spawn = "firefox"; "Mod+Space".action.spawn = "fuzzel"; - "XF86AudioRaiseVolume".action.spawn = [ - "swayosd-client" "--output-volume" "raise" + "XF86AudioRaiseVolume".action.spawn = [ + "swayosd-client" + "--output-volume" + "raise" ]; "XF86AudioLowerVolume".action.spawn = [ - "swayosd-client" "--output-volume" "lower" + "swayosd-client" + "--output-volume" + "lower" ]; "XF86AudioMute".action.spawn = [ - "swayosd-client" "--output-volume" "mute-toggle" + "swayosd-client" + "--output-volume" + "mute-toggle" ]; - "Mod+XF86AudioRaiseVolume".action.spawn = [ - "swayosd-client" "--input-volume" "raise" + "Mod+XF86AudioRaiseVolume".action.spawn = [ + "swayosd-client" + "--input-volume" + "raise" ]; "Mod+XF86AudioLowerVolume".action.spawn = [ - "swayosd-client" "--input-volume" "lower" + "swayosd-client" + "--input-volume" + "lower" ]; "Mod+XF86AudioMute".action.spawn = [ - "swayosd-client" "--output-volume" "mute-toggle" + "swayosd-client" + "--output-volume" + "mute-toggle" ]; "XF86MonBrightnessDown".action.spawn = [ - "swayosd-client" "--brightness" "lower" + "swayosd-client" + "--brightness" + "lower" ]; "XF86MonBrightnessUp".action.spawn = [ - "swayosd-client" "--brightness" "raise" + "swayosd-client" + "--brightness" + "raise" ]; "Mod+Backspace".action.close-window = []; diff --git a/modules/niri/sddm.theme.nix b/modules/niri/sddm.theme.nix index 2b2cafd..146aab2 100644 --- a/modules/niri/sddm.theme.nix +++ b/modules/niri/sddm.theme.nix @@ -1,4 +1,4 @@ -{ config, ... }: let +{config, ...}: let base = config.theme.base; surface = config.theme.surface; text = config.theme.text; diff --git a/modules/niri/sddm.wallpaper.png b/modules/niri/sddm.wallpaper.png index 7dfb56d473b83f154ce97ffc6908e727b082c6d3..dd7ba2fe815170235e0228c12255c33ae8018b7a 100644 GIT binary patch delta 14 VcmaDeiRIlSmWC~iIh;(qTmUcr1j+ya delta 11 ScmaDiiRH~CmWC~iIh+6?#{{te diff --git a/modules/niri/swaylock.conf.nix b/modules/niri/swaylock.conf.nix index 14cad6a..a33a651 100644 --- a/modules/niri/swaylock.conf.nix +++ b/modules/niri/swaylock.conf.nix @@ -1,4 +1,8 @@ -{ lib, config, ... }: let +{ + lib, + config, + ... +}: let inherit (lib.strings) concatStrings; inherit (config) theme; in { @@ -16,11 +20,11 @@ in { indicator-radius = 100; indicator-thickness = 4; - inside-color = concatStrings [ theme.overlay "aa" ]; - inside-clear-color = concatStrings [ theme.subtle "aa" ]; - inside-caps-lock-color = concatStrings [ theme.rose "aa" ]; - inside-ver-color = concatStrings [ theme.foam "aa" ]; - inside-wrong-color = concatStrings [ theme.love "aa" ]; + inside-color = concatStrings [theme.overlay "aa"]; + inside-clear-color = concatStrings [theme.subtle "aa"]; + inside-caps-lock-color = concatStrings [theme.rose "aa"]; + inside-ver-color = concatStrings [theme.foam "aa"]; + inside-wrong-color = concatStrings [theme.love "aa"]; line-uses-inside = true; ring-color = theme.surface; @@ -36,8 +40,8 @@ in { caps-lock-key-hl-color = theme.iris; caps-lock-bs-hl-color = theme.love; - layout-bg-color = concatStrings [ theme.overlay "aa" ]; - layout-border-color = concatStrings [ theme.overlay "aa" ]; + layout-bg-color = concatStrings [theme.overlay "aa"]; + layout-border-color = concatStrings [theme.overlay "aa"]; layout-text-color = theme.text; text-color = theme.text; diff --git a/modules/niri/swayosd.css.nix b/modules/niri/swayosd.css.nix index 7bf3d13..3458739 100644 --- a/modules/niri/swayosd.css.nix +++ b/modules/niri/swayosd.css.nix @@ -1,30 +1,30 @@ -{ config, ... }: let - background = config.theme.overlay; - muted = config.theme.muted; - font = config.theme.text; +{config, ...}: let + background = config.theme.overlay; + muted = config.theme.muted; + font = config.theme.text; in { - style = '' - window#osd { - border-radius: 8px; - border: none; - background: ${background}; - } + style = '' + window#osd { + border-radius: 8px; + border: none; + background: ${background}; + } - image, - label { - color: ${font}; - } + image, + label { + color: ${font}; + } - progressbar { - background: ${muted}; - } + progressbar { + background: ${muted}; + } - progress:disabled { - background: ${font}; - } + progress:disabled { + background: ${font}; + } - progress { - background: ${font}; - } - ''; + progress { + background: ${font}; + } + ''; } diff --git a/modules/niri/waybar.conf.nix b/modules/niri/waybar.conf.nix index 54cd4f0..3dfeb6e 100644 --- a/modules/niri/waybar.conf.nix +++ b/modules/niri/waybar.conf.nix @@ -1,4 +1,4 @@ -{ ... }: { +{...}: { mainBar = { layer = "top"; position = "top"; diff --git a/modules/niri/waybar.css.nix b/modules/niri/waybar.css.nix index 454b1bd..66899f6 100644 --- a/modules/niri/waybar.css.nix +++ b/modules/niri/waybar.css.nix @@ -1,62 +1,62 @@ -{ config, ... }: let - best = config.theme.pine; - better = config.theme.foam; - good = config.theme.iris; - bad = config.theme.rose; - worse = config.theme.gold; - worst = config.theme.love; - charging = config.theme.highlight-high; +{config, ...}: let + best = config.theme.pine; + better = config.theme.foam; + good = config.theme.iris; + bad = config.theme.rose; + worse = config.theme.gold; + worst = config.theme.love; + charging = config.theme.highlight-high; in { - style = '' - * { - font-size: 1px; - } + style = '' + * { + font-size: 1px; + } - window#waybar { - background: rgba(0, 0, 0, 0); - } + window#waybar { + background: rgba(0, 0, 0, 0); + } - #battery { - border: none; - border-radius: 4px; - min-height: 4px; - min-width: 720px; - margin: 2px; - background: ${best}; - } - #battery.better { - background: ${better}; - } - #battery.good { - background: ${good}; - } - #battery.bad { - background: ${bad}; - } - #battery.worse { - background: ${worse}; - } - #battery.worst { - background: ${worst}; - } + #battery { + border: none; + border-radius: 4px; + min-height: 4px; + min-width: 720px; + margin: 2px; + background: ${best}; + } + #battery.better { + background: ${better}; + } + #battery.good { + background: ${good}; + } + #battery.bad { + background: ${bad}; + } + #battery.worse { + background: ${worse}; + } + #battery.worst { + background: ${worst}; + } - #battery.charging { - background: linear-gradient(0deg, ${charging}, ${best}); - } - #battery.better.charging { - background: linear-gradient(0deg, ${best}, ${better}); - } - #battery.good.charging { - background: linear-gradient(0deg, ${better}, ${good}); - } - #battery.bad.charging { - background: linear-gradient(0deg, ${good}, ${bad}); - } - #battery.worse.charging { - background: linear-gradient(0deg, ${bad}, ${worse}); - } - #battery.worst.charging { - background: linear-gradient(0deg, ${worse}, ${worst}); - } - ''; + #battery.charging { + background: linear-gradient(0deg, ${charging}, ${best}); + } + #battery.better.charging { + background: linear-gradient(0deg, ${best}, ${better}); + } + #battery.good.charging { + background: linear-gradient(0deg, ${better}, ${good}); + } + #battery.bad.charging { + background: linear-gradient(0deg, ${good}, ${bad}); + } + #battery.worse.charging { + background: linear-gradient(0deg, ${bad}, ${worse}); + } + #battery.worst.charging { + background: linear-gradient(0deg, ${worse}, ${worst}); + } + ''; } diff --git a/modules/niri/xwl-wrapper.nix b/modules/niri/xwl-wrapper.nix index 994bec2..8fe8810 100644 --- a/modules/niri/xwl-wrapper.nix +++ b/modules/niri/xwl-wrapper.nix @@ -1,13 +1,20 @@ -{ pkgs, name, pkg ? name, exe ? pkg, ... }: let +{ + pkgs, + name, + pkg ? name, + exe ? pkg, + ... +}: let inherit (pkgs.lib) concatStrings; config = pkgs.writeTextFile { - name = concatStrings [ "i3-config" name ]; + name = concatStrings ["i3-config" name]; text = '' exec ${pkgs.${pkg}}/bin/${exe} ''; }; -in pkgs.makeDesktopItem { - name = name; - desktopName = name; - exec = "${pkgs.xwayland-run}/bin/xwayland-run -- ${pkgs.i3}/bin/i3 -c ${config}"; -} +in + pkgs.makeDesktopItem { + name = name; + desktopName = name; + exec = "${pkgs.xwayland-run}/bin/xwayland-run -- ${pkgs.i3}/bin/i3 -c ${config}"; + } diff --git a/modules/nix/default.nix b/modules/nix/default.nix index dd0bf88..2397c77 100644 --- a/modules/nix/default.nix +++ b/modules/nix/default.nix @@ -1,4 +1,8 @@ -{ inputs, ... }: { +{ + pkgs, + inputs, + ... +}: { nix = { nixPath = ["nixpkgs=${inputs.nixpkgs}"]; gc = { @@ -7,7 +11,7 @@ options = "--delete-older-than 14d"; }; settings = { - experimental-features = [ "nix-command" "flakes" ]; + experimental-features = ["nix-command" "flakes"]; auto-optimise-store = true; }; }; @@ -22,4 +26,5 @@ allowUnfree = true; }; }; + environment.systemPackages = [inputs.alejandra.defaultPackage.${pkgs.system}]; } diff --git a/modules/secureboot/default.nix b/modules/secureboot/default.nix index d3ca1db..21832cc 100644 --- a/modules/secureboot/default.nix +++ b/modules/secureboot/default.nix @@ -1,13 +1,19 @@ -{ lib, config, pkgs, ... }: let +{ + lib, + config, + pkgs, + ... +}: let inherit (lib) mkIf mkForce; inherit (config) conf; -in mkIf conf.secureboot.enable { - environment.systemPackages = [ pkgs.sbctl ]; +in + mkIf conf.secureboot.enable { + environment.systemPackages = [pkgs.sbctl]; - boot.loader.systemd-boot.enable = mkForce false; + boot.loader.systemd-boot.enable = mkForce false; - boot.lanzaboote = { - enable = true; - pkiBundle = "/var/lib/sbctl"; - }; -} + boot.lanzaboote = { + enable = true; + pkiBundle = "/var/lib/sbctl"; + }; + } diff --git a/modules/ssh/default.nix b/modules/ssh/default.nix index 21e6af1..cbe8f2b 100644 --- a/modules/ssh/default.nix +++ b/modules/ssh/default.nix @@ -1,19 +1,24 @@ -{ lib, config, ... }: let +{ + lib, + config, + ... +}: let inherit (lib) mkIf; inherit (config) conf; -in mkIf conf.ssh.enable { - services.openssh = { - enable = true; - settings = { - PasswordAuthentication = false; +in + mkIf conf.ssh.enable { + services.openssh = { + enable = true; + settings = { + PasswordAuthentication = false; + }; }; - }; - users.users.root.openssh.authorizedKeys.keys = [ - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMYy89cBNXjet2kBbOw7CKMJguyIq72EQV8ixo836nOH" - ]; + users.users.root.openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMYy89cBNXjet2kBbOw7CKMJguyIq72EQV8ixo836nOH" + ]; - users.users.${conf.username}.openssh.authorizedKeys.keys = [ - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMYy89cBNXjet2kBbOw7CKMJguyIq72EQV8ixo836nOH" - ]; -} + users.users.${conf.username}.openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMYy89cBNXjet2kBbOw7CKMJguyIq72EQV8ixo836nOH" + ]; + } diff --git a/modules/utils/default.nix b/modules/utils/default.nix index ca798e3..6407cdf 100644 --- a/modules/utils/default.nix +++ b/modules/utils/default.nix @@ -1,4 +1,9 @@ -{ config, lib, pkgs, ... }: let +{ + config, + lib, + pkgs, + ... +}: let inherit (config) conf; inherit (config.conf) keys; inherit (lib.strings) concatMapStrings; @@ -54,9 +59,9 @@ in { programs.helix = { enable = true; defaultEditor = true; - extraPackages = with pkgs; [ nil marksman ]; - settings = import ./helix.conf.nix { config = config; }; - languages = import ./helix-languages.conf.nix { }; + extraPackages = with pkgs; [nil marksman]; + settings = import ./helix.conf.nix {config = config;}; + languages = import ./helix-languages.conf.nix {}; }; programs.direnv = { @@ -71,14 +76,20 @@ in { programs.hyfetch = { enable = true; - settings = import ./hyfetch.conf.nix { }; + settings = import ./hyfetch.conf.nix {}; }; programs.fish = { enable = true; plugins = with pkgs.fishPlugins; [ - { name = "pure"; src = pure.src; } - { name = "bass"; src = bass.src; } + { + name = "pure"; + src = pure.src; + } + { + name = "bass"; + src = bass.src; + } ]; interactiveShellInit = concatMapStrings (x: "set --universal " + x + "\n") [ "pure_enable_nixdevshell true" diff --git a/modules/utils/helix-languages.conf.nix b/modules/utils/helix-languages.conf.nix index ed9aac6..5ca6922 100644 --- a/modules/utils/helix-languages.conf.nix +++ b/modules/utils/helix-languages.conf.nix @@ -6,6 +6,10 @@ }; language = [{ + name = "nix"; + auto-format = true; + formatter.command = "alejandra"; + } { name = "gas"; scope = "source.gas"; auto-format = false; diff --git a/modules/utils/helix.conf.nix b/modules/utils/helix.conf.nix index cffbf28..ed71624 100644 --- a/modules/utils/helix.conf.nix +++ b/modules/utils/helix.conf.nix @@ -1,4 +1,4 @@ -{ config, ... }: let +{config, ...}: let inherit (config.conf) keys; in { theme = "rose_pine"; @@ -15,12 +15,12 @@ in { display-inlay-hints = true; }; - gutters = [ "diagnostics" "line-numbers" "diff" ]; + gutters = ["diagnostics" "line-numbers" "diff"]; statusline = { - left = [ "mode" "spinner" "version-control" ]; - center = [ "file-modification-indicator" "read-only-indicator" "file-name" ]; - right = [ "diagnostics" "position" ]; + left = ["mode" "spinner" "version-control"]; + center = ["file-modification-indicator" "read-only-indicator" "file-name"]; + right = ["diagnostics" "position"]; }; cursor-shape = { @@ -30,7 +30,7 @@ in { }; }; - keys.normal = { + keys.normal = { ${keys.up} = "move_line_up"; ${keys.down} = "move_line_down"; ${keys.left} = "move_char_left"; diff --git a/modules/utils/hyfetch.conf.nix b/modules/utils/hyfetch.conf.nix index 5dde5bf..6e61968 100644 --- a/modules/utils/hyfetch.conf.nix +++ b/modules/utils/hyfetch.conf.nix @@ -1,10 +1,10 @@ -{ ... }: { +{...}: { preset = "transgender"; mode = "rgb"; light_dark = "dark"; lightness = 0.65; color_align = { - mode = "horizontal"; + mode = "horizontal"; }; backend = "neofetch"; distro = "nixos_old"; diff --git a/modules/vm/default.nix b/modules/vm/default.nix index 0a60183..4225d25 100644 --- a/modules/vm/default.nix +++ b/modules/vm/default.nix @@ -1,20 +1,26 @@ -{ lib, config, pkgs, ... }: let +{ + lib, + config, + pkgs, + ... +}: let inherit (lib) mkIf; inherit (config) conf; -in mkIf conf.vm.enable { - virtualisation.libvirtd = { - enable = true; - qemu.vhostUserPackages = [ pkgs.virtiofsd ]; - }; - programs.virt-manager.enable = true; +in + mkIf conf.vm.enable { + virtualisation.libvirtd = { + enable = true; + qemu.vhostUserPackages = [pkgs.virtiofsd]; + }; + programs.virt-manager.enable = true; - users.users.${conf.username}.extraGroups = [ "libvirtd" ]; - home-manager.users.${conf.username} = { - dconf.settings = { - "org/virt-manager/virt-manager/connections" = { - autoconnect = [ "qemu:///system" ]; - uris = [ "qemu:///system" ]; + users.users.${conf.username}.extraGroups = ["libvirtd"]; + home-manager.users.${conf.username} = { + dconf.settings = { + "org/virt-manager/virt-manager/connections" = { + autoconnect = ["qemu:///system"]; + uris = ["qemu:///system"]; + }; }; }; - }; -} + } diff --git a/modules/website/default.nix b/modules/website/default.nix index ba84285..78d8324 100644 --- a/modules/website/default.nix +++ b/modules/website/default.nix @@ -1,14 +1,19 @@ -{ lib, config, ... }: let +{ + lib, + config, + ... +}: let inherit (lib) mkIf; inherit (config) conf; -in mkIf conf.website.enable { - services.nginx.virtualHosts = { - "twoneis.site" = { - default = true; - serverName = "twoneis.site"; - useACMEHost = "twoneis.site"; - forceSSL = true; - root = "/var/lib/website/"; +in + mkIf conf.website.enable { + services.nginx.virtualHosts = { + "twoneis.site" = { + default = true; + serverName = "twoneis.site"; + useACMEHost = "twoneis.site"; + forceSSL = true; + root = "/var/lib/website/"; + }; }; - }; -} + } diff --git a/options.nix b/options.nix index 8a62f24..223d970 100644 --- a/options.nix +++ b/options.nix @@ -1,4 +1,4 @@ -{ lib, ... }: let +{lib, ...}: let inherit (lib) mkOption mkEnableOption; inherit (lib.types) nullOr attrsOf str; in { @@ -48,7 +48,7 @@ in { keys = mkOption { type = attrsOf str; - description =- "Default key binds."; + description = - "Default key binds."; default = { up = "t"; down = "n"; @@ -68,7 +68,7 @@ in { disks = mkOption { type = attrsOf str; description = "A set of UUIDs of the partitions/lvms/... that can be used easily reused in the config. In this config boot and root are assumed to be always present."; - default = { }; + default = {}; example = { boot = "4672-C1A9"; crypt = "747ae319-f189-44f5-9737-a42672e2c02d"; diff --git a/outputs.nix b/outputs.nix index 006c91a..691eea3 100644 --- a/outputs.nix +++ b/outputs.nix @@ -1,11 +1,19 @@ -{ nixpkgs, home-manager, nixos-hardware, disko, niri, lanzaboote, ... }@inputs: let +{ + nixpkgs, + home-manager, + nixos-hardware, + disko, + niri, + lanzaboote, + ... +} @ inputs: let modules = [ - ./options.nix - ./modules - niri.nixosModules.niri - home-manager.nixosModules.home-manager - lanzaboote.nixosModules.lanzaboote - disko.nixosModules.disko + ./options.nix + ./modules + niri.nixosModules.niri + home-manager.nixosModules.home-manager + lanzaboote.nixosModules.lanzaboote + disko.nixosModules.disko ]; in { nixosConfigurations = { @@ -18,10 +26,12 @@ in { specialArgs = { inherit inputs; }; - modules = [ - ./devices/inkvine - nixos-hardware.nixosModules.framework-13-7040-amd - ] ++ modules; + modules = + [ + ./devices/inkvine + nixos-hardware.nixosModules.framework-13-7040-amd + ] + ++ modules; }; ellaca = nixpkgs.lib.nixosSystem { @@ -29,9 +39,11 @@ in { specialArgs = { inherit inputs; }; - modules = [ - ./devices/ellaca - ] ++ modules; + modules = + [ + ./devices/ellaca + ] + ++ modules; }; }; }