From ad816fe171820d3c4570bfcd227eb0e692255bf6 Mon Sep 17 00:00:00 2001 From: Chris Kruining Date: Thu, 20 Mar 2025 16:39:56 +0100 Subject: [PATCH] back to building state --- hosts/manwe/default.nix | 1 - hosts/manwe/hardware.nix | 2 - hosts/orome/default.nix | 2 +- hosts/orome/hardware.nix | 2 - hosts/ulmo/hardware.nix | 2 - lib/nixos.nix | 1 + modules/home/desktop/plasma.nix | 214 ++++++++++++-------------- modules/home/shell/default.nix | 14 ++ modules/home/shell/toolset/eza.nix | 26 ++++ modules/home/shell/toolset/yazi.nix | 18 +++ modules/home/shell/zsh.nix | 1 + modules/system/networking/default.nix | 30 ++-- modules/system/system/audio.nix | 1 - modules/system/system/bluetooth.nix | 33 ++++ 14 files changed, 207 insertions(+), 140 deletions(-) create mode 100644 modules/home/shell/toolset/eza.nix create mode 100644 modules/home/shell/toolset/yazi.nix create mode 100644 modules/system/system/bluetooth.nix diff --git a/hosts/manwe/default.nix b/hosts/manwe/default.nix index 9574d38..ca2872f 100644 --- a/hosts/manwe/default.nix +++ b/hosts/manwe/default.nix @@ -13,7 +13,6 @@ modules = { system.audio.enable = true; - networking.enable = true; # EXPERIMENTS services.auth.enable = true; diff --git a/hosts/manwe/hardware.nix b/hosts/manwe/hardware.nix index 97ac14a..856f139 100644 --- a/hosts/manwe/hardware.nix +++ b/hosts/manwe/hardware.nix @@ -28,8 +28,6 @@ in extraModulePackages = [ ]; }; - networking.useDHCP = mkDefault true; - nixpkgs.hostPlatform = mkDefault "x86_64-linux"; hardware.cpu.intel.updateMicrocode = mkDefault config.hardware.enableRedistributableFirmware; } diff --git a/hosts/orome/default.nix b/hosts/orome/default.nix index 82067c9..e6fd9ad 100644 --- a/hosts/orome/default.nix +++ b/hosts/orome/default.nix @@ -2,6 +2,6 @@ { modules = { system.audio.enable = true; - networking.enable = true; + system.bluetooth.enable = true; }; } diff --git a/hosts/orome/hardware.nix b/hosts/orome/hardware.nix index 09f9324..4e794e8 100644 --- a/hosts/orome/hardware.nix +++ b/hosts/orome/hardware.nix @@ -26,8 +26,6 @@ in extraModulePackages = [ ]; }; - networking.useDHCP = mkDefault true; - nixpkgs.hostPlatform = mkDefault "x86_64-linux"; hardware.cpu.intel.updateMicrocode = mkDefault config.hardware.enableRedistributableFirmware; } diff --git a/hosts/ulmo/hardware.nix b/hosts/ulmo/hardware.nix index e7ecc5d..e8c481b 100644 --- a/hosts/ulmo/hardware.nix +++ b/hosts/ulmo/hardware.nix @@ -26,8 +26,6 @@ in extraModulePackages = [ ]; }; - networking.useDHCP = mkDefault true; - nixpkgs.hostPlatform = mkDefault "x86_64-linux"; hardware.cpu.intel.updateMicrocode = mkDefault config.hardware.enableRedistributableFirmware; } diff --git a/lib/nixos.nix b/lib/nixos.nix index c8630af..f095725 100644 --- a/lib/nixos.nix +++ b/lib/nixos.nix @@ -27,6 +27,7 @@ in rec inputs.nixos-boot.nixosModules.default ({ options, config, ...}: { nixpkgs.pkgs = pkgs; + networking.hostName = mkDefault (removeSuffix ".nix" (baseNameOf path)); system = { diff --git a/modules/home/desktop/plasma.nix b/modules/home/desktop/plasma.nix index 5c3121d..7b30c96 100644 --- a/modules/home/desktop/plasma.nix +++ b/modules/home/desktop/plasma.nix @@ -37,131 +37,113 @@ in environment.sessionVariables.NIXOS_OZONE_WL = "1"; - environment.plasma6.excludePackages = with pkgs.kdePackages; [ - konsole - ]; + environment.plasma6.excludePackages = with pkgs.kdePackages; [ konsole kate ghostwriter ]; # should enable theme integration with gtk apps (i.e. firefox, thunderbird) programs.dconf.enable = true; - home-manager.users.${user}.programs = { - plasma = { - enable = true; - - workspace = { - lookAndFeel = "org.kde.breezedark.desktop"; - wallpaper = "${pkgs.kdePackages.plasma-workspace-wallpapers}/share/wallpapers/Patak/contents/images/1080x1920.png"; - }; + home-manager.users.${user}.programs.plasma = { + enable = true; + immutableByDefault = true; + + workspace = { + lookAndFeel = "org.kde.breezedark.desktop"; + }; - hotkeys.commands."spectable" = { - name = "Launch Spectable"; - key = "Meta+Shift+S"; - command = "spectable captureRectangularRegion"; - }; + spectacle.shortcuts = { + captureRectangularRegion = "Meta+Shift+S"; + }; - kwin = { - edgeBarrier = 0; - cornerBarrier = false; - }; + kwin = { + edgeBarrier = 0; + cornerBarrier = false; - panels = [ - # Windows-like panel at the bottom - { - location = "bottom"; - widgets = [ - # We can configure the widgets by adding the name and config - # attributes. For example to add the the kickoff widget and set the - # icon to "nix-snowflake-white" use the below configuration. This will - # add the "icon" key to the "General" group for the widget in - # ~/.config/plasma-org.kde.plasma.desktop-appletsrc. - { - name = "org.kde.plasma.kickoff"; - config = { - General = { - icon = "nix-snowflake-white"; - alphaSort = true; - }; - }; - } - # Or you can configure the widgets by adding the widget-specific options for it. - # See modules/widgets for supported widgets and options for these widgets. - # For example: - { - kickoff = { - sortAlphabetically = true; - icon = "nix-snowflake-white"; - }; - } - # Adding configuration to the widgets can also for example be used to - # pin apps to the task-manager, which this example illustrates by - # pinning dolphin and konsole to the task-manager by default with widget-specific options. - { - iconTasks = { - launchers = [ - "applications:org.kde.dolphin.desktop" - "applications:org.kde.konsole.desktop" - ]; - }; - } - # Or you can do it manually, for example: - { - name = "org.kde.plasma.icontasks"; - config = { - General = { - launchers = [ - "applications:org.kde.dolphin.desktop" - "applications:org.kde.konsole.desktop" - ]; - }; - }; - } - # If no configuration is needed, specifying only the name of the - # widget will add them with the default configuration. - "org.kde.plasma.marginsseparator" - # If you need configuration for your widget, instead of specifying the - # the keys and values directly using the config attribute as shown - # above, plasma-manager also provides some higher-level interfaces for - # configuring the widgets. See modules/widgets for supported widgets - # and options for these widgets. The widgets below shows two examples - # of usage, one where we add a digital clock, setting 12h time and - # first day of the week to Sunday and another adding a systray with - # some modifications in which entries to show. - { - digitalClock = { - calendar.firstDayOfWeek = "sunday"; - time.format = "12h"; - }; - } - { - systemTray.items = { - # We explicitly show bluetooth and battery - shown = [ - "org.kde.plasma.battery" - "org.kde.plasma.bluetooth" - ]; - # And explicitly hide networkmanagement and volume - hidden = [ - "org.kde.plasma.networkmanagement" - "org.kde.plasma.volume" - ]; - }; - } - ]; - } - ]; + effects = { + translucency.enable = true; - configFile = { - baloofilerc."Basic Settings"."Indexing-Enabled" = false; - kwinrc."org.kde.kdecoration2".ButtonsOnLeft = "SF"; - kwinrc.Desktops.Number = { - value = 1; - immutable = true; + blur = { + enable = true; + strength = 5; + noiseStrength = 5; }; - kscreenlockerrc = { - Greeter.WallpaperPlugin = "org.kde.potd"; - # To use nested groups use / as a separator. In the below example, - # Provider will be added to [Greeter][Wallpaper][org.kde.potd][General]. - "Greeter/Wallpaper/org.kde.potd/General".Provider = "bing"; + + snapHelper.enable = true; + }; + }; + + panels = [ + # Windows-like panel at the bottom + { + location = "bottom"; + widgets = [ + "org.kde.plasma.kickoff" + { + name = "org.kde.plasma.icontasks"; + config = { + launchers = [ + "preferred://browser" + "applications:org.kde.konsole.desktop" + "applications:org.kde.dolphin.desktop" + "applications:equibop.desktop" + "applications:code.desktop" + "applications:com.obsproject.Studio" + "applications:spotify.desktop" + ]; + }; + } + "org.kde.plasma.systemtray" + "org.kde.plasma.digitalclock" + ]; + floating = true; + minLength = 1743; + maxLength = 1920; + hiding = "dodgewindows"; + } + ]; + + powerdevil = { + AC = { + powerButtonAction = "shutDown"; + whenLaptopLidClosed = "doNothing"; + + autoSuspend.action = "nothing"; + dimDisplay.enable = false; + + turnOffDisplay = { + idleTimeout = "never"; + }; + }; + battery = { + powerButtonAction = "shutDown"; + whenLaptopLidClosed = "doNothing"; + + autoSuspend.action = "nothing"; + dimDisplay.enable = false; + + turnOffDisplay = { + idleTimeout = "never"; + }; + }; + }; + + kscreenlocker = { + autoLock = false; + lockOnResume = false; + lockOnStartup = false; + + appearance = { + alwaysShowClock = true; + showMediaControls = true; + }; + }; + + configFile = { + kdeglobals = { + General = { + # enable font antialiasing + XftAntialias = true; + XftHintStyle = "hintslight"; + XftSubPixel = "rgb"; }; }; }; diff --git a/modules/home/shell/default.nix b/modules/home/shell/default.nix index 6fc8c56..4b252c8 100644 --- a/modules/home/shell/default.nix +++ b/modules/home/shell/default.nix @@ -31,6 +31,8 @@ in fzf.enable = true; starship.enable = true; tmux.enable = true; + yazi.enable = true; + eza.enable = true; }; home-manager.users.${user} = { @@ -41,9 +43,21 @@ in rgFull = pkgs.ripgrep.override {withPCRE2 = true;}; }; + home.shellAliases = { + ls = "eza -a"; + cat = "bat -pp"; + y = "yazi"; + zed = "zeditor ."; + }; + programs = { direnv = { enable = true; + config.global = { + load_dotenv = true; + strict_env = true; + hide_env_diff = true; + }; nix-direnv.enable = true; config.whitelist.prefix = ["/home"]; }; diff --git a/modules/home/shell/toolset/eza.nix b/modules/home/shell/toolset/eza.nix new file mode 100644 index 0000000..2d64dfb --- /dev/null +++ b/modules/home/shell/toolset/eza.nix @@ -0,0 +1,26 @@ +{ config, options, lib, pkgs, user, ... }: +let + inherit (lib.modules) mkIf; + inherit (lib.strings) concatStringsSep; + inherit (lib.options) mkEnableOption; + + cfg = config.modules.${user}.shell.toolset.eza; +in +{ + options.modules.${user}.shell.toolset.eza = { + enable = mkEnableOption "system-monitor"; + }; + + config = mkIf cfg.enable { + home-manager.users.${user}.programs.eza = { + enable = true; + icons = "auto"; + git = true; + extraOptions = [ + "--hyperlink" + "--across" + "--group-directories-first" + ]; + }; + }; +} diff --git a/modules/home/shell/toolset/yazi.nix b/modules/home/shell/toolset/yazi.nix new file mode 100644 index 0000000..27f0f51 --- /dev/null +++ b/modules/home/shell/toolset/yazi.nix @@ -0,0 +1,18 @@ +{ config, options, lib, pkgs, user, ... }: +let + inherit (lib.modules) mkIf; + inherit (lib.strings) concatStringsSep; +in +{ + options.modules.${user}.shell.toolset.yazi = let + inherit (lib.options) mkEnableOption; + in { + enable = mkEnableOption "system-monitor"; + }; + + config = mkIf config.modules.${user}.shell.toolset.yazi.enable { + home-manager.users.${user}.programs.yazi = { + enable = true; + }; + }; +} diff --git a/modules/home/shell/zsh.nix b/modules/home/shell/zsh.nix index 3eab612..3bdccd4 100644 --- a/modules/home/shell/zsh.nix +++ b/modules/home/shell/zsh.nix @@ -34,6 +34,7 @@ in programs = { starship.enableZshIntegration = true; + yazi.enableZshIntegration = true; zsh = { enable = true; diff --git a/modules/system/networking/default.nix b/modules/system/networking/default.nix index 6e29e7e..d8cdec7 100644 --- a/modules/system/networking/default.nix +++ b/modules/system/networking/default.nix @@ -1,30 +1,30 @@ -{ - config, - options, - lib, - pkgs, - ... -}: let - inherit (lib.meta) getExe; - inherit (lib.modules) mkDefault mkIf mkMerge; +{ config, options, lib, pkgs, ... }: let + inherit (lib.modules) mkDefault; + inherit (lib.options) mkOption; cfg = config.modules.networking; in { - options.modules.networking = let - inherit (lib.options) mkEnableOption; - in { - enable = mkEnableOption "network manager"; + options.modules.networking = { + wifi.backend = mkOption { + type = with lib.types; enum [ "wpa_supplicant" "iwd" ]; + default = "wpa_supplicant"; + example = "wpa_supplicant"; + description = "set the backend used for wifi wpa_supplicant by default"; + }; }; - config = mkIf cfg.enable { + config = { systemd.services.NetworkManager-wait-online.enable = false; networking = { + enableIPv6 = true; + useDHCP = mkDefault true; + firewall.enable = true; networkmanager = { enable = mkDefault true; - wifi.backend = "wpa_supplicant"; + wifi.backend = mkDefault config.modules.networking.wifi.backend; }; }; }; diff --git a/modules/system/system/audio.nix b/modules/system/system/audio.nix index c2dcae7..e29afa9 100644 --- a/modules/system/system/audio.nix +++ b/modules/system/system/audio.nix @@ -24,7 +24,6 @@ in enable = true; wireplumber.enable = true; pulse.enable = true; -# jack.enable = true; alsa = { enable = true; diff --git a/modules/system/system/bluetooth.nix b/modules/system/system/bluetooth.nix new file mode 100644 index 0000000..480f129 --- /dev/null +++ b/modules/system/system/bluetooth.nix @@ -0,0 +1,33 @@ +{ config, options, lib, pkgs, ... }: +let + inherit (lib.attrsets) attrValues; + inherit (lib.modules) mkIf; + + cfg = config.modules.system.bluetooth; +in +{ + options.modules.system.bluetooth = let + inherit (lib.options) mkEnableOption; + in + { + enable = mkEnableOption "enable bluetooth"; + }; + + config = mkIf cfg.enable { + hardware = { + bluetooth = { + enable = true; + powerOnBoot = true; + }; + }; + + services.pipewire.wireplumber.extraConfig.bluetoothEnhancements = { + "monitor.bluez.properties" = { + "bluez5.enable-sbc-xq" = true; + "bluez5.enable-msbc" = true; + "bluez5.enable-hw-volume" = true; + "bluez5.roles" = [ "hsp_hs" "hsp_ag" "hfp_hf" "hfp_ag" ]; + }; + }; + }; +}