From 8a78e618bba2591b60fe5edcd4476a02912d8ecc Mon Sep 17 00:00:00 2001 From: Kopatz <7265381+Kropatz@users.noreply.github.com> Date: Thu, 30 Oct 2025 21:59:31 +0100 Subject: [PATCH] format all --- flake.nix | 163 +++--- home-manager/code.nix | 10 +- home-manager/direnv.nix | 7 +- home-manager/discord-theme.nix | 3 +- home-manager/dunst.nix | 13 +- home-manager/fastfetch.nix | 7 +- .../firefox/config/browser-features.nix | 2 +- home-manager/firefox/config/preferences.nix | 5 +- home-manager/firefox/default.nix | 510 ++++++++++-------- home-manager/floorp/default.nix | 119 ++-- home-manager/gitconfig.nix | 7 +- home-manager/hyprland/hyprland-settings.nix | 109 ++-- .../hyprland/hyprland-xwaylandvideobridge.nix | 9 +- home-manager/hyprland/hyprlock.nix | 17 +- home-manager/hyprland/hyprshade.nix | 67 ++- home-manager/hyprland/hyprspace.nix | 37 +- home-manager/hyprland/waybar.nix | 90 +++- home-manager/i3.nix | 30 +- home-manager/kitty.nix | 8 +- home-manager/lf.nix | 7 +- home-manager/mpv.nix | 7 +- home-manager/nixvim/auto-pairs.nix | 4 +- home-manager/nixvim/barbar.nix | 6 +- home-manager/nixvim/cmp.nix | 51 +- home-manager/nixvim/config.nix | 26 +- home-manager/nixvim/default.nix | 86 +-- home-manager/nixvim/git.nix | 8 +- home-manager/nixvim/lightline.nix | 6 +- home-manager/nixvim/lsp.nix | 16 +- home-manager/nixvim/markdown.nix | 5 +- home-manager/nixvim/neo-tree.nix | 1 - home-manager/nixvim/refactoring.nix | 4 +- home-manager/nixvim/telescope.nix | 4 +- home-manager/nixvim/which_key.nix | 4 +- home-manager/nixvim/wilder.nix | 6 +- home-manager/nvim.nix | 7 +- home-manager/opensnitch-ui.nix | 16 +- home-manager/rofi/default.nix | 18 +- home-manager/stylix.nix | 10 +- home-manager/theme.nix | 7 +- home-manager/vr.nix | 54 +- home-manager/zsh/default.nix | 28 +- misc-unrelated/budak-image.nix | 14 +- modules/fh/bakk.nix | 8 +- modules/fh/writing.nix | 3 +- modules/graphical/audio.nix | 7 +- modules/graphical/awesome.nix | 13 +- modules/graphical/basics.nix | 14 +- modules/graphical/code-android.nix | 19 +- modules/graphical/code.nix | 39 +- modules/graphical/cosmic.nix | 12 +- modules/graphical/default.nix | 7 +- modules/graphical/emulators.nix | 8 +- modules/graphical/games.nix | 53 +- modules/graphical/gnome-settings.nix | 202 +++---- modules/graphical/gnome.nix | 57 +- modules/graphical/hyprland.nix | 29 +- modules/graphical/i3.nix | 24 +- modules/graphical/ime.nix | 17 +- modules/graphical/lightdm.nix | 13 +- modules/graphical/lxqt.nix | 7 +- modules/graphical/nightlight.nix | 13 +- modules/graphical/niri.nix | 17 +- modules/graphical/noise-supression.nix | 7 +- modules/graphical/obs.nix | 7 +- modules/graphical/openrgb.nix | 7 +- modules/graphical/plasma.nix | 13 +- modules/graphical/sddm.nix | 17 +- modules/graphical/shared.nix | 37 +- modules/graphical/stylix.nix | 21 +- modules/graphical/sway.nix | 13 +- modules/graphical/xfce.nix | 7 +- modules/hardware/amd-gpu.nix | 93 ++-- modules/hardware/android.nix | 15 +- modules/hardware/default.nix | 3 +- modules/hardware/fingerprint.nix | 13 +- modules/hardware/firmware.nix | 1 - modules/hardware/nvidia.nix | 164 +++--- modules/hardware/ryzenmonitor.nix | 3 +- modules/hardware/scheduler.nix | 1 - modules/hardware/ssd.nix | 1 - modules/hardware/tablet.nix | 13 +- modules/hardware/tpm.nix | 17 +- modules/hardware/vfio.nix | 28 +- modules/hardware/vr.nix | 21 +- modules/hardware/wooting.nix | 7 +- modules/misc/backup.nix | 124 +++-- modules/misc/btrfs.nix | 1 - modules/misc/cli-tools.nix | 25 +- modules/misc/docker.nix | 12 +- modules/misc/faster-boot-time.nix | 18 +- modules/misc/firejail.nix | 26 +- modules/misc/kernel-testing.nix | 37 +- modules/misc/nftables.nix | 1 - modules/misc/nixvim.nix | 14 +- modules/misc/packages-list.nix | 6 +- modules/misc/podman.nix | 17 +- modules/misc/static-ip.nix | 25 +- modules/misc/tmpfs.nix | 1 - modules/misc/virt-manager.nix | 44 +- modules/misc/wireshark.nix | 8 +- modules/misc/zram.nix | 8 +- modules/nix/index.nix | 10 +- modules/nix/latest.nix | 8 +- modules/nix/ld.nix | 7 +- modules/nix/settings.nix | 17 +- modules/services/acme.nix | 8 +- modules/services/adam-site.nix | 19 +- modules/services/adguard.nix | 245 +++++---- modules/services/caldav.nix | 33 +- modules/services/coturn.nix | 22 +- modules/services/ddclient-cloudflare.nix | 8 +- modules/services/dnsmasq.nix | 14 +- modules/services/duckdns.nix | 12 +- modules/services/ente.nix | 8 +- modules/services/fileshelter.nix | 9 +- modules/services/games/palworld.nix | 9 +- modules/services/games/terraria.nix | 8 +- modules/services/github-runner.nix | 27 +- modules/services/gitolite.nix | 14 +- modules/services/grafana.nix | 67 +-- modules/services/kavita.nix | 43 +- modules/services/kop-fileshare.nix | 18 +- modules/services/kop-monitor.nix | 19 +- modules/services/kubernetes.nix | 7 +- modules/services/nextcloud.nix | 14 +- modules/services/nginx.nix | 32 +- modules/services/nix-cache.nix | 3 +- modules/services/opensnitch.nix | 14 +- modules/services/paperless.nix | 9 +- modules/services/plausible.nix | 14 +- modules/services/rdp.nix | 8 +- modules/services/smartd.nix | 14 +- modules/services/step-ca.nix | 70 +-- modules/services/synapse.nix | 25 +- modules/services/syncthing.nix | 86 ++- modules/services/wireguard-client.nix | 13 +- modules/services/wireguard.nix | 24 +- modules/wake-on-lan.nix | 8 +- modules/work/vpn.nix | 3 +- overlays.nix | 63 ++- pkgs/adam-site/default.nix | 6 +- pkgs/csharp-lsp/default.nix | 12 +- pkgs/default.nix | 19 +- pkgs/ente-frontend/default.nix | 19 +- .../default.nix | 30 +- pkgs/hub/default.nix | 7 +- pkgs/internxt-cli/default.nix | 52 +- pkgs/kop-fhcalendar/default.nix | 7 +- pkgs/kop-fileshare/default.nix | 8 +- pkgs/kop-monitor/default.nix | 9 +- pkgs/kop-newproject/default.nix | 7 +- pkgs/mangal/default.nix | 21 +- pkgs/peframe/default.nix | 73 +-- pkgs/scheibnkleister-presence/default.nix | 9 +- pkgs/sddm-astronaut/default.nix | 20 +- pkgs/website/default.nix | 9 +- secrets/secrets.nix | 159 ++++-- systems/adam-site/configuration.nix | 55 +- systems/amd-server-vm/configuration.nix | 81 ++- systems/amd-server-vm/disk-config.nix | 8 +- systems/amd-server-vm/mail.nix | 67 ++- systems/amd-server-vpn-vm/configuration.nix | 17 +- systems/amd-server-vpn-vm/disk-config.nix | 8 +- systems/amd-server-vpn-vm/hardware.nix | 29 +- systems/amd-server/configuration.nix | 44 +- .../hardware-configuration-intel.nix | 24 +- systems/amd-server/hardware-configuration.nix | 31 +- systems/laptop/configuration.nix | 19 +- systems/laptop/disk-config.nix | 49 +- systems/laptop/hardware-configuration.nix | 21 +- systems/laptop/modules/battery.nix | 13 +- systems/laptop/modules/rpi-stuffidk.nix | 16 +- systems/laptop/secrets/secrets.nix | 5 +- systems/pc/configuration.nix | 52 +- systems/pc/hardware-configuration.nix | 50 +- systems/pc/tailscale-client.nix | 7 +- systems/portable-ssd/configuration.nix | 58 +- systems/vm/configuration.nix | 9 +- systems/vm/vm-common.nix | 21 +- users/anon/default.nix | 18 +- users/anon/home.nix | 7 +- users/default.nix | 11 +- users/kopatz/default.nix | 18 +- users/kopatz/home.nix | 30 +- users/option.nix | 7 +- users/vm/default.nix | 19 +- users/vm/home.nix | 12 +- 188 files changed, 3526 insertions(+), 1825 deletions(-) diff --git a/flake.nix b/flake.nix index 4867fe6..e3fe552 100644 --- a/flake.nix +++ b/flake.nix @@ -59,80 +59,107 @@ #}; }; outputs = - { self - , nur - , nixpkgs - , nixos-hardware - , nixpkgs-unstable - , agenix - , home-manager - , home-manager-unstable + { + self, + nur, + nixpkgs, + nixos-hardware, + nixpkgs-unstable, + agenix, + home-manager, + home-manager-unstable, #, nixos-cosmic - , nixvim - , stylix - , disko - , flake-utils - , ... + nixvim, + stylix, + disko, + flake-utils, + ... }@inputs: let inherit (self) outputs; - overlays = { outputs, ... }: { - nixpkgs.overlays = with outputs.overlays; [ - #unstable-packages - stable-packages - additions - modifications - nur.overlays.default - ]; - }; - defaultModules = [ ./modules agenix.nixosModules.default overlays ]; + overlays = + { outputs, ... }: + { + nixpkgs.overlays = with outputs.overlays; [ + #unstable-packages + stable-packages + additions + modifications + nur.overlays.default + ]; + }; + defaultModules = [ + ./modules + agenix.nixosModules.default + overlays + ]; # helper function to create a machine mkHost = - { modules - , specialArgs ? { + { + modules, + specialArgs ? { pkgsVersion = nixpkgs-unstable; home-manager-version = home-manager-unstable; - } - , system ? "x86_64-linux" - , minimal ? false - , graphical ? true + }, + system ? "x86_64-linux", + minimal ? false, + graphical ? true, }: - let lib = specialArgs.pkgsVersion.lib; - in specialArgs.pkgsVersion.lib.nixosSystem { + let + lib = specialArgs.pkgsVersion.lib; + in + specialArgs.pkgsVersion.lib.nixosSystem { inherit system; - modules = modules ++ defaultModules ++ lib.lists.optionals (!minimal) - [ specialArgs.home-manager-version.nixosModules.home-manager ] + modules = + modules + ++ defaultModules + ++ lib.lists.optionals (!minimal) [ specialArgs.home-manager-version.nixosModules.home-manager ] ++ lib.lists.optionals (!minimal && graphical) [ - stylix.nixosModules.stylix - inputs.nixpkgs-xr.nixosModules.nixpkgs-xr - ./modules/graphical/stylix.nix - #nixos-cosmic.nixosModules.default - #./modules/graphical/cosmic.nix - ({ outputs, ... }: { stylix.image = ./tsukasa.jpg; }) - ]; - specialArgs = specialArgs // { inherit inputs outputs; }; + stylix.nixosModules.stylix + inputs.nixpkgs-xr.nixosModules.nixpkgs-xr + ./modules/graphical/stylix.nix + #nixos-cosmic.nixosModules.default + #./modules/graphical/cosmic.nix + ( + { outputs, ... }: + { + stylix.image = ./tsukasa.jpg; + } + ) + ]; + specialArgs = specialArgs // { + inherit inputs outputs; + }; }; mkStableServer = - { modules - , specialArgs ? { + { + modules, + specialArgs ? { pkgsVersion = nixpkgs; home-manager-version = home-manager; - } - , system ? "x86_64-linux" - , minimal ? false + }, + system ? "x86_64-linux", + minimal ? false, }: - let lib = specialArgs.pkgsVersion.lib; - in specialArgs.pkgsVersion.lib.nixosSystem { + let + lib = specialArgs.pkgsVersion.lib; + in + specialArgs.pkgsVersion.lib.nixosSystem { inherit system; - modules = modules - ++ [ ./modules agenix.nixosModules.default overlays ] - ++ lib.lists.optionals (!minimal) - [ specialArgs.home-manager-version.nixosModules.home-manager ]; - specialArgs = specialArgs // { inherit inputs outputs; }; + modules = + modules + ++ [ + ./modules + agenix.nixosModules.default + overlays + ] + ++ lib.lists.optionals (!minimal) [ specialArgs.home-manager-version.nixosModules.home-manager ]; + specialArgs = specialArgs // { + inherit inputs outputs; + }; }; customPackages = flake-utils.lib.eachDefaultSystem (system: { - packages = - import ./pkgs { pkgs = nixpkgs-unstable.legacyPackages.${system}; }; + packages = import ./pkgs { pkgs = nixpkgs-unstable.legacyPackages.${system}; }; }); in { @@ -140,7 +167,10 @@ nixosConfigurations = { "kop-pc" = mkHost { - modules = [ ./users/kopatz ./systems/pc/configuration.nix ]; + modules = [ + ./users/kopatz + ./systems/pc/configuration.nix + ]; }; "framework" = mkHost { modules = [ @@ -159,11 +189,16 @@ pkgsVersion = nixpkgs; home-manager-version = home-manager; }; - modules = - [ disko.nixosModules.disko ./systems/adam-site/configuration.nix ]; + modules = [ + disko.nixosModules.disko + ./systems/adam-site/configuration.nix + ]; }; "amd-server" = mkHost { - modules = [ ./users/kopatz ./systems/amd-server/configuration.nix ]; + modules = [ + ./users/kopatz + ./systems/amd-server/configuration.nix + ]; }; "amd-server-vpn-vm" = mkHost { modules = [ @@ -173,9 +208,13 @@ ]; }; # build vm -> nixos-rebuild build-vm --flake .#vm - "vm" = - mkHost { modules = [ ./users/vm ./systems/vm/configuration.nix ]; }; - # nixos-rebuild switch --flake .#server-vm --target-host root@192.168.0.21 + "vm" = mkHost { + modules = [ + ./users/vm + ./systems/vm/configuration.nix + ]; + }; + # nixos-rebuild switch --flake .#server-vm --target-host root@192.168.0.21 "server-vm" = mkHost { modules = [ ./users/anon diff --git a/home-manager/code.nix b/home-manager/code.nix index 560a748..d44e6b8 100644 --- a/home-manager/code.nix +++ b/home-manager/code.nix @@ -1,4 +1,12 @@ -{ osConfig, config, pkgs, inputs, lib, ... }: { +{ + osConfig, + config, + pkgs, + inputs, + lib, + ... +}: +{ config = lib.mkIf osConfig.custom.graphical.code.enable rec { #home.activation.makeVSCodeConfigWritable = # let diff --git a/home-manager/direnv.nix b/home-manager/direnv.nix index 69f2d87..56e8044 100644 --- a/home-manager/direnv.nix +++ b/home-manager/direnv.nix @@ -1,4 +1,9 @@ -{ config, pkgs, inputs, ... }: +{ + config, + pkgs, + inputs, + ... +}: { programs.direnv = { enable = true; diff --git a/home-manager/discord-theme.nix b/home-manager/discord-theme.nix index 1f3a959..b451599 100644 --- a/home-manager/discord-theme.nix +++ b/home-manager/discord-theme.nix @@ -1,3 +1,4 @@ -{ ... }: { +{ ... }: +{ home.file.".config/Vencord/themes/theme.css".source = ./BasicBackground.theme.css; } diff --git a/home-manager/dunst.nix b/home-manager/dunst.nix index df360e9..f70fcc7 100644 --- a/home-manager/dunst.nix +++ b/home-manager/dunst.nix @@ -1,6 +1,13 @@ -{ lib, osConfig, pkgs, ... }: -let enable = osConfig.custom.graphical.i3.enable || osConfig.custom.graphical.hyprland.enable; -in { +{ + lib, + osConfig, + pkgs, + ... +}: +let + enable = osConfig.custom.graphical.i3.enable || osConfig.custom.graphical.hyprland.enable; +in +{ config = lib.mkIf enable { services.dunst = { enable = true; diff --git a/home-manager/fastfetch.nix b/home-manager/fastfetch.nix index f813aa9..98bda9f 100644 --- a/home-manager/fastfetch.nix +++ b/home-manager/fastfetch.nix @@ -1,10 +1,13 @@ -{ lib, pkgs, ... }: { +{ lib, pkgs, ... }: +{ programs.fastfetch = { enable = true; settings = { #logo = { source = ../test.sixel; type = "raw"; width = 40; height = 40; }; - display = { separator = ""; }; + display = { + separator = ""; + }; # https://www.nerdfonts.com/cheat-sheet modules = [ diff --git a/home-manager/firefox/config/browser-features.nix b/home-manager/firefox/config/browser-features.nix index d6f3058..d56b99e 100644 --- a/home-manager/firefox/config/browser-features.nix +++ b/home-manager/firefox/config/browser-features.nix @@ -121,7 +121,7 @@ # some PDFs are not rendered correctly due to missing functions. "pdfjs.enableScripting" = false; - # copied these from a blog + # copied these from a blog "browser.newtabpage.activity-stream.feeds.telemetry" = false; "browser.newtabpage.activity-stream.feeds.asrouterfeed" = false; "browser.newtabpage.activity-stream.telemetry" = false; diff --git a/home-manager/firefox/config/preferences.nix b/home-manager/firefox/config/preferences.nix index 03713fb..48ee2b0 100644 --- a/home-manager/firefox/config/preferences.nix +++ b/home-manager/firefox/config/preferences.nix @@ -17,8 +17,7 @@ # Firefox 83 introduced sponsored top sites # (https://support.mozilla.org/en-US/kb/sponsor-privacy), which are sponsored ads # displayed as suggestions in the URL bar. - "services.sync.prefs.sync.browser.newtabpage.activity-stream.showSponsoredTopSite" = - false; + "services.sync.prefs.sync.browser.newtabpage.activity-stream.showSponsoredTopSite" = false; # Disable about:config warning. # No details "browser.aboutConfig.showWarning" = false; @@ -40,7 +39,7 @@ # time about their experience with Firefox. "browser.selfsupport.url" = ""; # Content of the new tab page - # + # "browser.newtabpage.enhanced" = false; # Disable the new tab page (blank page) "browser.newtabpage.enabled" = false; diff --git a/home-manager/firefox/default.nix b/home-manager/firefox/default.nix index ccd89f4..0a767c1 100644 --- a/home-manager/firefox/default.nix +++ b/home-manager/firefox/default.nix @@ -1,226 +1,231 @@ -{ pkgs, lib, osConfig, ... }: +{ + pkgs, + lib, + osConfig, + ... +}: let base16 = osConfig.stylix.base16Scheme; merge = lib.foldr (a: b: a // b) { }; betterfox = '' -/**************************************************************************** - * SECTION: FASTFOX * -****************************************************************************/ -/** GENERAL ***/ -user_pref("content.notify.interval", 100000); + /**************************************************************************** + * SECTION: FASTFOX * + ****************************************************************************/ + /** GENERAL ***/ + user_pref("content.notify.interval", 100000); -/** GFX ***/ -user_pref("gfx.canvas.accelerated.cache-size", 512); -user_pref("gfx.content.skia-font-cache-size", 20); + /** GFX ***/ + user_pref("gfx.canvas.accelerated.cache-size", 512); + user_pref("gfx.content.skia-font-cache-size", 20); -/** DISK CACHE ***/ -user_pref("browser.cache.disk.enable", false); + /** DISK CACHE ***/ + user_pref("browser.cache.disk.enable", false); -/** MEMORY CACHE ***/ -user_pref("browser.sessionhistory.max_total_viewers", 4); + /** MEMORY CACHE ***/ + user_pref("browser.sessionhistory.max_total_viewers", 4); -/** MEDIA CACHE ***/ -user_pref("media.memory_cache_max_size", 65536); -user_pref("media.cache_readahead_limit", 7200); -user_pref("media.cache_resume_threshold", 3600); + /** MEDIA CACHE ***/ + user_pref("media.memory_cache_max_size", 65536); + user_pref("media.cache_readahead_limit", 7200); + user_pref("media.cache_resume_threshold", 3600); -/** IMAGE CACHE ***/ -user_pref("image.mem.decode_bytes_at_a_time", 32768); + /** IMAGE CACHE ***/ + user_pref("image.mem.decode_bytes_at_a_time", 32768); -/** NETWORK ***/ -user_pref("network.http.max-connections", 1800); -user_pref("network.http.max-persistent-connections-per-server", 10); -user_pref("network.http.max-urgent-start-excessive-connections-per-host", 5); -user_pref("network.http.pacing.requests.enabled", false); -user_pref("network.dnsCacheExpiration", 3600); -user_pref("network.ssl_tokens_cache_capacity", 10240); + /** NETWORK ***/ + user_pref("network.http.max-connections", 1800); + user_pref("network.http.max-persistent-connections-per-server", 10); + user_pref("network.http.max-urgent-start-excessive-connections-per-host", 5); + user_pref("network.http.pacing.requests.enabled", false); + user_pref("network.dnsCacheExpiration", 3600); + user_pref("network.ssl_tokens_cache_capacity", 10240); -/** SPECULATIVE LOADING ***/ -user_pref("network.http.speculative-parallel-limit", 0); -user_pref("network.dns.disablePrefetch", true); -user_pref("network.dns.disablePrefetchFromHTTPS", true); -user_pref("browser.urlbar.speculativeConnect.enabled", false); -user_pref("browser.places.speculativeConnect.enabled", false); -user_pref("network.prefetch-next", false); -user_pref("network.predictor.enabled", false); + /** SPECULATIVE LOADING ***/ + user_pref("network.http.speculative-parallel-limit", 0); + user_pref("network.dns.disablePrefetch", true); + user_pref("network.dns.disablePrefetchFromHTTPS", true); + user_pref("browser.urlbar.speculativeConnect.enabled", false); + user_pref("browser.places.speculativeConnect.enabled", false); + user_pref("network.prefetch-next", false); + user_pref("network.predictor.enabled", false); -/** EXPERIMENTAL ***/ -user_pref("layout.css.grid-template-masonry-value.enabled", true); + /** EXPERIMENTAL ***/ + user_pref("layout.css.grid-template-masonry-value.enabled", true); -/**************************************************************************** - * SECTION: SECUREFOX * -****************************************************************************/ -/** TRACKING PROTECTION ***/ -user_pref("browser.contentblocking.category", "strict"); -user_pref("privacy.trackingprotection.allow_list.baseline.enabled", true); -user_pref("privacy.trackingprotection.allow_list.convenience.enabled", true); -user_pref("browser.download.start_downloads_in_tmp_dir", true); -user_pref("browser.helperApps.deleteTempFileOnExit", true); -user_pref("browser.uitour.enabled", false); -user_pref("privacy.globalprivacycontrol.enabled", true); + /**************************************************************************** + * SECTION: SECUREFOX * + ****************************************************************************/ + /** TRACKING PROTECTION ***/ + user_pref("browser.contentblocking.category", "strict"); + user_pref("privacy.trackingprotection.allow_list.baseline.enabled", true); + user_pref("privacy.trackingprotection.allow_list.convenience.enabled", true); + user_pref("browser.download.start_downloads_in_tmp_dir", true); + user_pref("browser.helperApps.deleteTempFileOnExit", true); + user_pref("browser.uitour.enabled", false); + user_pref("privacy.globalprivacycontrol.enabled", true); -/** OCSP & CERTS / HPKP ***/ -user_pref("security.OCSP.enabled", 0); -user_pref("security.pki.crlite_mode", 2); -user_pref("security.csp.reporting.enabled", false); + /** OCSP & CERTS / HPKP ***/ + user_pref("security.OCSP.enabled", 0); + user_pref("security.pki.crlite_mode", 2); + user_pref("security.csp.reporting.enabled", false); -/** SSL / TLS ***/ -user_pref("security.ssl.treat_unsafe_negotiation_as_broken", true); -user_pref("browser.xul.error_pages.expert_bad_cert", true); -user_pref("security.tls.enable_0rtt_data", false); + /** SSL / TLS ***/ + user_pref("security.ssl.treat_unsafe_negotiation_as_broken", true); + user_pref("browser.xul.error_pages.expert_bad_cert", true); + user_pref("security.tls.enable_0rtt_data", false); -/** DISK AVOIDANCE ***/ -user_pref("browser.privatebrowsing.forceMediaMemoryCache", true); -user_pref("browser.sessionstore.interval", 60000); + /** DISK AVOIDANCE ***/ + user_pref("browser.privatebrowsing.forceMediaMemoryCache", true); + user_pref("browser.sessionstore.interval", 60000); -/** SHUTDOWN & SANITIZING ***/ -user_pref("browser.privatebrowsing.resetPBM.enabled", true); -user_pref("privacy.history.custom", true); + /** SHUTDOWN & SANITIZING ***/ + user_pref("browser.privatebrowsing.resetPBM.enabled", true); + user_pref("privacy.history.custom", true); -/** SEARCH / URL BAR ***/ -user_pref("browser.urlbar.trimHttps", true); -user_pref("browser.urlbar.untrimOnUserInteraction.featureGate", true); -user_pref("browser.search.separatePrivateDefault.ui.enabled", true); -user_pref("browser.search.suggest.enabled", false); -user_pref("browser.urlbar.quicksuggest.enabled", false); -user_pref("browser.urlbar.groupLabels.enabled", false); -user_pref("browser.formfill.enable", false); -user_pref("network.IDN_show_punycode", true); + /** SEARCH / URL BAR ***/ + user_pref("browser.urlbar.trimHttps", true); + user_pref("browser.urlbar.untrimOnUserInteraction.featureGate", true); + user_pref("browser.search.separatePrivateDefault.ui.enabled", true); + user_pref("browser.search.suggest.enabled", false); + user_pref("browser.urlbar.quicksuggest.enabled", false); + user_pref("browser.urlbar.groupLabels.enabled", false); + user_pref("browser.formfill.enable", false); + user_pref("network.IDN_show_punycode", true); -/** PASSWORDS ***/ -user_pref("signon.formlessCapture.enabled", false); -user_pref("signon.privateBrowsingCapture.enabled", false); -user_pref("network.auth.subresource-http-auth-allow", 1); -user_pref("editor.truncate_user_pastes", false); + /** PASSWORDS ***/ + user_pref("signon.formlessCapture.enabled", false); + user_pref("signon.privateBrowsingCapture.enabled", false); + user_pref("network.auth.subresource-http-auth-allow", 1); + user_pref("editor.truncate_user_pastes", false); -/** MIXED CONTENT + CROSS-SITE ***/ -user_pref("security.mixed_content.block_display_content", true); -user_pref("pdfjs.enableScripting", false); + /** MIXED CONTENT + CROSS-SITE ***/ + user_pref("security.mixed_content.block_display_content", true); + user_pref("pdfjs.enableScripting", false); -/** EXTENSIONS ***/ -user_pref("extensions.enabledScopes", 5); + /** EXTENSIONS ***/ + user_pref("extensions.enabledScopes", 5); -/** HEADERS / REFERERS ***/ -user_pref("network.http.referer.XOriginTrimmingPolicy", 2); + /** HEADERS / REFERERS ***/ + user_pref("network.http.referer.XOriginTrimmingPolicy", 2); -/** CONTAINERS ***/ -user_pref("privacy.userContext.ui.enabled", true); + /** CONTAINERS ***/ + user_pref("privacy.userContext.ui.enabled", true); -/** SAFE BROWSING ***/ -user_pref("browser.safebrowsing.downloads.remote.enabled", false); + /** SAFE BROWSING ***/ + user_pref("browser.safebrowsing.downloads.remote.enabled", false); -/** MOZILLA ***/ -user_pref("permissions.default.desktop-notification", 2); -user_pref("permissions.default.geo", 2); -user_pref("geo.provider.network.url", "https://beacondb.net/v1/geolocate"); -user_pref("browser.search.update", false); -user_pref("permissions.manager.defaultsUrl", ""); -user_pref("extensions.getAddons.cache.enabled", false); + /** MOZILLA ***/ + user_pref("permissions.default.desktop-notification", 2); + user_pref("permissions.default.geo", 2); + user_pref("geo.provider.network.url", "https://beacondb.net/v1/geolocate"); + user_pref("browser.search.update", false); + user_pref("permissions.manager.defaultsUrl", ""); + user_pref("extensions.getAddons.cache.enabled", false); -/** TELEMETRY ***/ -user_pref("datareporting.policy.dataSubmissionEnabled", false); -user_pref("datareporting.healthreport.uploadEnabled", false); -user_pref("toolkit.telemetry.unified", false); -user_pref("toolkit.telemetry.enabled", false); -user_pref("toolkit.telemetry.server", "data:,"); -user_pref("toolkit.telemetry.archive.enabled", false); -user_pref("toolkit.telemetry.newProfilePing.enabled", false); -user_pref("toolkit.telemetry.shutdownPingSender.enabled", false); -user_pref("toolkit.telemetry.updatePing.enabled", false); -user_pref("toolkit.telemetry.bhrPing.enabled", false); -user_pref("toolkit.telemetry.firstShutdownPing.enabled", false); -user_pref("toolkit.telemetry.coverage.opt-out", true); -user_pref("toolkit.coverage.opt-out", true); -user_pref("toolkit.coverage.endpoint.base", ""); -user_pref("browser.newtabpage.activity-stream.feeds.telemetry", false); -user_pref("browser.newtabpage.activity-stream.telemetry", false); -user_pref("datareporting.usage.uploadEnabled", false); + /** TELEMETRY ***/ + user_pref("datareporting.policy.dataSubmissionEnabled", false); + user_pref("datareporting.healthreport.uploadEnabled", false); + user_pref("toolkit.telemetry.unified", false); + user_pref("toolkit.telemetry.enabled", false); + user_pref("toolkit.telemetry.server", "data:,"); + user_pref("toolkit.telemetry.archive.enabled", false); + user_pref("toolkit.telemetry.newProfilePing.enabled", false); + user_pref("toolkit.telemetry.shutdownPingSender.enabled", false); + user_pref("toolkit.telemetry.updatePing.enabled", false); + user_pref("toolkit.telemetry.bhrPing.enabled", false); + user_pref("toolkit.telemetry.firstShutdownPing.enabled", false); + user_pref("toolkit.telemetry.coverage.opt-out", true); + user_pref("toolkit.coverage.opt-out", true); + user_pref("toolkit.coverage.endpoint.base", ""); + user_pref("browser.newtabpage.activity-stream.feeds.telemetry", false); + user_pref("browser.newtabpage.activity-stream.telemetry", false); + user_pref("datareporting.usage.uploadEnabled", false); -/** EXPERIMENTS ***/ -user_pref("app.shield.optoutstudies.enabled", false); -user_pref("app.normandy.enabled", false); -user_pref("app.normandy.api_url", ""); + /** EXPERIMENTS ***/ + user_pref("app.shield.optoutstudies.enabled", false); + user_pref("app.normandy.enabled", false); + user_pref("app.normandy.api_url", ""); -/** CRASH REPORTS ***/ -user_pref("breakpad.reportURL", ""); -user_pref("browser.tabs.crashReporting.sendReport", false); + /** CRASH REPORTS ***/ + user_pref("breakpad.reportURL", ""); + user_pref("browser.tabs.crashReporting.sendReport", false); -/**************************************************************************** - * SECTION: PESKYFOX * -****************************************************************************/ -/** MOZILLA UI ***/ -user_pref("browser.privatebrowsing.vpnpromourl", ""); -user_pref("extensions.getAddons.showPane", false); -user_pref("extensions.htmlaboutaddons.recommendations.enabled", false); -user_pref("browser.discovery.enabled", false); -user_pref("browser.shell.checkDefaultBrowser", false); -user_pref("browser.newtabpage.activity-stream.asrouter.userprefs.cfr.addons", false); -user_pref("browser.newtabpage.activity-stream.asrouter.userprefs.cfr.features", false); -user_pref("browser.preferences.moreFromMozilla", false); -user_pref("browser.aboutConfig.showWarning", false); -user_pref("browser.aboutwelcome.enabled", false); -user_pref("browser.profiles.enabled", true); + /**************************************************************************** + * SECTION: PESKYFOX * + ****************************************************************************/ + /** MOZILLA UI ***/ + user_pref("browser.privatebrowsing.vpnpromourl", ""); + user_pref("extensions.getAddons.showPane", false); + user_pref("extensions.htmlaboutaddons.recommendations.enabled", false); + user_pref("browser.discovery.enabled", false); + user_pref("browser.shell.checkDefaultBrowser", false); + user_pref("browser.newtabpage.activity-stream.asrouter.userprefs.cfr.addons", false); + user_pref("browser.newtabpage.activity-stream.asrouter.userprefs.cfr.features", false); + user_pref("browser.preferences.moreFromMozilla", false); + user_pref("browser.aboutConfig.showWarning", false); + user_pref("browser.aboutwelcome.enabled", false); + user_pref("browser.profiles.enabled", true); -/** THEME ADJUSTMENTS ***/ -user_pref("toolkit.legacyUserProfileCustomizations.stylesheets", true); -user_pref("browser.compactmode.show", true); -user_pref("browser.privateWindowSeparation.enabled", false); // WINDOWS + /** THEME ADJUSTMENTS ***/ + user_pref("toolkit.legacyUserProfileCustomizations.stylesheets", true); + user_pref("browser.compactmode.show", true); + user_pref("browser.privateWindowSeparation.enabled", false); // WINDOWS -/** AI ***/ -user_pref("browser.ml.enable", false); -user_pref("browser.ml.chat.enabled", false); + /** AI ***/ + user_pref("browser.ml.enable", false); + user_pref("browser.ml.chat.enabled", false); -/** FULLSCREEN NOTICE ***/ -user_pref("full-screen-api.transition-duration.enter", "0 0"); -user_pref("full-screen-api.transition-duration.leave", "0 0"); -user_pref("full-screen-api.warning.timeout", 0); + /** FULLSCREEN NOTICE ***/ + user_pref("full-screen-api.transition-duration.enter", "0 0"); + user_pref("full-screen-api.transition-duration.leave", "0 0"); + user_pref("full-screen-api.warning.timeout", 0); -/** URL BAR ***/ -user_pref("browser.urlbar.trending.featureGate", false); + /** URL BAR ***/ + user_pref("browser.urlbar.trending.featureGate", false); -/** NEW TAB PAGE ***/ -user_pref("browser.newtabpage.activity-stream.default.sites", ""); -user_pref("browser.newtabpage.activity-stream.showSponsoredTopSites", false); -user_pref("browser.newtabpage.activity-stream.feeds.section.topstories", false); -user_pref("browser.newtabpage.activity-stream.showSponsored", false); -user_pref("browser.newtabpage.activity-stream.showSponsoredCheckboxes", false); + /** NEW TAB PAGE ***/ + user_pref("browser.newtabpage.activity-stream.default.sites", ""); + user_pref("browser.newtabpage.activity-stream.showSponsoredTopSites", false); + user_pref("browser.newtabpage.activity-stream.feeds.section.topstories", false); + user_pref("browser.newtabpage.activity-stream.showSponsored", false); + user_pref("browser.newtabpage.activity-stream.showSponsoredCheckboxes", false); -/** POCKET ***/ -user_pref("extensions.pocket.enabled", false); + /** POCKET ***/ + user_pref("extensions.pocket.enabled", false); -/** DOWNLOADS ***/ -user_pref("browser.download.manager.addToRecentDocs", false); + /** DOWNLOADS ***/ + user_pref("browser.download.manager.addToRecentDocs", false); -/** PDF ***/ -user_pref("browser.download.open_pdf_attachments_inline", true); + /** PDF ***/ + user_pref("browser.download.open_pdf_attachments_inline", true); -/** TAB BEHAVIOR ***/ -user_pref("browser.bookmarks.openInTabClosesMenu", false); -user_pref("browser.menu.showViewImageInfo", true); -user_pref("findbar.highlightAll", true); -user_pref("layout.word_select.eat_space_to_next_word", false); + /** TAB BEHAVIOR ***/ + user_pref("browser.bookmarks.openInTabClosesMenu", false); + user_pref("browser.menu.showViewImageInfo", true); + user_pref("findbar.highlightAll", true); + user_pref("layout.word_select.eat_space_to_next_word", false); -/**************************************************************************** - * START: MY OVERRIDES * -****************************************************************************/ -// visit https://github.com/yokoffing/Betterfox/wiki/Common-Overrides -// visit https://github.com/yokoffing/Betterfox/wiki/Optional-Hardening -// Enter your personal overrides below this line: + /**************************************************************************** + * START: MY OVERRIDES * + ****************************************************************************/ + // visit https://github.com/yokoffing/Betterfox/wiki/Common-Overrides + // visit https://github.com/yokoffing/Betterfox/wiki/Optional-Hardening + // Enter your personal overrides below this line: -/**************************************************************************** - * SECTION: SMOOTHFOX * -****************************************************************************/ -// visit https://github.com/yokoffing/Betterfox/blob/main/Smoothfox.js -// Enter your scrolling overrides below this line: + /**************************************************************************** + * SECTION: SMOOTHFOX * + ****************************************************************************/ + // visit https://github.com/yokoffing/Betterfox/blob/main/Smoothfox.js + // Enter your scrolling overrides below this line: -/**************************************************************************** - * END: BETTERFOX * -****************************************************************************/ + /**************************************************************************** + * END: BETTERFOX * + ****************************************************************************/ ''; search = { default = "ddg"; @@ -232,49 +237,63 @@ user_pref("layout.word_select.eat_space_to_next_word", false); "ebay".metaData.hidden = true; "ddg" = { - urls = [{ - template = "https://duckduckgo.com"; - params = [{ - name = "q"; - value = "{searchTerms}"; - }]; - }]; + urls = [ + { + template = "https://duckduckgo.com"; + params = [ + { + name = "q"; + value = "{searchTerms}"; + } + ]; + } + ]; definedAliases = [ ",d" ]; }; "Nix Packages" = { - urls = [{ - template = "https://search.nixos.org/packages"; - params = [ - { - name = "type"; - value = "packages"; - } - { - name = "query"; - value = "{searchTerms}"; - } - ]; - }]; + urls = [ + { + template = "https://search.nixos.org/packages"; + params = [ + { + name = "type"; + value = "packages"; + } + { + name = "query"; + value = "{searchTerms}"; + } + ]; + } + ]; definedAliases = [ ",n" ]; }; "Wikipedia" = { - urls = [{ - template = "https://en.wikipedia.org/wiki/Special:Search"; - params = [{ - name = "search"; - value = "{searchTerms}"; - }]; - }]; + urls = [ + { + template = "https://en.wikipedia.org/wiki/Special:Search"; + params = [ + { + name = "search"; + value = "{searchTerms}"; + } + ]; + } + ]; definedAliases = [ ",w" ]; }; "GitHub" = { - urls = [{ - template = "https://github.com/search"; - params = [{ - name = "q"; - value = "{searchTerms}"; - }]; - }]; + urls = [ + { + template = "https://github.com/search"; + params = [ + { + name = "q"; + value = "{searchTerms}"; + } + ]; + } + ]; definedAliases = [ ",gh" ]; }; }; @@ -313,8 +332,7 @@ in "ebay@search.mozilla.org".installation_mode = "blocked"; "wikipedia@search.mozilla.org".installation_mode = "blocked"; "{5cd68d86-8324-4ab2-9e0d-3afcc60bee5f}" = { - install_url = - "https://addons.mozilla.org/firefox/downloads/latest/animated-pekora-dark-theme/latest.xpi"; + install_url = "https://addons.mozilla.org/firefox/downloads/latest/animated-pekora-dark-theme/latest.xpi"; installation_mode = "force_installed"; }; }; @@ -323,16 +341,18 @@ in default = { name = "privacy-friendly"; extraConfig = betterfox; - settings = merge ([ - (import ./config/preferences.nix) - (import ./config/browser-features.nix) - (import ./config/privacy.nix) - (import ./config/tracking.nix) - (import ./config/tracking-webaudio.nix) - (import ./config/security.nix) - (import ./config/speed.nix) - ] ++ lib.optionals osConfig.custom.hardware.nvidia.enable - [ (import ./config/nvidia-fixes.nix) ]); + settings = merge ( + [ + (import ./config/preferences.nix) + (import ./config/browser-features.nix) + (import ./config/privacy.nix) + (import ./config/tracking.nix) + (import ./config/tracking-webaudio.nix) + (import ./config/security.nix) + (import ./config/speed.nix) + ] + ++ lib.optionals osConfig.custom.hardware.nvidia.enable [ (import ./config/nvidia-fixes.nix) ] + ); userChrome = '' /* Hide tab bar. Used with Sidebery */ #TabsToolbar { @@ -358,7 +378,7 @@ in --toolbar-bg-color: #${base16.base01}; } ''; - # Changes the extension storage backend from IDB to json, wipes all data when switching + # Changes the extension storage backend from IDB to json, wipes all data when switching extensions.force = true; extensions.packages = with pkgs.nur.repos.rycee.firefox-addons; [ clearurls @@ -375,15 +395,17 @@ in enable-webaudio = { name = "privacy-but-enable-webaudio"; id = 2; - settings = merge ([ - (import ./config/preferences.nix) - (import ./config/browser-features.nix) - (import ./config/privacy.nix) - (import ./config/tracking.nix) - (import ./config/security.nix) - (import ./config/speed.nix) - ] ++ lib.optionals osConfig.custom.hardware.nvidia.enable - [ (import ./config/nvidia-fixes.nix) ]); + settings = merge ( + [ + (import ./config/preferences.nix) + (import ./config/browser-features.nix) + (import ./config/privacy.nix) + (import ./config/tracking.nix) + (import ./config/security.nix) + (import ./config/speed.nix) + ] + ++ lib.optionals osConfig.custom.hardware.nvidia.enable [ (import ./config/nvidia-fixes.nix) ] + ); userChrome = '' /* Hide tab bar. Used with Sidebery */ #TabsToolbar { @@ -413,10 +435,13 @@ in visibility: collapse !important; } ''; - settings = merge - ([ (import ./config/preferences.nix) (import ./config/speed.nix) ] - ++ lib.optionals osConfig.custom.hardware.nvidia.enable - [ (import ./config/nvidia-fixes.nix) ]); + settings = merge ( + [ + (import ./config/preferences.nix) + (import ./config/speed.nix) + ] + ++ lib.optionals osConfig.custom.hardware.nvidia.enable [ (import ./config/nvidia-fixes.nix) ] + ); extensions.packages = with pkgs.nur.repos.rycee.firefox-addons; [ clearurls darkreader @@ -435,8 +460,15 @@ in genericName = "Web Browser"; exec = "firefox -P privacy-but-enable-webaudio %U"; terminal = false; - categories = [ "Application" "Network" "WebBrowser" ]; - mimeType = [ "text/html" "text/xml" ]; + categories = [ + "Application" + "Network" + "WebBrowser" + ]; + mimeType = [ + "text/html" + "text/xml" + ]; }; }; } diff --git a/home-manager/floorp/default.nix b/home-manager/floorp/default.nix index e49e2c4..eded54b 100644 --- a/home-manager/floorp/default.nix +++ b/home-manager/floorp/default.nix @@ -1,4 +1,10 @@ -{ lib, config, osConfig, pkgs, ... }: +{ + lib, + config, + osConfig, + pkgs, + ... +}: let merge = lib.foldr (a: b: a // b) { }; search = { @@ -11,49 +17,63 @@ let "eBay".metaData.hidden = true; "DuckDuckGo" = { - urls = [{ - template = "https://duckduckgo.com"; - params = [{ - name = "q"; - value = "{searchTerms}"; - }]; - }]; + urls = [ + { + template = "https://duckduckgo.com"; + params = [ + { + name = "q"; + value = "{searchTerms}"; + } + ]; + } + ]; definedAliases = [ ",d" ]; }; "Nix Packages" = { - urls = [{ - template = "https://search.nixos.org/packages"; - params = [ - { - name = "type"; - value = "packages"; - } - { - name = "query"; - value = "{searchTerms}"; - } - ]; - }]; + urls = [ + { + template = "https://search.nixos.org/packages"; + params = [ + { + name = "type"; + value = "packages"; + } + { + name = "query"; + value = "{searchTerms}"; + } + ]; + } + ]; definedAliases = [ ",n" ]; }; "Wikipedia" = { - urls = [{ - template = "https://en.wikipedia.org/wiki/Special:Search"; - params = [{ - name = "search"; - value = "{searchTerms}"; - }]; - }]; + urls = [ + { + template = "https://en.wikipedia.org/wiki/Special:Search"; + params = [ + { + name = "search"; + value = "{searchTerms}"; + } + ]; + } + ]; definedAliases = [ ",w" ]; }; "GitHub" = { - urls = [{ - template = "https://github.com/search"; - params = [{ - name = "q"; - value = "{searchTerms}"; - }]; - }]; + urls = [ + { + template = "https://github.com/search"; + params = [ + { + name = "q"; + value = "{searchTerms}"; + } + ]; + } + ]; definedAliases = [ ",gh" ]; }; }; @@ -86,25 +106,28 @@ in "ebay@search.mozilla.org".installation_mode = "blocked"; "wikipedia@search.mozilla.org".installation_mode = "blocked"; "{5cd68d86-8324-4ab2-9e0d-3afcc60bee5f}" = { - install_url = - "https://addons.mozilla.org/firefox/downloads/latest/animated-pekora-dark-theme/latest.xpi"; + install_url = "https://addons.mozilla.org/firefox/downloads/latest/animated-pekora-dark-theme/latest.xpi"; installation_mode = "force_installed"; }; }; }; profiles.default = { inherit search; - settings = merge ([ - (import ../firefox/config/preferences.nix) - (import ../firefox/config/browser-features.nix) - (import ../firefox/config/privacy.nix) - (import ../firefox/config/tracking.nix) - (import ../firefox/config/tracking-webaudio.nix) - (import ../firefox/config/security.nix) - (import ../firefox/config/speed.nix) - (import ./floorp-config.nix) - ] ++ lib.optionals osConfig.custom.hardware.nvidia.enable - [ (import ../firefox/config/nvidia-fixes.nix) ]); + settings = merge ( + [ + (import ../firefox/config/preferences.nix) + (import ../firefox/config/browser-features.nix) + (import ../firefox/config/privacy.nix) + (import ../firefox/config/tracking.nix) + (import ../firefox/config/tracking-webaudio.nix) + (import ../firefox/config/security.nix) + (import ../firefox/config/speed.nix) + (import ./floorp-config.nix) + ] + ++ lib.optionals osConfig.custom.hardware.nvidia.enable [ + (import ../firefox/config/nvidia-fixes.nix) + ] + ); userChrome = '' /* Hide tab bar. Used with Sidebery */ #TabsToolbar { diff --git a/home-manager/gitconfig.nix b/home-manager/gitconfig.nix index d3c03d8..47c1f76 100644 --- a/home-manager/gitconfig.nix +++ b/home-manager/gitconfig.nix @@ -1,4 +1,9 @@ -{ config, pkgs, inputs, ... }: +{ + config, + pkgs, + inputs, + ... +}: { home.file.".gitconfig" = { enable = true; diff --git a/home-manager/hyprland/hyprland-settings.nix b/home-manager/hyprland/hyprland-settings.nix index 0757624..f0beb14 100644 --- a/home-manager/hyprland/hyprland-settings.nix +++ b/home-manager/hyprland/hyprland-settings.nix @@ -1,4 +1,11 @@ -{ config, osConfig, pkgs, inputs, lib, ... }: +{ + config, + osConfig, + pkgs, + inputs, + lib, + ... +}: let cfg = osConfig.custom.graphical.hyprland; isPc = osConfig.networking.hostName == "kop-pc"; @@ -16,7 +23,13 @@ let hyprctl --instance 0 "dispatch exec hyprlock" ''; scale = if isLaptop then "1.33333" else "1"; - monitor1 = if isPc then "DP-1" else if isLaptop then "eDP-1" else "eDP-1"; + monitor1 = + if isPc then + "DP-1" + else if isLaptop then + "eDP-1" + else + "eDP-1"; monitor2 = "HDMI-A-1"; in { @@ -38,32 +51,35 @@ in # See https://wiki.hyprland.org/Configuring/Monitors/ monitor = - if isPc then [ - "${monitor2},1920x1080@60,0x0,${scale}" - "${monitor1},2560x1440@144,1920x0,${scale}" - "Unknown-1,disable" - ] else if isLaptop then [ - # laptop - "eDP-1,2256x1504@60,0x0,${scale}" - #"DP-3,1920x1080@60,1920x0,1" - #",preferred,auto,1,mirror,eDP-1" - ",preferred,auto,auto" - ] else + if isPc then + [ + "${monitor2},1920x1080@60,0x0,${scale}" + "${monitor1},2560x1440@144,1920x0,${scale}" + "Unknown-1,disable" + ] + else if isLaptop then + [ + # laptop + "eDP-1,2256x1504@60,0x0,${scale}" + #"DP-3,1920x1080@60,1920x0,1" + #",preferred,auto,1,mirror,eDP-1" + ",preferred,auto,auto" + ] + else [ # Default ",preferred,auto,auto" ]; - workspace = - lib.lists.optionals (osConfig.networking.hostName == "kop-pc") [ - "1,monitor:${monitor1}" - "2,monitor:${monitor1}" - "3,monitor:${monitor1}" - "4,monitor:${monitor1}" - "5,monitor:${monitor1}" - "9,monitor:${monitor2}" - "10,monitor:${monitor2}" - ]; + workspace = lib.lists.optionals (osConfig.networking.hostName == "kop-pc") [ + "1,monitor:${monitor1}" + "2,monitor:${monitor1}" + "3,monitor:${monitor1}" + "4,monitor:${monitor1}" + "5,monitor:${monitor1}" + "9,monitor:${monitor2}" + "10,monitor:${monitor2}" + ]; # See https://wiki.hyprland.org/Configuring/Keywords/ for more @@ -74,13 +90,16 @@ in # source = ~/.config/hypr/myColors.conf # Some default env vars. - env = - [ "XCURSOR_SIZE,24" "NIXOS_OZONE_WL,1" "GDK_SCALE,${scale}" ] - ++ lib.optionals osConfig.custom.hardware.nvidia.enable [ - "LIBVA_DRIVER_NAME,nvidia" - "GBM_BACKEND,nvidia-drm" - "__GLX_VENDOR_LIBRARY_NAME,nvidia" - ]; + env = [ + "XCURSOR_SIZE,24" + "NIXOS_OZONE_WL,1" + "GDK_SCALE,${scale}" + ] + ++ lib.optionals osConfig.custom.hardware.nvidia.enable [ + "LIBVA_DRIVER_NAME,nvidia" + "GBM_BACKEND,nvidia-drm" + "__GLX_VENDOR_LIBRARY_NAME,nvidia" + ]; # For all categories, see https://wiki.hyprland.org/Configuring/Variables/ input = { @@ -93,7 +112,9 @@ in follow_mouse = 1; float_switch_override_focus = 2; - touchpad = { natural_scroll = true; }; + touchpad = { + natural_scroll = true; + }; accel_profile = "flat"; sensitivity = 0; @@ -124,9 +145,9 @@ in render = { new_render_scheduling = true; }; - misc = { - vfr = true; - middle_click_paste = false; + misc = { + vfr = true; + middle_click_paste = false; enable_anr_dialog = false; disable_hyprland_logo = true; }; @@ -169,8 +190,7 @@ in dwindle = { # See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more - pseudotile = - true; # master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below + pseudotile = true; # master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below preserve_split = true; # you probably want this }; @@ -212,8 +232,9 @@ in wl-copy = "${pkgs.wl-clipboard}/bin/wl-copy"; wl-paste = "${pkgs.wl-clipboard}/bin/wl-paste"; grimblast = "${pkgs.grimblast}/bin/grimblast"; - saved-screenshot-cmd = ''${grimblast} --freeze save area $OUT && notify-send "Saved screenshot to $OUT" -h string:image-path:$OUT && echo "file://$(realpath $OUT)" | wl-copy -t text/uri-list -''; + saved-screenshot-cmd = '' + ${grimblast} --freeze save area $OUT && notify-send "Saved screenshot to $OUT" -h string:image-path:$OUT && echo "file://$(realpath $OUT)" | wl-copy -t text/uri-list + ''; pdfgrep = "${pkgs.pdfgrep}/bin/pdfgrep"; brightnessctl = "${pkgs.brightnessctl}/bin/brightnessctl"; #swaylock = "${pkgs.swaylock}/bin/swaylock"; @@ -241,10 +262,8 @@ in ''$mainMod, R, exec, hyprctl hyprpaper reload ,"$(ls -d ~/synced/default/dinge/Bg/* | shuf -n 1)"'' "$mainMod, W, exec, hyprctl hyprpaper reload ,${config.stylix.image}" " , Print, exec, hyprshade off && ${grimblast} --freeze copy area && hyprshade auto" - '' - $mainMod, Print, exec, export OUT=/tmp/$(date +'%s_grim.png') && ${saved-screenshot-cmd}'' - '' - Shift_L, Print, exec, export OUT=~/Pictures/$(date +'%s_grim.png') && ${saved-screenshot-cmd}'' + ''$mainMod, Print, exec, export OUT=/tmp/$(date +'%s_grim.png') && ${saved-screenshot-cmd}'' + ''Shift_L, Print, exec, export OUT=~/Pictures/$(date +'%s_grim.png') && ${saved-screenshot-cmd}'' #"$mainMod, G, exec, ${peek}" # record gif "$mainMod, SPACE, exec, ${rofi} -modi drun -show drun -config ~/.config/rofi/rofidmenu.rasi" " , XF86AudioPlay, exec, ${playerctl} play-pause" @@ -359,12 +378,14 @@ in "dex --autostart --environment Hyprland" "${pkgs.hypridle}/bin/hypridle &" #"${pkgs.dunst}/bin/dunst &" - ] ++ lib.lists.optionals (osConfig.networking.hostName == "kop-pc") [ + ] + ++ lib.lists.optionals (osConfig.networking.hostName == "kop-pc") [ "[workspace 9 silent] sleep 2 && discord" "[workspace 9 silent] sleep 2 && discordcanary" "[workspace 10 silent] firefox" "xrandr --monitor ${monitor1} --primary" - ] ++ [ + ] + ++ [ "sleep 3 && ${pkgs.waybar}/bin/waybar &" "${restartPortals}" ]; diff --git a/home-manager/hyprland/hyprland-xwaylandvideobridge.nix b/home-manager/hyprland/hyprland-xwaylandvideobridge.nix index a75fc7d..75e74bc 100644 --- a/home-manager/hyprland/hyprland-xwaylandvideobridge.nix +++ b/home-manager/hyprland/hyprland-xwaylandvideobridge.nix @@ -1,4 +1,11 @@ -{ config, osConfig, pkgs, inputs, lib, ... }: +{ + config, + osConfig, + pkgs, + inputs, + lib, + ... +}: with lib; let cfg = osConfig.custom.graphical.hyprland.videobridge; diff --git a/home-manager/hyprland/hyprlock.nix b/home-manager/hyprland/hyprlock.nix index e76c680..adebabe 100644 --- a/home-manager/hyprland/hyprlock.nix +++ b/home-manager/hyprland/hyprlock.nix @@ -1,6 +1,15 @@ -{ config, osConfig, pkgs, inputs, lib, ... }: -let cfg = osConfig.custom.graphical.hyprland; -in { +{ + config, + osConfig, + pkgs, + inputs, + lib, + ... +}: +let + cfg = osConfig.custom.graphical.hyprland; +in +{ config = lib.mkIf cfg.enable { programs.hyprlock.enable = true; programs.hyprlock.settings = { @@ -34,7 +43,7 @@ in { ## shadow_passes = 2; ##}; ## - ### DATE + ### DATE ##label = { ## monitor = ""; ## text = "cmd[update:43200000] echo \"$(date +\"%A, %d %B %Y\")\""; diff --git a/home-manager/hyprland/hyprshade.nix b/home-manager/hyprland/hyprshade.nix index 066f6a9..30e77bb 100644 --- a/home-manager/hyprland/hyprshade.nix +++ b/home-manager/hyprland/hyprshade.nix @@ -1,36 +1,47 @@ -{ osConfig, pkgs, lib, ... }: +{ + osConfig, + pkgs, + lib, + ... +}: -let cfg = osConfig.custom.graphical.hyprland; -in { - config = lib.mkIf cfg.enable - { - home.file.".config/hypr/hyprshade.toml".source = ../../.config/hypr/hyprshade.toml; - wayland.windowManager.hyprland.settings.exec-once = [ "${pkgs.hyprshade}/bin/hyprshade auto" ]; - systemd.user = { +let + cfg = osConfig.custom.graphical.hyprland; +in +{ + config = lib.mkIf cfg.enable { + home.file.".config/hypr/hyprshade.toml".source = ../../.config/hypr/hyprshade.toml; + wayland.windowManager.hyprland.settings.exec-once = [ "${pkgs.hyprshade}/bin/hyprshade auto" ]; + systemd.user = { - services.hyprshade = { - Install.WantedBy = [ "graphical-session.target" ]; + services.hyprshade = { + Install.WantedBy = [ "graphical-session.target" ]; - Unit = { - ConditionEnvironment = "HYPRLAND_INSTANCE_SIGNATURE"; - Description = "Apply screen filter"; - After = [ "graphical-session-pre.target" ]; - PartOf = [ "graphical-session.target" ]; - }; - Service = { - Type = "oneshot"; - ExecStart = "${pkgs.hyprshade}/bin/hyprshade auto"; - }; + Unit = { + ConditionEnvironment = "HYPRLAND_INSTANCE_SIGNATURE"; + Description = "Apply screen filter"; + After = [ "graphical-session-pre.target" ]; + PartOf = [ "graphical-session.target" ]; }; - - timers.hyprshade = { - - Install.WantedBy = [ "timers.target" ]; - - Unit = { Description = "Apply screen filter on schedule"; }; - - Timer.OnCalendar = [ "*-*-* 06:00:00" "*-*-* 19:00:00" ]; + Service = { + Type = "oneshot"; + ExecStart = "${pkgs.hyprshade}/bin/hyprshade auto"; }; }; + + timers.hyprshade = { + + Install.WantedBy = [ "timers.target" ]; + + Unit = { + Description = "Apply screen filter on schedule"; + }; + + Timer.OnCalendar = [ + "*-*-* 06:00:00" + "*-*-* 19:00:00" + ]; + }; }; + }; } diff --git a/home-manager/hyprland/hyprspace.nix b/home-manager/hyprland/hyprspace.nix index b644134..9cbb4df 100644 --- a/home-manager/hyprland/hyprspace.nix +++ b/home-manager/hyprland/hyprspace.nix @@ -1,6 +1,15 @@ -{ config, osConfig, pkgs, inputs, lib, ... }: -let cfg = osConfig.custom.graphical.hyprland; -in { +{ + config, + osConfig, + pkgs, + inputs, + lib, + ... +}: +let + cfg = osConfig.custom.graphical.hyprland; +in +{ config = lib.mkIf cfg.enable { wayland.windowManager.hyprland = { plugins = [ pkgs.hyprlandPlugins.hyprspace ]; @@ -9,16 +18,18 @@ in { "$mainMod, TAB, overview:toggle" "$mainMod SHIFT, TAB, overview:toggle, all" ]; - plugin = [{ - overview = { - affectStrut = false; - hideTopLayers = true; - panelHeight = 250; - showEmptyWorkspace = false; - showNewWorkspace = true; - disableBlur = true; - }; - }]; + plugin = [ + { + overview = { + affectStrut = false; + hideTopLayers = true; + panelHeight = 250; + showEmptyWorkspace = false; + showNewWorkspace = true; + disableBlur = true; + }; + } + ]; }; }; }; diff --git a/home-manager/hyprland/waybar.nix b/home-manager/hyprland/waybar.nix index a22fb2d..337b739 100644 --- a/home-manager/hyprland/waybar.nix +++ b/home-manager/hyprland/waybar.nix @@ -1,7 +1,16 @@ -{ config, osConfig, pkgs, inputs, lib, ... }: +{ + config, + osConfig, + pkgs, + inputs, + lib, + ... +}: with lib; -let cfg = osConfig.custom.graphical.hyprland; -in { +let + cfg = osConfig.custom.graphical.hyprland; +in +{ config = let # styles from https://github.com/khaneliman/khanelinix/blob/8375f8cfbe5bfd87565b4dc34c9d30630c17336d/modules/home/desktop/addons/waybar/default.nix @@ -37,25 +46,43 @@ in { #"hyprland/window" ]; modules-center = [ ]; - modules-right = [ "group/stats" "group/other" ]; + modules-right = [ + "group/stats" + "group/other" + ]; "group/stats" = { "orientation" = "horizontal"; - "modules" = [ "network" "cpu" "memory" "temperature" ] - ++ lib.optionals osConfig.custom.hardware.nvidia.enable [ "custom/nvidia" ] - ++ lib.optionals osConfig.custom.hardware.amd-gpu.enable [ "custom/amd-gpu" ] - ++ lib.optionals osConfig.services.power-profiles-daemon.enable [ "power-profiles-daemon" ]; + "modules" = [ + "network" + "cpu" + "memory" + "temperature" + ] + ++ lib.optionals osConfig.custom.hardware.nvidia.enable [ "custom/nvidia" ] + ++ lib.optionals osConfig.custom.hardware.amd-gpu.enable [ "custom/amd-gpu" ] + ++ lib.optionals osConfig.services.power-profiles-daemon.enable [ "power-profiles-daemon" ]; }; "group/other" = { "orientation" = "horizontal"; - "modules" = - [ "tray" "backlight" "pulseaudio" "mpris" "battery" "clock" ]; + "modules" = [ + "tray" + "backlight" + "pulseaudio" + "mpris" + "battery" + "clock" + ]; }; "cpu" = { "format" = " {usage}%"; "tooltip" = true; }; - "disk" = { "format" = " {percentage_used}%"; }; - "memory" = { "format" = "󰍛 {}%"; }; + "disk" = { + "format" = " {percentage_used}%"; + }; + "memory" = { + "format" = "󰍛 {}%"; + }; "idle_inhibitor" = { "format" = "{icon} "; @@ -95,7 +122,10 @@ in { "phone" = ""; "portable" = ""; "car" = ""; - "default" = [ "" "" ]; + "default" = [ + "" + "" + ]; }; "scroll-step" = 1; "on-click" = "${pkgs.pavucontrol}/bin/pavucontrol"; @@ -110,18 +140,30 @@ in { "temperature".critical-threshold = 80; "temperature".format = "{temperatureC}°C "; "temperature".interval = 5; - "temperature".hwmon-path = - lib.mkIf (osConfig.networking.hostName == "framework") - "/sys/class/hwmon/hwmon6/temp1_input"; + "temperature".hwmon-path = lib.mkIf ( + osConfig.networking.hostName == "framework" + ) "/sys/class/hwmon/hwmon6/temp1_input"; "backlight".format = "{percent}% {icon}"; - "backlight".states = [ 0 50 ]; - "backlight".format-icons = [ "" "" ]; + "backlight".states = [ + 0 + 50 + ]; + "backlight".format-icons = [ + "" + "" + ]; "battery".states.good = 95; "battery".interval = 5; "battery".states.warning = 30; "battery".states.critical = 15; "battery".format = "{capacity}% / {power:.2}W {icon}"; - "battery".format-icons = [ "" "" "" "" "" ]; + "battery".format-icons = [ + "" + "" + "" + "" + "" + ]; "clock" = { format = "{:%F %H:%M}"; tooltip-format = "{calendar}"; @@ -148,7 +190,9 @@ in { "default" = "▶"; "mpv" = "🎵"; }; - "status-icons" = { "paused" = "⏸"; }; + "status-icons" = { + "paused" = "⏸"; + }; }; "power-profiles-daemon" = { "format" = "{icon}"; @@ -217,8 +261,7 @@ in { "class" = ""; "class" = ""; "class title<.*github.*>" = ""; - "class title<.*twitch|youtube|plex|tntdrama|bally sports.*>" = - ""; + "class title<.*twitch|youtube|plex|tntdrama|bally sports.*>" = ""; "class" = ""; "class" = ""; "class" = "󱂷"; @@ -247,8 +290,7 @@ in { }; }; }; - style = - "${theme}${style}${notificationsStyle}${powerStyle}${statsStyle}${workspacesStyle}"; + style = "${theme}${style}${notificationsStyle}${powerStyle}${statsStyle}${workspacesStyle}"; }; }; } diff --git a/home-manager/i3.nix b/home-manager/i3.nix index ad94000..4f892d2 100644 --- a/home-manager/i3.nix +++ b/home-manager/i3.nix @@ -1,6 +1,14 @@ -{ osConfig, pkgs, config, lib, ... }: -let cfg = osConfig.custom.graphical.i3; -in { +{ + osConfig, + pkgs, + config, + lib, + ... +}: +let + cfg = osConfig.custom.graphical.i3; +in +{ config = lib.mkIf cfg.enable { home.file.".config/i3" = { recursive = true; @@ -55,10 +63,12 @@ in { module-margin = 1; modules-left = "i3 xwindow"; modules-center = ""; - modules-right = [ "music network memory cpu cpu-wattage cpu-temp" ] - ++ lib.optionals osConfig.custom.hardware.nvidia.enable [ "nvidia-gpu" ] - ++ lib.optionals osConfig.custom.hardware.amd-gpu.enable [ "amd-gpu" ] - ++ [ "pulseaudio date tray" ]; + modules-right = [ + "music network memory cpu cpu-wattage cpu-temp" + ] + ++ lib.optionals osConfig.custom.hardware.nvidia.enable [ "nvidia-gpu" ] + ++ lib.optionals osConfig.custom.hardware.amd-gpu.enable [ "amd-gpu" ] + ++ [ "pulseaudio date tray" ]; cursor-click = "pointer"; cursor-scroll = "ns-resize"; enable-ipc = true; @@ -69,8 +79,10 @@ in { # override-redirect = true; }; "module/i3" = - let padding = 2; - in { + let + padding = 2; + in + { type = "internal/i3"; pin-workspaces = true; show-urgent = true; diff --git a/home-manager/kitty.nix b/home-manager/kitty.nix index 7e73b60..3c7621c 100644 --- a/home-manager/kitty.nix +++ b/home-manager/kitty.nix @@ -1,4 +1,10 @@ -{ config, pkgs, inputs, lib, ... }: +{ + config, + pkgs, + inputs, + lib, + ... +}: { programs.kitty = { enable = true; diff --git a/home-manager/lf.nix b/home-manager/lf.nix index e8f45e1..56036ed 100644 --- a/home-manager/lf.nix +++ b/home-manager/lf.nix @@ -1,4 +1,9 @@ -{ config, pkgs, inputs, ... }: +{ + config, + pkgs, + inputs, + ... +}: { programs.lf = { enable = true; diff --git a/home-manager/mpv.nix b/home-manager/mpv.nix index 9fcdba6..a00884d 100644 --- a/home-manager/mpv.nix +++ b/home-manager/mpv.nix @@ -1,4 +1,9 @@ -{ config, pkgs, inputs, ... }: +{ + config, + pkgs, + inputs, + ... +}: { programs.mpv = { enable = true; diff --git a/home-manager/nixvim/auto-pairs.nix b/home-manager/nixvim/auto-pairs.nix index 448282c..b748672 100644 --- a/home-manager/nixvim/auto-pairs.nix +++ b/home-manager/nixvim/auto-pairs.nix @@ -1,3 +1,5 @@ { - plugins.nvim-autopairs = { enable = true; }; + plugins.nvim-autopairs = { + enable = true; + }; } diff --git a/home-manager/nixvim/barbar.nix b/home-manager/nixvim/barbar.nix index a67e105..7042a93 100644 --- a/home-manager/nixvim/barbar.nix +++ b/home-manager/nixvim/barbar.nix @@ -1 +1,5 @@ -{ plugins.barbar = { enable = true; }; } # tab bar up top +{ + plugins.barbar = { + enable = true; + }; +} # tab bar up top diff --git a/home-manager/nixvim/cmp.nix b/home-manager/nixvim/cmp.nix index 6dc7ea0..cc86fc0 100644 --- a/home-manager/nixvim/cmp.nix +++ b/home-manager/nixvim/cmp.nix @@ -10,15 +10,25 @@ }; }; - cmp-buffer = { enable = true; }; + cmp-buffer = { + enable = true; + }; - cmp-emoji = { enable = true; }; + cmp-emoji = { + enable = true; + }; - cmp-nvim-lsp = { enable = true; }; + cmp-nvim-lsp = { + enable = true; + }; - cmp-path = { enable = true; }; + cmp-path = { + enable = true; + }; - cmp_luasnip = { enable = true; }; + cmp_luasnip = { + enable = true; + }; cmp = { enable = true; @@ -48,11 +58,29 @@ completion = { scrollbar = true; sidePadding = 0; - border = [ "╭" "─" "╮" "│" "╯" "─" "╰" "│" ]; + border = [ + "╭" + "─" + "╮" + "│" + "╯" + "─" + "╰" + "│" + ]; }; settings.documentation = { - border = [ "╭" "─" "╮" "│" "╯" "─" "╰" "│" ]; + border = [ + "╭" + "─" + "╮" + "│" + "╯" + "─" + "╰" + "│" + ]; }; }; @@ -65,8 +93,7 @@ "" = "cmp.mapping.scroll_docs(4)"; "" = "cmp.mapping.complete()"; "" = "cmp.mapping.close()"; - "" = - "cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Insert, select = false })"; + "" = "cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Insert, select = false })"; "" = # lua '' @@ -96,7 +123,11 @@ }; formatting = { - fields = [ "abbr" "kind" "menu" ]; + fields = [ + "abbr" + "kind" + "menu" + ]; format = # lua '' diff --git a/home-manager/nixvim/config.nix b/home-manager/nixvim/config.nix index 389c012..37eb8a0 100644 --- a/home-manager/nixvim/config.nix +++ b/home-manager/nixvim/config.nix @@ -11,7 +11,7 @@ number = true; relativenumber = true; - showmode = false; #already shown in lightline + showmode = false; # already shown in lightline autoindent = true; clipboard = "unnamedplus"; @@ -65,7 +65,7 @@ options.desc = "Format the current buffer"; } - # Git + # Git { mode = "n"; key = "g"; @@ -159,7 +159,7 @@ options.desc = "Escape terminal mode"; } - # Trouble + # Trouble { key = "dt"; action = "TroubleToggle"; @@ -205,18 +205,18 @@ key = "rI"; action = ":Refactor inline_func "; options.desc = "Inline function"; - } + } # hop - { + { key = "f"; action.__raw = '' - function() - require'hop'.hint_char1({ - --direction = require'hop.hint'.HintDirection.AFTER_CURSOR, - current_line_only = false, - case_insensitive = true, - }) - end + function() + require'hop'.hint_char1({ + --direction = require'hop.hint'.HintDirection.AFTER_CURSOR, + current_line_only = false, + case_insensitive = true, + }) + end ''; options.remap = true; } @@ -229,7 +229,7 @@ current_line_only = false }) end - ''; + ''; options.remap = true; } ]; diff --git a/home-manager/nixvim/default.nix b/home-manager/nixvim/default.nix index a7ed124..285f1e9 100644 --- a/home-manager/nixvim/default.nix +++ b/home-manager/nixvim/default.nix @@ -1,47 +1,59 @@ -{ lib, pkgs, osConfig, ... }: +{ + lib, + pkgs, + osConfig, + ... +}: # https://nix-community.github.io/nixvim/NeovimOptions/index.html let cfg = osConfig.custom.nixvimPlugins; args = { inherit lib pkgs; }; - importFile = file: - let config = import file; - in if builtins.isFunction config then config args else config; - configs = map importFile ([ - ./config.nix - ] ++ lib.optionals cfg [ - ./auto-pairs.nix - ./autosave.nix - ./blankline.nix - ./barbar.nix - ./cmp.nix - ./fidget.nix - ./refactoring.nix - ./git.nix - ./lightline.nix - ./lsp.nix - ./images.nix - ./none-ls.nix - ./nvim-tree.nix + importFile = + file: + let + config = import file; + in + if builtins.isFunction config then config args else config; + configs = map importFile ( + [ + ./config.nix + ] + ++ lib.optionals cfg [ + ./auto-pairs.nix + ./autosave.nix + ./blankline.nix + ./barbar.nix + ./cmp.nix + ./fidget.nix + ./refactoring.nix + ./git.nix + ./lightline.nix + ./lsp.nix + ./images.nix + ./none-ls.nix + ./nvim-tree.nix #./neo-tree.nix - ./telescope.nix - ./toggleterm.nix - ./treesitter.nix - ./trouble.nix - ./which_key.nix - ./wilder.nix - ./typst-preview.nix - ./markdown.nix - ./hop.nix - ./colorizer.nix - ./surround.nix - ./vimwiki.nix - ]); - merged = - builtins.foldl' (acc: elem: lib.recursiveUpdate acc elem) { } configs; + ./telescope.nix + ./toggleterm.nix + ./treesitter.nix + ./trouble.nix + ./which_key.nix + ./wilder.nix + ./typst-preview.nix + ./markdown.nix + ./hop.nix + ./colorizer.nix + ./surround.nix + ./vimwiki.nix + ] + ); + merged = builtins.foldl' (acc: elem: lib.recursiveUpdate acc elem) { } configs; in { - home.sessionVariables = { EDITOR = "nvim"; }; - home.packages = with pkgs; [ nixfmt-rfc-style ]; # nixd config option to set nixpkgs-fmt should work, but it doesn't + home.sessionVariables = { + EDITOR = "nvim"; + }; + home.packages = with pkgs; [ nixfmt-rfc-style ]; # nixd config option to set nixpkgs-fmt should work, but it doesn't programs.nixvim = merged; } diff --git a/home-manager/nixvim/git.nix b/home-manager/nixvim/git.nix index da4eeb2..a3431b9 100644 --- a/home-manager/nixvim/git.nix +++ b/home-manager/nixvim/git.nix @@ -1,7 +1,11 @@ { plugins = { - diffview = { enable = true; }; - lazygit = { enable = true; }; + diffview = { + enable = true; + }; + lazygit = { + enable = true; + }; #neogit = { # enable = true; # settings.integrations = { diffview = true; }; diff --git a/home-manager/nixvim/lightline.nix b/home-manager/nixvim/lightline.nix index dd03fbc..5aa08ac 100644 --- a/home-manager/nixvim/lightline.nix +++ b/home-manager/nixvim/lightline.nix @@ -1 +1,5 @@ -{ plugins.lightline = { enable = true; }; } #status line at the bottom +{ + plugins.lightline = { + enable = true; + }; +} # status line at the bottom diff --git a/home-manager/nixvim/lsp.nix b/home-manager/nixvim/lsp.nix index 6614310..38b0bfa 100644 --- a/home-manager/nixvim/lsp.nix +++ b/home-manager/nixvim/lsp.nix @@ -4,16 +4,18 @@ inlayHints.enable = true; servers = { bashls.enable = true; - #ccls.enable = true; + #ccls.enable = true; clangd.enable = true; cssls.enable = true; gopls.enable = true; clojure_lsp.enable = true; - qmlls = - { - enable = true; - settings.cmd = [ "qmlls" "-E" ]; - }; + qmlls = { + enable = true; + settings.cmd = [ + "qmlls" + "-E" + ]; + }; nixd = { enable = true; settings = { @@ -33,7 +35,7 @@ }; tinymist.enable = true; # typst }; - keymaps= [ + keymaps = [ { key = "gd"; lspBufAction = "definition"; diff --git a/home-manager/nixvim/markdown.nix b/home-manager/nixvim/markdown.nix index fe6f81a..8c7581b 100644 --- a/home-manager/nixvim/markdown.nix +++ b/home-manager/nixvim/markdown.nix @@ -2,7 +2,10 @@ plugins.render-markdown = { enable = true; settings = { - file_types = [ "markdown" "vimwiki"]; + file_types = [ + "markdown" + "vimwiki" + ]; }; }; } diff --git a/home-manager/nixvim/neo-tree.nix b/home-manager/nixvim/neo-tree.nix index b74232a..3ad5c33 100644 --- a/home-manager/nixvim/neo-tree.nix +++ b/home-manager/nixvim/neo-tree.nix @@ -17,7 +17,6 @@ }; }; - # default keybinds # window = { # mappings = { diff --git a/home-manager/nixvim/refactoring.nix b/home-manager/nixvim/refactoring.nix index 109b7b4..64e4522 100644 --- a/home-manager/nixvim/refactoring.nix +++ b/home-manager/nixvim/refactoring.nix @@ -1,3 +1,5 @@ { - plugins = { refactoring.enable = true; }; + plugins = { + refactoring.enable = true; + }; } diff --git a/home-manager/nixvim/telescope.nix b/home-manager/nixvim/telescope.nix index 0fbbb49..36d3721 100644 --- a/home-manager/nixvim/telescope.nix +++ b/home-manager/nixvim/telescope.nix @@ -16,6 +16,8 @@ options.desc = "List buffers"; }; }; - extensions.fzf-native = { enable = true; }; + extensions.fzf-native = { + enable = true; + }; }; } diff --git a/home-manager/nixvim/which_key.nix b/home-manager/nixvim/which_key.nix index 46223c5..b5aaf82 100644 --- a/home-manager/nixvim/which_key.nix +++ b/home-manager/nixvim/which_key.nix @@ -2,5 +2,7 @@ opts = { timeoutlen = 500; }; - plugins.which-key = { enable = true; }; + plugins.which-key = { + enable = true; + }; } diff --git a/home-manager/nixvim/wilder.nix b/home-manager/nixvim/wilder.nix index 1cca351..92b0e13 100644 --- a/home-manager/nixvim/wilder.nix +++ b/home-manager/nixvim/wilder.nix @@ -1,6 +1,10 @@ { plugins.wilder = { enable = true; - modes = [ ":" "/" "?" ]; + modes = [ + ":" + "/" + "?" + ]; }; } diff --git a/home-manager/nvim.nix b/home-manager/nvim.nix index 26f36a2..9f4c30c 100644 --- a/home-manager/nvim.nix +++ b/home-manager/nvim.nix @@ -1,4 +1,9 @@ -{ config, pkgs, inputs, ... }: +{ + config, + pkgs, + inputs, + ... +}: { home.file.".config/nvim" = { enable = true; diff --git a/home-manager/opensnitch-ui.nix b/home-manager/opensnitch-ui.nix index 8d86151..3793f83 100644 --- a/home-manager/opensnitch-ui.nix +++ b/home-manager/opensnitch-ui.nix @@ -1,3 +1,13 @@ -{ osConfig, pkgs, lib, inputs, ... }: -let cfg = osConfig.custom.services.opensnitch; -in { config = lib.mkIf cfg.enable { services.opensnitch-ui.enable = true; }; } +{ + osConfig, + pkgs, + lib, + inputs, + ... +}: +let + cfg = osConfig.custom.services.opensnitch; +in +{ + config = lib.mkIf cfg.enable { services.opensnitch-ui.enable = true; }; +} diff --git a/home-manager/rofi/default.nix b/home-manager/rofi/default.nix index 0131150..155a809 100644 --- a/home-manager/rofi/default.nix +++ b/home-manager/rofi/default.nix @@ -1,8 +1,15 @@ -{ config, pkgs, inputs, lib, ... }: +{ + config, + pkgs, + inputs, + lib, + ... +}: with config.stylix.fonts; let mkLiteral = name: "${name}"; - mkRgba = opacity: color: + mkRgba = + opacity: color: let c = config.lib.stylix.colors; r = c."${color}-rgb-r"; @@ -11,8 +18,7 @@ let in "rgba ( ${r}, ${g}, ${b}, ${opacity} % )"; mkRgb = mkRgba "100"; - rofiOpacity = - builtins.toString (builtins.ceil (config.stylix.opacity.popups * 100)); + rofiOpacity = builtins.toString (builtins.ceil (config.stylix.opacity.popups * 100)); rofiTheme = { background = mkRgba rofiOpacity "base00"; lightbg = mkRgba rofiOpacity "base01"; @@ -68,7 +74,9 @@ in enable = true; text = '' * { - ${builtins.concatStringsSep "\n" (lib.mapAttrsToList (name: value: "${name}: ${value};") rofiTheme)} + ${builtins.concatStringsSep "\n" ( + lib.mapAttrsToList (name: value: "${name}: ${value};") rofiTheme + )} } ''; }; diff --git a/home-manager/stylix.nix b/home-manager/stylix.nix index 7473462..65d3a24 100644 --- a/home-manager/stylix.nix +++ b/home-manager/stylix.nix @@ -1,4 +1,10 @@ -{ osConfig, pkgs, config, lib, ... }: +{ + osConfig, + pkgs, + config, + lib, + ... +}: let cfg = osConfig.custom.graphical.stylix; base16 = config.stylix.base16Scheme; @@ -14,7 +20,7 @@ in enable = true; addCss = false; }; - gtk.flatpakSupport.enable = true; #edits ~/.themes/adw-gtk3 + gtk.flatpakSupport.enable = true; # edits ~/.themes/adw-gtk3 }; }; diff --git a/home-manager/theme.nix b/home-manager/theme.nix index 04bc591..255c294 100644 --- a/home-manager/theme.nix +++ b/home-manager/theme.nix @@ -1,4 +1,9 @@ -{ config, pkgs, inputs, ... }: +{ + config, + pkgs, + inputs, + ... +}: { home = { pointerCursor = { diff --git a/home-manager/vr.nix b/home-manager/vr.nix index d979323..edcfd93 100644 --- a/home-manager/vr.nix +++ b/home-manager/vr.nix @@ -1,26 +1,32 @@ -{ pkgs, config, osConfig, lib, ... }: { - config = lib.mkIf osConfig.custom.hardware.vr.enable - { - xdg.configFile."openxr/1/active_runtime.json".source = "${pkgs.monado}/share/openxr/1/openxr_monado.json"; - xdg.configFile."openvr/openvrpaths.vrpath".text = '' - { - "config" : - [ - "~/.local/share/Steam/config" - ], - "external_drivers" : null, - "jsonid" : "vrpathreg", - "log" : - [ - "~/.local/share/Steam/logs" - ], - "runtime" : - [ - "${pkgs.opencomposite}/lib/opencomposite" - ], - "version" : 1 - } - ''; - }; + pkgs, + config, + osConfig, + lib, + ... +}: +{ + config = lib.mkIf osConfig.custom.hardware.vr.enable { + xdg.configFile."openxr/1/active_runtime.json".source = + "${pkgs.monado}/share/openxr/1/openxr_monado.json"; + xdg.configFile."openvr/openvrpaths.vrpath".text = '' + { + "config" : + [ + "~/.local/share/Steam/config" + ], + "external_drivers" : null, + "jsonid" : "vrpathreg", + "log" : + [ + "~/.local/share/Steam/logs" + ], + "runtime" : + [ + "${pkgs.opencomposite}/lib/opencomposite" + ], + "version" : 1 + } + ''; + }; } diff --git a/home-manager/zsh/default.nix b/home-manager/zsh/default.nix index 1557256..c0fa889 100644 --- a/home-manager/zsh/default.nix +++ b/home-manager/zsh/default.nix @@ -1,4 +1,10 @@ -{ config, pkgs, inputs, ... }: { +{ + config, + pkgs, + inputs, + ... +}: +{ programs.fzf = { enable = true; enableZshIntegration = true; @@ -17,12 +23,10 @@ save = 100000; }; shellAliases = { - # TODO: gifsicle -O3 --lossy=30 noita-20240328-191617-1612416266-00316616.gif -o noita-20240328-191617-1612416266.gif - backupNoita = - "cp -r ~/.local/share/Steam/steamapps/compatdata/881100/pfx/drive_c/users/steamuser/AppData/LocalLow/Nolla_Games_Noita/* ~/synced/default/dont_remotebackup/noita_save"; + # TODO: gifsicle -O3 --lossy=30 noita-20240328-191617-1612416266-00316616.gif -o noita-20240328-191617-1612416266.gif + backupNoita = "cp -r ~/.local/share/Steam/steamapps/compatdata/881100/pfx/drive_c/users/steamuser/AppData/LocalLow/Nolla_Games_Noita/* ~/synced/default/dont_remotebackup/noita_save"; checkTime = "(cd ~/synced/work_drive/TS && nix run)"; - checkWaylandWindowsKDE = - "qdbus org.kde.KWin /KWin org.kde.KWin.showDebugConsole"; + checkWaylandWindowsKDE = "qdbus org.kde.KWin /KWin org.kde.KWin.showDebugConsole"; collectGarbage = "nh clean all"; edit = "cd ~/projects/github/nix-config && nvim ."; ll = "ls -l"; @@ -36,14 +40,10 @@ dev = "nix-shell --run zsh"; rmt = "trash put"; bat = "bat -P --style plain"; - cdf = - "cd $(fd --type d --exclude node_modules --exclude bin --exclude target --exclude .cache . | fzf)"; - cpu_performance = - "echo performance | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor"; - cpu_powersave = - "echo powersave | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor"; - cpu_schedutil = - "echo schedutil | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor"; + cdf = "cd $(fd --type d --exclude node_modules --exclude bin --exclude target --exclude .cache . | fzf)"; + cpu_performance = "echo performance | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor"; + cpu_powersave = "echo powersave | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor"; + cpu_schedutil = "echo schedutil | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor"; cpu_freq = ''watch -n 1 "cat /proc/cpuinfo | grep \"^[c]pu MHz\""''; gpu_monitor = "nvidia-smi dmon -s puct"; nix-shell = "nix-shell --command zsh"; diff --git a/misc-unrelated/budak-image.nix b/misc-unrelated/budak-image.nix index 82d6c43..695b4b7 100644 --- a/misc-unrelated/budak-image.nix +++ b/misc-unrelated/budak-image.nix @@ -1,6 +1,13 @@ -{ pkgs, modulesPath, config, lib, ... }: { +{ + pkgs, + modulesPath, + config, + lib, + ... +}: +{ imports = [ - "${modulesPath}/installer/cd-dvd/installation-cd-graphical-gnome.nix" + "${modulesPath}/installer/cd-dvd/installation-cd-graphical-gnome.nix" ]; # use the latest Linux kernel @@ -15,8 +22,7 @@ enable = true; enable32Bit = true; }; - boot.kernelParams = - [ "nvidia-drm.fbdev=1" ]; + boot.kernelParams = [ "nvidia-drm.fbdev=1" ]; services.xserver.videoDrivers = [ "nvidia" ]; hardware.nvidia = { diff --git a/modules/fh/bakk.nix b/modules/fh/bakk.nix index f63d023..a04ce88 100644 --- a/modules/fh/bakk.nix +++ b/modules/fh/bakk.nix @@ -1,4 +1,10 @@ -{ config, pkgs, lib, ... }: { +{ + config, + pkgs, + lib, + ... +}: +{ services.postgresql = { enable = true; extensions = with pkgs.postgresql14Packages; [ pg_libversion ]; diff --git a/modules/fh/writing.nix b/modules/fh/writing.nix index cc692db..024aa3a 100644 --- a/modules/fh/writing.nix +++ b/modules/fh/writing.nix @@ -1,4 +1,5 @@ -{ pkgs, ... }: { +{ pkgs, ... }: +{ environment.systemPackages = with pkgs; [ typst ]; diff --git a/modules/graphical/audio.nix b/modules/graphical/audio.nix index ef95525..76f997c 100644 --- a/modules/graphical/audio.nix +++ b/modules/graphical/audio.nix @@ -1,4 +1,9 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: with lib; let cfg = config.custom.graphical.audio; diff --git a/modules/graphical/awesome.nix b/modules/graphical/awesome.nix index 9d349a4..33da3a5 100644 --- a/modules/graphical/awesome.nix +++ b/modules/graphical/awesome.nix @@ -1,6 +1,13 @@ -{ config, pkgs, lib, ... }: -let cfg = config.custom.graphical.awesome; -in { +{ + config, + pkgs, + lib, + ... +}: +let + cfg = config.custom.graphical.awesome; +in +{ options.custom.graphical.awesome = { enable = lib.mkEnableOption "Enables awesome"; }; diff --git a/modules/graphical/basics.nix b/modules/graphical/basics.nix index 2e4482b..f914936 100644 --- a/modules/graphical/basics.nix +++ b/modules/graphical/basics.nix @@ -1,7 +1,15 @@ -{ config, pkgs, inputs, lib, ... }: +{ + config, + pkgs, + inputs, + lib, + ... +}: with lib; -let cfg = config.custom.graphical.basics; -in { +let + cfg = config.custom.graphical.basics; +in +{ options.custom.graphical.basics = { enable = mkEnableOption "Enables basics"; }; diff --git a/modules/graphical/code-android.nix b/modules/graphical/code-android.nix index 8224f88..d980d99 100644 --- a/modules/graphical/code-android.nix +++ b/modules/graphical/code-android.nix @@ -1,7 +1,15 @@ -{ config, pkgs, inputs, lib, ... }: +{ + config, + pkgs, + inputs, + lib, + ... +}: with lib; -let cfg = config.custom.graphical.code.android; -in { +let + cfg = config.custom.graphical.code.android; +in +{ options.custom.graphical.code.android = { enable = mkEnableOption "Enables code"; }; @@ -10,6 +18,9 @@ in { documentation.dev.enable = true; programs.adb.enable = true; environment.systemPackages = with pkgs; [ android-studio ]; - users.users.${config.mainUser.name}.extraGroups = [ "adbusers" "kvm" ]; + users.users.${config.mainUser.name}.extraGroups = [ + "adbusers" + "kvm" + ]; }; } diff --git a/modules/graphical/code.nix b/modules/graphical/code.nix index 11790b3..059278b 100644 --- a/modules/graphical/code.nix +++ b/modules/graphical/code.nix @@ -1,4 +1,10 @@ -{ config, pkgs, inputs, lib, ... }: +{ + config, + pkgs, + inputs, + lib, + ... +}: with lib; let cfg = config.custom.graphical.code; @@ -12,23 +18,26 @@ in config = mkIf cfg.enable { documentation.dev.enable = true; - environment.systemPackages = with pkgs; [ - man-pages - stable.jetbrains.idea-ultimate - typescript - bruno - nodejs_22 # needed for tabby extension - python3 - gcc - ] ++ lib.optionals cfg.rider [ - pkgs.jetbrains.rider - ] ++ lib.optionals cfg.clion [ - pkgs.jetbrains.clion - ]; + environment.systemPackages = + with pkgs; + [ + man-pages + stable.jetbrains.idea-ultimate + typescript + bruno + nodejs_22 # needed for tabby extension + python3 + gcc + ] + ++ lib.optionals cfg.rider [ + pkgs.jetbrains.rider + ] + ++ lib.optionals cfg.clion [ + pkgs.jetbrains.clion + ]; #environment.sessionVariables = { # DOTNET_ROOT = "${pkgs.dotnet-sdk_7}"; #}; }; } - diff --git a/modules/graphical/cosmic.nix b/modules/graphical/cosmic.nix index cb79c26..d9c1ce0 100644 --- a/modules/graphical/cosmic.nix +++ b/modules/graphical/cosmic.nix @@ -1,4 +1,10 @@ -{ config, pkgs, inputs, lib, ... }: +{ + config, + pkgs, + inputs, + lib, + ... +}: let cfg = config.custom.graphical.cosmic; in @@ -13,7 +19,7 @@ in trusted-public-keys = [ "cosmic.cachix.org-1:Dya9IyXD4xdBehWjrkPv6rtxpmMdRel02smYzA85dPE=" ]; }; services.desktopManager.cosmic.enable = true; - services.displayManager.cosmic-greeter.enable = if (config.custom.graphical.sddm.enable == false) then true else false; + services.displayManager.cosmic-greeter.enable = + if (config.custom.graphical.sddm.enable == false) then true else false; }; } - diff --git a/modules/graphical/default.nix b/modules/graphical/default.nix index fdf5559..8bfe02b 100644 --- a/modules/graphical/default.nix +++ b/modules/graphical/default.nix @@ -1,4 +1,9 @@ -{ pkgs, config, lib, ... }: +{ + pkgs, + config, + lib, + ... +}: { imports = [ diff --git a/modules/graphical/emulators.nix b/modules/graphical/emulators.nix index f5f0d3d..f47bf0f 100644 --- a/modules/graphical/emulators.nix +++ b/modules/graphical/emulators.nix @@ -1,4 +1,10 @@ -{ lib, config, pkgs, inputs, ... }: +{ + lib, + config, + pkgs, + inputs, + ... +}: with lib; let cfg = config.custom.graphical.emulators; diff --git a/modules/graphical/games.nix b/modules/graphical/games.nix index f9cc5e9..954560b 100644 --- a/modules/graphical/games.nix +++ b/modules/graphical/games.nix @@ -1,4 +1,9 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: with lib; let cfg = config.custom.graphical.games; @@ -22,12 +27,13 @@ in config = mkIf cfg.enable { programs.steam = { enable = true; - remotePlay.openFirewall = - true; # Open ports in the firewall for Steam Remote Play - dedicatedServer.openFirewall = - true; # Open ports in the firewall for Source Dedicated Server + remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play + dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server gamescopeSession.enable = true; - extraCompatPackages = with pkgs; [ proton-ge-bin steamtinkerlaunch ]; + extraCompatPackages = with pkgs; [ + proton-ge-bin + steamtinkerlaunch + ]; }; programs.gamemode = { enable = true; @@ -37,19 +43,28 @@ in }; }; - environment.systemPackages = with pkgs; [ mangohud lutris ] - ++ optionals cfg.enablePreinstalled (with pkgs; [ - #taisei - #osu-lazer-bin - wineWowPackages.unstableFull - winetricks - heroic - prismlauncher - steamtinkerlaunch - tetrio-desktop - beyond-all-reason - #libs - ]) ++ optionals cfg.enableVr (with pkgs; [ bs-manager ]); + environment.systemPackages = + with pkgs; + [ + mangohud + lutris + ] + ++ optionals cfg.enablePreinstalled ( + with pkgs; + [ + #taisei + #osu-lazer-bin + wineWowPackages.unstableFull + winetricks + heroic + prismlauncher + steamtinkerlaunch + tetrio-desktop + beyond-all-reason + #libs + ] + ) + ++ optionals cfg.enableVr (with pkgs; [ bs-manager ]); }; } diff --git a/modules/graphical/gnome-settings.nix b/modules/graphical/gnome-settings.nix index 3e13a2a..b3777b8 100644 --- a/modules/graphical/gnome-settings.nix +++ b/modules/graphical/gnome-settings.nix @@ -1,114 +1,124 @@ { config, lib, ... }: -let cfg = config.custom.graphical.gnome; -in { +let + cfg = config.custom.graphical.gnome; +in +{ # doesnt work for me.. nothing changes config = lib.mkIf cfg.enable { - programs.dconf.profiles.user.databases = [{ - lockAll = true; - settings = with lib.gvariant; { - "org/gnome/settings-daemon/plugins/media-keys" = { - custom-keybindings = [ - "/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/" - "/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1/" - "/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom2/" - ]; - }; - "org/gnome/desktop/wm/preferences" = { - resize-with-right-button = true; - }; - "org/gnome/desktop/sound" = { event-sounds = false; }; - "org/gnome/desktop/peripherals/mouse" = { accel-profile = "flat"; }; - "org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0" = - { + programs.dconf.profiles.user.databases = [ + { + lockAll = true; + settings = with lib.gvariant; { + "org/gnome/settings-daemon/plugins/media-keys" = { + custom-keybindings = [ + "/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/" + "/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1/" + "/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom2/" + ]; + }; + "org/gnome/desktop/wm/preferences" = { + resize-with-right-button = true; + }; + "org/gnome/desktop/sound" = { + event-sounds = false; + }; + "org/gnome/desktop/peripherals/mouse" = { + accel-profile = "flat"; + }; + "org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0" = { name = "nautilus"; command = "nautilus"; binding = "e"; }; - "org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1" = - { + "org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1" = { name = "kitty super"; command = "kitty"; binding = "q"; }; - "org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom2" = - { + "org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom2" = { binding = "space"; command = "rofi -show combi"; name = "Open Rofi"; }; - "org/gnome/shell" = { - disable-user-extensions = false; - enabled-extensions = [ - "blur-my-shell@aunetx" - "trayIconsReloaded@selfmade.pl" - "Vitals@CoreCoding.com" - "workspace-indicator@gnome-shell-extensions.gcampax.github.com" - "dash-to-dock@micxgx.gmail.com" - "just-perfection-desktop@just-perfection" - "user-theme@gnome-shell-extensions.gcampax.github.com" - "apps-menu@gnome-shell-extensions.gcampax.github.com" - ]; + "org/gnome/shell" = { + disable-user-extensions = false; + enabled-extensions = [ + "blur-my-shell@aunetx" + "trayIconsReloaded@selfmade.pl" + "Vitals@CoreCoding.com" + "workspace-indicator@gnome-shell-extensions.gcampax.github.com" + "dash-to-dock@micxgx.gmail.com" + "just-perfection-desktop@just-perfection" + "user-theme@gnome-shell-extensions.gcampax.github.com" + "apps-menu@gnome-shell-extensions.gcampax.github.com" + ]; + }; + "org/gnome/mutter" = { + edge-tiling = true; + workspaces-only-on-primary = true; + dynamic-workspaces = false; + }; + #"org/gnome/desktop/wm/preferences" = { + # num-workspaces = 9; + # focus-mode = "sloppy"; + #}; + "org/gnome/desktop/wm/keybindings" = { + #minimize = [ "comma" ]; + maximize = [ "f" ]; + #switch-to-workspace-left = [ "e" ]; + #switch-to-workspace-right = [ "r" ]; + unmaximize = mkEmptyArray type.string; + activate-window-menu = mkEmptyArray type.string; + move-to-monitor-up = mkEmptyArray type.string; + move-to-monitor-down = mkEmptyArray type.string; + #move-to-monitor-left = [ "e" ]; + #move-to-monitor-right = [ "r" ]; + move-to-workspace-down = mkEmptyArray type.string; + move-to-workspace-up = mkEmptyArray type.string; + switch-to-workspace-down = [ + "Down" + "j" + ]; + switch-to-workspace-up = [ + "Up" + "k" + ]; + toggle-maximized = [ "f" ]; + close = [ "F4" ]; + switch-to-workspace-1 = [ "1" ]; + switch-to-workspace-2 = [ "2" ]; + switch-to-workspace-3 = [ "3" ]; + switch-to-workspace-4 = [ "4" ]; + switch-to-workspace-5 = [ "5" ]; + switch-to-workspace-6 = [ "6" ]; + switch-to-workspace-7 = [ "7" ]; + switch-to-workspace-8 = [ "8" ]; + switch-to-workspace-9 = [ "9" ]; + move-to-workspace-1 = [ "1" ]; + move-to-workspace-2 = [ "2" ]; + move-to-workspace-3 = [ "3" ]; + move-to-workspace-4 = [ "4" ]; + move-to-workspace-5 = [ "5" ]; + move-to-workspace-6 = [ "6" ]; + move-to-workspace-7 = [ "7" ]; + move-to-workspace-8 = [ "8" ]; + move-to-workspace-9 = [ "9" ]; + }; + "org/gnome/shell/keybindings" = { + # Following binds need to be disabled, as their defaults are used for + # the binds above, and will run into conflicts. + switch-to-application-1 = mkEmptyArray type.string; + switch-to-application-2 = mkEmptyArray type.string; + switch-to-application-3 = mkEmptyArray type.string; + switch-to-application-4 = mkEmptyArray type.string; + switch-to-application-5 = mkEmptyArray type.string; + switch-to-application-6 = mkEmptyArray type.string; + switch-to-application-7 = mkEmptyArray type.string; + switch-to-application-8 = mkEmptyArray type.string; + switch-to-application-9 = mkEmptyArray type.string; + }; }; - "org/gnome/mutter" = { - edge-tiling = true; - workspaces-only-on-primary = true; - dynamic-workspaces = false; - }; - #"org/gnome/desktop/wm/preferences" = { - # num-workspaces = 9; - # focus-mode = "sloppy"; - #}; - "org/gnome/desktop/wm/keybindings" = { - #minimize = [ "comma" ]; - maximize = [ "f" ]; - #switch-to-workspace-left = [ "e" ]; - #switch-to-workspace-right = [ "r" ]; - unmaximize = mkEmptyArray type.string; - activate-window-menu = mkEmptyArray type.string; - move-to-monitor-up = mkEmptyArray type.string; - move-to-monitor-down = mkEmptyArray type.string; - #move-to-monitor-left = [ "e" ]; - #move-to-monitor-right = [ "r" ]; - move-to-workspace-down = mkEmptyArray type.string; - move-to-workspace-up = mkEmptyArray type.string; - switch-to-workspace-down = - [ "Down" "j" ]; - switch-to-workspace-up = [ "Up" "k" ]; - toggle-maximized = [ "f" ]; - close = [ "F4" ]; - switch-to-workspace-1 = [ "1" ]; - switch-to-workspace-2 = [ "2" ]; - switch-to-workspace-3 = [ "3" ]; - switch-to-workspace-4 = [ "4" ]; - switch-to-workspace-5 = [ "5" ]; - switch-to-workspace-6 = [ "6" ]; - switch-to-workspace-7 = [ "7" ]; - switch-to-workspace-8 = [ "8" ]; - switch-to-workspace-9 = [ "9" ]; - move-to-workspace-1 = [ "1" ]; - move-to-workspace-2 = [ "2" ]; - move-to-workspace-3 = [ "3" ]; - move-to-workspace-4 = [ "4" ]; - move-to-workspace-5 = [ "5" ]; - move-to-workspace-6 = [ "6" ]; - move-to-workspace-7 = [ "7" ]; - move-to-workspace-8 = [ "8" ]; - move-to-workspace-9 = [ "9" ]; - }; - "org/gnome/shell/keybindings" = { - # Following binds need to be disabled, as their defaults are used for - # the binds above, and will run into conflicts. - switch-to-application-1 = mkEmptyArray type.string; - switch-to-application-2 = mkEmptyArray type.string; - switch-to-application-3 = mkEmptyArray type.string; - switch-to-application-4 = mkEmptyArray type.string; - switch-to-application-5 = mkEmptyArray type.string; - switch-to-application-6 = mkEmptyArray type.string; - switch-to-application-7 = mkEmptyArray type.string; - switch-to-application-8 = mkEmptyArray type.string; - switch-to-application-9 = mkEmptyArray type.string; - }; - }; - }]; + } + ]; }; } diff --git a/modules/graphical/gnome.nix b/modules/graphical/gnome.nix index 0708635..3a499c6 100644 --- a/modules/graphical/gnome.nix +++ b/modules/graphical/gnome.nix @@ -1,16 +1,24 @@ -{ lib, config, pkgs, ... }: +{ + lib, + config, + pkgs, + ... +}: with lib; -let cfg = config.custom.graphical.gnome; -in { - options.custom.graphical.gnome = { enable = mkEnableOption "Enables gnome"; }; +let + cfg = config.custom.graphical.gnome; +in +{ + options.custom.graphical.gnome = { + enable = mkEnableOption "Enables gnome"; + }; config = mkIf cfg.enable { services.xserver = { xkb.layout = config.mainUser.layout; xkb.variant = config.mainUser.variant; enable = true; - displayManager.gdm.enable = - lib.mkIf (!config.custom.graphical.sddm.enable) true; + displayManager.gdm.enable = lib.mkIf (!config.custom.graphical.sddm.enable) true; desktopManager.gnome.enable = true; }; @@ -21,23 +29,26 @@ in { environment.sessionVariables.NIXOS_OZONE_WL = "1"; - environment.gnome.excludePackages = (with pkgs; [ - gnome-photos - gnome-tour - cheese - gedit # text editor - gnome-music - gnome-terminal - epiphany # web browser - #geary # email reader - evince # document viewer - gnome-characters - totem # video player - tali # poker game - iagno # go game - hitori # sudoku game - atomix # puzzle game - ]); + environment.gnome.excludePackages = ( + with pkgs; + [ + gnome-photos + gnome-tour + cheese + gedit # text editor + gnome-music + gnome-terminal + epiphany # web browser + #geary # email reader + evince # document viewer + gnome-characters + totem # video player + tali # poker game + iagno # go game + hitori # sudoku game + atomix # puzzle game + ] + ); environment.systemPackages = with pkgs; [ wmctrl diff --git a/modules/graphical/hyprland.nix b/modules/graphical/hyprland.nix index 5d888e9..35b1e7b 100644 --- a/modules/graphical/hyprland.nix +++ b/modules/graphical/hyprland.nix @@ -1,6 +1,14 @@ -{ config, pkgs, lib, inputs, ... }: -let cfg = config.custom.graphical.hyprland; -in { +{ + config, + pkgs, + lib, + inputs, + ... +}: +let + cfg = config.custom.graphical.hyprland; +in +{ options.custom.graphical.hyprland = { enable = lib.mkEnableOption "Enables hyprland"; }; @@ -14,8 +22,7 @@ in { xkb.variant = config.mainUser.variant; enable = true; }; - services.displayManager.sddm.enable = - !config.services.xserver.displayManager.gdm.enable; + services.displayManager.sddm.enable = !config.services.xserver.displayManager.gdm.enable; nix.settings = { substituters = [ "https://hyprland.cachix.org" ]; @@ -30,7 +37,9 @@ in { pkgs.xdg-desktop-portal-hyprland ]; - programs.hyprland = { enable = true; }; + programs.hyprland = { + enable = true; + }; security.pam.services.hyprlock = { }; systemd = { @@ -41,8 +50,7 @@ in { after = [ "graphical-session.target" ]; serviceConfig = { Type = "simple"; - ExecStart = - "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1"; + ExecStart = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1"; Restart = "on-failure"; RestartSec = 1; TimeoutStopSec = 10; @@ -72,9 +80,8 @@ in { #xdg-utils #xwayland (writeShellScriptBin "copyfiletoclip" '' - echo "file://$(realpath $1)" | wl-copy -t text/uri-list - '' - ) + echo "file://$(realpath $1)" | wl-copy -t text/uri-list + '') ]; }; diff --git a/modules/graphical/i3.nix b/modules/graphical/i3.nix index 7cb5f97..508b8a5 100644 --- a/modules/graphical/i3.nix +++ b/modules/graphical/i3.nix @@ -1,6 +1,13 @@ -{ config, pkgs, lib, ... }: -let cfg = config.custom.graphical.i3; -in { +{ + config, + pkgs, + lib, + ... +}: +let + cfg = config.custom.graphical.i3; +in +{ options = { custom.graphical.i3.enable = lib.mkOption { @@ -24,14 +31,18 @@ in { }; services = { - displayManager = { defaultSession = "none+i3"; }; + displayManager = { + defaultSession = "none+i3"; + }; xserver = { enable = true; xkb.layout = config.mainUser.layout; xkb.variant = config.mainUser.variant; - desktopManager = { xterm.enable = false; }; + desktopManager = { + xterm.enable = false; + }; windowManager.i3 = { enable = true; @@ -53,8 +64,7 @@ in { after = [ "graphical-session.target" ]; serviceConfig = { Type = "simple"; - ExecStart = - "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1"; + ExecStart = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1"; Restart = "on-failure"; RestartSec = 1; TimeoutStopSec = 10; diff --git a/modules/graphical/ime.nix b/modules/graphical/ime.nix index a5c0913..1545b60 100644 --- a/modules/graphical/ime.nix +++ b/modules/graphical/ime.nix @@ -1,8 +1,17 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: with lib; -let cfg = config.custom.graphical.ime; -in { - options.custom.graphical.ime = { enable = mkEnableOption "Enables ime"; }; +let + cfg = config.custom.graphical.ime; +in +{ + options.custom.graphical.ime = { + enable = mkEnableOption "Enables ime"; + }; config = mkIf cfg.enable { i18n.inputMethod = { diff --git a/modules/graphical/lightdm.nix b/modules/graphical/lightdm.nix index 2234a7b..b4617bc 100644 --- a/modules/graphical/lightdm.nix +++ b/modules/graphical/lightdm.nix @@ -1,6 +1,13 @@ -{ config, pkgs, lib, ... }: -let cfg = config.custom.graphical.lightdm; -in { +{ + config, + pkgs, + lib, + ... +}: +let + cfg = config.custom.graphical.lightdm; +in +{ options = { custom.graphical.lightdm.enable = lib.mkOption { diff --git a/modules/graphical/lxqt.nix b/modules/graphical/lxqt.nix index baa3d0d..134666b 100644 --- a/modules/graphical/lxqt.nix +++ b/modules/graphical/lxqt.nix @@ -1,4 +1,9 @@ -{ lib, config, pkgs, ... }: +{ + lib, + config, + pkgs, + ... +}: with lib; let cfg = config.custom.graphical.lxqt; diff --git a/modules/graphical/nightlight.nix b/modules/graphical/nightlight.nix index a462a2b..1c61bf7 100644 --- a/modules/graphical/nightlight.nix +++ b/modules/graphical/nightlight.nix @@ -1,6 +1,13 @@ -{ config, lib, pkgs, ... }: -let cfg = config.custom.graphical.nightlight; -in { +{ + config, + lib, + pkgs, + ... +}: +let + cfg = config.custom.graphical.nightlight; +in +{ options.custom.graphical.nightlight = { enable = lib.mkEnableOption "Enables nightlight"; }; diff --git a/modules/graphical/niri.nix b/modules/graphical/niri.nix index 1b9a14f..e4099e5 100644 --- a/modules/graphical/niri.nix +++ b/modules/graphical/niri.nix @@ -1,6 +1,13 @@ -{ config, pkgs, lib, ... }: -let cfg = config.custom.graphical.niri; -in { +{ + config, + pkgs, + lib, + ... +}: +let + cfg = config.custom.graphical.niri; +in +{ options = { custom.graphical.niri.enable = lib.mkOption { @@ -11,7 +18,9 @@ in { }; config = lib.mkIf cfg.enable { - programs.niri = { enable = true; }; + programs.niri = { + enable = true; + }; environment.systemPackages = with pkgs; [ xwayland-satellite ]; }; } diff --git a/modules/graphical/noise-supression.nix b/modules/graphical/noise-supression.nix index f2195a4..f5d908a 100644 --- a/modules/graphical/noise-supression.nix +++ b/modules/graphical/noise-supression.nix @@ -1,4 +1,9 @@ -{ config, pkgs, lib, ... }: +{ + config, + pkgs, + lib, + ... +}: let cfg = config.custom.graphical.noise-supression; in diff --git a/modules/graphical/obs.nix b/modules/graphical/obs.nix index 37d55a1..5cf2d31 100644 --- a/modules/graphical/obs.nix +++ b/modules/graphical/obs.nix @@ -1,4 +1,9 @@ -{ lib, config, pkgs, ... }: +{ + lib, + config, + pkgs, + ... +}: with lib; let cfg = config.custom.graphical.obs; diff --git a/modules/graphical/openrgb.nix b/modules/graphical/openrgb.nix index 4bbfda4..f7eaf08 100644 --- a/modules/graphical/openrgb.nix +++ b/modules/graphical/openrgb.nix @@ -1,4 +1,9 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: with lib; let cfg = config.custom.graphical.openrgb; diff --git a/modules/graphical/plasma.nix b/modules/graphical/plasma.nix index bff4334..f37ea6f 100644 --- a/modules/graphical/plasma.nix +++ b/modules/graphical/plasma.nix @@ -1,7 +1,14 @@ -{ lib, config, pkgs, ... }: +{ + lib, + config, + pkgs, + ... +}: with lib; -let cfg = config.custom.graphical.plasma; -in { +let + cfg = config.custom.graphical.plasma; +in +{ options.custom.graphical.plasma = { enable = mkEnableOption "Enables plasma"; }; diff --git a/modules/graphical/sddm.nix b/modules/graphical/sddm.nix index 452cd0c..5c00451 100644 --- a/modules/graphical/sddm.nix +++ b/modules/graphical/sddm.nix @@ -1,6 +1,13 @@ -{ config, pkgs, lib, ... }: -let cfg = config.custom.graphical.sddm; -in { +{ + config, + pkgs, + lib, + ... +}: +let + cfg = config.custom.graphical.sddm; +in +{ options = { custom.graphical.sddm.enable = lib.mkOption { @@ -11,12 +18,12 @@ in { }; config = lib.mkIf cfg.enable { - environment.systemPackages = [ (pkgs.sddm-astronaut.override { embeddedTheme = "pixel_sakura";}) ]; + environment.systemPackages = [ (pkgs.sddm-astronaut.override { embeddedTheme = "pixel_sakura"; }) ]; services = { displayManager.sddm = { enable = true; theme = "sddm-astronaut-theme"; - extraPackages = [ (pkgs.sddm-astronaut.override { embeddedTheme = "pixel_sakura";}) ]; + extraPackages = [ (pkgs.sddm-astronaut.override { embeddedTheme = "pixel_sakura"; }) ]; #wayland.enable = true; #sddm.theme = "breeze"; }; diff --git a/modules/graphical/shared.nix b/modules/graphical/shared.nix index 1a0bbc7..227bde7 100644 --- a/modules/graphical/shared.nix +++ b/modules/graphical/shared.nix @@ -1,7 +1,15 @@ -{ config, pkgs, inputs, lib, ... }: +{ + config, + pkgs, + inputs, + lib, + ... +}: with lib; -let cfg = config.custom.graphical.shared; -in { +let + cfg = config.custom.graphical.shared; +in +{ options.custom.graphical.shared = { enable = mkEnableOption "Enables shared"; }; @@ -39,16 +47,21 @@ in { networking.firewall = { enable = true; allowedTCPPorts = [ 53317 ]; # localsend - allowedUDPPorts = [ 1194 53317 ]; # openvpn, localsend - allowedTCPPortRanges = [{ - from = 1714; - to = 1764; - } # KDE Connect + allowedUDPPorts = [ + 1194 + 53317 + ]; # openvpn, localsend + allowedTCPPortRanges = [ + { + from = 1714; + to = 1764; + } # KDE Connect ]; - allowedUDPPortRanges = [{ - from = 1714; - to = 1764; - } # KDE Connect + allowedUDPPortRanges = [ + { + from = 1714; + to = 1764; + } # KDE Connect ]; }; diff --git a/modules/graphical/stylix.nix b/modules/graphical/stylix.nix index e74e333..7c397ff 100644 --- a/modules/graphical/stylix.nix +++ b/modules/graphical/stylix.nix @@ -1,6 +1,13 @@ -{ lib, config, pkgs, ... }: -let cfg = config.custom.graphical.stylix; -in { +{ + lib, + config, + pkgs, + ... +}: +let + cfg = config.custom.graphical.stylix; +in +{ options.custom.graphical.stylix = with lib; { enable = mkEnableOption "Enables stylix"; image = mkOption { @@ -11,7 +18,13 @@ in { ''; }; base16Scheme = mkOption { - type = with lib.types; nullOr (oneOf [ path lines attrs ]); + type = + with lib.types; + nullOr (oneOf [ + path + lines + attrs + ]); default = null; description = '' The base16 scheme to use. diff --git a/modules/graphical/sway.nix b/modules/graphical/sway.nix index ac5af92..f587d45 100644 --- a/modules/graphical/sway.nix +++ b/modules/graphical/sway.nix @@ -1,6 +1,13 @@ -{ config, pkgs, lib, ... }: -let cfg = config.custom.graphical.sway; -in { +{ + config, + pkgs, + lib, + ... +}: +let + cfg = config.custom.graphical.sway; +in +{ options = { custom.graphical.sway.enable = lib.mkOption { diff --git a/modules/graphical/xfce.nix b/modules/graphical/xfce.nix index be867c0..a731a5e 100644 --- a/modules/graphical/xfce.nix +++ b/modules/graphical/xfce.nix @@ -1,4 +1,9 @@ -{ lib, config, pkgs, ... }: +{ + lib, + config, + pkgs, + ... +}: with lib; let cfg = config.custom.graphical.xfce; diff --git a/modules/hardware/amd-gpu.nix b/modules/hardware/amd-gpu.nix index 50cee6d..55b5888 100644 --- a/modules/hardware/amd-gpu.nix +++ b/modules/hardware/amd-gpu.nix @@ -1,54 +1,73 @@ -{ lib, config, pkgs, inputs, pkgsVersion, ... }: -let cfg = config.custom.hardware.amd-gpu; -in { +{ + lib, + config, + pkgs, + inputs, + pkgsVersion, + ... +}: +let + cfg = config.custom.hardware.amd-gpu; +in +{ options.custom.hardware.amd-gpu = { enable = lib.mkEnableOption "Enables amd gpus"; overdrive = lib.mkEnableOption "Enables overdrive"; rocm.enable = lib.mkEnableOption "Enables rocm"; }; - config = - lib.mkIf cfg.enable { - boot.kernelParams = lib.mkIf cfg.overdrive - [ "amdgpu.ppfeaturemask=0xfff7ffff" "split_lock_detect=off" ]; + config = lib.mkIf cfg.enable { + boot.kernelParams = lib.mkIf cfg.overdrive [ + "amdgpu.ppfeaturemask=0xfff7ffff" + "split_lock_detect=off" + ]; - hardware.graphics = { - enable = true; - enable32Bit = true; - extraPackages = lib.mkIf cfg.rocm.enable (with pkgs; [ rocmPackages.clr rocmPackages.clr.icd ]); - }; + hardware.graphics = { + enable = true; + enable32Bit = true; + extraPackages = lib.mkIf cfg.rocm.enable ( + with pkgs; + [ + rocmPackages.clr + rocmPackages.clr.icd + ] + ); + }; - hardware.amdgpu.initrd.enable = lib.mkDefault true; - services.xserver.videoDrivers = [ "amdgpu" ]; - # controller (overclock, undervolt, fan curves) - environment.systemPackages = with pkgs; [ + hardware.amdgpu.initrd.enable = lib.mkDefault true; + services.xserver.videoDrivers = [ "amdgpu" ]; + # controller (overclock, undervolt, fan curves) + environment.systemPackages = + with pkgs; + [ nvtopPackages.amd amdgpu_top - ] ++ lib.optionals cfg.rocm.enable [ + ] + ++ lib.optionals cfg.rocm.enable [ clinfo rocmPackages.rocminfo - ] ++ lib.optionals cfg.overdrive [ + ] + ++ lib.optionals cfg.overdrive [ lact ]; - systemd = { - packages = lib.mkIf cfg.overdrive (with pkgs; [ lact ]); - services.lactd.wantedBy = lib.mkIf cfg.overdrive [ "multi-user.target" ]; - #rocm - tmpfiles.rules = - let - rocmEnv = pkgs.symlinkJoin { - name = "rocm-combined"; - paths = with pkgs.rocmPackages; [ - rocblas - hipblas - clr - ]; - }; - in - lib.mkIf cfg.rocm.enable - [ - "L+ /opt/rocm - - - - ${rocmEnv}" + systemd = { + packages = lib.mkIf cfg.overdrive (with pkgs; [ lact ]); + services.lactd.wantedBy = lib.mkIf cfg.overdrive [ "multi-user.target" ]; + #rocm + tmpfiles.rules = + let + rocmEnv = pkgs.symlinkJoin { + name = "rocm-combined"; + paths = with pkgs.rocmPackages; [ + rocblas + hipblas + clr ]; - }; + }; + in + lib.mkIf cfg.rocm.enable [ + "L+ /opt/rocm - - - - ${rocmEnv}" + ]; }; + }; } diff --git a/modules/hardware/android.nix b/modules/hardware/android.nix index ea5c06a..f36b7cf 100644 --- a/modules/hardware/android.nix +++ b/modules/hardware/android.nix @@ -1,6 +1,13 @@ -{ config, pkgs, lib, ... }: -let cfg = config.custom.hardware.android; -in { +{ + config, + pkgs, + lib, + ... +}: +let + cfg = config.custom.hardware.android; +in +{ options.custom.hardware.android = { enable = lib.mkEnableOption "Enables android phone support"; }; @@ -9,7 +16,7 @@ in { programs.adb = { enable = true; }; - environment.systemPackages = with pkgs;[ + environment.systemPackages = with pkgs; [ scrcpy # mirrors screen to pc, -S turns off screen while active, --render-driver opengl uses opengl for rendering ]; users.users.${config.mainUser.name}.extraGroups = [ "adbusers" ]; diff --git a/modules/hardware/default.nix b/modules/hardware/default.nix index 66619ff..4c90e6c 100644 --- a/modules/hardware/default.nix +++ b/modules/hardware/default.nix @@ -1,4 +1,5 @@ -{ pkgs, config, ... }: { +{ pkgs, config, ... }: +{ imports = [ ./amd-gpu.nix ./android.nix diff --git a/modules/hardware/fingerprint.nix b/modules/hardware/fingerprint.nix index d146875..6e36587 100644 --- a/modules/hardware/fingerprint.nix +++ b/modules/hardware/fingerprint.nix @@ -1,6 +1,13 @@ -{ config, pkgs, lib, ... }: -let cfg = config.custom.hardware.fingerprint; -in { +{ + config, + pkgs, + lib, + ... +}: +let + cfg = config.custom.hardware.fingerprint; +in +{ options.custom.hardware.fingerprint = { enable = lib.mkEnableOption "Enables fingerprint sensor support"; }; diff --git a/modules/hardware/firmware.nix b/modules/hardware/firmware.nix index fe84d2b..1e7cdff 100644 --- a/modules/hardware/firmware.nix +++ b/modules/hardware/firmware.nix @@ -12,4 +12,3 @@ in services.fwupd.enable = true; }; } - diff --git a/modules/hardware/nvidia.nix b/modules/hardware/nvidia.nix index 09ea20e..4b848c6 100644 --- a/modules/hardware/nvidia.nix +++ b/modules/hardware/nvidia.nix @@ -1,6 +1,15 @@ -{ lib, config, pkgs, inputs, pkgsVersion, ... }: -let cfg = config.custom.hardware.nvidia; -in { +{ + lib, + config, + pkgs, + inputs, + pkgsVersion, + ... +}: +let + cfg = config.custom.hardware.nvidia; +in +{ options.custom.hardware.nvidia = { enable = lib.mkEnableOption "Enables nvidia gpus"; powerLimit = { @@ -32,51 +41,57 @@ in { let # the option was renamed in unstable nvidiaOption = - if (pkgsVersion == inputs.nixpkgs-unstable) then { - hardware.graphics = { - enable = true; - enable32Bit = true; - extraPackages = with pkgs; [ nvidia-vaapi-driver ]; + if (pkgsVersion == inputs.nixpkgs-unstable) then + { + hardware.graphics = { + enable = true; + enable32Bit = true; + extraPackages = with pkgs; [ nvidia-vaapi-driver ]; + }; + } + else + { + hardware.opengl = { + enable = true; + driSupport = true; + driSupport32Bit = true; + }; }; - } else { - hardware.opengl = { - enable = true; - driSupport = true; - driSupport32Bit = true; - }; - }; nvidia_oc = "${pkgs.nvidia_oc}/bin/nvidia_oc"; in - lib.mkIf cfg.enable (lib.recursiveUpdate nvidiaOption { - boot.kernelParams = - [ "nvidia-drm.fbdev=1" "nvidia.NVreg_PreserveVideoMemoryAllocations=1" ]; - services.xserver.videoDrivers = [ "nvidia" ]; - services.xserver.deviceSection = '' - Option "Coolbits" "24" - ''; - hardware.nvidia = { - # Modesetting is required. - modesetting.enable = true; - # Open drivers with gsp stutters in VR - https://github.com/ValveSoftware/SteamVR-for-Linux/issues/631 - gsp.enable = config.hardware.nvidia.open; - # Nvidia power management. Experimental, and can cause sleep/suspend to fail. - powerManagement.enable = false; - # Fine-grained power management. Turns off GPU when not in use. - # Experimental and only works on modern Nvidia GPUs (Turing or newer). - powerManagement.finegrained = false; - # Use the NVidia open source kernel module (not to be confused with the - # independent third-party "nouveau" open source driver). - # Support is limited to the Turing and later architectures. Full list of - # supported GPUs is at: - # https://github.com/NVIDIA/open-gpu-kernel-modules#compatible-gpus - # Only available from driver 515.43.04+ - # GSP must be enabled for this to work. - open = false; - # Enable the Nvidia settings menu, - # accessible via `nvidia-settings`. - nvidiaSettings = true; - # Optionally, you may need to select the appropriate driver version for your specific GPU. - package = config.boot.kernelPackages.nvidiaPackages.beta; + lib.mkIf cfg.enable ( + lib.recursiveUpdate nvidiaOption { + boot.kernelParams = [ + "nvidia-drm.fbdev=1" + "nvidia.NVreg_PreserveVideoMemoryAllocations=1" + ]; + services.xserver.videoDrivers = [ "nvidia" ]; + services.xserver.deviceSection = '' + Option "Coolbits" "24" + ''; + hardware.nvidia = { + # Modesetting is required. + modesetting.enable = true; + # Open drivers with gsp stutters in VR - https://github.com/ValveSoftware/SteamVR-for-Linux/issues/631 + gsp.enable = config.hardware.nvidia.open; + # Nvidia power management. Experimental, and can cause sleep/suspend to fail. + powerManagement.enable = false; + # Fine-grained power management. Turns off GPU when not in use. + # Experimental and only works on modern Nvidia GPUs (Turing or newer). + powerManagement.finegrained = false; + # Use the NVidia open source kernel module (not to be confused with the + # independent third-party "nouveau" open source driver). + # Support is limited to the Turing and later architectures. Full list of + # supported GPUs is at: + # https://github.com/NVIDIA/open-gpu-kernel-modules#compatible-gpus + # Only available from driver 515.43.04+ + # GSP must be enabled for this to work. + open = false; + # Enable the Nvidia settings menu, + # accessible via `nvidia-settings`. + nvidiaSettings = true; + # Optionally, you may need to select the appropriate driver version for your specific GPU. + package = config.boot.kernelPackages.nvidiaPackages.beta; #package = config.boot.kernelPackages.nvidiaPackages.mkDriver { # version = "570.124.04"; # sha256_64bit = "sha256-G3hqS3Ei18QhbFiuQAdoik93jBlsFI2RkWOBXuENU8Q="; @@ -85,40 +100,35 @@ in { # settingsSha256 = "sha256-LNL0J/sYHD8vagkV1w8tb52gMtzj/F0QmJTV1cMaso8="; # persistencedSha256 = ""; #}; - }; + }; - environment.systemPackages = with pkgs; [ - vaapiVdpau - libvdpau-va-gl - libva - libva-utils - pkgs.nvidia_oc - (gwe.override { nvidia_x11 = config.hardware.nvidia.package; }) - ]; + environment.systemPackages = with pkgs; [ + vaapiVdpau + libvdpau-va-gl + libva + libva-utils + pkgs.nvidia_oc + (gwe.override { nvidia_x11 = config.hardware.nvidia.package; }) + ]; - environment.sessionVariables = { - # for firefox, see https://github.com/elFarto/nvidia-vaapi-driver/#firefox - MOZ_DISABLE_RDD_SANDBOX = "1"; - LIBVA_DRIVER_NAME = "nvidia"; - }; + environment.sessionVariables = { + # for firefox, see https://github.com/elFarto/nvidia-vaapi-driver/#firefox + MOZ_DISABLE_RDD_SANDBOX = "1"; + LIBVA_DRIVER_NAME = "nvidia"; + }; - systemd.services.nvidiaSetPower = lib.mkIf cfg.powerLimit.enable { - description = - "Increase GPU power limit to ${toString cfg.powerLimit.wattage} watts"; - script = "/run/current-system/sw/bin/nvidia-smi -pl=${ - toString cfg.powerLimit.wattage - }"; - wantedBy = [ "multi-user.target" ]; - }; - systemd.services.nvidiaSetClocks = lib.mkIf cfg.clock.enable { - description = "Set GPU clocks"; - script = - "${nvidia_oc} set -i 0 --min-clock ${toString cfg.clock.min} --max-clock ${ - toString cfg.clock.max - } --freq-offset ${toString cfg.clock.offset}"; - wantedBy = [ "multi-user.target" ]; - after = [ "network.target" ]; - }; + systemd.services.nvidiaSetPower = lib.mkIf cfg.powerLimit.enable { + description = "Increase GPU power limit to ${toString cfg.powerLimit.wattage} watts"; + script = "/run/current-system/sw/bin/nvidia-smi -pl=${toString cfg.powerLimit.wattage}"; + wantedBy = [ "multi-user.target" ]; + }; + systemd.services.nvidiaSetClocks = lib.mkIf cfg.clock.enable { + description = "Set GPU clocks"; + script = "${nvidia_oc} set -i 0 --min-clock ${toString cfg.clock.min} --max-clock ${toString cfg.clock.max} --freq-offset ${toString cfg.clock.offset}"; + wantedBy = [ "multi-user.target" ]; + after = [ "network.target" ]; + }; - }); + } + ); } diff --git a/modules/hardware/ryzenmonitor.nix b/modules/hardware/ryzenmonitor.nix index 8b55fef..dd36cd1 100644 --- a/modules/hardware/ryzenmonitor.nix +++ b/modules/hardware/ryzenmonitor.nix @@ -1,4 +1,5 @@ -{ config, pkgs, ... }: { +{ config, pkgs, ... }: +{ boot = { extraModulePackages = with config.boot.kernelPackages; [ zenpower ]; diff --git a/modules/hardware/scheduler.nix b/modules/hardware/scheduler.nix index 64817dc..547b890 100644 --- a/modules/hardware/scheduler.nix +++ b/modules/hardware/scheduler.nix @@ -16,4 +16,3 @@ in hardware.system76.enableAll = true; }; } - diff --git a/modules/hardware/ssd.nix b/modules/hardware/ssd.nix index 2943bc8..6e6690b 100644 --- a/modules/hardware/ssd.nix +++ b/modules/hardware/ssd.nix @@ -12,4 +12,3 @@ in services.fstrim.enable = true; }; } - diff --git a/modules/hardware/tablet.nix b/modules/hardware/tablet.nix index fcb6500..f803656 100644 --- a/modules/hardware/tablet.nix +++ b/modules/hardware/tablet.nix @@ -1,7 +1,14 @@ -{ pkgs, config, lib, ... }: +{ + pkgs, + config, + lib, + ... +}: with lib; -let cfg = config.custom.hardware.tablet; -in { +let + cfg = config.custom.hardware.tablet; +in +{ options.custom.hardware.tablet = { enable = mkEnableOption "Enables tablet"; }; diff --git a/modules/hardware/tpm.nix b/modules/hardware/tpm.nix index 84ec350..6ec3fbb 100644 --- a/modules/hardware/tpm.nix +++ b/modules/hardware/tpm.nix @@ -1,8 +1,17 @@ -{ config, pkgs, lib, ... }: +{ + config, + pkgs, + lib, + ... +}: with lib; -let cfg = config.custom.hardware.tpm; -in { - options.custom.hardware.tpm = { enable = mkEnableOption "Enables tpm"; }; +let + cfg = config.custom.hardware.tpm; +in +{ + options.custom.hardware.tpm = { + enable = mkEnableOption "Enables tpm"; + }; config = mkIf cfg.enable { diff --git a/modules/hardware/vfio.nix b/modules/hardware/vfio.nix index d1514cc..2472168 100644 --- a/modules/hardware/vfio.nix +++ b/modules/hardware/vfio.nix @@ -1,4 +1,9 @@ -{ pkgs, lib, config, ... }: +{ + pkgs, + lib, + config, + ... +}: with lib; let cfg = config.custom.hardware.vfio; @@ -15,9 +20,24 @@ in config = mkIf (cfg.enable && config.virtualisation.libvirtd.enable) { boot = { - kernelModules = [ "vfio" "vfio_iommu_type1" "vfio_pci" ]; - kernelParams = [ "amd_iommu=on" "iommu=pt" ] ++ (if cfg.stub_pci != [] then [ "vfio-pci.ids=${concatStringsSep "," cfg.stub_pci}" ] else []); - blacklistedKernelModules = [ "nouveau" "nvidia" "nvidiafb" "nvidia-drm" "nvidia-uvm" "nvidia-modeset" ]; + kernelModules = [ + "vfio" + "vfio_iommu_type1" + "vfio_pci" + ]; + kernelParams = [ + "amd_iommu=on" + "iommu=pt" + ] + ++ (if cfg.stub_pci != [ ] then [ "vfio-pci.ids=${concatStringsSep "," cfg.stub_pci}" ] else [ ]); + blacklistedKernelModules = [ + "nouveau" + "nvidia" + "nvidiafb" + "nvidia-drm" + "nvidia-uvm" + "nvidia-modeset" + ]; }; }; } diff --git a/modules/hardware/vr.nix b/modules/hardware/vr.nix index aa701eb..9e79f86 100644 --- a/modules/hardware/vr.nix +++ b/modules/hardware/vr.nix @@ -1,16 +1,27 @@ -{ pkgs, config, lib, ... }: +{ + pkgs, + config, + lib, + ... +}: let cfg = config.custom.hardware.vr; # https://wiki.nixos.org/wiki/VR#Patching_AMDGPU_to_allow_high_priority_queues amdgpu = - { pkgs - , lib - , kernel ? pkgs.linuxPackages_latest.kernel + { + pkgs, + lib, + kernel ? pkgs.linuxPackages_latest.kernel, }: pkgs.stdenv.mkDerivation { pname = "amdgpu-kernel-module"; - inherit (kernel) src version postPatch nativeBuildInputs; + inherit (kernel) + src + version + postPatch + nativeBuildInputs + ; kernel_dev = kernel.dev; kernelVersion = kernel.modDirVersion; diff --git a/modules/hardware/wooting.nix b/modules/hardware/wooting.nix index 3aded60..8d2e38f 100644 --- a/modules/hardware/wooting.nix +++ b/modules/hardware/wooting.nix @@ -1,4 +1,9 @@ -{ config, pkgs, lib, ... }: +{ + config, + pkgs, + lib, + ... +}: with lib; let cfg = config.custom.hardware.wooting; diff --git a/modules/misc/backup.nix b/modules/misc/backup.nix index 7ca2796..1332ac0 100644 --- a/modules/misc/backup.nix +++ b/modules/misc/backup.nix @@ -1,4 +1,10 @@ -{ config, pkgs, lib, inputs, ... }: +{ + config, + pkgs, + lib, + inputs, + ... +}: with lib; let cfg = config.custom.misc.backup; @@ -22,7 +28,15 @@ in }; excludePaths = lib.mkOption { type = types.listOf types.str; - default = [ "**/Cache" "**/.cache" "**/__pycache__" "**/node_modules" "**/venv" "*.o" "*.out" ]; + default = [ + "**/Cache" + "**/.cache" + "**/__pycache__" + "**/node_modules" + "**/venv" + "*.o" + "*.out" + ]; description = "paths to exclude from the backup"; }; excludePathsRemote = lib.mkOption { @@ -39,17 +53,29 @@ in text = '' # Check how much space is used by the backup paths echo "Checking storage space (small) with excluded paths..." - du -sch ${builtins.concatStringsSep " " (map (x: "--exclude=" + x) cfg.excludePaths)} ${builtins.concatStringsSep " " cfg.small} + du -sch ${ + builtins.concatStringsSep " " (map (x: "--exclude=" + x) cfg.excludePaths) + } ${builtins.concatStringsSep " " cfg.small} echo "Checking storage space (small) with excluded paths (remote)..." - du -sch ${builtins.concatStringsSep " " (map (x: "--exclude=" + x) cfg.excludePathsRemote)} ${builtins.concatStringsSep " " cfg.small} + du -sch ${ + builtins.concatStringsSep " " (map (x: "--exclude=" + x) cfg.excludePathsRemote) + } ${builtins.concatStringsSep " " cfg.small} echo "Checking storage space (medium) with excluded paths..." - du -sch ${builtins.concatStringsSep " " (map (x: "--exclude=" + x) cfg.excludePaths)} ${builtins.concatStringsSep " " cfg.medium} + du -sch ${ + builtins.concatStringsSep " " (map (x: "--exclude=" + x) cfg.excludePaths) + } ${builtins.concatStringsSep " " cfg.medium} echo "Checking storage space (medium) with excluded paths (remote)..." - du -sch ${builtins.concatStringsSep " " (map (x: "--exclude=" + x) cfg.excludePathsRemote)} ${builtins.concatStringsSep " " cfg.medium} + du -sch ${ + builtins.concatStringsSep " " (map (x: "--exclude=" + x) cfg.excludePathsRemote) + } ${builtins.concatStringsSep " " cfg.medium} echo "Checking storage space (full) with excluded paths..." - du -sch ${builtins.concatStringsSep " " (map (x: "--exclude=" + x) cfg.excludePaths)} ${builtins.concatStringsSep " " cfg.large} + du -sch ${ + builtins.concatStringsSep " " (map (x: "--exclude=" + x) cfg.excludePaths) + } ${builtins.concatStringsSep " " cfg.large} echo "Checking storage space (full) with excluded paths (remote)..." - du -sch ${builtins.concatStringsSep " " (map (x: "--exclude=" + x) cfg.excludePathsRemote)} ${builtins.concatStringsSep " " cfg.large} + du -sch ${ + builtins.concatStringsSep " " (map (x: "--exclude=" + x) cfg.excludePathsRemote) + } ${builtins.concatStringsSep " " cfg.large} ''; }; cli = "${pkgs.internxt-cli}/bin/internxt"; @@ -94,7 +120,11 @@ in }; in mkIf cfg.enable { - environment.systemPackages = [ checkStorageSpace startInternxtWebdav stopInternxtWebdav ]; + environment.systemPackages = [ + checkStorageSpace + startInternxtWebdav + stopInternxtWebdav + ]; age.secrets.restic-pw = { file = ../../secrets/restic-pw.age; }; @@ -126,7 +156,12 @@ in OnCalendar = "04:00"; Persistent = true; }; - pruneOpts = [ "--keep-daily 7" "--keep-weekly 3" "--keep-monthly 3" "--keep-yearly 3" ]; + pruneOpts = [ + "--keep-daily 7" + "--keep-weekly 3" + "--keep-monthly 3" + "--keep-yearly 3" + ]; repository = "/1tbssd/restic"; }; #localbackup-1tb = { @@ -148,7 +183,12 @@ in paths = cfg.medium; rcloneConfigFile = config.age.secrets.restic-gdrive.path; repository = "rclone:it-experts:backup"; - pruneOpts = [ "--keep-daily 5" "--keep-weekly 3" "--keep-monthly 3" "--keep-yearly 3" ]; + pruneOpts = [ + "--keep-daily 5" + "--keep-weekly 3" + "--keep-monthly 3" + "--keep-yearly 3" + ]; timerConfig = { OnCalendar = "*-*-03,06,09,12,15,18,21,24,27,30 02:00:00"; Persistent = true; @@ -160,37 +200,53 @@ in environmentFile = config.age.secrets.restic-s3.path; exclude = cfg.excludePathsRemote; paths = cfg.small; - pruneOpts = [ "--keep-daily 5" "--keep-weekly 3" "--keep-monthly 3" "--keep-yearly 3" ]; + pruneOpts = [ + "--keep-daily 5" + "--keep-weekly 3" + "--keep-monthly 3" + "--keep-yearly 3" + ]; timerConfig = { OnCalendar = "*-*-03,06,09,12,15,18,21,24,27,30 02:00:00"; Persistent = true; }; repository = "s3:s3.us-west-002.backblazeb2.com/kop-bucket"; }; - remotebackup-large = let cli = "${pkgs.internxt-cli}/bin/internxt"; in { - initialize = true; - passwordFile = config.age.secrets.restic-pw.path; - environmentFile = config.age.secrets.restic-internxt.path; - exclude = cfg.excludePathsRemote; - paths = cfg.large; - backupPrepareCommand = '' - ${startInternxtWebdav} - ''; - backupCleanupCommand = '' - ${stopInternxtWebdav} - ''; - pruneOpts = [ "--keep-daily 5" "--keep-weekly 3" "--keep-monthly 3" "--keep-yearly 3" ]; - timerConfig = { - OnCalendar = "*-*-03,06,09,12,15,18,21,24,27,30 02:00:00"; - Persistent = true; - }; - rcloneConfig = { - type = "webdav"; + remotebackup-large = + let + cli = "${pkgs.internxt-cli}/bin/internxt"; + in + { + initialize = true; + passwordFile = config.age.secrets.restic-pw.path; + environmentFile = config.age.secrets.restic-internxt.path; + exclude = cfg.excludePathsRemote; + paths = cfg.large; + backupPrepareCommand = '' + ${startInternxtWebdav} + ''; + backupCleanupCommand = '' + ${stopInternxtWebdav} + ''; + pruneOpts = [ + "--keep-daily 5" + "--keep-weekly 3" + "--keep-monthly 3" + "--keep-yearly 3" + ]; + timerConfig = { + OnCalendar = "*-*-03,06,09,12,15,18,21,24,27,30 02:00:00"; + Persistent = true; + }; + rcloneConfig = { + type = "webdav"; url = "https://127.0.0.1:3005"; + }; + rcloneOptions = { + "no-check-certificate" = true; + }; + repository = "rclone:internxt:backup"; }; - rcloneOptions = { "no-check-certificate" = true; }; - repository = "rclone:internxt:backup"; - }; }; }; }; diff --git a/modules/misc/btrfs.nix b/modules/misc/btrfs.nix index 6ad2f65..8b37cd7 100644 --- a/modules/misc/btrfs.nix +++ b/modules/misc/btrfs.nix @@ -12,4 +12,3 @@ in services.btrfs.autoScrub.enable = true; }; } - diff --git a/modules/misc/cli-tools.nix b/modules/misc/cli-tools.nix index 89be79a..6f53e76 100644 --- a/modules/misc/cli-tools.nix +++ b/modules/misc/cli-tools.nix @@ -1,8 +1,18 @@ -{ lib, config, pkgs, inputs, ... }: +{ + lib, + config, + pkgs, + inputs, + ... +}: with lib; -let cfg = config.custom.cli-tools; -in { - options.custom.cli-tools = { enable = mkEnableOption "Enables cli-tools"; }; +let + cfg = config.custom.cli-tools; +in +{ + options.custom.cli-tools = { + enable = mkEnableOption "Enables cli-tools"; + }; config = let @@ -28,7 +38,7 @@ in { in mkIf cfg.enable { - #Fuse filesystem that returns symlinks to executables based on the PATH of the requesting process. + #Fuse filesystem that returns symlinks to executables based on the PATH of the requesting process. #This is useful to execute shebangs on NixOS that assume hard coded locations in locations like /bin or /usr/bin etc. services.envfs.enable = true; @@ -48,10 +58,7 @@ in { environment.systemPackages = with pkgs; [ getTotalPowerUsed watchCurrentPowerUsed - (if lib.versionOlder lib.version "25.05" then - wget - else - powerjoular) # monitor power usage + (if lib.versionOlder lib.version "25.05" then wget else powerjoular) # monitor power usage bat # fancy cat fd # nicer find duf # nicer du diff --git a/modules/misc/docker.nix b/modules/misc/docker.nix index ef7ab31..b1439bf 100644 --- a/modules/misc/docker.nix +++ b/modules/misc/docker.nix @@ -1,4 +1,10 @@ -{ config, pkgs, lib, inputs, ... }: +{ + config, + pkgs, + lib, + inputs, + ... +}: with lib; let cfg = config.custom.misc.docker; @@ -9,7 +15,9 @@ in }; config = lib.mkIf cfg.enable { virtualisation.docker.enable = true; - virtualisation.docker.daemon.settings = { ip = "127.0.0.1"; }; + virtualisation.docker.daemon.settings = { + ip = "127.0.0.1"; + }; environment.systemPackages = with pkgs; [ docker-compose ]; diff --git a/modules/misc/faster-boot-time.nix b/modules/misc/faster-boot-time.nix index 2266d81..bd2aa81 100644 --- a/modules/misc/faster-boot-time.nix +++ b/modules/misc/faster-boot-time.nix @@ -1,11 +1,15 @@ -{ lib, pkgs, config, ... }: { - # before: Startup finished in 18.830s (firmware) + 5.844s (loader) + 4.422s (kernel) + 7.616s (userspace) = 36.713s - # after: Startup finished in 14.115s (firmware) + 789ms (loader) + 4.312s (kernel) + 5.777s (userspace) = 24.995s +{ + lib, + pkgs, + config, + ... +}: +{ + # before: Startup finished in 18.830s (firmware) + 5.844s (loader) + 4.422s (kernel) + 7.616s (userspace) = 36.713s + # after: Startup finished in 14.115s (firmware) + 789ms (loader) + 4.312s (kernel) + 5.777s (userspace) = 24.995s systemd = { - targets.network-online.wantedBy = - lib.mkForce [ ]; # Normally ["multi-user.target"] - services.NetworkManager-wait-online.wantedBy = - lib.mkForce [ ]; # Normally ["network-online.target"] + targets.network-online.wantedBy = lib.mkForce [ ]; # Normally ["multi-user.target"] + services.NetworkManager-wait-online.wantedBy = lib.mkForce [ ]; # Normally ["network-online.target"] }; # mash spacebar to still be able to select a different boot option boot.loader.timeout = 1; diff --git a/modules/misc/firejail.nix b/modules/misc/firejail.nix index 8e9908b..4dca19d 100644 --- a/modules/misc/firejail.nix +++ b/modules/misc/firejail.nix @@ -1,7 +1,14 @@ -{ lib, config, pkgs, ... }: +{ + lib, + config, + pkgs, + ... +}: -let cfg = config.custom.misc.firejail; -in { +let + cfg = config.custom.misc.firejail; +in +{ options.custom.misc.firejail = { enable = lib.mkEnableOption "Enables firejail"; package = lib.mkOption { @@ -13,12 +20,17 @@ in { mk = lib.mkOption { readOnly = true; description = "Utility function to make a wrappedBinaries entry"; - default = name: - { pkg, profile ? name, bin ? name }: { + default = + name: + { + pkg, + profile ? name, + bin ? name, + }: + { ${bin} = { executable = "${lib.getBin pkg}/bin/${bin}"; - profile = - "${config.custom.misc.firejail.package}/etc/firejail/${profile}.profile"; + profile = "${config.custom.misc.firejail.package}/etc/firejail/${profile}.profile"; }; }; }; diff --git a/modules/misc/kernel-testing.nix b/modules/misc/kernel-testing.nix index 1543dfd..48394bc 100644 --- a/modules/misc/kernel-testing.nix +++ b/modules/misc/kernel-testing.nix @@ -1,4 +1,9 @@ -{ pkgs, lib, config, ... }: +{ + pkgs, + lib, + config, + ... +}: let #amdgpu_module_pkg = # { pkgs, lib, fetchurl, kernel ? pkgs.linuxPackages_latest.kernel, ... }: @@ -46,22 +51,26 @@ let # amdgpu_module = pkgs.callPackage amdgpu_module_pkg { # kernel = config.boot.kernelPackages.kernel; # }; - amd_drm_next_pkg = { fetchurl, buildLinux, ... }@args: + amd_drm_next_pkg = + { fetchurl, buildLinux, ... }@args: - buildLinux (args // rec { - version = "6.14.0-rc6"; - modDirVersion = version; + buildLinux ( + args + // rec { + version = "6.14.0-rc6"; + modDirVersion = version; - src = fetchurl { - url = - "https://gitlab.freedesktop.org/agd5f/linux/-/archive/amd-drm-fixes-6.15-2025-04-09/linux-amd-drm-fixes-6.15-2025-04-09.tar.gz"; - #"https://gitlab.freedesktop.org/agd5f/linux/-/archive/amd-drm-next-6.15-2025-03-21/linux-amd-drm-next-6.15-2025-03-21.tar.gz"; - hash = "sha256-AhyDuV9KufqDJEJ+Fp+jnAta3OM/a9OcMNG9UV+OgR0="; - }; - kernelPatches = [ ]; + src = fetchurl { + url = "https://gitlab.freedesktop.org/agd5f/linux/-/archive/amd-drm-fixes-6.15-2025-04-09/linux-amd-drm-fixes-6.15-2025-04-09.tar.gz"; + #"https://gitlab.freedesktop.org/agd5f/linux/-/archive/amd-drm-next-6.15-2025-03-21/linux-amd-drm-next-6.15-2025-03-21.tar.gz"; + hash = "sha256-AhyDuV9KufqDJEJ+Fp+jnAta3OM/a9OcMNG9UV+OgR0="; + }; + kernelPatches = [ ]; - extraMeta.branch = "6.14.0-rc6"; - } // (args.argsOverride or { })); + extraMeta.branch = "6.14.0-rc6"; + } + // (args.argsOverride or { }) + ); linux_amd_drm_next = pkgs.callPackage amd_drm_next_pkg { }; linux_6_14 = pkgs.buildLinux { diff --git a/modules/misc/nftables.nix b/modules/misc/nftables.nix index e624adc..f6f2682 100644 --- a/modules/misc/nftables.nix +++ b/modules/misc/nftables.nix @@ -12,4 +12,3 @@ in networking.nftables.enable = true; }; } - diff --git a/modules/misc/nixvim.nix b/modules/misc/nixvim.nix index abe0d78..55e8bc8 100644 --- a/modules/misc/nixvim.nix +++ b/modules/misc/nixvim.nix @@ -1,6 +1,14 @@ -{ lib, config, pkgs, inputs, ... }: +{ + lib, + config, + pkgs, + inputs, + ... +}: with lib; -let cfg = config.custom.nixvimPlugins; -in { +let + cfg = config.custom.nixvimPlugins; +in +{ options.custom.nixvimPlugins = mkEnableOption "Enables nixvim plugins"; } diff --git a/modules/misc/packages-list.nix b/modules/misc/packages-list.nix index f14e140..040ca43 100644 --- a/modules/misc/packages-list.nix +++ b/modules/misc/packages-list.nix @@ -1,9 +1,9 @@ -{ config, pkgs, ... }: { +{ config, pkgs, ... }: +{ environment.etc."current-system-packages".text = let packages = builtins.map (p: "${p.name}") config.environment.systemPackages; - sortedUnique = - builtins.sort builtins.lessThan (pkgs.lib.lists.unique packages); + sortedUnique = builtins.sort builtins.lessThan (pkgs.lib.lists.unique packages); formatted = builtins.concatStringsSep "\n" sortedUnique; in formatted; diff --git a/modules/misc/podman.nix b/modules/misc/podman.nix index 7b63c48..9d3e041 100644 --- a/modules/misc/podman.nix +++ b/modules/misc/podman.nix @@ -1,8 +1,17 @@ -{ pkgs, lib, config, ... }: -let cfg = config.custom.misc.podman; -in { +{ + pkgs, + lib, + config, + ... +}: +let + cfg = config.custom.misc.podman; +in +{ options = { - custom.misc.podman = { enable = lib.mkEnableOption "Enable podman service"; }; + custom.misc.podman = { + enable = lib.mkEnableOption "Enable podman service"; + }; }; config = lib.mkIf cfg.enable { # Enable common container config files in /etc/containers diff --git a/modules/misc/static-ip.nix b/modules/misc/static-ip.nix index 8794447..effc094 100644 --- a/modules/misc/static-ip.nix +++ b/modules/misc/static-ip.nix @@ -1,7 +1,9 @@ { config, lib, ... }: with lib; -let cfg = config.custom.static-ip; -in { +let + cfg = config.custom.static-ip; +in +{ options.custom.static-ip = { enable = mkEnableOption "Enables static-ip"; ip = lib.mkOption { @@ -23,20 +25,23 @@ in { }; }; config = - let fallback = "1.1.1.1"; - in mkIf cfg.enable { + let + fallback = "1.1.1.1"; + in + mkIf cfg.enable { networking = { defaultGateway = cfg.gateway; useDHCP = false; - nameservers = [ cfg.dns ] - ++ lib.lists.optionals (!config.services.resolved.enable) [ fallback ]; + nameservers = [ cfg.dns ] ++ lib.lists.optionals (!config.services.resolved.enable) [ fallback ]; interfaces = { ${cfg.interface} = { name = "eth0"; - ipv4.addresses = [{ - address = cfg.ip; - prefixLength = 24; - }]; + ipv4.addresses = [ + { + address = cfg.ip; + prefixLength = 24; + } + ]; }; }; }; diff --git a/modules/misc/tmpfs.nix b/modules/misc/tmpfs.nix index f4287a1..9a36dd0 100644 --- a/modules/misc/tmpfs.nix +++ b/modules/misc/tmpfs.nix @@ -12,4 +12,3 @@ in boot.tmp.useTmpfs = true; }; } - diff --git a/modules/misc/virt-manager.nix b/modules/misc/virt-manager.nix index f2dd089..e16f5f8 100644 --- a/modules/misc/virt-manager.nix +++ b/modules/misc/virt-manager.nix @@ -1,14 +1,20 @@ -{ lib, config, pkgs, ... }: +{ + lib, + config, + pkgs, + ... +}: with lib; -let cfg = config.custom.virt-manager; -in { +let + cfg = config.custom.virt-manager; +in +{ options.custom.virt-manager = { enable = mkEnableOption "Enables virt-manager"; }; config = mkIf cfg.enable { - programs.dconf.enable = - true; # virt-manager requires dconf to remember settings + programs.dconf.enable = true; # virt-manager requires dconf to remember settings environment.systemPackages = with pkgs; [ virtiofsd ]; environment.sessionVariables.GSETTINGS_BACKEND = "keyfile"; boot.extraModprobeConfig = '' @@ -25,19 +31,31 @@ in { }; hooks.qemu = { # doesnt work, screen just freezes. no error in libvirt logs though, so idk how to fix it - "passthrough" = lib.getExe (pkgs.writeShellApplication { - name = "qemu-hook"; - excludeShellChecks = [ "SC2046" "SC2086" ]; + "passthrough" = lib.getExe ( + pkgs.writeShellApplication { + name = "qemu-hook"; + excludeShellChecks = [ + "SC2046" + "SC2086" + ]; - runtimeInputs = with pkgs; [ libvirt systemd kmod ]; - text = builtins.readFile ./hook.sh; - }); + runtimeInputs = with pkgs; [ + libvirt + systemd + kmod + ]; + text = builtins.readFile ./hook.sh; + } + ); }; }; spiceUSBRedirection.enable = true; }; services.spice-vdagentd.enable = true; - users.users.${config.mainUser.name}.extraGroups = - [ "libvirtd" "kvm" "input" ]; + users.users.${config.mainUser.name}.extraGroups = [ + "libvirtd" + "kvm" + "input" + ]; }; } diff --git a/modules/misc/wireshark.nix b/modules/misc/wireshark.nix index e2eda28..08c940d 100644 --- a/modules/misc/wireshark.nix +++ b/modules/misc/wireshark.nix @@ -1,4 +1,9 @@ -{ lib, config, pkgs, ... }: +{ + lib, + config, + pkgs, + ... +}: with lib; let cfg = config.custom.wireshark; @@ -15,4 +20,3 @@ in users.users.${config.mainUser.name}.extraGroups = [ "wireshark" ]; }; } - diff --git a/modules/misc/zram.nix b/modules/misc/zram.nix index 6b8c2b3..a4dc4dd 100644 --- a/modules/misc/zram.nix +++ b/modules/misc/zram.nix @@ -1,4 +1,10 @@ -{ pkgs, lib, config, ... }: { +{ + pkgs, + lib, + config, + ... +}: +{ zramSwap = { enable = true; }; diff --git a/modules/nix/index.nix b/modules/nix/index.nix index e923bda..b34fd4f 100644 --- a/modules/nix/index.nix +++ b/modules/nix/index.nix @@ -1,8 +1,12 @@ { config, lib, ... }: with lib; -let cfg = config.custom.nix.index; -in { - options.custom.nix.index = { enable = mkEnableOption "Enables nix index"; }; +let + cfg = config.custom.nix.index; +in +{ + options.custom.nix.index = { + enable = mkEnableOption "Enables nix index"; + }; config = mkIf cfg.enable { programs.command-not-found.enable = false; diff --git a/modules/nix/latest.nix b/modules/nix/latest.nix index 12b685a..20f1a01 100644 --- a/modules/nix/latest.nix +++ b/modules/nix/latest.nix @@ -1,4 +1,10 @@ -{ lib, inputs, config, pkgs, ... }: +{ + lib, + inputs, + config, + pkgs, + ... +}: with lib; let cfg = config.custom.nix; diff --git a/modules/nix/ld.nix b/modules/nix/ld.nix index 0890b1f..ea3524e 100644 --- a/modules/nix/ld.nix +++ b/modules/nix/ld.nix @@ -1,4 +1,9 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: with lib; let cfg = config.custom.nix.ld; diff --git a/modules/nix/settings.nix b/modules/nix/settings.nix index 591a80b..c52bdcf 100644 --- a/modules/nix/settings.nix +++ b/modules/nix/settings.nix @@ -1,4 +1,10 @@ -{ lib, inputs, config, pkgsVersion, ... }: +{ + lib, + inputs, + config, + pkgsVersion, + ... +}: with lib; let cfg = config.custom.nix.settings; @@ -15,12 +21,15 @@ in }; config = mkIf cfg.enable { - systemd.services.nix-daemon.serviceConfig.OOMScoreAdjust = - lib.mkDefault 250; + systemd.services.nix-daemon.serviceConfig.OOMScoreAdjust = lib.mkDefault 250; nix = { optimise.automatic = cfg.optimise; - settings.experimental-features = [ "nix-command" "flakes" "pipe-operators" ]; + settings.experimental-features = [ + "nix-command" + "flakes" + "pipe-operators" + ]; # not used #settings.substituters = # lib.mkIf (config.networking.hostName == "kop-pc") diff --git a/modules/services/acme.nix b/modules/services/acme.nix index 044b67f..6400bee 100644 --- a/modules/services/acme.nix +++ b/modules/services/acme.nix @@ -1,4 +1,10 @@ -{ config, pkgs, lib, inputs, ... }: +{ + config, + pkgs, + lib, + inputs, + ... +}: with lib; let cfg = config.custom.services.acme; diff --git a/modules/services/adam-site.nix b/modules/services/adam-site.nix index 3c5db4d..39c6766 100644 --- a/modules/services/adam-site.nix +++ b/modules/services/adam-site.nix @@ -1,7 +1,15 @@ -{ config, pkgs, lib, inputs, ... }: +{ + config, + pkgs, + lib, + inputs, + ... +}: with lib; -let cfg = config.custom.services.adam-site; -in { +let + cfg = config.custom.services.adam-site; +in +{ options.custom.services.adam-site = { enable = mkEnableOption "Enables adams website"; }; @@ -9,7 +17,10 @@ in { systemd.services.adam-site = { description = "Adams Website"; wants = [ "network-online.target" ]; - after = [ "network.target" "network-online.target" ]; + after = [ + "network.target" + "network-online.target" + ]; wantedBy = [ "multi-user.target" ]; preStart = '' if [ ! -d "$STATE_DIRECTORY/data" ]; then diff --git a/modules/services/adguard.nix b/modules/services/adguard.nix index b38187d..d6e93d5 100644 --- a/modules/services/adguard.nix +++ b/modules/services/adguard.nix @@ -1,8 +1,16 @@ -{ config, pkgs, inputs, lib, ... }: -let cfg = config.custom.services.adguard; - ip = cfg.ip; - wireguardIp = config.custom.services.wireguard.ip; -in { +{ + config, + pkgs, + inputs, + lib, + ... +}: +let + cfg = config.custom.services.adguard; + ip = cfg.ip; + wireguardIp = config.custom.services.wireguard.ip; +in +{ options.custom.services.adguard = { enable = lib.mkEnableOption "Enables adguard"; ip = lib.mkOption { @@ -27,94 +35,96 @@ in { }; rewrites = lib.mkOption { type = lib.types.listOf (lib.types.attrsOf lib.types.str); - default = [ { - "domain" = "kopatz.ddns.net"; - "answer" = ip; - } - { - "domain" = "kopatz.dev"; - "answer" = ip; - } - { - "domain" = "kavita.kopatz.dev"; - "answer" = ip; - } - { - "domain" = "kop.oasch.net"; - "answer" = ip; - } - { - "domain" = "kop.bobin.at"; - "answer" = ip; - } - { - "domain" = "kavita-kopatz.duckdns.org"; - "answer" = ip; - } - { - "domain" = "server.home"; - "answer" = ip; - } - { - "domain" = "server.home.arpa"; - "answer" = ip; - } - { - "domain" = "adguard.home.arpa"; - "answer" = ip; - } - { - "domain" = "nextcloud.home.arpa"; - "answer" = ip; - } - { - "domain" = "kavita.home.arpa"; - "answer" = ip; - } - { - "domain" = "grafana.home.arpa"; - "answer" = ip; - } - { - "domain" = "yt.home.arpa"; - "answer" = ip; - } - { - "domain" = "nextcloud.home.arpa"; - "answer" = wireguardIp; - } - { - "domain" = "kavita.home.arpa"; - "answer" = wireguardIp; - } - { - "domain" = "yt.home.arpa"; - "answer" = wireguardIp; - } - { - "domain" = "turnserver.home.arpa"; - "answer" = wireguardIp; - } - { - "domain" = "powerline.home.arpa"; - "answer" = "192.168.0.2"; - } - { - "domain" = "3neo.home.arpa"; - "answer" = "192.168.0.4"; - } - { - "domain" = "alcatel.home.arpa"; - "answer" = "192.168.0.5"; - } - { - "domain" = "extender.home.arpa"; - "answer" = "192.168.0.8"; - } - { - "domain" = "inverter.home.arpa"; - "answer" = "192.168.0.9"; - }]; + default = [ + { + "domain" = "kopatz.ddns.net"; + "answer" = ip; + } + { + "domain" = "kopatz.dev"; + "answer" = ip; + } + { + "domain" = "kavita.kopatz.dev"; + "answer" = ip; + } + { + "domain" = "kop.oasch.net"; + "answer" = ip; + } + { + "domain" = "kop.bobin.at"; + "answer" = ip; + } + { + "domain" = "kavita-kopatz.duckdns.org"; + "answer" = ip; + } + { + "domain" = "server.home"; + "answer" = ip; + } + { + "domain" = "server.home.arpa"; + "answer" = ip; + } + { + "domain" = "adguard.home.arpa"; + "answer" = ip; + } + { + "domain" = "nextcloud.home.arpa"; + "answer" = ip; + } + { + "domain" = "kavita.home.arpa"; + "answer" = ip; + } + { + "domain" = "grafana.home.arpa"; + "answer" = ip; + } + { + "domain" = "yt.home.arpa"; + "answer" = ip; + } + { + "domain" = "nextcloud.home.arpa"; + "answer" = wireguardIp; + } + { + "domain" = "kavita.home.arpa"; + "answer" = wireguardIp; + } + { + "domain" = "yt.home.arpa"; + "answer" = wireguardIp; + } + { + "domain" = "turnserver.home.arpa"; + "answer" = wireguardIp; + } + { + "domain" = "powerline.home.arpa"; + "answer" = "192.168.0.2"; + } + { + "domain" = "3neo.home.arpa"; + "answer" = "192.168.0.4"; + } + { + "domain" = "alcatel.home.arpa"; + "answer" = "192.168.0.5"; + } + { + "domain" = "extender.home.arpa"; + "answer" = "192.168.0.8"; + } + { + "domain" = "inverter.home.arpa"; + "answer" = "192.168.0.9"; + } + ]; description = "list of domains to rewrite to this server's ip"; }; }; @@ -134,33 +144,40 @@ in { forceSSL = cfg.useHttps; enableACME = cfg.useHttps; locations."/" = { - proxyPass = - "http://127.0.0.1:${toString config.services.adguardhome.port}"; + proxyPass = "http://127.0.0.1:${toString config.services.adguardhome.port}"; proxyWebsockets = true; }; }; systemd.services.adguardhome = { - after = [ "nginx.service" "step-ca.service" ]; + after = [ + "nginx.service" + "step-ca.service" + ]; }; services.adguardhome = { enable = true; settings = { schema_version = 28; - users = [{ - name = "admin"; - password = - "$2y$15$iPzjmUJPTwWUOsDp46GOPO/LYor/jDJjndwy2QlPddaKSD4QXvq9W"; - }]; + users = [ + { + name = "admin"; + password = "$2y$15$iPzjmUJPTwWUOsDp46GOPO/LYor/jDJjndwy2QlPddaKSD4QXvq9W"; + } + ]; dns = { - bind_hosts = [ "127.0.0.1" ip ] ++ lib.lists.optionals config.custom.services.wireguard.enable [ wireguardIp ]; + bind_hosts = [ + "127.0.0.1" + ip + ] + ++ lib.lists.optionals config.custom.services.wireguard.enable [ wireguardIp ]; port = 53; protection_enabled = true; filtering_enabled = true; upstream_dns = [ - #"https://dns10.quad9.net/dns-query" slow + #"https://dns10.quad9.net/dns-query" slow "quic://dns.adguard-dns.com" - #"tls://noads.libredns.gr" slow + #"tls://noads.libredns.gr" slow "https://noads.joindns4.eu/dns-query" "tls://getdnsapi.net" ]; @@ -170,19 +187,19 @@ in { ]; use_http3_upstreams = true; }; - querylog = { enabled = false; }; + querylog = { + enabled = false; + }; filters = [ { enabled = true; - url = - "https://adguardteam.github.io/HostlistsRegistry/assets/filter_1.txt"; + url = "https://adguardteam.github.io/HostlistsRegistry/assets/filter_1.txt"; name = "adguard dns list"; id = 1; } { enabled = true; - url = - "https://adguardteam.github.io/HostlistsRegistry/assets/filter_2.txt"; + url = "https://adguardteam.github.io/HostlistsRegistry/assets/filter_2.txt"; name = "adguard block list"; id = 2; } @@ -199,12 +216,16 @@ in { enabled = true; url = pkgs.writeText "adguard-whitelist.txt" '' @@|pool.supportxmr.com^ - ''; + ''; name = "adguard whitelist"; } ]; - dhcp = { enabled = false; }; - tls = { enabled = false; }; + dhcp = { + enabled = false; + }; + tls = { + enabled = false; + }; filtering = { rewrites = cfg.rewrites; }; diff --git a/modules/services/caldav.nix b/modules/services/caldav.nix index d150b8a..9f88804 100644 --- a/modules/services/caldav.nix +++ b/modules/services/caldav.nix @@ -1,6 +1,14 @@ -{ config, pkgs, lib, inputs, ... }: -let cfg = config.custom.services.caldav; -in { +{ + config, + pkgs, + lib, + inputs, + ... +}: +let + cfg = config.custom.services.caldav; +in +{ options.custom.services.caldav = { enable = lib.mkEnableOption "Enables caldav server"; }; @@ -12,14 +20,18 @@ in { services.radicale = { enable = true; settings = { - server = { hosts = [ "127.0.0.1:5232" ]; }; + server = { + hosts = [ "127.0.0.1:5232" ]; + }; #server = { hosts = [ "192.168.0.11:5232" ]; }; auth = { type = "htpasswd"; htpasswd_filename = config.age.secrets.radicale-users.path; htpasswd_encryption = "bcrypt"; }; - storage = { filesystem_folder = "/var/lib/radicale/collections"; }; + storage = { + filesystem_folder = "/var/lib/radicale/collections"; + }; }; }; custom.misc.backup = lib.mkIf config.custom.misc.backup.enable { @@ -32,18 +44,19 @@ in { let radicale = if lib.versionOlder lib.version "25.05" then - (builtins.elemAt - config.services.radicale.settings.storage.filesystem_folder 0) + (builtins.elemAt config.services.radicale.settings.storage.filesystem_folder 0) else config.services.radicale.settings.storage.filesystem_folder; # not reproducible - working = - "${radicale}/collection-root/kopatz/b6d2c446-8109-714a-397f-1f35d3136639"; + working = "${radicale}/collection-root/kopatz/b6d2c446-8109-714a-397f-1f35d3136639"; in { description = "Download fh calendar"; wants = [ "network-online.target" ]; - after = [ "network.target" "network-online.target" ]; + after = [ + "network.target" + "network-online.target" + ]; wantedBy = [ "multi-user.target" ]; startAt = "*-*-* 06:00:00"; diff --git a/modules/services/coturn.nix b/modules/services/coturn.nix index 30f9766..2942643 100644 --- a/modules/services/coturn.nix +++ b/modules/services/coturn.nix @@ -1,4 +1,10 @@ -{ config, pkgs, lib, inputs, ... }: +{ + config, + pkgs, + lib, + inputs, + ... +}: { age.secrets.coturn-secret = { file = ../../secrets/coturn-secret.age; @@ -6,10 +12,14 @@ group = "turnserver"; }; - networking.firewall.allowedUDPPortRanges = [{ from = 49000; to = 50000; }]; - networking.firewall.allowedUDPPorts = [ 3478 ]; #5349 ]; - networking.firewall.allowedTCPPorts = [ 3478 ]; #5349 ]; - + networking.firewall.allowedUDPPortRanges = [ + { + from = 49000; + to = 50000; + } + ]; + networking.firewall.allowedUDPPorts = [ 3478 ]; # 5349 ]; + networking.firewall.allowedTCPPorts = [ 3478 ]; # 5349 ]; services.coturn = { enable = true; @@ -68,6 +78,6 @@ # serviceConfig = { # User = lib.mkForce "root"; # Group = lib.mkForce "root"; - # }; + # }; # }; } diff --git a/modules/services/ddclient-cloudflare.nix b/modules/services/ddclient-cloudflare.nix index a69c752..ccc9cbe 100644 --- a/modules/services/ddclient-cloudflare.nix +++ b/modules/services/ddclient-cloudflare.nix @@ -1,4 +1,10 @@ -{ config, pkgs, lib, ... }: { +{ + config, + pkgs, + lib, + ... +}: +{ age.secrets.cloudflare-api = { file = ../../secrets/cloudflare-api.age; }; diff --git a/modules/services/dnsmasq.nix b/modules/services/dnsmasq.nix index 7e07bce..8ad8305 100644 --- a/modules/services/dnsmasq.nix +++ b/modules/services/dnsmasq.nix @@ -1,7 +1,15 @@ -{ config, pkgs, lib, inputs, ... }: +{ + config, + pkgs, + lib, + inputs, + ... +}: with lib; -let cfg = config.custom.services.dnsmasq; -in { +let + cfg = config.custom.services.dnsmasq; +in +{ options.custom.services.dnsmasq = { enable = mkEnableOption "Enables dnsmaq service"; server = mkOption { type = types.listOf types.string; }; diff --git a/modules/services/duckdns.nix b/modules/services/duckdns.nix index ab1fd8f..42b2030 100644 --- a/modules/services/duckdns.nix +++ b/modules/services/duckdns.nix @@ -1,4 +1,10 @@ -{ config, pkgs, lib, inputs, ... }: +{ + config, + pkgs, + lib, + inputs, + ... +}: { age.secrets.duckdns = { file = ../../secrets/duckdns.age; @@ -9,7 +15,7 @@ domains = [ "kavita-kopatz" ]; }; systemd.services.duckdns = { - wantedBy = lib.mkForce []; - startAt = lib.mkForce "daily"; + wantedBy = lib.mkForce [ ]; + startAt = lib.mkForce "daily"; }; } diff --git a/modules/services/ente.nix b/modules/services/ente.nix index 500d509..4cc6b16 100644 --- a/modules/services/ente.nix +++ b/modules/services/ente.nix @@ -1,4 +1,10 @@ -{ config, pkgs, lib, inputs, ... }: +{ + config, + pkgs, + lib, + inputs, + ... +}: with lib; let cfg = config.custom.services.ente; diff --git a/modules/services/fileshelter.nix b/modules/services/fileshelter.nix index 661fbf4..69b22f5 100644 --- a/modules/services/fileshelter.nix +++ b/modules/services/fileshelter.nix @@ -1,4 +1,10 @@ -{ config, pkgs, lib, inputs, ... }: +{ + config, + pkgs, + lib, + inputs, + ... +}: with lib; let cfg = config.custom.services.fileshelter; @@ -45,4 +51,3 @@ in }; }; } - diff --git a/modules/services/games/palworld.nix b/modules/services/games/palworld.nix index 28134ef..8382335 100644 --- a/modules/services/games/palworld.nix +++ b/modules/services/games/palworld.nix @@ -1,5 +1,10 @@ # valheim.nix -{ config, pkgs, lib, ... }: +{ + config, + pkgs, + lib, + ... +}: let join = builtins.concatStringsSep " "; in @@ -12,7 +17,7 @@ in ]; }; - networking.firewall.allowedUDPPorts = [ 8211 ]; #5349 ]; + networking.firewall.allowedUDPPorts = [ 8211 ]; # 5349 ]; users.users.palworld = { isSystemUser = true; # Valheim puts save data in the home directory. diff --git a/modules/services/games/terraria.nix b/modules/services/games/terraria.nix index bb6317f..7e18c86 100644 --- a/modules/services/games/terraria.nix +++ b/modules/services/games/terraria.nix @@ -1,4 +1,10 @@ -{ config, pkgs, lib, inputs, ... }: +{ + config, + pkgs, + lib, + inputs, + ... +}: let cfg = config.custom.services.terraria; in diff --git a/modules/services/github-runner.nix b/modules/services/github-runner.nix index 8049c54..ca03595 100644 --- a/modules/services/github-runner.nix +++ b/modules/services/github-runner.nix @@ -1,6 +1,14 @@ -{ config, pkgs, lib, inputs, ... }: -let cfg = config.custom.services.github-runner; -in { +{ + config, + pkgs, + lib, + inputs, + ... +}: +let + cfg = config.custom.services.github-runner; +in +{ options.custom.services.github-runner = { enable = lib.mkEnableOption "Enables github-runner service."; }; @@ -34,11 +42,16 @@ in { url = "https://github.com/oberprofis"; user = "github-actions-runner"; workDir = "/github-actions-runner"; - extraPackages = with pkgs; [ rsync nodePackages.pnpm nodejs ]; + extraPackages = with pkgs; [ + rsync + nodePackages.pnpm + nodejs + ]; serviceOverrides = { - BindPaths = [ "/github-actions-runner" ] - ++ lib.optional config.custom.services.kavita.enable - config.custom.services.kavita.dir; + BindPaths = [ + "/github-actions-runner" + ] + ++ lib.optional config.custom.services.kavita.enable config.custom.services.kavita.dir; UMask = "022"; }; }; diff --git a/modules/services/gitolite.nix b/modules/services/gitolite.nix index 80f9fa8..4f6421e 100644 --- a/modules/services/gitolite.nix +++ b/modules/services/gitolite.nix @@ -1,6 +1,14 @@ -{ config, pkgs, lib, inputs, ... }: -let cfg = config.custom.services.gitolite; -in { +{ + config, + pkgs, + lib, + inputs, + ... +}: +let + cfg = config.custom.services.gitolite; +in +{ options.custom.services.gitolite = { enable = lib.mkEnableOption "Enables ente"; }; diff --git a/modules/services/grafana.nix b/modules/services/grafana.nix index d9b6869..5a15c73 100644 --- a/modules/services/grafana.nix +++ b/modules/services/grafana.nix @@ -1,4 +1,9 @@ -{ pkgs, config, lib, ... }: +{ + pkgs, + config, + lib, + ... +}: let useHttps = config.services.step-ca.enable; fqdn = "grafana.home.arpa"; @@ -28,27 +33,28 @@ in provision.alerting.policies.path = ./grafana/notification-policies.yml; provision.alerting.templates.path = ./grafana/alerts.yml; provision.datasources.settings = { - datasources = - [ - { - name = "DS_PROMETHEUS"; - url = "http://127.0.0.1:${toString config.services.prometheus.port}"; - type = "prometheus"; - isDefault = true; - # This has to match the prometheus scrape interval, otherwise the $__rate_interval variable wont work. - jsonData.timeInterval = "60s"; - } - { - name = "loki"; - url = "http://localhost:3100"; - type = "loki"; - } - ]; + datasources = [ + { + name = "DS_PROMETHEUS"; + url = "http://127.0.0.1:${toString config.services.prometheus.port}"; + type = "prometheus"; + isDefault = true; + # This has to match the prometheus scrape interval, otherwise the $__rate_interval variable wont work. + jsonData.timeInterval = "60s"; + } + { + name = "loki"; + url = "http://localhost:3100"; + type = "loki"; + } + ]; }; - provision.dashboards.settings.providers = [{ - name = "provisioned-dashboards"; - options.path = ./grafana/dashboards; - }]; + provision.dashboards.settings.providers = [ + { + name = "provisioned-dashboards"; + options.path = ./grafana/dashboards; + } + ]; }; systemd.services.grafana = { @@ -100,15 +106,16 @@ in scrapeConfigs = [ { job_name = "scrapema"; - static_configs = [{ - targets = [ - "127.0.0.1:${toString config.services.prometheus.exporters.node.port}" - ] ++ - (lib.optional config.services.cadvisor.enable "${config.services.cadvisor.listenAddress}:${toString config.services.cadvisor.port}") ++ - (lib.optional config.services.prometheus.exporters.nginx.enable "127.0.0.1:${toString config.services.prometheus.exporters.nginx.port}") ++ - (lib.optional config.services.prometheus.exporters.nginxlog.enable "127.0.0.1:${toString config.services.prometheus.exporters.nginxlog.port}") - ; - }]; + static_configs = [ + { + targets = [ + "127.0.0.1:${toString config.services.prometheus.exporters.node.port}" + ] + ++ (lib.optional config.services.cadvisor.enable "${config.services.cadvisor.listenAddress}:${toString config.services.cadvisor.port}") + ++ (lib.optional config.services.prometheus.exporters.nginx.enable "127.0.0.1:${toString config.services.prometheus.exporters.nginx.port}") + ++ (lib.optional config.services.prometheus.exporters.nginxlog.enable "127.0.0.1:${toString config.services.prometheus.exporters.nginxlog.port}"); + } + ]; } ]; }; diff --git a/modules/services/kavita.nix b/modules/services/kavita.nix index 3859f58..6ee6d53 100644 --- a/modules/services/kavita.nix +++ b/modules/services/kavita.nix @@ -1,7 +1,15 @@ -{ config, pkgs, lib, inputs, ... }: +{ + config, + pkgs, + lib, + inputs, + ... +}: with lib; -let cfg = config.custom.services.kavita; -in { +let + cfg = config.custom.services.kavita; +in +{ options.custom.services.kavita = { enable = mkEnableOption "Enables kavita"; https = mkOption { @@ -33,13 +41,15 @@ in { lib.mkIf cfg.enable { # not needed with nginx networking.firewall.allowedTCPPorts = [ 5000 ]; systemd.tmpfiles.rules = [ - (if githubRunnerEnabled then - "d ${baseDir} 0750 kavita github-actions-runner -" - else - "d ${baseDir} 0770 kavita kavita -") + ( + if githubRunnerEnabled then + "d ${baseDir} 0750 kavita github-actions-runner -" + else + "d ${baseDir} 0770 kavita kavita -" + ) "d ${baseDir}/manga 0770 kavita kavita -" - ] ++ lib.optional githubRunnerEnabled - "d ${baseDir}/github 0770 github-actions-runner kavita -"; + ] + ++ lib.optional githubRunnerEnabled "d ${baseDir}/github 0770 github-actions-runner kavita -"; age.secrets.kavita = mkIf (!cfg.isTest) { file = ../../secrets/kavita.age; @@ -52,9 +62,15 @@ in { user = "kavita"; package = let - backend = pkgs.kavita-old.backend.overrideAttrs - (old: { patches = old.patches ++ [ ./kavita-patches-chapter-parsing.diff ./kavita-page-size.diff ]; }); - kavitaPatched = pkgs.kavita-old.overrideAttrs (old: { backend = backend; }); + backend = pkgs.kavita-old.backend.overrideAttrs (old: { + patches = old.patches ++ [ + ./kavita-patches-chapter-parsing.diff + ./kavita-page-size.diff + ]; + }); + kavitaPatched = pkgs.kavita-old.overrideAttrs (old: { + backend = backend; + }); in kavitaPatched; settings = { @@ -65,8 +81,7 @@ in { dataDir = baseDir; tokenKeyFile = if cfg.isTest then - (builtins.toFile "test" - "wWKNeGUslGILrUUp8Dnn4xyYnivZWBb8uqjKg3ALyCs7reV5v3CtE/E2b6i0Mwz1Xw1p9a0wcduRDNoa8Yh8kQ==") + (builtins.toFile "test" "wWKNeGUslGILrUUp8Dnn4xyYnivZWBb8uqjKg3ALyCs7reV5v3CtE/E2b6i0Mwz1Xw1p9a0wcduRDNoa8Yh8kQ==") else config.age.secrets.kavita.path; }; diff --git a/modules/services/kop-fileshare.nix b/modules/services/kop-fileshare.nix index 70ad91e..5cdb360 100644 --- a/modules/services/kop-fileshare.nix +++ b/modules/services/kop-fileshare.nix @@ -1,7 +1,14 @@ -{ config, pkgs, lib, ... }: +{ + config, + pkgs, + lib, + ... +}: with lib; -let cfg = config.custom.services.kop-fileshare; -in { +let + cfg = config.custom.services.kop-fileshare; +in +{ options = { custom.services.kop-fileshare = { enable = mkEnableOption "Enable the file upload server"; @@ -34,7 +41,10 @@ in { systemd.services.kop-fileshare = { description = "File Upload Server"; wants = [ "network-online.target" ]; - after = [ "network.target" "network-online.target" ]; + after = [ + "network.target" + "network-online.target" + ]; wantedBy = [ "multi-user.target" ]; serviceConfig = { diff --git a/modules/services/kop-monitor.nix b/modules/services/kop-monitor.nix index 9670d7f..1266ea0 100644 --- a/modules/services/kop-monitor.nix +++ b/modules/services/kop-monitor.nix @@ -1,7 +1,15 @@ -{ config, pkgs, lib, inputs, ... }: +{ + config, + pkgs, + lib, + inputs, + ... +}: with lib; -let cfg = config.custom.services.kop-monitor; -in { +let + cfg = config.custom.services.kop-monitor; +in +{ options.custom.services.kop-monitor = { enable = mkEnableOption "Enables monitor"; }; @@ -13,7 +21,10 @@ in { systemd.services.kop-monitor = { description = "Kop Monitor"; wants = [ "network-online.target" ]; - after = [ "network.target" "network-online.target" ]; + after = [ + "network.target" + "network-online.target" + ]; wantedBy = [ "multi-user.target" ]; serviceConfig = { Type = "simple"; diff --git a/modules/services/kubernetes.nix b/modules/services/kubernetes.nix index 8412b66..f7e764d 100644 --- a/modules/services/kubernetes.nix +++ b/modules/services/kubernetes.nix @@ -1,4 +1,9 @@ -{ pkgs, config, lib, ... }: +{ + pkgs, + config, + lib, + ... +}: # idk, dont need this with lib; let diff --git a/modules/services/nextcloud.nix b/modules/services/nextcloud.nix index 09188cf..76e94ec 100644 --- a/modules/services/nextcloud.nix +++ b/modules/services/nextcloud.nix @@ -1,4 +1,11 @@ -{ config, pkgs, lib, inputs, vars, ... }: +{ + config, + pkgs, + lib, + inputs, + vars, + ... +}: let wireguardIp = vars.wireguardIp; fqdn = "nextcloud.home.arpa"; @@ -46,7 +53,10 @@ in config.adminpassFile = config.age.secrets.nextcloud-admin.path; config.dbtype = "pgsql"; database.createLocally = true; - settings.trusted_domains = [ wireguardIp "nextcloud.home.arpa" ]; + settings.trusted_domains = [ + wireguardIp + "nextcloud.home.arpa" + ]; home = "/mnt/250ssd/nextcloud"; extraApps = with config.services.nextcloud.package.packages.apps; { inherit onlyoffice calendar mail; diff --git a/modules/services/nginx.nix b/modules/services/nginx.nix index 13a80f2..a8580b9 100644 --- a/modules/services/nginx.nix +++ b/modules/services/nginx.nix @@ -1,7 +1,15 @@ -{ config, pkgs, lib, inputs, ... }: +{ + config, + pkgs, + lib, + inputs, + ... +}: with lib; -let cfg = config.custom.services.nginx; -in { +let + cfg = config.custom.services.nginx; +in +{ options.custom.services.nginx = { enable = mkEnableOption "Enables nginx"; https = mkOption { @@ -11,8 +19,14 @@ in { }; }; config = lib.mkIf cfg.enable { - networking.firewall.allowedTCPPorts = [ 80 443 ]; - networking.firewall.allowedUDPPorts = [ 80 443 ]; + networking.firewall.allowedTCPPorts = [ + 80 + 443 + ]; + networking.firewall.allowedUDPPorts = [ + 80 + 443 + ]; age.secrets.stash-auth = { file = ../../secrets/stash-auth.age; @@ -34,8 +48,7 @@ in { recommendedOptimisation = true; recommendedProxySettings = true; recommendedTlsSettings = true; - statusPage = - lib.mkIf config.services.prometheus.exporters.nginx.enable true; + statusPage = lib.mkIf config.services.prometheus.exporters.nginx.enable true; # Only allow PFS-enabled ciphers with AES256 sslCiphers = "AES256+EECDH:AES256+EDH:!aNULL"; @@ -101,7 +114,10 @@ in { ''; proxyPass = "http://localhost:5232/"; }; - "/socket.io" = { proxyPass = "http://localhost:9955"; proxyWebsockets = true; }; + "/socket.io" = { + proxyPass = "http://localhost:9955"; + proxyWebsockets = true; + }; "/comms/" = { extraConfig = '' more_set_headers "Permissions-Policy: geolocation=(), microphone=(self), camera=(self)"; diff --git a/modules/services/nix-cache.nix b/modules/services/nix-cache.nix index 703b019..651ac4d 100644 --- a/modules/services/nix-cache.nix +++ b/modules/services/nix-cache.nix @@ -1,4 +1,5 @@ -{ config, ... }: { +{ config, ... }: +{ age.secrets.binary-cache = { file = ../../secrets/binary-cache.age; diff --git a/modules/services/opensnitch.nix b/modules/services/opensnitch.nix index cbbc5fc..2eba211 100644 --- a/modules/services/opensnitch.nix +++ b/modules/services/opensnitch.nix @@ -1,6 +1,14 @@ -{ config, pkgs, lib, inputs, ... }: -let cfg = config.custom.services.opensnitch; -in { +{ + config, + pkgs, + lib, + inputs, + ... +}: +let + cfg = config.custom.services.opensnitch; +in +{ options.custom.services.opensnitch = { enable = lib.mkEnableOption "Enables opensnitch"; }; diff --git a/modules/services/paperless.nix b/modules/services/paperless.nix index c00b2d7..fd468c1 100644 --- a/modules/services/paperless.nix +++ b/modules/services/paperless.nix @@ -1,4 +1,11 @@ -{ config, pkgs, lib, inputs, vars, ... }: +{ + config, + pkgs, + lib, + inputs, + vars, + ... +}: let ip = vars.ipv4; wireguardIp = vars.wireguardIp; diff --git a/modules/services/plausible.nix b/modules/services/plausible.nix index a853bc9..ccf3676 100644 --- a/modules/services/plausible.nix +++ b/modules/services/plausible.nix @@ -1,6 +1,14 @@ -{ config, pkgs, lib, inputs, ... }: -let cfg = config.custom.services.plausible; -in { +{ + config, + pkgs, + lib, + inputs, + ... +}: +let + cfg = config.custom.services.plausible; +in +{ options.custom.services.plausible = { enable = lib.mkEnableOption "Enables plausible"; }; diff --git a/modules/services/rdp.nix b/modules/services/rdp.nix index a2d61a7..3f6650a 100644 --- a/modules/services/rdp.nix +++ b/modules/services/rdp.nix @@ -1,4 +1,10 @@ -{ config, pkgs, lib, vars, ... }: +{ + config, + pkgs, + lib, + vars, + ... +}: let wm = vars.wm; in diff --git a/modules/services/smartd.nix b/modules/services/smartd.nix index ba354db..acc7da7 100644 --- a/modules/services/smartd.nix +++ b/modules/services/smartd.nix @@ -1,4 +1,11 @@ -{ config, pkgs, inputs, system, lib, ... }: +{ + config, + pkgs, + inputs, + system, + lib, + ... +}: let notifyScript = pkgs.writeScript "smartd-notify.sh" '' #!${pkgs.runtimeShell} @@ -25,7 +32,7 @@ in }; config = lib.mkIf cfg.enable { age.secrets.webhook-smartd = { - file = ../../secrets/webhook.age; #File contains WEBHOOK_URL="https://discord.com/api/webhooks/..." + file = ../../secrets/webhook.age; # File contains WEBHOOK_URL="https://discord.com/api/webhooks/..." owner = "root"; group = "root"; mode = "400"; @@ -39,8 +46,7 @@ in wall.enable = false; mail.enable = false; }; - defaults.autodetected = - "-a -o on -s (S/../.././02|L/../../7/04) -m -M exec ${notifyScript} -M test"; + defaults.autodetected = "-a -o on -s (S/../.././02|L/../../7/04) -m -M exec ${notifyScript} -M test"; }; }; } diff --git a/modules/services/step-ca.nix b/modules/services/step-ca.nix index 9aa192f..f0f4a98 100644 --- a/modules/services/step-ca.nix +++ b/modules/services/step-ca.nix @@ -1,34 +1,37 @@ -{ pkgs, lib, config, ... }: +{ + pkgs, + lib, + config, + ... +}: let - root_ca = - '' - -----BEGIN CERTIFICATE----- - MIIBjTCCATKgAwIBAgIRAMVH2+JHZ3wm2fLUlKjTYDswCgYIKoZIzj0EAwIwJDEM - MAoGA1UEChMDS29wMRQwEgYDVQQDEwtLb3AgUm9vdCBDQTAeFw0yMzEyMDgxNDUx - MTZaFw0zMzEyMDUxNDUxMTZaMCQxDDAKBgNVBAoTA0tvcDEUMBIGA1UEAxMLS29w - IFJvb3QgQ0EwWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAATdZBOkNynShXipzhuX - f6dUByD3chNupNWsagYC5AlPRJT9fAeHEIK/bxWkFwRtLBDopWvBu9lHahBgpHc7 - y7rTo0UwQzAOBgNVHQ8BAf8EBAMCAQYwEgYDVR0TAQH/BAgwBgEB/wIBATAdBgNV - HQ4EFgQU9AVtwipW5HDBLfZRH1KZCnIKCfowCgYIKoZIzj0EAwIDSQAwRgIhAMHj - AipNdhQKIYPvMt/h1uW4xP3NTkitnmshM09+rIasAiEAlSalGddXDkqJBHhPD+Fr - gpuVkfVkA8gQCXNs5F9TnxA= - -----END CERTIFICATE----- - ''; - intermediate_ca = - '' - -----BEGIN CERTIFICATE----- - MIIBtDCCAVqgAwIBAgIQbEVEV7LgtjVWO+qBrrmgETAKBggqhkjOPQQDAjAkMQww - CgYDVQQKEwNLb3AxFDASBgNVBAMTC0tvcCBSb290IENBMB4XDTIzMTIwODE0NTEx - N1oXDTMzMTIwNTE0NTExN1owLDEMMAoGA1UEChMDS29wMRwwGgYDVQQDExNLb3Ag - SW50ZXJtZWRpYXRlIENBMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEmv7jg7Cs - 4L5v52+3yUmn79hZFS2vmm/5wwcUCL63dokEXQsHgbEjaRKsF/MW0yJDLTB6Sdhl - pCvoNJqITWuEN6NmMGQwDgYDVR0PAQH/BAQDAgEGMBIGA1UdEwEB/wQIMAYBAf8C - AQAwHQYDVR0OBBYEFDgVolMCmdrhDIXhuIs4q/KwRKNLMB8GA1UdIwQYMBaAFPQF - bcIqVuRwwS32UR9SmQpyCgn6MAoGCCqGSM49BAMCA0gAMEUCIQCQa01E+UvAJ8KR - DFfDducZUpW4tZRN35lqoge7T9nM2QIgK4FFt1NqDqcjOSabAXPOQ68bvdxlHW0y - AgN9qNc3Jbo= - -----END CERTIFICATE----- - ''; + root_ca = '' + -----BEGIN CERTIFICATE----- + MIIBjTCCATKgAwIBAgIRAMVH2+JHZ3wm2fLUlKjTYDswCgYIKoZIzj0EAwIwJDEM + MAoGA1UEChMDS29wMRQwEgYDVQQDEwtLb3AgUm9vdCBDQTAeFw0yMzEyMDgxNDUx + MTZaFw0zMzEyMDUxNDUxMTZaMCQxDDAKBgNVBAoTA0tvcDEUMBIGA1UEAxMLS29w + IFJvb3QgQ0EwWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAATdZBOkNynShXipzhuX + f6dUByD3chNupNWsagYC5AlPRJT9fAeHEIK/bxWkFwRtLBDopWvBu9lHahBgpHc7 + y7rTo0UwQzAOBgNVHQ8BAf8EBAMCAQYwEgYDVR0TAQH/BAgwBgEB/wIBATAdBgNV + HQ4EFgQU9AVtwipW5HDBLfZRH1KZCnIKCfowCgYIKoZIzj0EAwIDSQAwRgIhAMHj + AipNdhQKIYPvMt/h1uW4xP3NTkitnmshM09+rIasAiEAlSalGddXDkqJBHhPD+Fr + gpuVkfVkA8gQCXNs5F9TnxA= + -----END CERTIFICATE----- + ''; + intermediate_ca = '' + -----BEGIN CERTIFICATE----- + MIIBtDCCAVqgAwIBAgIQbEVEV7LgtjVWO+qBrrmgETAKBggqhkjOPQQDAjAkMQww + CgYDVQQKEwNLb3AxFDASBgNVBAMTC0tvcCBSb290IENBMB4XDTIzMTIwODE0NTEx + N1oXDTMzMTIwNTE0NTExN1owLDEMMAoGA1UEChMDS29wMRwwGgYDVQQDExNLb3Ag + SW50ZXJtZWRpYXRlIENBMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEmv7jg7Cs + 4L5v52+3yUmn79hZFS2vmm/5wwcUCL63dokEXQsHgbEjaRKsF/MW0yJDLTB6Sdhl + pCvoNJqITWuEN6NmMGQwDgYDVR0PAQH/BAQDAgEGMBIGA1UdEwEB/wQIMAYBAf8C + AQAwHQYDVR0OBBYEFDgVolMCmdrhDIXhuIs4q/KwRKNLMB8GA1UdIwQYMBaAFPQF + bcIqVuRwwS32UR9SmQpyCgn6MAoGCCqGSM49BAMCA0gAMEUCIQCQa01E+UvAJ8KR + DFfDducZUpW4tZRN35lqoge7T9nM2QIgK4FFt1NqDqcjOSabAXPOQ68bvdxlHW0y + AgN9qNc3Jbo= + -----END CERTIFICATE----- + ''; in { @@ -50,7 +53,12 @@ in port = 8443; intermediatePasswordFile = config.age.secrets.step-ca-pw.path; settings = { - dnsNames = [ "localhost" "127.0.0.1" "*.home.arpa" "192.168.0.10" ]; + dnsNames = [ + "localhost" + "127.0.0.1" + "*.home.arpa" + "192.168.0.10" + ]; root = pkgs.writeTextFile { name = "root.ca"; text = root_ca; diff --git a/modules/services/synapse.nix b/modules/services/synapse.nix index 57bc17b..aaa28ed 100644 --- a/modules/services/synapse.nix +++ b/modules/services/synapse.nix @@ -1,4 +1,9 @@ -{ pkgs, lib, config, ... }: +{ + pkgs, + lib, + config, + ... +}: let fqdn = "${config.networking.domain}"; baseUrl = "https://${fqdn}"; @@ -12,7 +17,10 @@ let in { networking.domain = "kopatz.ddns.net"; - networking.firewall.allowedTCPPorts = [ 80 443 ]; + networking.firewall.allowedTCPPorts = [ + 80 + 443 + ]; services.postgresql.enable = true; services.postgresql.initialScript = pkgs.writeText "synapse-init.sql" '' @@ -84,10 +92,15 @@ in type = "http"; tls = false; x_forwarded = true; - resources = [{ - names = [ "client" "federation" ]; - compress = true; - }]; + resources = [ + { + names = [ + "client" + "federation" + ]; + compress = true; + } + ]; } ]; }; diff --git a/modules/services/syncthing.nix b/modules/services/syncthing.nix index 74846cf..19d2e70 100644 --- a/modules/services/syncthing.nix +++ b/modules/services/syncthing.nix @@ -1,6 +1,14 @@ -{ config, pkgs, lib, inputs, ... }: -let cfg = config.custom.services.syncthing; -in { +{ + config, + pkgs, + lib, + inputs, + ... +}: +let + cfg = config.custom.services.syncthing; +in +{ options.custom.services.syncthing = { enable = lib.mkEnableOption "Enables syncthing"; basePath = lib.mkOption { @@ -10,8 +18,7 @@ in { }; }; config = lib.mkIf cfg.enable { - systemd.tmpfiles.rules = - [ "d ${cfg.basePath} 0700 ${config.mainUser.name} users -" ]; + systemd.tmpfiles.rules = [ "d ${cfg.basePath} 0700 ${config.mainUser.name} users -" ]; # check device id: syncthing cli --gui-address=/synced/gui-socket --gui-apikey= show system environment.systemPackages = with pkgs; [ syncthing ]; @@ -33,61 +40,92 @@ in { devices = { kop-pc = { - id = - "DZKIUS7-WCGTYEV-4OKVSZU-MIVL2NC-N45AKZL-ABT3VN2-I7RXUMF-RF4CYAU"; + id = "DZKIUS7-WCGTYEV-4OKVSZU-MIVL2NC-N45AKZL-ABT3VN2-I7RXUMF-RF4CYAU"; addresses = [ "tcp://192.168.0.11" ]; }; server = { - id = - "FK3DW4B-6Y7C25O-IDBSOMV-GOUSWZW-KQR7ELS-QUKS4UR-AFZXLZE-67QJXAX"; - addresses = [ "tcp://192.168.0.10" "tcp://192.168.2.1" ]; + id = "FK3DW4B-6Y7C25O-IDBSOMV-GOUSWZW-KQR7ELS-QUKS4UR-AFZXLZE-67QJXAX"; + addresses = [ + "tcp://192.168.0.10" + "tcp://192.168.2.1" + ]; }; laptop = { - id = - "ACLM2MY-G6TK6QH-NEVVG3R-6QGXWYI-GHGA2FJ-SI6DFZJ-JWKWAOA-DPMEEQO"; - addresses = [ "tcp://192.168.2.22" "tcp://192.168.0.166" ]; + id = "ACLM2MY-G6TK6QH-NEVVG3R-6QGXWYI-GHGA2FJ-SI6DFZJ-JWKWAOA-DPMEEQO"; + addresses = [ + "tcp://192.168.2.22" + "tcp://192.168.0.166" + ]; }; phone = { - id = - "JKZGIMH-4YWAMUN-SQZBKFY-BVLEFP4-NBNZP2T-R2LSLSN-RVSL7BH-3AFIFAB"; - addresses = [ "tcp://192.168.0.15" "tcp://192.168.2.20" ]; + id = "JKZGIMH-4YWAMUN-SQZBKFY-BVLEFP4-NBNZP2T-R2LSLSN-RVSL7BH-3AFIFAB"; + addresses = [ + "tcp://192.168.0.15" + "tcp://192.168.2.20" + ]; }; }; folders."default" = { id = "default"; path = "${cfg.basePath}/default"; - devices = - [ "kop-pc" "server" "laptop" "phone" ]; + devices = [ + "kop-pc" + "server" + "laptop" + "phone" + ]; ignorePerms = false; }; folders."books" = { id = "books"; path = "${cfg.basePath}/books"; - devices = [ "kop-pc" "server" "laptop" ]; + devices = [ + "kop-pc" + "server" + "laptop" + ]; }; folders."fh" = { id = "fh"; path = "${cfg.basePath}/fh"; - devices = [ "kop-pc" "server" "laptop" ]; + devices = [ + "kop-pc" + "server" + "laptop" + ]; }; folders."work_drive" = { id = "work_drive"; path = "${cfg.basePath}/work_drive"; - devices = [ "kop-pc" "server" "laptop" ]; + devices = [ + "kop-pc" + "server" + "laptop" + ]; }; folders."no_backup" = { id = "no_backup"; path = "${cfg.basePath}/no_backup"; - devices = [ "kop-pc" "server" "laptop" ]; + devices = [ + "kop-pc" + "server" + "laptop" + ]; }; }; }; - networking.firewall.allowedTCPPorts = [ 8384 22000 ]; - networking.firewall.allowedUDPPorts = [ 22000 21027 ]; + networking.firewall.allowedTCPPorts = [ + 8384 + 22000 + ]; + networking.firewall.allowedUDPPorts = [ + 22000 + 21027 + ]; }; } diff --git a/modules/services/wireguard-client.nix b/modules/services/wireguard-client.nix index 5cc9a9a..ee21a1d 100644 --- a/modules/services/wireguard-client.nix +++ b/modules/services/wireguard-client.nix @@ -1,4 +1,10 @@ -{ config, pkgs, lib, inputs, ... }: +{ + config, + pkgs, + lib, + inputs, + ... +}: { age.secrets.wireguard-client = { @@ -35,7 +41,10 @@ address = [ "192.168.2.22/24" ]; peers = [ { - allowedIPs = [ "192.168.2.0/24" "192.168.0.0/24" ]; + allowedIPs = [ + "192.168.2.0/24" + "192.168.0.0/24" + ]; #allowedIPs = [ "0.0.0.0/0" ]; endpoint = "kopatz.dev:51820"; publicKey = "vyHNUy97R1cvqEvElznPpFQtoqm7WUHnT96UP6Dquwc="; diff --git a/modules/services/wireguard.nix b/modules/services/wireguard.nix index 598a268..c08ba4c 100644 --- a/modules/services/wireguard.nix +++ b/modules/services/wireguard.nix @@ -1,4 +1,10 @@ -{ config, pkgs, lib, inputs, ... }: +{ + config, + pkgs, + lib, + inputs, + ... +}: with lib; let cfg = config.custom.services.wireguard; @@ -37,14 +43,14 @@ in networking.nat.internalInterfaces = [ "wg0" ]; networking.firewall.allowedUDPPorts = [ 51820 ]; - #[Interface] - #PrivateKey = - #Address = 192.168.2.20/24 - #[Peer] - #PublicKey = vyHNUy97R1cvqEvElznPpFQtoqm7WUHnT96UP6Dquwc= - #AllowedIPs = 192.168.2.0/24 - #Endpoint = kopatz.dev:51820 - #PersistentKeepalive = 25 + #[Interface] + #PrivateKey = + #Address = 192.168.2.20/24 + #[Peer] + #PublicKey = vyHNUy97R1cvqEvElznPpFQtoqm7WUHnT96UP6Dquwc= + #AllowedIPs = 192.168.2.0/24 + #Endpoint = kopatz.dev:51820 + #PersistentKeepalive = 25 networking.wg-quick.interfaces = { wg0 = { autostart = true; diff --git a/modules/wake-on-lan.nix b/modules/wake-on-lan.nix index 24f978c..a6c6add 100644 --- a/modules/wake-on-lan.nix +++ b/modules/wake-on-lan.nix @@ -1,4 +1,10 @@ -{ config, pkgs, lib, vars, ... }: +{ + config, + pkgs, + lib, + vars, + ... +}: let interface = vars.interface; in diff --git a/modules/work/vpn.nix b/modules/work/vpn.nix index 0f07eb3..e3287c7 100644 --- a/modules/work/vpn.nix +++ b/modules/work/vpn.nix @@ -1,4 +1,5 @@ -{ pkgs, ... }: { +{ pkgs, ... }: +{ services.resolved.enable = true; programs.openvpn3.enable = true; #mdns resolves to ipv6 address idk why diff --git a/overlays.nix b/overlays.nix index 59fefe3..aed45b6 100644 --- a/overlays.nix +++ b/overlays.nix @@ -1,31 +1,34 @@ # This file defines overlays { inputs, ... }: let - addPatches = pkg: patches: - pkg.overrideAttrs - (oldAttrs: { patches = (oldAttrs.patches or [ ]) ++ patches; }); - neotestPatch = '' diff --git a/tests/unit/client/strategies/integrated_spec.lua b/tests/unit/client/strategies/integrated_spec.lua -index 196c2e78..42a3df76 100644 ---- a/tests/unit/client/strategies/integrated_spec.lua -+++ b/tests/unit/client/strategies/integrated_spec.lua -@@ -34,7 +34,7 @@ describe("integrated strategy", function() + addPatches = + pkg: patches: + pkg.overrideAttrs (oldAttrs: { + patches = (oldAttrs.patches or [ ]) ++ patches; + }); + neotestPatch = '' + diff --git a/tests/unit/client/strategies/integrated_spec.lua b/tests/unit/client/strategies/integrated_spec.lua + index 196c2e78..42a3df76 100644 + --- a/tests/unit/client/strategies/integrated_spec.lua + +++ b/tests/unit/client/strategies/integrated_spec.lua + @@ -34,7 +34,7 @@ describe("integrated strategy", function() - a.it("stops the job", function() - local process = strategy({ -- command = { "bash", "-c", "sleep 1" }, -+ command = { "bash", "-c", "sleep 10" }, - strategy = { - height = 10, - width = 10, -@@ -47,7 +47,7 @@ describe("integrated strategy", function() + a.it("stops the job", function() + local process = strategy({ + - command = { "bash", "-c", "sleep 1" }, + + command = { "bash", "-c", "sleep 10" }, + strategy = { + height = 10, + width = 10, + @@ -47,7 +47,7 @@ describe("integrated strategy", function() - a.it("streams output", function() - local process = strategy({ -- command = { "bash", "-c", "printf hello; sleep 0; printf world" }, -+ command = { "bash", "-c", "printf hello; sleep 0.1; printf world" }, - strategy = { - height = 10, - width = 10, + a.it("streams output", function() + local process = strategy({ + - command = { "bash", "-c", "printf hello; sleep 0; printf world" }, + + command = { "bash", "-c", "printf hello; sleep 0.1; printf world" }, + strategy = { + height = 10, + width = 10, ''; in { @@ -39,10 +42,10 @@ in discord-canary = prev.discord-canary.override { withVencord = true; }; discord = prev.discord.override { withVencord = true; }; tetrio-desktop = prev.tetrio-desktop.override { withTetrioPlus = true; }; - #xrdp = (import inputs.nixpkgs-working-xrdp { - # system = "x86_64-linux"; - # config.allowUnfree = true; - #}).xrdp; + #xrdp = (import inputs.nixpkgs-working-xrdp { + # system = "x86_64-linux"; + # config.allowUnfree = true; + #}).xrdp; #jetbrains = prev.jetbrains // { # jdk = (import inputs.nixpkgs-working-jetbrains { @@ -69,7 +72,10 @@ in }; }; monado = prev.monado.overrideAttrs (old: { - cmakeFlags = old.cmakeFlags ++ [ "-DBUILD_WITH_OPENCV=OFF" (prev.lib.cmakeBool "XRT_HAVE_OPENCV" false) ]; + cmakeFlags = old.cmakeFlags ++ [ + "-DBUILD_WITH_OPENCV=OFF" + (prev.lib.cmakeBool "XRT_HAVE_OPENCV" false) + ]; }); luajitPackages = prev.luajitPackages // { @@ -86,7 +92,6 @@ in #xdg-desktop-portal-hyprland = # inputs.hyprland.packages.${prev.stdenv.hostPlatform.system}.xdg-desktop-portal-hyprland; - # to add input capture protocol support (needed for kde connect) #hyprland = prev.hyprland.overrideAttrs (oldAttrs: { # src = prev.fetchFromGitHub { diff --git a/pkgs/adam-site/default.nix b/pkgs/adam-site/default.nix index 6349c8e..ae4eac7 100644 --- a/pkgs/adam-site/default.nix +++ b/pkgs/adam-site/default.nix @@ -1,4 +1,8 @@ -{ lib, buildNpmPackage, fetchFromGitHub }: +{ + lib, + buildNpmPackage, + fetchFromGitHub, +}: buildNpmPackage rec { pname = "adam-site"; version = "1.0.0"; diff --git a/pkgs/csharp-lsp/default.nix b/pkgs/csharp-lsp/default.nix index a603472..faa4097 100644 --- a/pkgs/csharp-lsp/default.nix +++ b/pkgs/csharp-lsp/default.nix @@ -1,9 +1,9 @@ -{ lib -, buildDotnetGlobalTool -, dotnetCorePackages -, versionCheckHook -, nix-update-script -, +{ + lib, + buildDotnetGlobalTool, + dotnetCorePackages, + versionCheckHook, + nix-update-script, }: let inherit (dotnetCorePackages) sdk_8_0; diff --git a/pkgs/default.nix b/pkgs/default.nix index 19ff021..5d6b5ba 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -1,4 +1,5 @@ -{ pkgs, ... }: rec { +{ pkgs, ... }: +rec { adam-site = pkgs.callPackage ./adam-site/default.nix { }; ente-frontend = pkgs.callPackage ./ente-frontend/default.nix { }; kop-fhcalendar = pkgs.callPackage ./kop-fhcalendar/default.nix { }; @@ -6,18 +7,24 @@ kop-hub = pkgs.callPackage ./hub/default.nix { }; kop-monitor = pkgs.callPackage ./kop-monitor/default.nix { }; kop-newproject = pkgs.callPackage ./kop-newproject/default.nix { }; - kop-website = - pkgs.callPackage ./website/default.nix { inherit kop-hub ente-frontend; }; + kop-website = pkgs.callPackage ./website/default.nix { inherit kop-hub ente-frontend; }; scheibnkleister-presence = pkgs.callPackage ./scheibnkleister-presence/default.nix { }; custom-sddm-astronaut = pkgs.callPackage ./sddm-astronaut/default.nix { }; mangal-patched = pkgs.callPackage ./mangal/default.nix { }; csharp-ls-8 = pkgs.callPackage ./csharp-lsp/default.nix { }; gpu-screen-recorder-ui = pkgs.callPackage ./gpu-screen-recorder-ui/default.nix { }; - gpu-screen-recorder-notification = pkgs.callPackage ./gpu-screen-recorder-notification/default.nix { }; + gpu-screen-recorder-notification = + pkgs.callPackage ./gpu-screen-recorder-notification/default.nix + { }; kavita-old = pkgs.callPackage ./kavita-old/default.nix { }; hollow-grub = pkgs.callPackage ./hollow-grub/default.nix { }; - peframe = pkgs.callPackage ./peframe/default.nix { python3Packages = pkgs.python3Packages; inherit virustotal-api; }; - virustotal-api = pkgs.callPackage ./virustotal-api/default.nix { python3Packages = pkgs.python3Packages; }; + peframe = pkgs.callPackage ./peframe/default.nix { + python3Packages = pkgs.python3Packages; + inherit virustotal-api; + }; + virustotal-api = pkgs.callPackage ./virustotal-api/default.nix { + python3Packages = pkgs.python3Packages; + }; answer = pkgs.callPackage ./answer/default.nix { }; internxt-cli = pkgs.callPackage ./internxt-cli/default.nix { }; } diff --git a/pkgs/ente-frontend/default.nix b/pkgs/ente-frontend/default.nix index 5ff7ada..bb892f9 100644 --- a/pkgs/ente-frontend/default.nix +++ b/pkgs/ente-frontend/default.nix @@ -1,14 +1,21 @@ -{ lib, buildNpmPackage, fetchFromGitHub, npm-lockfile-fix }: +{ + lib, + buildNpmPackage, + fetchFromGitHub, + npm-lockfile-fix, +}: buildNpmPackage rec { pname = "ente-website"; version = "1.0.0"; - src = "${(fetchGit { - url = "git@github.com:oberprofis/ente.git"; - ref = "master"; - rev = "cb63e1e20fd9fde401fa9d3f09b36c572b17ff34"; - })}/website/tracker-site"; + src = "${ + (fetchGit { + url = "git@github.com:oberprofis/ente.git"; + ref = "master"; + rev = "cb63e1e20fd9fde401fa9d3f09b36c572b17ff34"; + }) + }/website/tracker-site"; npmDepsHash = "sha256-fYTRhIU+8pdIm3wC5wJRcDUhgN3d+mmvfmVzuu0pjLQ="; # The prepack script runs the build script, which we'd rather do in the build phase. diff --git a/pkgs/gpu-screen-recorder-notification/default.nix b/pkgs/gpu-screen-recorder-notification/default.nix index a9299f5..be96d48 100644 --- a/pkgs/gpu-screen-recorder-notification/default.nix +++ b/pkgs/gpu-screen-recorder-notification/default.nix @@ -1,18 +1,18 @@ -{ lib -, stdenv -, fetchgit -, pkg-config -, meson -, ninja -, libX11 -, libXrender -, libXrandr -, libXext -, libglvnd -, wayland -, wayland-scanner -, gitUpdater -, +{ + lib, + stdenv, + fetchgit, + pkg-config, + meson, + ninja, + libX11, + libXrender, + libXrandr, + libXext, + libglvnd, + wayland, + wayland-scanner, + gitUpdater, }: stdenv.mkDerivation rec { diff --git a/pkgs/hub/default.nix b/pkgs/hub/default.nix index 6f21bc8..0dbd986 100644 --- a/pkgs/hub/default.nix +++ b/pkgs/hub/default.nix @@ -1,6 +1,7 @@ -{ stdenv -, lib -, ... +{ + stdenv, + lib, + ... }: stdenv.mkDerivation (finalAttrs: { pname = "hub"; diff --git a/pkgs/internxt-cli/default.nix b/pkgs/internxt-cli/default.nix index ef714cf..8fecf36 100644 --- a/pkgs/internxt-cli/default.nix +++ b/pkgs/internxt-cli/default.nix @@ -22,31 +22,33 @@ stdenv.mkDerivation (finalAttrs: { }; # Tip: use diff -ur to create patches - patches = [ (pkgs.writeText "cli-patch" '' -diff --git i/src/services/auth.service.ts w/src/services/auth.service.ts -index dcc63bb..fae23b9 100644 ---- i/src/services/auth.service.ts -+++ w/src/services/auth.service.ts -@@ -29,14 +29,14 @@ export class AuthService { - tfaCode: twoFactorCode, - }; - -- const data = await authClient.loginAccess(loginDetails, CryptoService.cryptoProvider); -+ const data = await authClient.login(loginDetails, CryptoService.cryptoProvider); - const { user, newToken } = data; - - const clearMnemonic = CryptoService.instance.decryptTextWithKey(user.mnemonic, password); -- const clearUser: LoginCredentials['user'] = { -- ...user, -+ const clearUser: LoginCredentials['user'] = Object.assign({}, user, { -+ createdAt: user.createdAt as any as string, - mnemonic: clearMnemonic, -- }; -+ }); - return { - user: clearUser, - token: newToken, - '') ]; + patches = [ + (pkgs.writeText "cli-patch" '' + diff --git i/src/services/auth.service.ts w/src/services/auth.service.ts + index dcc63bb..fae23b9 100644 + --- i/src/services/auth.service.ts + +++ w/src/services/auth.service.ts + @@ -29,14 +29,14 @@ export class AuthService { + tfaCode: twoFactorCode, + }; + + - const data = await authClient.loginAccess(loginDetails, CryptoService.cryptoProvider); + + const data = await authClient.login(loginDetails, CryptoService.cryptoProvider); + const { user, newToken } = data; + + const clearMnemonic = CryptoService.instance.decryptTextWithKey(user.mnemonic, password); + - const clearUser: LoginCredentials['user'] = { + - ...user, + + const clearUser: LoginCredentials['user'] = Object.assign({}, user, { + + createdAt: user.createdAt as any as string, + mnemonic: clearMnemonic, + - }; + + }); + return { + user: clearUser, + token: newToken, + '') + ]; prePatch = '' cp .env.template .env diff --git a/pkgs/kop-fhcalendar/default.nix b/pkgs/kop-fhcalendar/default.nix index 54fbd51..52d681a 100644 --- a/pkgs/kop-fhcalendar/default.nix +++ b/pkgs/kop-fhcalendar/default.nix @@ -1,4 +1,9 @@ -{ rustPlatform, lib, pkgs, ... }: +{ + rustPlatform, + lib, + pkgs, + ... +}: rustPlatform.buildRustPackage { pname = "kop-fhcalendar"; version = "1.0.0"; diff --git a/pkgs/kop-fileshare/default.nix b/pkgs/kop-fileshare/default.nix index 10e9999..7fba256 100644 --- a/pkgs/kop-fileshare/default.nix +++ b/pkgs/kop-fileshare/default.nix @@ -1,4 +1,10 @@ -{ buildGoModule, stdenv, pkgs, lib, ... }: +{ + buildGoModule, + stdenv, + pkgs, + lib, + ... +}: buildGoModule rec { pname = "kop-fileshare"; version = "0.0.1"; diff --git a/pkgs/kop-monitor/default.nix b/pkgs/kop-monitor/default.nix index 701a450..3a25717 100644 --- a/pkgs/kop-monitor/default.nix +++ b/pkgs/kop-monitor/default.nix @@ -1,7 +1,8 @@ -{ rustPlatform -, lib -, pkgs -, ... +{ + rustPlatform, + lib, + pkgs, + ... }: rustPlatform.buildRustPackage { pname = "kop-monitor"; diff --git a/pkgs/kop-newproject/default.nix b/pkgs/kop-newproject/default.nix index 6a4cafb..12f334f 100644 --- a/pkgs/kop-newproject/default.nix +++ b/pkgs/kop-newproject/default.nix @@ -1,4 +1,9 @@ -{ rustPlatform, lib, pkgs, ... }: +{ + rustPlatform, + lib, + pkgs, + ... +}: rustPlatform.buildRustPackage { pname = "kop-newproject"; version = "1.0.0"; diff --git a/pkgs/mangal/default.nix b/pkgs/mangal/default.nix index 54c94d5..d8c7117 100644 --- a/pkgs/mangal/default.nix +++ b/pkgs/mangal/default.nix @@ -1,11 +1,11 @@ -{ lib -, stdenv -, buildGoModule -, fetchFromGitHub -, installShellFiles -, libgbm -, makeWrapper -, +{ + lib, + stdenv, + buildGoModule, + fetchFromGitHub, + installShellFiles, + libgbm, + makeWrapper, }: buildGoModule rec { name = "mangal"; @@ -27,7 +27,10 @@ buildGoModule rec { buildInputs = [ libgbm ]; runtimeDeps = [ libgbm ]; - nativeBuildInputs = [ installShellFiles makeWrapper ]; + nativeBuildInputs = [ + installShellFiles + makeWrapper + ]; preFixup = '' wrapProgram $out/bin/mangal --prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ libgbm ]} diff --git a/pkgs/peframe/default.nix b/pkgs/peframe/default.nix index 34682d1..984dd26 100644 --- a/pkgs/peframe/default.nix +++ b/pkgs/peframe/default.nix @@ -1,36 +1,49 @@ -{lib, fetchPypi, python3Packages, swig, pkgconf, openssl, virustotal-api, ...}: +{ + lib, + fetchPypi, + python3Packages, + swig, + pkgconf, + openssl, + virustotal-api, + ... +}: python3Packages.buildPythonApplication rec { - pname = "peframe_ds"; - version = "7.0.0"; - pyproject = true; + pname = "peframe_ds"; + version = "7.0.0"; + pyproject = true; - src = fetchPypi { - inherit pname version; - hash = "sha256-Z9/hMD3w4ZYcfPMbLUuyKhS1wWGT11Y3gdVNVqSdhvg="; - }; - build-system = with python3Packages; [ setuptools ]; - postPatch = '' - substituteInPlace pyproject.toml \ - --replace-fail "readline" "gnureadline" - ''; + src = fetchPypi { + inherit pname version; + hash = "sha256-Z9/hMD3w4ZYcfPMbLUuyKhS1wWGT11Y3gdVNVqSdhvg="; + }; + build-system = with python3Packages; [ setuptools ]; + postPatch = '' + substituteInPlace pyproject.toml \ + --replace-fail "readline" "gnureadline" + ''; - dependencies = with python3Packages; [ - pefile - yara-python - python-magic - requests - oletools - m2crypto - virustotal-api - gnureadline - ]; + dependencies = with python3Packages; [ + pefile + yara-python + python-magic + requests + oletools + m2crypto + virustotal-api + gnureadline + ]; - nativeBuildInputs = [ swig pkgconf openssl ]; + nativeBuildInputs = [ + swig + pkgconf + openssl + ]; - meta = with lib; { - description = "PEframe — static analysis of PE files and suspicious documents"; - homepage = "https://github.com/guelfoweb/peframe"; - license = licenses.gpl2Plus; - maintainers = with maintainers; [ ]; - }; + meta = with lib; { + description = "PEframe — static analysis of PE files and suspicious documents"; + homepage = "https://github.com/guelfoweb/peframe"; + license = licenses.gpl2Plus; + maintainers = with maintainers; [ ]; + }; } diff --git a/pkgs/scheibnkleister-presence/default.nix b/pkgs/scheibnkleister-presence/default.nix index 3a19dfc..070b24d 100644 --- a/pkgs/scheibnkleister-presence/default.nix +++ b/pkgs/scheibnkleister-presence/default.nix @@ -1,7 +1,8 @@ -{ buildNpmPackage -, fetchFromGitHub -, lib -, ... +{ + buildNpmPackage, + fetchFromGitHub, + lib, + ... }: buildNpmPackage rec { pname = "scheibnkleister-presence"; diff --git a/pkgs/sddm-astronaut/default.nix b/pkgs/sddm-astronaut/default.nix index 40eb7c9..697267b 100644 --- a/pkgs/sddm-astronaut/default.nix +++ b/pkgs/sddm-astronaut/default.nix @@ -9,15 +9,17 @@ pkgs.stdenv.mkDerivation { rev = "6726b5e951a13d308bf17aa09e91a349d82c997b"; }; # Tip: use diff -ur to create patches - patches = [ (pkgs.writeText "astronaut-patch" '' ---- a/metadata.desktop -+++ b/metadata.desktop -@@ -9,3 +9,4 @@ - MainScript=Main.qml - ConfigFile=theme.conf - Theme-Id=sddm-astronaut -+QTVersion=6 - '') ]; + patches = [ + (pkgs.writeText "astronaut-patch" '' + --- a/metadata.desktop + +++ b/metadata.desktop + @@ -9,3 +9,4 @@ + MainScript=Main.qml + ConfigFile=theme.conf + Theme-Id=sddm-astronaut + +QTVersion=6 + '') + ]; installPhase = '' mkdir -p $out cp -R ./* $out/ diff --git a/pkgs/website/default.nix b/pkgs/website/default.nix index 68e8056..bdad229 100644 --- a/pkgs/website/default.nix +++ b/pkgs/website/default.nix @@ -1,4 +1,11 @@ -{ stdenv, lib, buildNpmPackage, fetchFromGitHub, kop-hub, ente-frontend }: +{ + stdenv, + lib, + buildNpmPackage, + fetchFromGitHub, + kop-hub, + ente-frontend, +}: stdenv.mkDerivation (finalAttrs: { pname = "kopatz-website"; diff --git a/secrets/secrets.nix b/secrets/secrets.nix index cd37865..9902654 100644 --- a/secrets/secrets.nix +++ b/secrets/secrets.nix @@ -8,38 +8,135 @@ let amd-server = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAII/t25OaQF020DZdew53gMFqoeHX1+g3um02mopke2eX root@nixos"; amd-server-vpn-vm = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKkTbNz36z1gGbKp+7NyyTpMslXcFLX0tOrfJ/GQFn+g root@amd-server-vpn-vm"; users = [ kop ]; - systems = [ server-vm server laptop ]; + systems = [ + server-vm + server + laptop + ]; in { - "github-runner-token.age".publicKeys = [ server-vm kop ]; - "github-runner-pw.age".publicKeys = [ server-vm kop ]; - "duckdns.age".publicKeys = [ server-vm kop ]; - "nextcloud-admin.age".publicKeys = [ server-vm kop ]; - "nextcloud-cert.age".publicKeys = [ server-vm kop ]; - "nextcloud-key.age".publicKeys = [ server-vm kop ]; + "github-runner-token.age".publicKeys = [ + server-vm + kop + ]; + "github-runner-pw.age".publicKeys = [ + server-vm + kop + ]; + "duckdns.age".publicKeys = [ + server-vm + kop + ]; + "nextcloud-admin.age".publicKeys = [ + server-vm + kop + ]; + "nextcloud-cert.age".publicKeys = [ + server-vm + kop + ]; + "nextcloud-key.age".publicKeys = [ + server-vm + kop + ]; #backups - "restic-pw.age".publicKeys = [ server-vm kop ]; - "restic-s3.age".publicKeys = [ server-vm kop ]; - "restic-gdrive.age".publicKeys = [ server-vm kop ]; - "restic-internxt.age".publicKeys = [ server-vm kop ]; - "wireguard-private.age".publicKeys = [ server-vm kop ]; - "wireguard-client.age".publicKeys = [ kop laptop ]; - "coturn-secret.age".publicKeys = [ server-vm kop ]; - "matrix-registration.age".publicKeys = [ server-vm kop ]; - "paperless.age".publicKeys = [ server-vm kop ]; - "kavita.age".publicKeys = [ server-vm kop ]; - "step-ca-pw.age".publicKeys = [ server-vm kop ]; - "step-ca-key.age".publicKeys = [ server-vm kop ]; - "grafana-contact-points.age".publicKeys = [ server-vm kop ]; - "fileshelter-conf.age".publicKeys = [ server-vm kop ]; - "webhook.age".publicKeys = [ server-vm server kop amd-server adam-site ]; - "stash-auth.age".publicKeys = [ server-vm kop ]; - "plausible-admin.age".publicKeys = [ adam-site kop ]; - "plausible-keybase.age".publicKeys = [ adam-site kop ]; - "adminarea.age".publicKeys = [ adam-site kop ]; - "radicale.age".publicKeys = [ server-vm kop ]; - "binary-cache.age".publicKeys = [ kop amd-server ]; - "wireguard-evo-vpn.age".publicKeys = [ kop amd-server-vpn-vm ]; - "cloudflare-api.age".publicKeys = [ kop server-vm ]; - "wireguard-ipv6-private.age".publicKeys = [ kop adam-site ]; + "restic-pw.age".publicKeys = [ + server-vm + kop + ]; + "restic-s3.age".publicKeys = [ + server-vm + kop + ]; + "restic-gdrive.age".publicKeys = [ + server-vm + kop + ]; + "restic-internxt.age".publicKeys = [ + server-vm + kop + ]; + "wireguard-private.age".publicKeys = [ + server-vm + kop + ]; + "wireguard-client.age".publicKeys = [ + kop + laptop + ]; + "coturn-secret.age".publicKeys = [ + server-vm + kop + ]; + "matrix-registration.age".publicKeys = [ + server-vm + kop + ]; + "paperless.age".publicKeys = [ + server-vm + kop + ]; + "kavita.age".publicKeys = [ + server-vm + kop + ]; + "step-ca-pw.age".publicKeys = [ + server-vm + kop + ]; + "step-ca-key.age".publicKeys = [ + server-vm + kop + ]; + "grafana-contact-points.age".publicKeys = [ + server-vm + kop + ]; + "fileshelter-conf.age".publicKeys = [ + server-vm + kop + ]; + "webhook.age".publicKeys = [ + server-vm + server + kop + amd-server + adam-site + ]; + "stash-auth.age".publicKeys = [ + server-vm + kop + ]; + "plausible-admin.age".publicKeys = [ + adam-site + kop + ]; + "plausible-keybase.age".publicKeys = [ + adam-site + kop + ]; + "adminarea.age".publicKeys = [ + adam-site + kop + ]; + "radicale.age".publicKeys = [ + server-vm + kop + ]; + "binary-cache.age".publicKeys = [ + kop + amd-server + ]; + "wireguard-evo-vpn.age".publicKeys = [ + kop + amd-server-vpn-vm + ]; + "cloudflare-api.age".publicKeys = [ + kop + server-vm + ]; + "wireguard-ipv6-private.age".publicKeys = [ + kop + adam-site + ]; } diff --git a/systems/adam-site/configuration.nix b/systems/adam-site/configuration.nix index e37645b..a3ccec7 100644 --- a/systems/adam-site/configuration.nix +++ b/systems/adam-site/configuration.nix @@ -1,4 +1,11 @@ -{ modulesPath, config, lib, pkgs, ... }: { +{ + modulesPath, + config, + lib, + pkgs, + ... +}: +{ imports = [ (modulesPath + "/installer/scan/not-detected.nix") (modulesPath + "/profiles/qemu-guest.nix") @@ -6,7 +13,11 @@ ]; services.openssh.enable = true; - networking.firewall.allowedTCPPorts = [ 22 80 443 ]; + networking.firewall.allowedTCPPorts = [ + 22 + 80 + 443 + ]; networking = { defaultGateway6 = { address = "fe80::1"; @@ -14,10 +25,12 @@ }; interfaces.enp1s0 = { - ipv6.addresses = [ { - address = "2a01:4f8:c013:232b::2"; - prefixLength = 64; - } ]; + ipv6.addresses = [ + { + address = "2a01:4f8:c013:232b::2"; + prefixLength = 64; + } + ]; }; }; custom = { @@ -27,7 +40,9 @@ plausible.enable = true; }; nftables.enable = true; - nix = { settings.enable = true; }; + nix = { + settings.enable = true; + }; }; age.secrets.stash-auth = { @@ -76,7 +91,10 @@ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKJTpEPKK38MQHcLHkJ6TCqrhSQ9B2ruVx6ONRVQYJC6" "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPb326bQdoNNQ/z38C07TbyhNoj59eJTHRHaMqHSHBXy" ]; - environment.systemPackages = map lib.lowPrio [ pkgs.curl pkgs.gitMinimal ]; + environment.systemPackages = map lib.lowPrio [ + pkgs.curl + pkgs.gitMinimal + ]; boot.loader.grub = { efiSupport = true; efiInstallAsRemovable = true; @@ -88,18 +106,23 @@ systemd.services.kop-monitor = { description = "Kop Monitor"; wants = [ "network-online.target" ]; - after = [ "network.target" "network-online.target" ]; + after = [ + "network.target" + "network-online.target" + ]; wantedBy = [ "multi-user.target" ]; path = [ "${pkgs.iputils}" ]; serviceConfig = with lib; { Type = "simple"; - ExecStart = "${(pkgs.kop-monitor.overrideAttrs { + ExecStart = "${ + (pkgs.kop-monitor.overrideAttrs { src = fetchGit { url = "git@github.com:kropatz/monitor.git"; ref = "monitor-homeserver"; rev = "14e84874302146690491a8ced7e3c89dce183a74"; }; - })}/bin/monitor"; + }) + }/bin/monitor"; DynamicUser = true; Restart = "on-failure"; RestartSec = "5s"; @@ -137,14 +160,20 @@ networking.wg-quick.interfaces = { wg0 = { autostart = true; - address = [ "10.100.0.1/24" "fd42:42:42::1/64" ]; + address = [ + "10.100.0.1/24" + "fd42:42:42::1/64" + ]; listenPort = 51820; privateKeyFile = config.age.secrets.wireguard.path; peers = [ { # kop pc publicKey = "YgecbWSNRqOmylYqxr/V21LL3UpKEr5x42lXPAxriSc="; - allowedIPs = [ "10.100.0.2/32" "fd42:42:42::2/128" ]; + allowedIPs = [ + "10.100.0.2/32" + "fd42:42:42::2/128" + ]; } ]; }; diff --git a/systems/amd-server-vm/configuration.nix b/systems/amd-server-vm/configuration.nix index 23abc5d..882e69d 100644 --- a/systems/amd-server-vm/configuration.nix +++ b/systems/amd-server-vm/configuration.nix @@ -1,4 +1,10 @@ -{ config, pkgs, modulesPath, lib, ... }: +{ + config, + pkgs, + modulesPath, + lib, + ... +}: { imports = [ # Include the results of the hardware scan. @@ -19,7 +25,10 @@ ]; boot = { - kernelParams = [ "console=tty0" "console=ttyS0" ]; + kernelParams = [ + "console=tty0" + "console=ttyS0" + ]; loader.timeout = lib.mkForce 1; loader.grub = { @@ -52,17 +61,44 @@ let kavita = "/data/kavita"; gitolite = "/var/lib/gitolite"; - mail = [ "/data/vmail" "/var/lib/opendkim" ]; - syncthing = [ "/data/synced/default/" "/data/synced/work_drive/" ]; - syncthingFull = syncthing - ++ [ "/data/synced/fh/" "/data/synced/books/" ]; - backupPathsSmall = [ "/home" gitolite ] ++ syncthing ++ mail; - backupPathsMedium = [ "/home" gitolite ] ++ syncthing ++ mail; - backupPathsFull = [ "/home" kavita gitolite ] ++ syncthingFull ++ mail; + mail = [ + "/data/vmail" + "/var/lib/opendkim" + ]; + syncthing = [ + "/data/synced/default/" + "/data/synced/work_drive/" + ]; + syncthingFull = syncthing ++ [ + "/data/synced/fh/" + "/data/synced/books/" + ]; + backupPathsSmall = [ + "/home" + gitolite + ] + ++ syncthing + ++ mail; + backupPathsMedium = [ + "/home" + gitolite + ] + ++ syncthing + ++ mail; + backupPathsFull = [ + "/home" + kavita + gitolite + ] + ++ syncthingFull + ++ mail; in { enable = true; - excludePaths = lib.mkOptionDefault [ "${kavita}/manga" "/home/anon/projects" ]; + excludePaths = lib.mkOptionDefault [ + "${kavita}/manga" + "/home/anon/projects" + ]; small = backupPathsSmall; # goes to backblaze medium = backupPathsMedium; # goes to gdrive large = backupPathsFull; # goes to local storage medium @@ -108,7 +144,11 @@ services.xserver.videoDrivers = [ "vmware" ]; # 8888 = scheibenmeister skip button - networking.firewall.allowedTCPPorts = [ 25565 25566 8888 ]; + networking.firewall.allowedTCPPorts = [ + 25565 + 25566 + 8888 + ]; networking.nftables.tables.ip_drop = { family = "inet"; content = '' @@ -145,21 +185,32 @@ fileSystems."/data" = { device = "/dev/disk/by-uuid/d117419d-fce9-4d52-85c7-e3481feaa22a"; fsType = "btrfs"; - options = [ "compress=zstd" "noatime" "nofail" ]; + options = [ + "compress=zstd" + "noatime" + "nofail" + ]; }; fileSystems."/1tbssd" = { device = "/dev/disk/by-uuid/801d9217-9c38-4ca8-914e-e31361603892"; fsType = "ext4"; - options = [ "defaults" "nofail" "noatime" ]; + options = [ + "defaults" + "nofail" + "noatime" + ]; }; fileSystems."/hdd" = { device = "/dev/disk/by-uuid/99954059-3801-4abb-a536-0e7802a3e6b4"; fsType = "ext4"; - options = [ "defaults" "nofail" "noatime" ]; + options = [ + "defaults" + "nofail" + "noatime" + ]; }; - # Configure console keymap console.keyMap = "us"; diff --git a/systems/amd-server-vm/disk-config.nix b/systems/amd-server-vm/disk-config.nix index d075579..d479090 100644 --- a/systems/amd-server-vm/disk-config.nix +++ b/systems/amd-server-vm/disk-config.nix @@ -1,5 +1,6 @@ # Example to create a bios compatible gpt partition -{ lib, ... }: { +{ lib, ... }: +{ disko.devices = { disk.main = { device = lib.mkDefault "/dev/vda"; @@ -28,7 +29,10 @@ type = "btrfs"; extraArgs = [ "-f" ]; # Override existing partition mountpoint = "/"; - mountOptions = [ "compress=zstd" "noatime" ]; + mountOptions = [ + "compress=zstd" + "noatime" + ]; }; }; }; diff --git a/systems/amd-server-vm/mail.nix b/systems/amd-server-vm/mail.nix index f07973e..e5f8956 100644 --- a/systems/amd-server-vm/mail.nix +++ b/systems/amd-server-vm/mail.nix @@ -1,10 +1,15 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: let # create hash -> dovecot -O pw tmp_dovecot_passwords = '' - lukas:{CRYPT}$2y$05$jqBkvhJ0e439J0PLhef4leOGc3GACGH83kSDCrvmAcsdz68tELkA6:5000:5000::/home/lukas"; - work:{CRYPT}$2y$05$bEpY1WJ4j/QovgUv0Pxak.vKcSC/o.0T9OHxaekUpI1GK5mAY6vQS:5000:5000::/home/work"; - school:{CRYPT}$2y$05$RRIjDak/PWhHITKMvGJ9b.MSMrsduUXjLJOfuXQ0k.pQX24shAsq2:5000:5000::/home/school"; + lukas:{CRYPT}$2y$05$jqBkvhJ0e439J0PLhef4leOGc3GACGH83kSDCrvmAcsdz68tELkA6:5000:5000::/home/lukas"; + work:{CRYPT}$2y$05$bEpY1WJ4j/QovgUv0Pxak.vKcSC/o.0T9OHxaekUpI1GK5mAY6vQS:5000:5000::/home/work"; + school:{CRYPT}$2y$05$RRIjDak/PWhHITKMvGJ9b.MSMrsduUXjLJOfuXQ0k.pQX24shAsq2:5000:5000::/home/school"; ''; email-domain = "kopatz.dev"; in @@ -12,7 +17,11 @@ in # 25 = stmp -> postfix # 143 = imap -> dovecot # 587 = submission -> postfix - networking.firewall.allowedTCPPorts = [ 25 143 587 ]; + networking.firewall.allowedTCPPorts = [ + 25 + 143 + 587 + ]; users = { users = { vmail = { @@ -42,25 +51,33 @@ in type = "inet"; private = false; command = "smtpd"; - args = [ "-o syslog_name=postfix/submission" - "-o smtpd_tls_security_level=encrypt" - "-o smtpd_sasl_auth_enable=yes" - "-o smtpd_client_restrictions=permit_sasl_authenticated,reject" - # TODO: look into check_sender_access hash:/etc/postfix/sender_access - # reject_unknown_sender_domain blocks internal git from evolit - #"-o smtpd_sender_restrictions=" - "-o smtpd_recipient_restrictions=reject_non_fqdn_recipient,reject_unknown_recipient_domain,permit_sasl_authenticated,reject" - "-o smtpd_relay_restrictions=permit_sasl_authenticated,reject" - "-o milter_macro_daemon_name=ORIGINATING" - ]; + args = [ + "-o syslog_name=postfix/submission" + "-o smtpd_tls_security_level=encrypt" + "-o smtpd_sasl_auth_enable=yes" + "-o smtpd_client_restrictions=permit_sasl_authenticated,reject" + # TODO: look into check_sender_access hash:/etc/postfix/sender_access + # reject_unknown_sender_domain blocks internal git from evolit + #"-o smtpd_sender_restrictions=" + "-o smtpd_recipient_restrictions=reject_non_fqdn_recipient,reject_unknown_recipient_domain,permit_sasl_authenticated,reject" + "-o smtpd_relay_restrictions=permit_sasl_authenticated,reject" + "-o milter_macro_daemon_name=ORIGINATING" + ]; }; }; main = { myhostname = "${email-domain}"; mydomain = "${email-domain}"; #myorigin = "$mydomain"; - mynetworks = [ "127.0.0.0/8" "192.168.0.0/24" "192.168.2.0/24" ]; - mydestination = [ "localhost.$mydomain" "localhost" ]; + mynetworks = [ + "127.0.0.0/8" + "192.168.0.0/24" + "192.168.2.0/24" + ]; + mydestination = [ + "localhost.$mydomain" + "localhost" + ]; message_size_limit = 25600000; # 25MB recipient_delimiter = "+"; virtual_mailbox_domains = [ "${email-domain}" ]; @@ -74,15 +91,21 @@ in # TLS settings # server settings / SMTP TLS configuration for inbound connections smtpd_tls_security_level = "may"; - smtpd_tls_chain_files = [ "/var/lib/acme/${email-domain}/key.pem " "/var/lib/acme/${email-domain}/fullchain.pem " ]; + smtpd_tls_chain_files = [ + "/var/lib/acme/${email-domain}/key.pem " + "/var/lib/acme/${email-domain}/fullchain.pem " + ]; smtpd_tls_received_header = "yes"; smtpd_tls_auth_only = "yes"; # disable AUTH over non-encrypted connections smtpd_tls_ciphers = "high"; # ciphers used in opportunistic TLS smtpd_tls_exclude_ciphers = "aNULL, MD5, DES"; # exclude weak ciphers smtpd_tls_protocols = ">=TLSv1.2"; #client settings / SMTP TLS configuration for outbound connections - smtp_tls_chain_files = [ "/var/lib/acme/${email-domain}/key.pem " "/var/lib/acme/${email-domain}/fullchain.pem " ]; # private key followed by cert chain - smtp_tls_security_level = "may"; #opportunistic TLS + smtp_tls_chain_files = [ + "/var/lib/acme/${email-domain}/key.pem " + "/var/lib/acme/${email-domain}/fullchain.pem " + ]; # private key followed by cert chain + smtp_tls_security_level = "may"; # opportunistic TLS smtp_tls_ciphers = "high"; # ciphers used in opportunistic TLS smtp_tls_exclude_ciphers = "aNULL, MD5, DES"; # exclude weak ciphers smtp_tls_protocols = ">=TLSv1.2"; @@ -182,7 +205,7 @@ in } namespace inbox { inbox = yes - + # Autocreate special folders mailbox Drafts { special_use = \Drafts diff --git a/systems/amd-server-vpn-vm/configuration.nix b/systems/amd-server-vpn-vm/configuration.nix index ea5b1de..ce364ed 100644 --- a/systems/amd-server-vpn-vm/configuration.nix +++ b/systems/amd-server-vpn-vm/configuration.nix @@ -1,4 +1,10 @@ -{ config, pkgs, modulesPath, lib, ... }: +{ + config, + pkgs, + modulesPath, + lib, + ... +}: { imports = [ @@ -16,7 +22,10 @@ ]; boot = { - kernelParams = [ "console=tty0" "console=ttyS0" ]; + kernelParams = [ + "console=tty0" + "console=ttyS0" + ]; loader.timeout = lib.mkForce 1; loader.grub.enable = true; @@ -72,8 +81,8 @@ # settings = { # server_url = "http://0.0.0.0:8080"; # logtail.enable = false; - # dns = { - # base_domain = "kopatz.dev"; + # dns = { + # base_domain = "kopatz.dev"; # override_local_dns = false; # }; # }; diff --git a/systems/amd-server-vpn-vm/disk-config.nix b/systems/amd-server-vpn-vm/disk-config.nix index d075579..d479090 100644 --- a/systems/amd-server-vpn-vm/disk-config.nix +++ b/systems/amd-server-vpn-vm/disk-config.nix @@ -1,5 +1,6 @@ # Example to create a bios compatible gpt partition -{ lib, ... }: { +{ lib, ... }: +{ disko.devices = { disk.main = { device = lib.mkDefault "/dev/vda"; @@ -28,7 +29,10 @@ type = "btrfs"; extraArgs = [ "-f" ]; # Override existing partition mountpoint = "/"; - mountOptions = [ "compress=zstd" "noatime" ]; + mountOptions = [ + "compress=zstd" + "noatime" + ]; }; }; }; diff --git a/systems/amd-server-vpn-vm/hardware.nix b/systems/amd-server-vpn-vm/hardware.nix index 47fb942..c5bb989 100644 --- a/systems/amd-server-vpn-vm/hardware.nix +++ b/systems/amd-server-vpn-vm/hardware.nix @@ -1,19 +1,30 @@ -{ config, lib, pkgs, modulesPath, ... }: +{ + config, + lib, + pkgs, + modulesPath, + ... +}: { - imports = - [ (modulesPath + "/profiles/qemu-guest.nix") - ]; + imports = [ + (modulesPath + "/profiles/qemu-guest.nix") + ]; - boot.initrd.availableKernelModules = [ "ahci" "xhci_pci" "virtio_pci" "virtio_blk" ]; + boot.initrd.availableKernelModules = [ + "ahci" + "xhci_pci" + "virtio_pci" + "virtio_blk" + ]; boot.initrd.kernelModules = [ ]; boot.kernelModules = [ "kvm-amd" ]; boot.extraModulePackages = [ ]; - fileSystems."/" = - { device = "/dev/disk/by-uuid/f222513b-ded1-49fa-b591-20ce86a2fe7f"; - fsType = "ext4"; - }; + fileSystems."/" = { + device = "/dev/disk/by-uuid/f222513b-ded1-49fa-b591-20ce86a2fe7f"; + fsType = "ext4"; + }; swapDevices = [ ]; diff --git a/systems/amd-server/configuration.nix b/systems/amd-server/configuration.nix index 9b21c3a..f8ef7b0 100644 --- a/systems/amd-server/configuration.nix +++ b/systems/amd-server/configuration.nix @@ -1,6 +1,11 @@ # 0000:2b:00.0 VGA compatible controller [0300]: NVIDIA Corporation GM204 [GeForce GTX 970] [10de:13c2] (rev a1) # 0000:2b:00.1 Audio device [0403]: NVIDIA Corporation GM204 High Definition Audio Controller [10de:0fbb] (rev a1) -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: { imports = [ @@ -28,7 +33,10 @@ ssd.enable = true; vfio = { enable = true; - stub_pci = [ "10de:13c2" "10de:0fbb" ]; #nvidia + stub_pci = [ + "10de:13c2" + "10de:0fbb" + ]; # nvidia }; wooting.enable = true; }; @@ -56,23 +64,33 @@ }; mainUser.layout = "de"; mainUser.variant = "us"; - services.xserver.displayManager.lightdm.enable = false; #no login manager! + services.xserver.displayManager.lightdm.enable = false; # no login manager! nix.gc.automatic = lib.mkForce false; networking = { useDHCP = false; defaultGateway.address = "192.168.0.1"; - nameservers = [ "192.168.0.10" "1.1.1.1" ]; + nameservers = [ + "192.168.0.10" + "1.1.1.1" + ]; - bridges.br0 = { interfaces = [ "enp42s0" ]; }; + bridges.br0 = { + interfaces = [ "enp42s0" ]; + }; interfaces.br0 = { - ipv4.addresses = [{ - address = "192.168.0.20"; - prefixLength = 24; - }]; + ipv4.addresses = [ + { + address = "192.168.0.20"; + prefixLength = 24; + } + ]; }; - firewall.allowedTCPPorts = [ 25565 25566 ]; # localsend + firewall.allowedTCPPorts = [ + 25565 + 25566 + ]; # localsend }; @@ -130,8 +148,10 @@ boot.blacklistedKernelModules = [ "k10temp" ]; networking.hostName = "amd-server"; # Define your hostname. - nixpkgs.config.permittedInsecurePackages = - [ "electron-28.3.3" "electron-27.3.11" ]; + nixpkgs.config.permittedInsecurePackages = [ + "electron-28.3.3" + "electron-27.3.11" + ]; # List packages installed in system profile. To search, run: # $ nix search wget diff --git a/systems/amd-server/hardware-configuration-intel.nix b/systems/amd-server/hardware-configuration-intel.nix index 01e98fd..e12e9bf 100644 --- a/systems/amd-server/hardware-configuration-intel.nix +++ b/systems/amd-server/hardware-configuration-intel.nix @@ -1,12 +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" "nvme" "uas" "sd_mod" ]; + boot.initrd.availableKernelModules = [ + "xhci_pci" + "ahci" + "nvme" + "uas" + "sd_mod" + ]; boot.initrd.kernelModules = [ ]; boot.kernelModules = [ "kvm-intel" ]; boot.extraModulePackages = [ ]; @@ -19,7 +31,10 @@ fileSystems."/boot" = { device = "/dev/disk/by-uuid/AE1C-16B9"; fsType = "vfat"; - options = [ "fmask=0077" "dmask=0077" ]; + options = [ + "fmask=0077" + "dmask=0077" + ]; }; swapDevices = [ ]; @@ -33,6 +48,5 @@ nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; - hardware.cpu.amd.updateMicrocode = - lib.mkDefault config.hardware.enableRedistributableFirmware; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; } diff --git a/systems/amd-server/hardware-configuration.nix b/systems/amd-server/hardware-configuration.nix index 50747a6..ae4636a 100644 --- a/systems/amd-server/hardware-configuration.nix +++ b/systems/amd-server/hardware-configuration.nix @@ -1,13 +1,25 @@ # 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" "nvme" "usbhid" "usb_storage" "sd_mod" ]; + boot.initrd.availableKernelModules = [ + "xhci_pci" + "ahci" + "nvme" + "usbhid" + "usb_storage" + "sd_mod" + ]; boot.initrd.kernelModules = [ ]; boot.kernelModules = [ "kvm-amd" ]; boot.extraModulePackages = [ ]; @@ -15,13 +27,19 @@ fileSystems."/" = { device = "/dev/disk/by-uuid/a3c34c9e-06be-49dc-a5d3-4156defa11e7"; fsType = "btrfs"; - options = [ "defaults" "noatime"]; + options = [ + "defaults" + "noatime" + ]; }; fileSystems."/boot" = { device = "/dev/disk/by-uuid/AE1C-16B9"; fsType = "vfat"; - options = [ "fmask=0077" "dmask=0077" ]; + options = [ + "fmask=0077" + "dmask=0077" + ]; }; swapDevices = [ ]; @@ -34,6 +52,5 @@ # networking.interfaces.enp6s0.useDHCP = lib.mkDefault true; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - hardware.cpu.amd.updateMicrocode = - lib.mkDefault config.hardware.enableRedistributableFirmware; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; } diff --git a/systems/laptop/configuration.nix b/systems/laptop/configuration.nix index 179fab4..ba058b9 100644 --- a/systems/laptop/configuration.nix +++ b/systems/laptop/configuration.nix @@ -1,4 +1,10 @@ -{ config, pkgs, inputs, lib, ... }: +{ + config, + pkgs, + inputs, + lib, + ... +}: let cec = "${pkgs.v4l-utils}/bin/cec-ctl"; in @@ -102,7 +108,10 @@ in }; }; - nixpkgs.config.permittedInsecurePackages = [ "electron-27.3.11" "electron-28.3.3" ]; + nixpkgs.config.permittedInsecurePackages = [ + "electron-27.3.11" + "electron-28.3.3" + ]; hardware.cpu.amd.ryzen-smu.enable = true; environment.systemPackages = with pkgs; [ nvtopPackages.amd @@ -144,8 +153,10 @@ in ]; }; - age.identityPaths = - [ "/home/kopatz/.ssh/id_ed25519" "/etc/ssh/ssh_host_ed25519_key" ]; + age.identityPaths = [ + "/home/kopatz/.ssh/id_ed25519" + "/etc/ssh/ssh_host_ed25519_key" + ]; mainUser.layout = "de_us_swapped"; mainUser.variant = ""; console.useXkbConfig = true; diff --git a/systems/laptop/disk-config.nix b/systems/laptop/disk-config.nix index b9dd7ca..ef94adb 100644 --- a/systems/laptop/disk-config.nix +++ b/systems/laptop/disk-config.nix @@ -1,5 +1,6 @@ # Example to create a bios compatible gpt partition -{ lib, ... }: { +{ lib, ... }: +{ disko.devices = { disk.main = { device = lib.mkDefault "/dev/nvme0n1"; @@ -7,33 +8,33 @@ content = { type = "gpt"; partitions = { - ESP = { - size = "1G"; - type = "EF00"; + ESP = { + size = "1G"; + type = "EF00"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + mountOptions = [ "umask=0077" ]; + }; + }; + root = { + size = "100%"; + content = { + # LUKS passphrase will be prompted interactively only + type = "luks"; + name = "crypted"; + settings = { + allowDiscards = true; + }; content = { type = "filesystem"; - format = "vfat"; - mountpoint = "/boot"; - mountOptions = [ "umask=0077" ]; + format = "ext4"; + mountpoint = "/"; + mountOptions = [ "noatime" ]; + }; }; - root = { - size = "100%"; - content = { - # LUKS passphrase will be prompted interactively only - type = "luks"; - name = "crypted"; - settings = { - allowDiscards = true; - }; - content = { - type = "filesystem"; - format = "ext4"; - mountpoint = "/"; - mountOptions = [ "noatime" ]; - - }; - }; }; }; }; diff --git a/systems/laptop/hardware-configuration.nix b/systems/laptop/hardware-configuration.nix index 2d85ebe..8c260da 100644 --- a/systems/laptop/hardware-configuration.nix +++ b/systems/laptop/hardware-configuration.nix @@ -1,16 +1,25 @@ # 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" "usb_storage" "uas" "sd_mod" "rtsx_pci_sdmmc" "thunderbolt"]; - boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "thunderbolt" ]; + boot.initrd.availableKernelModules = [ + "nvme" + "xhci_pci" + "thunderbolt" + ]; boot.initrd.kernelModules = [ ]; boot.kernelModules = [ "kvm-amd" ]; diff --git a/systems/laptop/modules/battery.nix b/systems/laptop/modules/battery.nix index 906b3f6..aaa00ba 100644 --- a/systems/laptop/modules/battery.nix +++ b/systems/laptop/modules/battery.nix @@ -6,7 +6,10 @@ services.system76-scheduler.settings.cfsProfiles.enable = true; services.upower.enable = true; - environment.systemPackages = with pkgs; [ gnome-power-manager powertop ]; + environment.systemPackages = with pkgs; [ + gnome-power-manager + powertop + ]; # Enable TLP (better than gnomes internal power manager) services.tlp = { @@ -19,11 +22,11 @@ CPU_ENERGY_PERF_POLICY_ON_BAT = "balance_power"; CPU_ENERGY_PERF_POLICY_ON_AC = "performance"; - RADEON_POWER_PROFILE_ON_AC="performance"; - RADEON_POWER_PROFILE_ON_BAT="battery"; + RADEON_POWER_PROFILE_ON_AC = "performance"; + RADEON_POWER_PROFILE_ON_BAT = "battery"; - AMDGPU_ABM_LEVEL_ON_AC=0; - AMDGPU_ABM_LEVEL_ON_BAT=2; + AMDGPU_ABM_LEVEL_ON_AC = 0; + AMDGPU_ABM_LEVEL_ON_BAT = 2; #CPU_MIN_PERF_ON_AC = 0; #CPU_MAX_PERF_ON_AC = 100; diff --git a/systems/laptop/modules/rpi-stuffidk.nix b/systems/laptop/modules/rpi-stuffidk.nix index bff39e4..22fd433 100644 --- a/systems/laptop/modules/rpi-stuffidk.nix +++ b/systems/laptop/modules/rpi-stuffidk.nix @@ -10,12 +10,17 @@ in openFirewall = true; }; networking.interfaces."${pi_interface}" = { - ipv4.addresses = [{ - address = "192.168.1.1"; - prefixLength = 24; - }]; + ipv4.addresses = [ + { + address = "192.168.1.1"; + prefixLength = 24; + } + ]; }; - networking.firewall.allowedUDPPorts = [ 67 68 ]; + networking.firewall.allowedUDPPorts = [ + 67 + 68 + ]; services = { kea.dhcp4 = { enable = true; @@ -62,5 +67,4 @@ in }; }; - } diff --git a/systems/laptop/secrets/secrets.nix b/systems/laptop/secrets/secrets.nix index 4550c2f..dfc6ef2 100644 --- a/systems/laptop/secrets/secrets.nix +++ b/systems/laptop/secrets/secrets.nix @@ -5,5 +5,8 @@ let systems = [ laptop ]; in { - "wireguard-private.age".publicKeys = [ laptop-user laptop ]; + "wireguard-private.age".publicKeys = [ + laptop-user + laptop + ]; } diff --git a/systems/pc/configuration.nix b/systems/pc/configuration.nix index 145e0ae..d5d0519 100644 --- a/systems/pc/configuration.nix +++ b/systems/pc/configuration.nix @@ -2,7 +2,14 @@ # your system. Help is available in the configuration.nix(5) man page # and in the NixOS manual (accessible by running ‘nixos-help’). -{ config, pkgs, lib, inputs, ... }: { +{ + config, + pkgs, + lib, + inputs, + ... +}: +{ imports = [ # Include the results of the hardware scan. ./hardware-configuration.nix @@ -43,8 +50,15 @@ dns = "192.168.0.10"; #gateway = "192.168.0.10"; }; - misc = { docker.enable = true; }; - services = { syncthing = { enable = true; }; adguard.ip = "192.168.0.10"; }; + misc = { + docker.enable = true; + }; + services = { + syncthing = { + enable = true; + }; + adguard.ip = "192.168.0.10"; + }; hardware = { android.enable = true; amd-gpu = { @@ -107,7 +121,7 @@ services.searx = { enable = false; settings = { - use_default_settings=true; + use_default_settings = true; server.port = 8787; server.bind_address = "0.0.0.0"; server.secret_key = "1"; @@ -131,15 +145,13 @@ after = [ "graphical-session.target" ]; serviceConfig = { Type = "simple"; - ExecStart = - "${pkgs.scheibnkleister-presence}/bin/scheibnkleister-presence"; + ExecStart = "${pkgs.scheibnkleister-presence}/bin/scheibnkleister-presence"; Restart = "on-failure"; RestartSec = 1; TimeoutStopSec = 10; }; }; - # apple shit #services.usbmuxd.enable = true; environment.systemPackages = with pkgs; [ @@ -147,7 +159,8 @@ #kdePackages.qtdeclarative #libimobiledevice #ifuse # optional, to mount using 'ifuse' - (wl-clicker.overrideAttrs (old: { # wayland autoclicker + (wl-clicker.overrideAttrs (old: { + # wayland autoclicker src = pkgs.fetchFromGitHub { owner = "phonetic112"; repo = "wl-clicker"; @@ -237,17 +250,26 @@ '' ]; - networking.hosts = let - addr_to_domain_list = config.custom.services.adguard.rewrites |> map (x: { "${x.answer}" = [ x.domain ];} ); - flattened = builtins.foldl' (acc: elem: + networking.hosts = + let + addr_to_domain_list = + config.custom.services.adguard.rewrites + |> map (x: { + "${x.answer}" = [ x.domain ]; + }); + flattened = builtins.foldl' ( + acc: elem: let ip = builtins.head (builtins.attrNames elem); names = elem.${ip}; - in acc // { - ${ip} = (acc.${ip} or []) ++ names; + in + acc + // { + ${ip} = (acc.${ip} or [ ]) ++ names; } - ) {} addr_to_domain_list; - in flattened; + ) { } addr_to_domain_list; + in + flattened; # This value determines the NixOS release from which the default # settings for stateful data, like file locations and database versions diff --git a/systems/pc/hardware-configuration.nix b/systems/pc/hardware-configuration.nix index 5f21846..76a3e07 100644 --- a/systems/pc/hardware-configuration.nix +++ b/systems/pc/hardware-configuration.nix @@ -1,34 +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 = [ "nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ]; + boot.initrd.availableKernelModules = [ + "nvme" + "xhci_pci" + "ahci" + "usbhid" + "usb_storage" + "sd_mod" + ]; boot.initrd.kernelModules = [ ]; boot.kernelModules = [ "kvm-amd" ]; boot.extraModulePackages = [ ]; - fileSystems."/" = - { - device = "/dev/disk/by-uuid/dd65bdf8-c003-439c-a1aa-d050cb20959d"; - fsType = "ext4"; - options = [ - "defaults" - "noatime" - ]; - }; + fileSystems."/" = { + device = "/dev/disk/by-uuid/dd65bdf8-c003-439c-a1aa-d050cb20959d"; + fsType = "ext4"; + options = [ + "defaults" + "noatime" + ]; + }; - fileSystems."/boot" = - { - device = "/dev/disk/by-uuid/CC7C-CF82"; - fsType = "vfat"; - }; + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/CC7C-CF82"; + fsType = "vfat"; + }; swapDevices = [ ]; diff --git a/systems/pc/tailscale-client.nix b/systems/pc/tailscale-client.nix index 14e3775..53d08d6 100644 --- a/systems/pc/tailscale-client.nix +++ b/systems/pc/tailscale-client.nix @@ -1,4 +1,9 @@ -{pkgs, lib, config, ...}: +{ + pkgs, + lib, + config, + ... +}: { # Run tailscale up --login-server http:// services.tailscale.enable = true; diff --git a/systems/portable-ssd/configuration.nix b/systems/portable-ssd/configuration.nix index 7f43422..6a19d28 100644 --- a/systems/portable-ssd/configuration.nix +++ b/systems/portable-ssd/configuration.nix @@ -2,7 +2,12 @@ # your system. Help is available in the configuration.nix(5) man page, on # https://search.nixos.org/options and in the NixOS manual (`nixos-help`). -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: { imports = [ ../../modules/misc/kernel.nix ]; @@ -10,11 +15,23 @@ specialisation = { nvidia = { inheritParentConfig = true; - configuration = { custom = { hardware = { nvidia.enable = true; }; }; }; + configuration = { + custom = { + hardware = { + nvidia.enable = true; + }; + }; + }; }; amd-gpu = { inheritParentConfig = true; - configuration = { custom = { hardware = { amd-gpu.enable = true; }; }; }; + configuration = { + custom = { + hardware = { + amd-gpu.enable = true; + }; + }; + }; }; }; @@ -47,27 +64,50 @@ networking.useDHCP = lib.mkDefault true; networking.networkmanager.enable = true; - boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "ehci_pci" "nvme" "usbhid" "usb_storage" "sd_mod" "sd_mod" "rtsx_pci_sdmmc" "uas" "usbcore" "ehci_hcd" "uhci_hcd" "ohci_hcd" "scsi_mod" ]; + boot.initrd.availableKernelModules = [ + "xhci_pci" + "ahci" + "ehci_pci" + "nvme" + "usbhid" + "usb_storage" + "sd_mod" + "sd_mod" + "rtsx_pci_sdmmc" + "uas" + "usbcore" + "ehci_hcd" + "uhci_hcd" + "ohci_hcd" + "scsi_mod" + ]; fileSystems."/" = { device = "/dev/disk/by-label/nixos-ssd"; fsType = "ext4"; - options = [ "defaults" "noatime" ]; + options = [ + "defaults" + "noatime" + ]; }; fileSystems."/boot" = { device = "/dev/disk/by-uuid/7395-0541"; fsType = "vfat"; - options = [ "fmask=0077" "dmask=0077" ]; + options = [ + "fmask=0077" + "dmask=0077" + ]; }; # Use the systemd-boot EFI boot loader. boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; - networking.hostName = "portable-ssd"; # Define your hostname. - nixpkgs.config.permittedInsecurePackages = - [ "electron-28.3.3" "electron-27.3.11" ]; + nixpkgs.config.permittedInsecurePackages = [ + "electron-28.3.3" + "electron-27.3.11" + ]; # List packages installed in system profile. To search, run: # $ nix search wget diff --git a/systems/vm/configuration.nix b/systems/vm/configuration.nix index 848b162..bdd55a0 100644 --- a/systems/vm/configuration.nix +++ b/systems/vm/configuration.nix @@ -1,4 +1,11 @@ -{ pkgs, config, lib, modulesPath, ... }: { +{ + pkgs, + config, + lib, + modulesPath, + ... +}: +{ imports = [ ./vm-common.nix diff --git a/systems/vm/vm-common.nix b/systems/vm/vm-common.nix index 999a1ce..6a46cd5 100644 --- a/systems/vm/vm-common.nix +++ b/systems/vm/vm-common.nix @@ -1,10 +1,16 @@ -{ pkgs, lib, ... }: { +{ pkgs, lib, ... }: +{ services.xserver = { enable = true; - resolutions = lib.mkOverride 9 ([ ] ++ [{ - x = 1680; - y = 1050; - }]); + resolutions = lib.mkOverride 9 ( + [ ] + ++ [ + { + x = 1680; + y = 1050; + } + ] + ); }; virtualisation.vmVariant = { @@ -15,7 +21,10 @@ }; }; boot = { - kernelParams = [ "console=tty0" "console=ttyS0" ]; + kernelParams = [ + "console=tty0" + "console=ttyS0" + ]; loader.timeout = lib.mkForce 1; loader.grub = { diff --git a/users/anon/default.nix b/users/anon/default.nix index 3927598..4f4538c 100644 --- a/users/anon/default.nix +++ b/users/anon/default.nix @@ -1,8 +1,9 @@ -{ inputs -, pkgs -, lib -, config -, ... +{ + inputs, + pkgs, + lib, + config, + ... }: { imports = [ ../default.nix ]; @@ -19,7 +20,12 @@ description = config.mainUser.name; shell = pkgs.zsh; initialPassword = "cooltemporarypw"; - extraGroups = [ "networkmanager" "wheel" "docker" "wireshark" ]; + extraGroups = [ + "networkmanager" + "wheel" + "docker" + "wireshark" + ]; openssh.authorizedKeys.keys = [ config.mainUser.sshKey "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCuRAKtoU5rjSbjDxlac6oAww/XHgsVRFHwIVnVm/TrTtDNqRyAkr6fIUiSKTHrpBPyJjIKCzkHS8QhbS2zZo4wjcgAyMyK33q/CzLs8DPQMWX0RKxR+OaVNwh90iWHr663a5x7ztTag3oPGOAYjeqCoIJWyQRlvIKflriJnAjWE8nvw4QkErpRWo4JJnhS61GQMrPT6VK0yXzq3zQs2t3cXTvGMmeLjBuluvJ6yiDk2bAGdY2UWnbs1y2M1TD3xn0pHzITeQnoWLfy+cwPHnEulciVqyr4pp6LDygmIPI1rxKAIQUnwo09n/A1eIcqlUo8aKy7ZDyrssuGWKZ/U4FC258NWwdUPbjyQvzNdcZjXC4+AmQTb+DwiECYOCfF7O/uRRqoFl7jfVfKqHJ7DKebt20QKwDCH/d5qfDs6xA0Krl2dgu3vePhsOkmpnIfPk9Cxl+YHGfmpCOVQHhxCwpkQs0Oh7NerO3idnG1enckjCuzCotnL8vDhczdL4eZmus= kopatz@framework" diff --git a/users/anon/home.nix b/users/anon/home.nix index 74c8b7f..37ac0c4 100644 --- a/users/anon/home.nix +++ b/users/anon/home.nix @@ -1,4 +1,9 @@ -{ config, pkgs, inputs, ... }: +{ + config, + pkgs, + inputs, + ... +}: { home = { # This value determines the Home Manager release that your diff --git a/users/default.nix b/users/default.nix index 8bdc611..3fd10e9 100644 --- a/users/default.nix +++ b/users/default.nix @@ -1,8 +1,9 @@ -{ inputs -, pkgs -, lib -, config -, ... +{ + inputs, + pkgs, + lib, + config, + ... }: { imports = [ ./option.nix ]; diff --git a/users/kopatz/default.nix b/users/kopatz/default.nix index 6ab73e0..97fb325 100644 --- a/users/kopatz/default.nix +++ b/users/kopatz/default.nix @@ -1,8 +1,9 @@ -{ inputs -, pkgs -, lib -, config -, ... +{ + inputs, + pkgs, + lib, + config, + ... }: { imports = [ ../default.nix ]; @@ -22,7 +23,12 @@ initialPassword = "1"; description = config.mainUser.name; shell = pkgs.zsh; - extraGroups = [ "networkmanager" "wheel" "docker" "input" ]; + extraGroups = [ + "networkmanager" + "wheel" + "docker" + "input" + ]; openssh.authorizedKeys.keys = [ config.mainUser.sshKey ]; }; } diff --git a/users/kopatz/home.nix b/users/kopatz/home.nix index 50d0a3c..d57e9e1 100644 --- a/users/kopatz/home.nix +++ b/users/kopatz/home.nix @@ -1,4 +1,12 @@ -{ osConfig, config, pkgs, inputs, lib, ... }: { +{ + osConfig, + config, + pkgs, + inputs, + lib, + ... +}: +{ home = { # This value determines the Home Manager release that your # configuration is compatible with. This helps avoid breakage @@ -47,8 +55,14 @@ zoom_out = 5; }; keybindings = { - prev_img = [ "h" "Left" ]; - next_img = [ "l" "Right" ]; + prev_img = [ + "h" + "Left" + ]; + next_img = [ + "l" + "Right" + ]; }; }; @@ -58,8 +72,14 @@ exec = "kitty -d /home/kopatz/synced/default/vimwiki nvim /home/kopatz/synced/default/vimwiki/index.md"; icon = "nvim"; type = "Application"; - categories = [ "Utility" "TextEditor" ]; - mimeType = [ "text/markdown" "text/plain" ]; + categories = [ + "Utility" + "TextEditor" + ]; + mimeType = [ + "text/markdown" + "text/plain" + ]; }; }; } diff --git a/users/option.nix b/users/option.nix index b7d9f00..8c20e64 100644 --- a/users/option.nix +++ b/users/option.nix @@ -1,4 +1,9 @@ -{ lib, config, pkgs, ... }: +{ + lib, + config, + pkgs, + ... +}: { options = { mainUser = { diff --git a/users/vm/default.nix b/users/vm/default.nix index c6d4f44..a729f4b 100644 --- a/users/vm/default.nix +++ b/users/vm/default.nix @@ -1,8 +1,17 @@ -{ inputs, pkgs, lib, config, ... }: { +{ + inputs, + pkgs, + lib, + config, + ... +}: +{ imports = [ ../default.nix ]; mainUser.name = "vm"; - home-manager = { users.${config.mainUser.name} = import ./home.nix; }; + home-manager = { + users.${config.mainUser.name} = import ./home.nix; + }; programs.zsh.enable = true; users.users.${config.mainUser.name} = { @@ -10,6 +19,10 @@ initialPassword = "test"; description = config.mainUser.name; shell = pkgs.zsh; - extraGroups = [ "networkmanager" "wheel" "docker" ]; + extraGroups = [ + "networkmanager" + "wheel" + "docker" + ]; }; } diff --git a/users/vm/home.nix b/users/vm/home.nix index 76a894c..eff5584 100644 --- a/users/vm/home.nix +++ b/users/vm/home.nix @@ -1,5 +1,13 @@ -{ config, pkgs, inputs, ... }: { - home = { stateVersion = "23.05"; }; +{ + config, + pkgs, + inputs, + ... +}: +{ + home = { + stateVersion = "23.05"; + }; imports = [ #../../home-manager/nvim.nix