diff --git a/modules/home/wayland/apps/kanshi/default.nix b/modules/home/wayland/apps/kanshi/default.nix index d119a80..3813f31 100644 --- a/modules/home/wayland/apps/kanshi/default.nix +++ b/modules/home/wayland/apps/kanshi/default.nix @@ -1,95 +1,95 @@ -{ config, lib,... }: { +{ config, lib, ... }: { config = lib.mkIf (config.usercfg.wm == "Wayland") { - services.kanshi = { - enable = true; - systemdTarget = "graphical-session.target"; - profiles = { - tower_0 = { - outputs = [{ - criteria = "CEX CX133 0x00000001"; - mode = "1920x1200@59.972"; - position = "0,0"; - scale = 1.0; - status = "enable"; - }]; - }; - tower_1 = { - outputs = [{ - criteria = "AOC 16G3 1DDP7HA000348"; - mode = "1920x1080@144.000"; - position = "0,0"; - status = "enable"; - scale = 1.0; - adaptiveSync = true; - }]; - }; - tower_2 = { - outputs = [ - { - criteria = "AOC 16G3 1DDP7HA000348"; - mode = "1920x1080@144.000"; - position = "0,0"; - status = "enable"; - scale = 1.0; - adaptiveSync = true; - } - { + services.kanshi = { + enable = true; + systemdTarget = "graphical-session.target"; + profiles = { + tower_0 = { + outputs = [{ criteria = "CEX CX133 0x00000001"; mode = "1920x1200@59.972"; - position = "0,1080"; - scale = 1.0; - status = "enable"; - } - ]; - }; - laptop_0 = { - outputs = [{ - criteria = "LG Display 0x060A Unknown"; - mode = "1920x1080@60.020"; - position = "0,0"; - scale = 1.0; - status = "enable"; - }]; - }; - laptop_1 = { - outputs = [ - { - criteria = "CEX CX133 0x00000001"; - mode = "2560x1600@59.972"; position = "0,0"; scale = 1.0; status = "enable"; - } - { - criteria = "LG Display 0x060A Unknown"; - mode = "1920x1080@60.020"; - position = "2560,0"; - scale = 1.0; - status = "enable"; - } - ]; - }; - laptop_2 = { - outputs = [ - { + }]; + }; + tower_1 = { + outputs = [{ criteria = "AOC 16G3 1DDP7HA000348"; mode = "1920x1080@144.000"; position = "0,0"; status = "enable"; scale = 1.0; adaptiveSync = true; - } - { + }]; + }; + tower_2 = { + outputs = [ + { + criteria = "AOC 16G3 1DDP7HA000348"; + mode = "1920x1080@144.000"; + position = "0,0"; + status = "enable"; + scale = 1.0; + adaptiveSync = true; + } + { + criteria = "CEX CX133 0x00000001"; + mode = "1920x1200@59.972"; + position = "0,1080"; + scale = 1.0; + status = "enable"; + } + ]; + }; + laptop_0 = { + outputs = [{ criteria = "LG Display 0x060A Unknown"; mode = "1920x1080@60.020"; - position = "1920,0"; + position = "0,0"; scale = 1.0; status = "enable"; - } - ]; + }]; + }; + laptop_1 = { + outputs = [ + { + criteria = "CEX CX133 0x00000001"; + mode = "2560x1600@59.972"; + position = "0,0"; + scale = 1.0; + status = "enable"; + } + { + criteria = "LG Display 0x060A Unknown"; + mode = "1920x1080@60.020"; + position = "2560,0"; + scale = 1.0; + status = "enable"; + } + ]; + }; + laptop_2 = { + outputs = [ + { + criteria = "AOC 16G3 1DDP7HA000348"; + mode = "1920x1080@144.000"; + position = "0,0"; + status = "enable"; + scale = 1.0; + adaptiveSync = true; + } + { + criteria = "LG Display 0x060A Unknown"; + mode = "1920x1080@60.020"; + position = "1920,0"; + scale = 1.0; + status = "enable"; + } + ]; + }; }; }; }; -}; } diff --git a/modules/nixos/gui/greet/default.nix b/modules/nixos/gui/greet/default.nix index bb87405..92a341f 100644 --- a/modules/nixos/gui/greet/default.nix +++ b/modules/nixos/gui/greet/default.nix @@ -1,5 +1,4 @@ -{ lib, config, pkgs, ... }: -{ +{ lib, config, pkgs, ... }: { config = lib.mkIf (config.syscfg.make.gui) { services.greetd = { diff --git a/modules/nixos/system/hw/boot/default.nix b/modules/nixos/system/hw/boot/default.nix index f8f8a18..a164474 100644 --- a/modules/nixos/system/hw/boot/default.nix +++ b/modules/nixos/system/hw/boot/default.nix @@ -1,12 +1,16 @@ -{ ... }: { - boot.loader = { - systemd-boot = { - enable = true; - configurationLimit = 8; - }; - efi = { - canTouchEfiVariables = true; - efiSysMountPoint = "/boot/efi"; +{ lib, config, ... }: +let isCI = builtins.elem config.syscfg.hostname [ "ci" "sandbox" ]; +in { + config = lib.mkIf (!isCI) { + boot.loader = { + systemd-boot = { + enable = true; + configurationLimit = 8; + }; + efi = { + canTouchEfiVariables = true; + efiSysMountPoint = "/boot/efi"; + }; }; }; } diff --git a/modules/nixos/system/hw/power/default.nix b/modules/nixos/system/hw/power/default.nix index a0a4dfc..5a92060 100644 --- a/modules/nixos/system/hw/power/default.nix +++ b/modules/nixos/system/hw/power/default.nix @@ -1,7 +1,5 @@ -{ lib, config, pkgs, ... }: -let cfg = config.syscfg.make.power; -in { - config = lib.mkIf cfg { +{ lib, config, pkgs, ... }: { + config = lib.mkIf (config.syscfg.make.power) { services.tlp = { enable = true; settings = { diff --git a/modules/nixos/system/hw/virt/default.nix b/modules/nixos/system/hw/virt/default.nix index 42bcdc2..ebbc0a0 100644 --- a/modules/nixos/system/hw/virt/default.nix +++ b/modules/nixos/system/hw/virt/default.nix @@ -1,11 +1,9 @@ -{ lib, config, pkgs, ... }: -let cfg = config.syscfg.make.virt; -in { - config = lib.mkIf cfg { +{ lib, config, pkgs, ... }: { + config = lib.mkIf (config.syscfg.make.virt) { - environment.systemPackages = [ pkgs.qemu ]; + #environment.systemPackages = [ pkgs.qemu ]; virtualisation = { - libvirtd.enable = true; + #libvirtd.enable = true; # waydroid.enable = true; # lxd.enable = true; docker = { diff --git a/modules/nixos/system/network/wifi/default.nix b/modules/nixos/system/network/wifi/default.nix index ceda69d..329f5ea 100644 --- a/modules/nixos/system/network/wifi/default.nix +++ b/modules/nixos/system/network/wifi/default.nix @@ -1,9 +1,7 @@ -{ lib, config, ... }: -let cfg = config.syscfg.net.wlp; -in { - config = lib.mkIf cfg.enable { +{ lib, config, ... }: { + config = lib.mkIf (config.syscfg.net.wlp.enable) { networking.supplicant = { - "${cfg.nif}" = { + "${config.syscfg.net.wlp.nif}" = { configFile.path = config.sops.secrets.wifi.path; extraConf = '' network={ diff --git a/modules/nixos/system/network/wireguard/default.nix b/modules/nixos/system/network/wireguard/default.nix index e4ee3cf..43990a5 100644 --- a/modules/nixos/system/network/wireguard/default.nix +++ b/modules/nixos/system/network/wireguard/default.nix @@ -1,19 +1,21 @@ -{ config, ... }: { - networking.wireguard = { - enable = true; - interfaces = { - wg0 = { - ips = [ config.syscfg.net.wg.ip4 config.syscfg.net.wg.ip6 ]; - privateKeyFile = - config.sops.secrets."${config.syscfg.hostname}_wg_priv".path; - listenPort = 1515; - mtu = 1340; - peers = [{ - allowedIPs = [ "10.10.1.0/24" "fd10:10:10::0/64" ]; - endpoint = "vpn.helcel.net:1515"; - publicKey = "NFBJvYXZC+bd62jhrKnM7/pugidWhgR6+C5qIiUiq3Q="; - persistentKeepalive = 30; - }]; +{ config, lib, ... }: { + config = lib.mkIf (config.syscfg.net.wg.enable) { + networking.wireguard = { + enable = true; + interfaces = { + wg0 = { + ips = [ config.syscfg.net.wg.ip4 config.syscfg.net.wg.ip6 ]; + privateKeyFile = + config.sops.secrets."${config.syscfg.hostname}_wg_priv".path; + listenPort = 1515; + mtu = 1340; + peers = [{ + allowedIPs = [ "10.10.1.0/24" "fd10:10:10::0/64" ]; + endpoint = "vpn.helcel.net:1515"; + publicKey = "NFBJvYXZC+bd62jhrKnM7/pugidWhgR6+C5qIiUiq3Q="; + persistentKeepalive = 30; + }]; + }; }; }; }; diff --git a/modules/nixos/system/xdg/default.nix b/modules/nixos/system/xdg/default.nix index 4dd7009..ee4dd78 100644 --- a/modules/nixos/system/xdg/default.nix +++ b/modules/nixos/system/xdg/default.nix @@ -1,14 +1,14 @@ { config, lib, pkgs, ... }: { - xdg.portal = { - enable = true; - # wlr.enable = true; - extraPortals = with pkgs; [ - xdg-desktop-portal-hyprland - xdg-desktop-portal-gtk - ]; - config.common.default = [ "hyprland" "gtk" ]; - }; + xdg.portal = { + enable = true; + # wlr.enable = true; + extraPortals = with pkgs; [ + xdg-desktop-portal-hyprland + xdg-desktop-portal-gtk + ]; + config.common.default = [ "hyprland" "gtk" ]; + }; environment.sessionVariables = rec { GBM_BACKEND = "amd-drm"; diff --git a/modules/nixos/tools/debug/default.nix b/modules/nixos/tools/debug/default.nix index 5245c1a..3f8c2da 100644 --- a/modules/nixos/tools/debug/default.nix +++ b/modules/nixos/tools/debug/default.nix @@ -1,6 +1,9 @@ -{ pkgs, config, ... }: { - programs.adb.enable = true; - programs.wireshark.enable = true; +{ pkgs, config, lib, ... }: { - environment.systemPackages = with pkgs; [ wget dconf wireshark ]; + config = lib.mkIf (config.syscfg.make.develop) { + programs.adb.enable = true; + programs.wireshark.enable = true; + + environment.systemPackages = with pkgs; [ wget dconf wireshark ]; + }; } diff --git a/modules/shared/syscfg/default.nix b/modules/shared/syscfg/default.nix index 2618c42..62eec72 100644 --- a/modules/shared/syscfg/default.nix +++ b/modules/shared/syscfg/default.nix @@ -3,7 +3,7 @@ let userOpt = with lib; { username = mkOption { type = types.str; }; wm = mkOption { - type = types.enum [ "Wayland" "X11" "-"]; + type = types.enum [ "Wayland" "X11" "-" ]; default = "-"; }; git = {