From 6ba0196a5cc237a263ce0210b920bbd5d38fac0c Mon Sep 17 00:00:00 2001 From: Raghuram Subramani Date: Thu, 16 Jan 2025 16:31:42 +0530 Subject: update --- config/plasma/default.nix | 117 +++++++++++++++++++++++++++++++++++++++++++ flake.lock | 58 ++++++++++++++------- flake.nix | 8 ++- machines/x/configuration.nix | 9 ++-- machines/x/home.nix | 11 ++-- modules/core/bluetooth.nix | 2 +- modules/core/fonts.nix | 3 +- modules/laptop.nix | 4 +- modules/login.nix | 4 +- modules/plasma.nix | 14 ++++++ modules/virtualization.nix | 30 +++++++++++ 11 files changed, 227 insertions(+), 33 deletions(-) create mode 100644 config/plasma/default.nix diff --git a/config/plasma/default.nix b/config/plasma/default.nix new file mode 100644 index 0000000..94ebfb1 --- /dev/null +++ b/config/plasma/default.nix @@ -0,0 +1,117 @@ +{ home, pkgs, ... }: + +{ + home.packages = [ + pkgs.bibata-cursors + pkgs.papirus-icon-theme + ]; + + gtk = { + enable = true; + + theme = { name = "Breeze"; }; + iconTheme = { name = "Papirus-Dark"; }; + + font = { name = "UbuntuMono Nerd Font Mono"; }; + }; + + programs.plasma = { + enable = true; + + workspace = { + lookAndFeel = "org.kde.breezedark.desktop"; + cursor = { + theme = "Bibata-Modern-Classic"; + size = 18; + }; + iconTheme = "Papirus-Dark"; + wallpaper = "/config/dist/wallpaper.jpg"; + }; + + fonts = { + general = { + family = "UbuntuMono Nerd Font"; + pointSize = 10; + }; + + fixedWidth = { + family = "UbuntuMono Nerd Font Mono"; + pointSize = 10; + }; + }; + + hotkeys.commands."launch-alacritty" = { + name = "Launch Alacritty"; + key = "Ctrl+Alt+T"; + command = "alacritty"; + }; + + kwin = { + edgeBarrier = 0; + cornerBarrier = false; + + titlebarButtons.left = []; + titlebarButtons.right = [ "minimize" "maximize" "close"]; + + effects.shakeCursor.enable = true; + effects.translucency.enable = true; + effects.wobblyWindows.enable = true; + }; + + shortcuts = { + kwin = { + "Window Operations Menu" = "Alt+Space"; + }; + }; + + input.mice = [ + { + vendorId = "06cb"; + productId = "ce81"; + name = "DLL0C55:00 06CB:CE81 Touchpad"; + middleButtonEmulation = true; + naturalScroll = true; + } + ]; + + panels = [ + { + location = "bottom"; + widgets = [ + { + name = "org.kde.plasma.kickoff"; + config = { + General = { + alphaSort = true; + }; + }; + } + + { + iconTasks = { + launchers = []; + }; + } + + "org.kde.plasma.marginsseparator" + + { + systemTray.items = { + shown = [ + "org.kde.plasma.battery" + "org.kde.plasma.bluetooth" + "org.kde.plasma.networkmanagement" + "org.kde.plasma.volume" + ]; + }; + } + { + digitalClock = { + time.format = "24h"; + }; + } + ]; + } + ]; + }; +} diff --git a/flake.lock b/flake.lock index fc4af04..c9ad6e9 100644 --- a/flake.lock +++ b/flake.lock @@ -7,11 +7,11 @@ ] }, "locked": { - "lastModified": 1736199437, - "narHash": "sha256-TdU0a/x8048rbbJmkKWzSY1CtsbbGKNkIJcMdr8Zf4Q=", + "lastModified": 1736711425, + "narHash": "sha256-8hKhPQuMtXfJi+4lPvw3FBk/zSJVHeb726Zo0uF1PP8=", "owner": "nix-community", "repo": "disko", - "rev": "49f8aa791f81ff2402039b3efe0c35b9386c4bcf", + "rev": "f720e64ec37fa16ebba6354eadf310f81555cc07", "type": "github" }, "original": { @@ -45,11 +45,11 @@ ] }, "locked": { - "lastModified": 1736277415, - "narHash": "sha256-kPDXF6cIPsVqSK08XF5EC6KM7BdMnM9vtJDzsnf+lLU=", + "lastModified": 1736785676, + "narHash": "sha256-TY0jUwR3EW0fnS0X5wXMAVy6h4Z7Y6a3m+Yq++C9AyE=", "owner": "nix-community", "repo": "home-manager", - "rev": "5c4302313d9207f7ec0886d68f8ff4a3c71209a1", + "rev": "fc52a210b60f2f52c74eac41a8647c1573d2071d", "type": "github" }, "original": { @@ -60,11 +60,11 @@ }, "impermanence": { "locked": { - "lastModified": 1734945620, - "narHash": "sha256-olIfsfJK4/GFmPH8mXMmBDAkzVQ1TWJmeGT3wBGfQPY=", + "lastModified": 1736688610, + "narHash": "sha256-1Zl9xahw399UiZSJ9Vxs1W4WRFjO1SsNdVZQD4nghz0=", "owner": "nix-community", "repo": "impermanence", - "rev": "d000479f4f41390ff7cf9204979660ad5dd16176", + "rev": "c64bed13b562fc3bb454b48773d4155023ac31b7", "type": "github" }, "original": { @@ -75,11 +75,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1736311665, - "narHash": "sha256-N8Rti16BvvxGKFWwl5xSaDyrJHnGKIvhwNlfsRYzBgU=", + "lastModified": 1737022245, + "narHash": "sha256-AkDUWBsc4WJXGSRFb7UUDwecDAaybFj1YvvDZhY4V7g=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "dfc2a331f2acbcecae02739a68b9a33e61a03a9b", + "rev": "1bda1e50be0d0ae1ecd4f4b707c680bc3ec6c22b", "type": "github" }, "original": { @@ -91,27 +91,51 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1736200483, - "narHash": "sha256-JO+lFN2HsCwSLMUWXHeOad6QUxOuwe9UOAF/iSl1J4I=", + "lastModified": 1736883708, + "narHash": "sha256-uQ+NQ0/xYU0N1CnXsa2zghgNaOPxWpMJXSUJJ9W7140=", "owner": "nixos", "repo": "nixpkgs", - "rev": "3f0a8ac25fb674611b98089ca3a5dd6480175751", + "rev": "eb62e6aa39ea67e0b8018ba8ea077efe65807dc8", "type": "github" }, "original": { "owner": "nixos", - "ref": "nixos-24.11", + "ref": "nixos-unstable", "repo": "nixpkgs", "type": "github" } }, + "plasma-manager": { + "inputs": { + "home-manager": [ + "home-manager" + ], + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1736549395, + "narHash": "sha256-XzwkB62Tt5UYoL1jXiHzgk/qz2fUpGHExcSIbyGTtI0=", + "owner": "nix-community", + "repo": "plasma-manager", + "rev": "a53af7f1514ef4cce8620a9d6a50f238cdedec8b", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "plasma-manager", + "type": "github" + } + }, "root": { "inputs": { "disko": "disko", "grub2-themes": "grub2-themes", "home-manager": "home-manager", "impermanence": "impermanence", - "nixpkgs": "nixpkgs_2" + "nixpkgs": "nixpkgs_2", + "plasma-manager": "plasma-manager" } } }, diff --git a/flake.nix b/flake.nix index 582211f..df732a2 100644 --- a/flake.nix +++ b/flake.nix @@ -3,7 +3,7 @@ inputs = { # Nixpkgs - nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11"; + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; # Home manager home-manager = { @@ -11,6 +11,12 @@ inputs.nixpkgs.follows = "nixpkgs"; }; + plasma-manager = { + url = "github:nix-community/plasma-manager"; + inputs.nixpkgs.follows = "nixpkgs"; + inputs.home-manager.follows = "home-manager"; + }; + # Disko disko = { url = "github:nix-community/disko"; diff --git a/machines/x/configuration.nix b/machines/x/configuration.nix index ae1682b..edfe0ba 100644 --- a/machines/x/configuration.nix +++ b/machines/x/configuration.nix @@ -27,10 +27,10 @@ in { "virtualization.nix" "remapcapslock.nix" - "wm_utils.nix" - "polkit.nix" + # "wm_utils.nix" + # "polkit.nix" "login.nix" - # "plasma.nix" + "plasma.nix" ]); boot.loader = { @@ -59,6 +59,9 @@ in { programs.fuse.userAllowOther = true; home-manager = { extraSpecialArgs = { inherit inputs; }; + useGlobalPkgs = true; + useUserPackages = true; + sharedModules = [ inputs.plasma-manager.homeManagerModules.plasma-manager ]; users = { "compromyse" = import ./home.nix; }; diff --git a/machines/x/home.nix b/machines/x/home.nix index 3f754dc..636987f 100644 --- a/machines/x/home.nix +++ b/machines/x/home.nix @@ -55,13 +55,14 @@ "nvim" # "qtile" - "dwl.nix" - "themes.nix" - "way-displays" - "swaylock" - "dunst" + # "dwl.nix" + # "themes.nix" + # "way-displays" + # "swaylock" + # "dunst" "alacritty" + "plasma" ]); home.stateVersion = "23.11"; diff --git a/modules/core/bluetooth.nix b/modules/core/bluetooth.nix index 5e64d97..fbd9b48 100644 --- a/modules/core/bluetooth.nix +++ b/modules/core/bluetooth.nix @@ -3,5 +3,5 @@ { hardware.bluetooth.enable = true; hardware.bluetooth.powerOnBoot = true; - services.blueman.enable = true; + # services.blueman.enable = true; } diff --git a/modules/core/fonts.nix b/modules/core/fonts.nix index 7f1d51d..b842dd9 100644 --- a/modules/core/fonts.nix +++ b/modules/core/fonts.nix @@ -2,8 +2,7 @@ { fonts.packages = with pkgs; [ - # nerd-fonts.ubuntu-mono - (nerdfonts.override { fonts = [ "UbuntuMono" ]; }) + nerd-fonts.ubuntu-mono noto-fonts noto-fonts-cjk-sans noto-fonts-emoji diff --git a/modules/laptop.nix b/modules/laptop.nix index 3dfdd29..092e61f 100644 --- a/modules/laptop.nix +++ b/modules/laptop.nix @@ -1,7 +1,7 @@ { pkgs, config, ... }: { - services.tlp = { + /* services.tlp = { enable = true; settings = { CPU_SCALING_GOVERNOR_ON_AC = "performance"; @@ -10,7 +10,7 @@ CPU_ENERGY_PERF_POLICY_ON_BAT = "power"; CPU_ENERGY_PERF_POLICY_ON_AC = "performance"; }; - }; + }; */ boot = { kernelModules = [ "acpi_call" ]; diff --git a/modules/login.nix b/modules/login.nix index 0789cff..ee4e29d 100644 --- a/modules/login.nix +++ b/modules/login.nix @@ -10,8 +10,8 @@ enable = true; settings = { default_session = { - # command = "tuigreet --time --remember --cmd \"startplasma-wayland\""; - command = "tuigreet --time --remember --cmd \"dwl -s dwlb\""; + command = "tuigreet --time --remember --cmd \"startplasma-wayland\""; + # command = "tuigreet --time --remember --cmd \"dwl -s dwlb\""; user = "greeter"; }; }; diff --git a/modules/plasma.nix b/modules/plasma.nix index 6fbe589..ea06802 100644 --- a/modules/plasma.nix +++ b/modules/plasma.nix @@ -2,4 +2,18 @@ { services.desktopManager.plasma6.enable = true; + environment.plasma6.excludePackages = with pkgs.kdePackages; [ + plasma-browser-integration + konsole + elisa + ark + gwenview + okular + kate + khelpcenter + dolphin + dolphin-plugins + baloo-widgets + krdp + ]; } diff --git a/modules/virtualization.nix b/modules/virtualization.nix index a92ffb9..02d5d93 100644 --- a/modules/virtualization.nix +++ b/modules/virtualization.nix @@ -51,6 +51,36 @@ in systemctl set-property --runtime -- system.slice AllowedCPUs="" systemctl set-property --runtime -- init.scope AllowedCPUs="" '') + + (pkgs.writeShellScriptBin "vfio-bind" '' + sudo modprobe -r nvidia_drm nvidia_modeset nvidia_uvm i2c_nvidia_gpu nvidia + + sudo modprobe vfio + sudo modprobe vfio_iommu_type1 + sudo modprobe vfio_pci + + systemctl --user -M compromyse@ stop pipewire.service pipewire.socket + + sudo virsh nodedev-detach pci_0000_01_00_0 + sudo virsh nodedev-detach pci_0000_01_00_1 + + systemctl --user -M compromyse@ restart pipewire.service pipewire.socket + '') + + (pkgs.writeShellScriptBin "vfio-unbind" '' + systemctl --user -M compromyse@ stop pipewire.service pipewire.socket + + sudo virsh nodedev-reattach pci_0000_01_00_0 + sudo virsh nodedev-reattach pci_0000_01_00_1 + + systemctl --user -M compromyse@ restart pipewire.service pipewire.socket + + sudo modprobe -r vfio_pci + sudo modprobe -r vfio_iommu_type1 + sudo modprobe -r vfio + + sudo modprobe nvidia_drm nvidia_modeset nvidia_uvm i2c_nvidia_gpu nvidia + '') ]; boot = { -- cgit v1.2.3