From b6e449dd48b953db249625ca95227281f634d177 Mon Sep 17 00:00:00 2001 From: alyx Date: Mon, 23 Feb 2026 17:32:32 +0000 Subject: [PATCH] waybar config, add calufrax (laptop), etc --- flake.nix | 22 +++++++ home/default.nix | 12 +++- home/waybar/cyberhack | 23 +++++++- home/waybar/cyberhack.css | 1 + home/wms/sway | 2 +- hosts/calufrax/default.nix | 72 +++++++++++++++++++++++ hosts/calufrax/hardware-configuration.nix | 33 +++++++++++ 7 files changed, 160 insertions(+), 5 deletions(-) create mode 100644 hosts/calufrax/default.nix create mode 100644 hosts/calufrax/hardware-configuration.nix diff --git a/flake.nix b/flake.nix index b73358f..5b90eb0 100644 --- a/flake.nix +++ b/flake.nix @@ -60,5 +60,27 @@ } ]; }; + nixosConfigurations."calufrax" = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + specialArgs = { inherit inputs; }; + modules = [ + ./hosts/calufrax + ./variables.nix + { config.var.username = "alyx"; + config.var.hostname = "calufrax"; + config.var.timezone = "Europe/London"; + config.var.class = "desktop"; + } + home-manager.nixosModules.home-manager { + home-manager.extraSpecialArgs = { + inherit inputs; + }; + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.sharedModules = [{ imports = with inputs; [nix-index-database.homeModules.default];}]; + home-manager.users.alyx = ./home; + } + ]; + }; }; } diff --git a/home/default.nix b/home/default.nix index 9427bf5..36bb09e 100644 --- a/home/default.nix +++ b/home/default.nix @@ -118,7 +118,17 @@ wayland.windowManager.sway.package = pkgs.swayfx; wayland.windowManager.sway.config = null; - wayland.windowManager.sway.extraConfigEarly = (if osConfig.var.username == "alyx" then ''set $mod Mod1'' else ''set $mod Mod4''); + #wayland.windowManager.sway.extraConfigEarly = (if osConfig.var.username == "alyx" then ''set $mod Mod1'' else ''set $mod Mod4''); + + wayland.windowManager.sway.extraConfigEarly = + (if osConfig.var.username == "alyx" then ''set $mod Mod1 + '' else ''set $mod Mod4 + '') + (if osConfig.var.hostname == "calufrax" then '' + input 1:1:AT_Translated_Set_2_keyboard { + xkb_layout "gb" + xkb_variant "colemak" + } + '' else ''''); wayland.windowManager.sway.extraConfig = '' include ~/.config/nixos/home/wms/sway diff --git a/home/waybar/cyberhack b/home/waybar/cyberhack index 5da7cb2..1bbbaaa 100644 --- a/home/waybar/cyberhack +++ b/home/waybar/cyberhack @@ -1,8 +1,8 @@ [{ "position": "top", -"modules-left": ["group/traydrawer", "custom/weather"], +"modules-left": ["group/traydrawer", "custom/weather", "battery", "power-profiles-daemon"], "modules-center": ["cpu", "group/mpdcontrols", "cpu#frequency"], -"modules-right": ["clock", "wireplumber", "battery", "memory", "disk", "group/poweroptions"], +"modules-right": ["clock", "wireplumber", "memory", "disk", "group/poweroptions"], "margin-top": 8, "margin-left": 8, "margin-right": 8, @@ -26,6 +26,18 @@ "tooltip-format": "BAT0, {power}W", }, +"power-profiles-daemon": { + "format": "{icon} {profile}", + "tooltip-format": "Power profile: {profile}\nDriver: {driver}", + "tooltip": true, + "format-icons": { + "default": "", + "performance": "", + "balanced": " ", + "power-saver": " " + } +}, + "group/mpdcontrols": { "orientation": "inherit", "drawer": { @@ -68,6 +80,11 @@ "format": " " }, +"tray": { + "icon-size": 15, + "spacing": 10, +}, + "custom/systemadvisory": { "format": "󱖫 " }, @@ -91,7 +108,7 @@ }, "custom/weather": { - "format": "{}°", + "format": " {}° ", "tooltip": true, "interval": 3600, "exec": "wttrbar --nerd --location edinburgh", diff --git a/home/waybar/cyberhack.css b/home/waybar/cyberhack.css index 0224e0e..540057a 100644 --- a/home/waybar/cyberhack.css +++ b/home/waybar/cyberhack.css @@ -10,6 +10,7 @@ #cpu, #cpu-frequency, #battery, +#power-profiles-daemon, #clock, #memory, #disk, diff --git a/home/wms/sway b/home/wms/sway index 37893e8..932d43e 100644 --- a/home/wms/sway +++ b/home/wms/sway @@ -149,7 +149,7 @@ exec "/nix/store/pb9dhpk6qxjybb8p7prvs18ls2vxk51a-dbus-1.14.10/bin/dbus-update-a blur enable corner_radius 10 -shadows enable - not using this because of flicker +shadows enable default_dim_inactive 0.3 client.focused 000000 00ffff 000000 00ffff for_window [title="Picture-in-Picture"] dim_inactive 0.0 diff --git a/hosts/calufrax/default.nix b/hosts/calufrax/default.nix new file mode 100644 index 0000000..6a69dc6 --- /dev/null +++ b/hosts/calufrax/default.nix @@ -0,0 +1,72 @@ +{ config, pkgs, lib, inputs, ...}:{ + + imports = [ + ./hardware-configuration.nix + ../generic.nix + ]; + + hardware.bluetooth.enable = true; + services.blueman.enable = true; + + boot.initrd.luks.devices = { + crypted = { + device = "/dev/disk/by-partuuid/5c614ca4-71bc-4ba7-a603-bf168f671533"; + allowDiscards = true; + preLVM = true; + }; + }; + + services.upower.enable = true; + services.power-profiles-daemon.enable = true; + + services.xserver.xkb = { + layout = lib.mkForce "gb"; + variant = lib.mkForce "colemak"; + }; + + console.useXkbConfig = true; + console.earlySetup = true; + + programs.bash.shellAliases = { + nano = "nvim"; + }; + + services.displayManager.ly = { + enable = true; + settings.animation = "colormix"; + }; + + boot.kernelModules = [ "kvm-intel" "vhost_vsock" "vfio_virqfd" "vhost-net" "vfio_pci" "vfio_iommu_type1" "vfio"]; + boot.kernelParams = [ "intel_iommu=on" "iommu=pt" "i915.force_probe=!7d51" "xe.force_probe=7d51" ]; + + services.printing.enable = true; + services.printing.drivers = [pkgs.gutenprint]; + + programs.virt-manager.enable = true; + users.groups.libvirtd.members = ["alyx"]; + virtualisation.libvirtd.enable = true; + virtualisation.libvirtd.onBoot = "ignore"; + virtualisation.libvirtd.onShutdown = "shutdown"; + virtualisation.libvirtd.qemu.package = pkgs.qemu_kvm; + virtualisation.libvirtd.qemu.swtpm.enable = true; + virtualisation.libvirtd.qemu.runAsRoot = true; + virtualisation.spiceUSBRedirection.enable = true; + + users.users."qemu-libvirtd" = { + extraGroups = [ "kvm" "input" ]; + isSystemUser = true; + }; + + boot.kernelPackages = pkgs.linuxKernel.packages.linux_xanmod_latest; + + hardware.graphics.extraPackages = with pkgs; [vpl-gpu-rt mesa.opencl libvdpau-va-gl intel-media-driver intel-vaapi-driver libva-vdpau-driver vulkan-validation-layers]; + hardware.graphics.extraPackages32 = with pkgs; [driversi686Linux.mesa.opencl]; + + + users.users.${config.var.username} = { + description = "Alyx Wren"; + extraGroups = [ "networkmanager" "wheel" "camera" "input" "adbusers" "inputs" "uinput" "pipewire" "kvm" "qemu-libvirt" "qemu-libvirtd" "lxd" "libvirtd" ]; + }; +} + + diff --git a/hosts/calufrax/hardware-configuration.nix b/hosts/calufrax/hardware-configuration.nix new file mode 100644 index 0000000..1c1ac30 --- /dev/null +++ b/hosts/calufrax/hardware-configuration.nix @@ -0,0 +1,33 @@ +# 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, ... }: + +{ + imports = + [ (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ "xhci_pci" "thunderbolt" "nvme" ]; + boot.initrd.kernelModules = [ "dm-snapshot" ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/mapper/vg-nixos"; + fsType = "xfs"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/C0F5-6023"; + fsType = "vfat"; + options = [ "fmask=0022" "dmask=0022" ]; + }; + + swapDevices = + [ { device = "/dev/mapper/vg-swap"; } + ]; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +}