From 91321fb3f667399d2be3c0e222c890b8bc675009 Mon Sep 17 00:00:00 2001 From: beanigen Date: Tue, 24 Jun 2025 19:23:31 +0800 Subject: [PATCH 1/2] pain --- base/callisto/configuration.nix | 13 ++- flake.lock | 170 +++++++++++++++++++++++++++----- flake.nix | 5 +- home/niri.nix | 141 ++++++++++++++++++++++++++ home/sway.nix | 1 + 5 files changed, 300 insertions(+), 30 deletions(-) create mode 100644 home/niri.nix diff --git a/base/callisto/configuration.nix b/base/callisto/configuration.nix index 18da599..30fe86c 100644 --- a/base/callisto/configuration.nix +++ b/base/callisto/configuration.nix @@ -2,7 +2,7 @@ # your system. Help is available in the configuration.nix(5) man page # and in the NixOS manual (accessible by running ‘nixos-help’). -{ config, pkgs, ... }: +{ config, pkgs, inputs, ... }: { imports = @@ -20,12 +20,13 @@ virtualisation.kvmgt = { enable = true; vgpus = { - "i915-GVTg_V4_8" = { + "i915-GVTg_V4_4" = { uuid = [ "b4c3049a-74a1-11ef-8112-df4a4be644fd" ]; }; }; }; services.gvfs.enable = true; + security.sudo.package = pkgs.sudo.override { withInsults = true; }; programs.thunderbird.enable = true; services.kmonad = { enable = true; @@ -100,6 +101,10 @@ NetworkManager.requires = ["ModemManager.service"]; }; + programs.niri = { + enable = true; + package = inputs.niri.packages.${pkgs.stdenv.hostPlatform.system}.niri-unstable; + }; services.tlp.enable = true; services.tlp.settings = { CPU_SCALING_GOVERNOR_ON_BAT = "ondemand"; @@ -185,9 +190,6 @@ xdg.portal = { enable = true; - wlr.enable = true; - extraPortals = [pkgs.xdg-desktop-portal-gtk]; - config.common.default = "*"; }; # Configure network proxy if necessary @@ -279,6 +281,7 @@ protonvpn-gui memtest86-efi edk2-uefi-shell + xwayland-satellite # wget ]; diff --git a/flake.lock b/flake.lock index 7d99868..7c25385 100644 --- a/flake.lock +++ b/flake.lock @@ -96,11 +96,11 @@ ] }, "locked": { - "lastModified": 1750127463, - "narHash": "sha256-K2xFtlD3PcKAZriOE3LaBLYmVfGQu+rIF4Jr1RFYR0Q=", + "lastModified": 1750730235, + "narHash": "sha256-rZErlxiV7ssvI8t7sPrKU+fRigNc2KvoKZG3gtUtK50=", "owner": "nix-community", "repo": "home-manager", - "rev": "28eef8722d1af18ca13e687dbf485e1c653a0402", + "rev": "d07e9cceb4994ed64a22b9b36f8b76923e87ac38", "type": "github" }, "original": { @@ -137,6 +137,62 @@ "type": "github" } }, + "niri": { + "inputs": { + "niri-stable": "niri-stable", + "niri-unstable": "niri-unstable", + "nixpkgs": "nixpkgs_2", + "nixpkgs-stable": "nixpkgs-stable", + "xwayland-satellite-stable": "xwayland-satellite-stable", + "xwayland-satellite-unstable": "xwayland-satellite-unstable" + }, + "locked": { + "lastModified": 1750735687, + "narHash": "sha256-pscxcZpLGcEEJGVjFAM7X77cARABc7M+zVyUN6qsEmU=", + "owner": "sodiboo", + "repo": "niri-flake", + "rev": "a581a91b7406a0b9039ef22e37e5166bd3b1a139", + "type": "github" + }, + "original": { + "owner": "sodiboo", + "repo": "niri-flake", + "type": "github" + } + }, + "niri-stable": { + "flake": false, + "locked": { + "lastModified": 1748151941, + "narHash": "sha256-z4viQZLgC2bIJ3VrzQnR+q2F3gAOEQpU1H5xHtX/2fs=", + "owner": "YaLTeR", + "repo": "niri", + "rev": "8ba57fcf25d2fc9565131684a839d58703f1dae7", + "type": "github" + }, + "original": { + "owner": "YaLTeR", + "ref": "v25.05.1", + "repo": "niri", + "type": "github" + } + }, + "niri-unstable": { + "flake": false, + "locked": { + "lastModified": 1750684365, + "narHash": "sha256-BqtoSRCgmutJXnQFZs+KFMNvp3LuX6POIHjXIxWdlTE=", + "owner": "YaLTeR", + "repo": "niri", + "rev": "4c02f3bba451747c3f337f4c131b0c7f9ef41bb7", + "type": "github" + }, + "original": { + "owner": "YaLTeR", + "repo": "niri", + "type": "github" + } + }, "nix-index-database": { "inputs": { "nixpkgs": [ @@ -144,11 +200,11 @@ ] }, "locked": { - "lastModified": 1749960154, - "narHash": "sha256-EWlr9MZDd+GoGtZB4QsDzaLyaDQPGnRY03MFp6u2wSg=", + "lastModified": 1750565152, + "narHash": "sha256-A6ZIoIgaPPkzIVxKuaxwEJicPOeTwC/MD9iuC3FVhDM=", "owner": "nix-community", "repo": "nix-index-database", - "rev": "424a40050cdc5f494ec45e46462d288f08c64475", + "rev": "78cd697acc2e492b4e92822a4913ffad279c20e6", "type": "github" }, "original": { @@ -193,19 +249,35 @@ "type": "github" } }, + "nixpkgs-stable": { + "locked": { + "lastModified": 1750622754, + "narHash": "sha256-kMhs+YzV4vPGfuTpD3mwzibWUE6jotw5Al2wczI0Pv8=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "c7ab75210cb8cb16ddd8f290755d9558edde7ee1", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-25.05", + "repo": "nixpkgs", + "type": "github" + } + }, "nixpkgs-xr": { "inputs": { "flake-compat": "flake-compat", "flake-utils": "flake-utils", - "nixpkgs": "nixpkgs_3", + "nixpkgs": "nixpkgs_4", "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1750210361, - "narHash": "sha256-k9l3fLchd9STS8pnz03165ZxXPSL24cGJ7REq9Wp+6g=", + "lastModified": 1750617326, + "narHash": "sha256-5H83I4cCw1XAduNneFzJ4momXFbujNvhTaAdFUjPLgw=", "owner": "nix-community", "repo": "nixpkgs-xr", - "rev": "d61bd4565e487503dd38b3fefed6c77ce6232323", + "rev": "860b5a8c984f161d1d15bb7bd841a4cce1dc2c22", "type": "github" }, "original": { @@ -216,11 +288,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1750134718, - "narHash": "sha256-v263g4GbxXv87hMXMCpjkIxd/viIF7p3JpJrwgKdNiI=", + "lastModified": 1750506804, + "narHash": "sha256-VLFNc4egNjovYVxDGyBYTrvVCgDYgENp5bVi9fPTDYc=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "9e83b64f727c88a7711a2c463a7b16eedb69a84c", + "rev": "4206c4cb56751df534751b058295ea61357bbbaa", "type": "github" }, "original": { @@ -232,11 +304,11 @@ }, "nixpkgs_3": { "locked": { - "lastModified": 1750134718, - "narHash": "sha256-v263g4GbxXv87hMXMCpjkIxd/viIF7p3JpJrwgKdNiI=", + "lastModified": 1750506804, + "narHash": "sha256-VLFNc4egNjovYVxDGyBYTrvVCgDYgENp5bVi9fPTDYc=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "9e83b64f727c88a7711a2c463a7b16eedb69a84c", + "rev": "4206c4cb56751df534751b058295ea61357bbbaa", "type": "github" }, "original": { @@ -248,11 +320,27 @@ }, "nixpkgs_4": { "locked": { - "lastModified": 1750122687, - "narHash": "sha256-zcGClfkXh4pckf4aGOZ18GFv73n1xHbdMWl17cPLouE=", + "lastModified": 1750365781, + "narHash": "sha256-XE/lFNhz5lsriMm/yjXkvSZz5DfvKJLUjsS6pP8EC50=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "c539ae8d21e49776966d714f82fba33b1fca78bc", + "rev": "08f22084e6085d19bcfb4be30d1ca76ecb96fe54", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_5": { + "locked": { + "lastModified": 1750605355, + "narHash": "sha256-xT8cPLTxlktxI9vSdoBlAVK7dXgd8IK59j7ZwzkkhnI=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "3078b9a9e75f1790e6d6ef9955fdc6a2d1740cc6", "type": "github" }, "original": { @@ -265,16 +353,16 @@ "nixvim": { "inputs": { "flake-parts": "flake-parts", - "nixpkgs": "nixpkgs_4", + "nixpkgs": "nixpkgs_5", "nuschtosSearch": "nuschtosSearch", "systems": "systems_3" }, "locked": { - "lastModified": 1750204267, - "narHash": "sha256-d1Sf8RdT9DmaoF03GAFFSHX8jRu2MciFdAi8Ki26nX8=", + "lastModified": 1750751277, + "narHash": "sha256-wdUjRFiiHK8sDmntP1wLYZEqKgju8bGedwulu+myD6E=", "owner": "nix-community", "repo": "nixvim", - "rev": "aef7b53979b89cea9f5eaebf96c16d3bdae150e2", + "rev": "3843b6226193bd2c40de0aea1343065b1bf9d3e4", "type": "github" }, "original": { @@ -310,9 +398,10 @@ "inputs": { "catppuccin": "catppuccin", "home-manager": "home-manager", + "niri": "niri", "nix-index-database": "nix-index-database", "nix-system-graphics": "nix-system-graphics", - "nixpkgs": "nixpkgs_2", + "nixpkgs": "nixpkgs_3", "nixpkgs-xr": "nixpkgs-xr", "nixvim": "nixvim", "system-manager": "system-manager" @@ -403,6 +492,39 @@ "repo": "treefmt-nix", "type": "github" } + }, + "xwayland-satellite-stable": { + "flake": false, + "locked": { + "lastModified": 1748488455, + "narHash": "sha256-IiLr1alzKFIy5tGGpDlabQbe6LV1c9ABvkH6T5WmyRI=", + "owner": "Supreeeme", + "repo": "xwayland-satellite", + "rev": "3ba30b149f9eb2bbf42cf4758d2158ca8cceef73", + "type": "github" + }, + "original": { + "owner": "Supreeeme", + "ref": "v0.6", + "repo": "xwayland-satellite", + "type": "github" + } + }, + "xwayland-satellite-unstable": { + "flake": false, + "locked": { + "lastModified": 1750686869, + "narHash": "sha256-FS/rYXd96VBtKNJRTV2xTpTk8CgrYP+lFsFj0+VKgoY=", + "owner": "Supreeeme", + "repo": "xwayland-satellite", + "rev": "117af56a83e2d1d25016fbd504a2a040babe586a", + "type": "github" + }, + "original": { + "owner": "Supreeeme", + "repo": "xwayland-satellite", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 23f2259..fdcf075 100644 --- a/flake.nix +++ b/flake.nix @@ -8,6 +8,7 @@ catppuccin.url = "github:catppuccin/nix"; nixpkgs-xr.url = "github:nix-community/nixpkgs-xr"; nixvim.url = "github:nix-community/nixvim"; + niri.url = "github:sodiboo/niri-flake"; nix-index-database.url = "github:nix-community/nix-index-database"; nix-index-database.inputs.nixpkgs.follows = "nixpkgs"; system-manager = { @@ -20,7 +21,7 @@ }; }; - outputs = inputs@{ self, nixpkgs, home-manager, system-manager, nixpkgs-xr, ...}:{ + outputs = inputs@{ self, nixpkgs, home-manager, system-manager, niri, nixpkgs-xr, ...}:{ nixosConfigurations."apollo" = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; modules = [ @@ -45,8 +46,10 @@ }; nixosConfigurations."callisto" = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; + specialArgs = {inherit inputs;}; modules = [ ./base/callisto + niri.nixosModules.niri home-manager.nixosModules.home-manager { home-manager.extraSpecialArgs = { inherit inputs; diff --git a/home/niri.nix b/home/niri.nix new file mode 100644 index 0000000..f26c392 --- /dev/null +++ b/home/niri.nix @@ -0,0 +1,141 @@ +{lib, osConfig, pkgs, inputs, vars, config, ...}:{ + programs.niri = { + settings = { + prefer-no-csd = true; + input.focus-follows-mouse.enable = true; + binds = with config.lib.niri.actions; { + "Mod+Return".action = spawn "foot"; + "XF86AudioRaiseVolume".action = spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "5%+"; + "XF86AudioLowerVolume".action = spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "5%-"; + "XF86AudioMute".action = spawn "wpctl" "set-mute" "@DEFAULT_AUDIO_SINK@" "toggle"; + "Mod+S".action = spawn "foot" "--title" "launch" "--app-id" "fzf-launcher-foot" "bash" "-c" "niri msg action spawn -- bash -c \"$(compgen -c | sort -u | fzf --bind=enter:replace-query+print-query) >/dev/null\""; + "Mod+W".action = spawn "hyprlock"; + "Mod+T".action = spawn "foot" "--title" "music" "--app-id" "mpd-control-foot" "ncmpcpp"; + "Mod+Shift+Q" = { + repeat = false; + action = close-window; + }; + "Mod+Y" = { + repeat = false; + action = toggle-overview; + }; + "Mod+Left".action = focus-column-left; + "Mod+Down".action = focus-window-down; + "Mod+Up".action = focus-window-up; + "Mod+Right".action = focus-column-right; + "Mod+H".action = focus-column-left; + "Mod+N".action = focus-window-down; + "Mod+E".action = focus-window-up; + "Mod+I".action = focus-column-right; + "Mod+Shift+Left".action = move-column-left; + "Mod+Shift+Down".action = move-window-down; + "Mod+Shift+Up".action = move-window-up; + "Mod+Shift+Right".action = move-column-right; + "Mod+Shift+H".action = move-column-left; + "Mod+Shift+N".action = move-window-down; + "Mod+Shift+E".action = move-window-up; + "Mod+Shift+I".action = move-column-right; + "Mod+Home".action = focus-column-first; + "Mod+End".action = focus-column-last; + "Mod+Shift+Home".action = move-column-to-first; + "Mod+Shift+End".action = move-column-to-last; + "Print".action = screenshot; + "Ctrl+Print".action = screenshot-window; + "Mod+Shift+F".action = quit; + "Mod+Shift+T".action = power-off-monitors; + "Mod+Shift+Space".action = toggle-window-floating; + "Mod+Shift+V".action = switch-focus-between-floating-and-tiling; + "Mod+F".action = maximize-column; + "Mod+Alt+F".action = fullscreen-window; + "Mod+Ctrl+F".action = expand-column-to-available-width; + "Mod+1".action = focus-workspace 1; + "Mod+2".action = focus-workspace 2; + "Mod+3".action = focus-workspace 3; + "Mod+4".action = focus-workspace 4; + "Mod+5".action = focus-workspace 5; + "Mod+6".action = focus-workspace 6; + "Mod+7".action = focus-workspace 7; + "Mod+8".action = focus-workspace 8; + "Mod+9".action = focus-workspace 9; + "Mod+Ctrl+Left".action = focus-monitor-left; + "Mod+Ctrl+Down".action = focus-monitor-down; + "Mod+Ctrl+Up".action = focus-monitor-up; + "Mod+Ctrl+Right".action = focus-monitor-right; + "Mod+Ctrl+H".action = focus-monitor-left; + "Mod+Ctrl+N".action = focus-monitor-down; + "Mod+Ctrl+E".action = focus-monitor-up; + "Mod+Ctrl+I".action = focus-monitor-right; + "Mod+Shift+Ctrl+Left".action = move-column-to-monitor-left; + "Mod+Shift+Ctrl+Down".action = move-column-to-monitor-down; + "Mod+Shift+Ctrl+Up".action = move-column-to-monitor-up; + "Mod+Shift+Ctrl+Right".action = move-column-to-monitor-right; + "Mod+Shift+Ctrl+H".action = move-column-to-monitor-left; + "Mod+Shift+Ctrl+N".action = move-column-to-monitor-down; + "Mod+Shift+Ctrl+E".action = move-column-to-monitor-up; + "Mod+Shift+Ctrl+I".action = move-column-to-monitor-right; + "Mod+Page_Down".action = focus-workspace-down; + "Mod+Page_Up".action = focus-workspace-up; + "Mod+L".action = focus-workspace-down; + "Mod+U".action = focus-workspace-up; + "Mod+Ctrl+Page_Down".action = focus-workspace-down; + "Mod+Ctrl+Page_Up".action = move-column-to-workspace-up; + "Mod+Ctrl+L".action = move-column-to-workspace-down; + "Mod+Ctrl+U".action = move-column-to-workspace-up; + "Mod+Shift+Page_Down".action = move-workspace-down; + "Mod+Shift+Page_Up".action = move-workspace-up; + "Mod+Shift+L".action = move-workspace-down; + "Mod+Shift+U".action = move-workspace-up; + "Mod+Comma".action = consume-window-into-column; + "Mod+Period".action = expel-window-from-column; + "Mod+P".action = switch-preset-column-width; + "Mod+Shift+P".action = switch-preset-window-height; + "Mod+Ctrl+P".action = reset-window-height; + "Mod+C".action = center-column; + "Mod+Ctrl+C".action = center-visible-columns; + "Mod+Minus".action = set-column-width "-10%"; + "Mod+Equal".action = set-column-width "+10%"; + "Mod+Shift+Minus".action = set-window-height "-10%"; + "Mod+Shift+Equal".action = set-window-height "+10%"; + }; + spawn-at-startup = [ + {command = ["waybar"];} + {command = ["xwayland-satellite"];} + {command = ["swaybg" "-m" "fill" "-i" "~/.config/nixos/assets/twilight.png"];} + ]; + environment = { + DISPLAY = ":0"; + }; + window-rules = [ + {matches = [{title = "^launch$";}]; + open-floating = true; + } + {matches = [{title = "^music$";}]; + open-floating = true; + } + {matches = [{title = "^(Picture-in-Picture)$";}]; + open-floating = true; + } + {matches = [{title = "^music$";}]; + open-floating = true; + } + { + geometry-corner-radius = { + bottom-left = 12.0; + bottom-right = 12.0; + top-left = 12.0; + top-right = 12.0; + }; + draw-border-with-background = false; + clip-to-geometry = true; + } + ]; + layout = { + focus-ring = { + enable = true; + active = {color = "rgb(203 166 247)";}; + inactive = {color = "rgb(68 12 136)";}; + }; + }; + }; + }; +} diff --git a/home/sway.nix b/home/sway.nix index 3e1c531..f3530de 100644 --- a/home/sway.nix +++ b/home/sway.nix @@ -3,6 +3,7 @@ package = pkgs.swayfx; enable = true; checkConfig = false; #gles2 renderer error + extraSessionCommands = "export WLR_DRM_DEVICES=/dev/dri/card1"; extraConfig = if (vars.class != "lowspec") then import ./swayfx else ""; config = { modifier = "Mod4"; From 4eae98a4eca8c06f2ae2a8eeb6b6867741d3231f Mon Sep 17 00:00:00 2001 From: beanigen Date: Tue, 24 Jun 2025 19:25:44 +0800 Subject: [PATCH 2/2] h --- base/callisto/configuration.nix | 4 +- base/callisto/hardware-configuration.nix | 2 +- flake.nix | 1 + home/default.nix | 13 +- home/niri.nix | 314 +++++++++++++++++------ home/nixvim/default.nix | 8 +- 6 files changed, 240 insertions(+), 102 deletions(-) diff --git a/base/callisto/configuration.nix b/base/callisto/configuration.nix index 30fe86c..eb3a3ef 100644 --- a/base/callisto/configuration.nix +++ b/base/callisto/configuration.nix @@ -188,9 +188,9 @@ }; }; - xdg.portal = { + /* xdg.portal = { enable = true; - }; + }; */ # Configure network proxy if necessary # networking.proxy.default = "http://user:password@proxy:port/"; diff --git a/base/callisto/hardware-configuration.nix b/base/callisto/hardware-configuration.nix index 16860e8..952d835 100644 --- a/base/callisto/hardware-configuration.nix +++ b/base/callisto/hardware-configuration.nix @@ -15,7 +15,7 @@ enable = true; tempBat = 80; tempAc = 95; - coreOffset = -75; + coreOffset = -73; gpuOffset = -95; }; boot.kernelModules = [ "kvm-intel" "sierra_net" ]; diff --git a/flake.nix b/flake.nix index fdcf075..bc70189 100644 --- a/flake.nix +++ b/flake.nix @@ -62,6 +62,7 @@ }; home-manager.useGlobalPkgs = true; home-manager.useUserPackages = true; + home-manager.sharedModules = [{ imports = with inputs; [ nix-index-database.hmModules.nix-index nixvim.homeManagerModules.nixvim catppuccin.homeModules.catppuccin ];}]; home-manager.users.maya = ./home; } ]; diff --git a/home/default.nix b/home/default.nix index e5321cb..92b036e 100644 --- a/home/default.nix +++ b/home/default.nix @@ -1,13 +1,10 @@ {config, pkgs, lib, inputs, vars, ...}:{ imports = [ - #home-manager modules - inputs.nix-index-database.hmModules.nix-index - inputs.nixvim.homeManagerModules.nixvim - inputs.catppuccin.homeModules.catppuccin #aux files to make finding specific things easier ./nixvim ./sway.nix ./theming.nix + ./niri.nix ./packages.nix #general user packages not managed by home-manager but i want to install via hm anyways ./syncthing.nix #this is a big block of configuration, really dont feel like cluttering this file more than it already is ]; @@ -23,9 +20,9 @@ }; }; programs.home-manager.enable = (!vars.isNixOS); #value is set in flake.nix - programs.foot.enable = true; programs.foot.settings.main.font = "monospace:size=10"; + programs.foot.settings.colors.alpha = 0.8; programs.ncmpcpp.enable = true; programs.ncmpcpp.settings.tags_separator = ";"; @@ -90,11 +87,7 @@ }; }; - xdg.portal = { - enable = true; - extraPortals = [ pkgs.xdg-desktop-portal-wlr ]; - configPackages = [ pkgs.xdg-desktop-portal-wlr ]; - }; + # programs.obs-studio = { # enable = true; # plugins = with pkgs.obs-studio-plugins; [ diff --git a/home/niri.nix b/home/niri.nix index f26c392..692fe22 100644 --- a/home/niri.nix +++ b/home/niri.nix @@ -1,106 +1,249 @@ {lib, osConfig, pkgs, inputs, vars, config, ...}:{ + xdg.portal = { + enable = true; + config.niri = { + default = [ "gnome" ]; + "org.freedesktop.impl.portal.FileChooser" = [ "gtk" ]; + }; + extraPortals = with pkgs; [ + xdg-desktop-portal-gtk + xdg-desktop-portal-gnome + ]; + }; programs.niri = { settings = { + input.touchpad = { + accel-profile = "flat"; + click-method = "clickfinger"; + scroll-factor = 0.3; + tap = false; + }; + input.trackpoint = { + accel-profile = "flat"; + }; prefer-no-csd = true; input.focus-follows-mouse.enable = true; - binds = with config.lib.niri.actions; { + binds = with config.lib.niri.actions; lib.mkDefault { "Mod+Return".action = spawn "foot"; "XF86AudioRaiseVolume".action = spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "5%+"; "XF86AudioLowerVolume".action = spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "5%-"; "XF86AudioMute".action = spawn "wpctl" "set-mute" "@DEFAULT_AUDIO_SINK@" "toggle"; - "Mod+S".action = spawn "foot" "--title" "launch" "--app-id" "fzf-launcher-foot" "bash" "-c" "niri msg action spawn -- bash -c \"$(compgen -c | sort -u | fzf --bind=enter:replace-query+print-query) >/dev/null\""; - "Mod+W".action = spawn "hyprlock"; + "Mod+D".action = spawn "foot" "--title" "launch" "--app-id" "fzf-launcher-foot" "bash" "-c" "niri msg action spawn -- bash -c \"$(compgen -c | sort -u | fzf --bind=enter:replace-query+print-query) >/dev/null\""; "Mod+T".action = spawn "foot" "--title" "music" "--app-id" "mpd-control-foot" "ncmpcpp"; "Mod+Shift+Q" = { repeat = false; action = close-window; }; - "Mod+Y" = { - repeat = false; - action = toggle-overview; - }; - "Mod+Left".action = focus-column-left; - "Mod+Down".action = focus-window-down; - "Mod+Up".action = focus-window-up; - "Mod+Right".action = focus-column-right; - "Mod+H".action = focus-column-left; - "Mod+N".action = focus-window-down; - "Mod+E".action = focus-window-up; - "Mod+I".action = focus-column-right; - "Mod+Shift+Left".action = move-column-left; - "Mod+Shift+Down".action = move-window-down; - "Mod+Shift+Up".action = move-window-up; - "Mod+Shift+Right".action = move-column-right; - "Mod+Shift+H".action = move-column-left; - "Mod+Shift+N".action = move-window-down; - "Mod+Shift+E".action = move-window-up; - "Mod+Shift+I".action = move-column-right; - "Mod+Home".action = focus-column-first; - "Mod+End".action = focus-column-last; - "Mod+Shift+Home".action = move-column-to-first; - "Mod+Shift+End".action = move-column-to-last; - "Print".action = screenshot; - "Ctrl+Print".action = screenshot-window; - "Mod+Shift+F".action = quit; - "Mod+Shift+T".action = power-off-monitors; - "Mod+Shift+Space".action = toggle-window-floating; - "Mod+Shift+V".action = switch-focus-between-floating-and-tiling; - "Mod+F".action = maximize-column; - "Mod+Alt+F".action = fullscreen-window; - "Mod+Ctrl+F".action = expand-column-to-available-width; - "Mod+1".action = focus-workspace 1; - "Mod+2".action = focus-workspace 2; - "Mod+3".action = focus-workspace 3; - "Mod+4".action = focus-workspace 4; - "Mod+5".action = focus-workspace 5; - "Mod+6".action = focus-workspace 6; - "Mod+7".action = focus-workspace 7; - "Mod+8".action = focus-workspace 8; - "Mod+9".action = focus-workspace 9; - "Mod+Ctrl+Left".action = focus-monitor-left; - "Mod+Ctrl+Down".action = focus-monitor-down; - "Mod+Ctrl+Up".action = focus-monitor-up; - "Mod+Ctrl+Right".action = focus-monitor-right; - "Mod+Ctrl+H".action = focus-monitor-left; - "Mod+Ctrl+N".action = focus-monitor-down; - "Mod+Ctrl+E".action = focus-monitor-up; - "Mod+Ctrl+I".action = focus-monitor-right; - "Mod+Shift+Ctrl+Left".action = move-column-to-monitor-left; - "Mod+Shift+Ctrl+Down".action = move-column-to-monitor-down; - "Mod+Shift+Ctrl+Up".action = move-column-to-monitor-up; - "Mod+Shift+Ctrl+Right".action = move-column-to-monitor-right; - "Mod+Shift+Ctrl+H".action = move-column-to-monitor-left; - "Mod+Shift+Ctrl+N".action = move-column-to-monitor-down; - "Mod+Shift+Ctrl+E".action = move-column-to-monitor-up; - "Mod+Shift+Ctrl+I".action = move-column-to-monitor-right; - "Mod+Page_Down".action = focus-workspace-down; - "Mod+Page_Up".action = focus-workspace-up; - "Mod+L".action = focus-workspace-down; - "Mod+U".action = focus-workspace-up; - "Mod+Ctrl+Page_Down".action = focus-workspace-down; - "Mod+Ctrl+Page_Up".action = move-column-to-workspace-up; - "Mod+Ctrl+L".action = move-column-to-workspace-down; - "Mod+Ctrl+U".action = move-column-to-workspace-up; - "Mod+Shift+Page_Down".action = move-workspace-down; - "Mod+Shift+Page_Up".action = move-workspace-up; - "Mod+Shift+L".action = move-workspace-down; - "Mod+Shift+U".action = move-workspace-up; - "Mod+Comma".action = consume-window-into-column; - "Mod+Period".action = expel-window-from-column; - "Mod+P".action = switch-preset-column-width; - "Mod+Shift+P".action = switch-preset-window-height; - "Mod+Ctrl+P".action = reset-window-height; - "Mod+C".action = center-column; - "Mod+Ctrl+C".action = center-visible-columns; - "Mod+Minus".action = set-column-width "-10%"; - "Mod+Equal".action = set-column-width "+10%"; - "Mod+Shift+Minus".action = set-window-height "-10%"; - "Mod+Shift+Equal".action = set-window-height "+10%"; + "XF86AudioMicMute" = { + allow-when-locked = true; + action.spawn = [ "wpctl" "set-mute" "@DEFAULT_AUDIO_SOURCE@" "toggle" ]; + }; + + "Mod+Q".action.close-window = {}; + + "Mod+Left".action.focus-column-left = {}; + "Mod+Down".action.focus-window-down = {}; + "Mod+Up".action.focus-window-up = {}; + "Mod+Right".action.focus-column-right = {}; + "Mod+H".action.focus-column-left = {}; + "Mod+J".action.focus-window-down = {}; + "Mod+K".action.focus-window-up = {}; + "Mod+L".action.focus-column-right = {}; + + "Mod+Shift+Left".action.move-column-left = {}; + "Mod+Shift+Down".action.move-window-down = {}; + "Mod+Shift+Up".action.move-window-up = {}; + "Mod+Shift+Right".action.move-column-right = {}; + "Mod+Shift+H".action.move-column-left = {}; + "Mod+Shift+J".action.move-window-down = {}; + "Mod+Shift+K".action.move-window-up = {}; + "Mod+Shift+L".action.move-column-right = {}; + + # Alternative commands that move across workspaces when reaching + # the first or last window in a column. + # Mod+J { focus-window-or-workspace-down; } + # Mod+K { focus-window-or-workspace-up; } + # Mod+Ctrl+J { move-window-down-or-to-workspace-down; } + # Mod+Ctrl+K { move-window-up-or-to-workspace-up; } + + "Mod+Home".action.focus-column-first = {}; + "Mod+End".action.focus-column-last = {}; + "Mod+Ctrl+Home".action.move-column-to-first = {}; + "Mod+Ctrl+End".action.move-column-to-last = {}; + +/* "Mod+Shift+Left".action.focus-monitor-left = {}; + "Mod+Shift+Down".action.focus-monitor-down = {}; + "Mod+Shift+Up".action.focus-monitor-up = {}; + "Mod+Shift+Right".action.focus-monitor-right = {}; + "Mod+Shift+H".action.focus-monitor-left = {}; + "Mod+Shift+J".action.focus-monitor-down = {}; + "Mod+Shift+K".action.focus-monitor-up = {}; + "Mod+Shift+L".action.focus-monitor-right = {}; +*/ + "Mod+Shift+Ctrl+Left".action.move-column-to-monitor-left = {}; + "Mod+Shift+Ctrl+Down".action.move-column-to-monitor-down = {}; + "Mod+Shift+Ctrl+Up".action.move-column-to-monitor-up = {}; + "Mod+Shift+Ctrl+Right".action.move-column-to-monitor-right = {}; + "Mod+Shift+Ctrl+H".action.move-column-to-monitor-left = {}; + "Mod+Shift+Ctrl+J".action.move-column-to-monitor-down = {}; + "Mod+Shift+Ctrl+K".action.move-column-to-monitor-up = {}; + "Mod+Shift+Ctrl+L".action.move-column-to-monitor-right = {}; + + # Alternatively, there are commands to move just a single window: + # Mod+Shift+Ctrl+Left { move-window-to-monitor-left; } + # ... + + # And you can also move a whole workspace to another monitor: + # Mod+Shift+Ctrl+Left { move-workspace-to-monitor-left; } + # ... + + "Mod+Page_Down".action.focus-workspace-down = {}; + "Mod+Page_Up".action.focus-workspace-up = {}; + "Mod+U".action.focus-workspace-down = {}; + "Mod+I".action.focus-workspace-up = {}; + "Mod+Ctrl+Page_Down".action.move-column-to-workspace-down = {}; + "Mod+Ctrl+Page_Up".action.move-column-to-workspace-up = {}; + "Mod+Ctrl+U".action.move-column-to-workspace-down = {}; + "Mod+Ctrl+I".action.move-column-to-workspace-up = {}; + + # Alternatively, there are commands to move just a single window: + # Mod+Ctrl+Page_Down { move-window-to-workspace-down; } + # ... + + "Mod+Shift+Page_Down".action.move-workspace-down = {}; + "Mod+Shift+Page_Up".action.move-workspace-up = {}; + "Mod+Shift+U".action.move-workspace-down = {}; + "Mod+Shift+I".action.move-workspace-up = {}; + + # You can bind mouse wheel scroll ticks using the following syntax. + # These binds will change direction based on the natural-scroll setting. + # + # To avoid scrolling through workspaces really fast, you can use + # the cooldown-ms property. The bind will be rate-limited to this value. + # You can set a cooldown on any bind, but it's most useful for the wheel. + "Mod+WheelScrollDown" = { + cooldown-ms = 150; + action.focus-workspace-down = {}; + }; + "Mod+WheelScrollUp" = { + cooldown-ms = 150; + action.focus-workspace-up = {}; + }; + "Mod+Ctrl+WheelScrollDown" = { + cooldown-ms = 150; + action.move-column-to-workspace-down = {}; + }; + "Mod+Ctrl+WheelScrollUp" = { + cooldown-ms = 150; + action.move-column-to-workspace-up = {}; + }; + + "Mod+WheelScrollRight".action.focus-column-right = {}; + "Mod+WheelScrollLeft".action.focus-column-left = {}; + "Mod+Ctrl+WheelScrollRight".action.move-column-right = {}; + "Mod+Ctrl+WheelScrollLeft".action.move-column-left = {}; + + # Usually scrolling up and down with Shift in applications results in + # horizontal scrolling; these binds replicate that. + "Mod+Shift+WheelScrollDown".action.focus-column-right = {}; + "Mod+Shift+WheelScrollUp".action.focus-column-left = {}; + "Mod+Ctrl+Shift+WheelScrollDown".action.move-column-right = {}; + "Mod+Ctrl+Shift+WheelScrollUp".action.move-column-left = {}; + + # Similarly, you can bind touchpad scroll "ticks". + # Touchpad scrolling is continuous, so for these binds it is split into + # discrete intervals. + # These binds are also affected by touchpad's natural-scroll, so these + # example binds are "inverted", since we have natural-scroll enabled for + # touchpads by default. + # Mod+TouchpadScrollDown { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.02+"; } + # Mod+TouchpadScrollUp { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.02-"; } + + # You can refer to workspaces by index. However, keep in mind that + # niri is a dynamic workspace system, so these commands are kind of + # "best effort". Trying to refer to a workspace index bigger than + # the current workspace count will instead refer to the bottommost + # (empty) workspace. + # + # For example, with 2 workspaces + 1 empty, indices 3, 4, 5 and so on + # will all refer to the 3rd workspace. + "Mod+1".action.focus-workspace = 1; + "Mod+2".action.focus-workspace = 2; + "Mod+3".action.focus-workspace = 3; + "Mod+4".action.focus-workspace = 4; + "Mod+5".action.focus-workspace = 5; + "Mod+6".action.focus-workspace = 6; + "Mod+7".action.focus-workspace = 7; + "Mod+8".action.focus-workspace = 8; + "Mod+9".action.focus-workspace = 9; + "Mod+Shift+1".action.move-column-to-workspace = 1; + "Mod+Shift+2".action.move-column-to-workspace = 2; + "Mod+Shift+3".action.move-column-to-workspace = 3; + "Mod+Shift+4".action.move-column-to-workspace = 4; + "Mod+Shift+5".action.move-column-to-workspace = 5; + "Mod+Shift+6".action.move-column-to-workspace = 6; + "Mod+Shift+7".action.move-column-to-workspace = 7; + "Mod+Shift+8".action.move-column-to-workspace = 8; + "Mod+Shift+9".action.move-column-to-workspace = 9; + + # Alternatively, there are commands to move just a single window: + # Mod+Ctrl+1 { move-window-to-workspace 1; } + + # Switches focus between the current and the previous workspace. + # Mod+Tab { focus-workspace-previous; } + + "Mod+Comma".action.consume-window-into-column = {}; + "Mod+Period".action.expel-window-from-column = {}; + + # There are also commands that consume or expel a single window to the side. + # Mod+BracketLeft { consume-or-expel-window-left; } + # Mod+BracketRight { consume-or-expel-window-right; } + + "Mod+R".action.switch-preset-column-width = {}; + "Mod+Shift+R".action.reset-window-height = {}; + "Mod+F".action.maximize-column = {}; + "Mod+Shift+F".action.fullscreen-window = {}; + "Mod+C".action.center-column = {}; + + # Finer width adjustments. + # This command can also: + # * set width in pixels: "1000" + # * adjust width in pixels: "-5" or "+5" + # * set width as a percentage of screen width: "25%" + # * adjust width as a percentage of screen width: "-10%" or "+10%" + # Pixel sizes use logical, or scaled, pixels. I.e. on an output with scale 2.0, + # set-column-width "100" will make the column occupy 200 physical screen pixels. + "Mod+Minus".action.set-column-width = "-10%"; + "Mod+Equal".action.set-column-width = "+10%"; + + # Finer height adjustments when in column with other windows. + "Mod+Shift+Minus".action.set-window-height = "-10%"; + "Mod+Shift+Equal".action.set-window-height = "+10%"; + + # Actions to switch layouts. + # Note: if you uncomment these, make sure you do NOT have + # a matching layout switch hotkey configured in xkb options above. + # Having both at once on the same hotkey will break the switching, + # since it will switch twice upon pressing the hotkey (once by xkb, once by niri). + # Mod+Space { switch-layout "next"; } + # Mod+Shift+Space { switch-layout "prev"; } + + "Print".action.screenshot = {}; + "Ctrl+Print".action.screenshot-screen = {}; + "Alt+Print".action.screenshot-window = {}; + + # The quit action will show a confirmation dialog to avoid accidental exits. + "Mod+Shift+E".action.quit = {}; + + # Powers off the monitors. To turn them back on, do any input like + # moving the mouse or pressing any other key. + "Mod+Shift+P".action.power-off-monitors = {}; }; spawn-at-startup = [ {command = ["waybar"];} {command = ["xwayland-satellite"];} - {command = ["swaybg" "-m" "fill" "-i" "~/.config/nixos/assets/twilight.png"];} + {command = ["swaybg" "-m" "fill" "-i" "/home/maya/.config/nixos/assets/twilight.png"];} + {command = ["udiskie --appindicator"];} ]; environment = { DISPLAY = ":0"; @@ -132,6 +275,7 @@ layout = { focus-ring = { enable = true; + width = 2; active = {color = "rgb(203 166 247)";}; inactive = {color = "rgb(68 12 136)";}; }; diff --git a/home/nixvim/default.nix b/home/nixvim/default.nix index 001438c..255d35d 100644 --- a/home/nixvim/default.nix +++ b/home/nixvim/default.nix @@ -31,11 +31,11 @@ servers.nixd = { enable = true; extraOptions.offset_encoding = "utf-8"; - settings.nixpkgs.expr = "import {}"; + settings.nixpkgs.expr = "import (builtins.getFlake \"/home/${vars.user}/.config/nixos\").inputs.nixpkgs {}"; settings.options = { - nixos.expr = "(builtins.getFlake \"/home/${vars.user}/.config/nixos\").nixosConfigurations.apollo.options"; - home-manager.expr = "(builtins.getFlake \"/home/${vars.user}/.config/nixos\").homeConfigurations.generic.options"; - nixvim.expr = "(builtins.getFlake \"/home/${vars.user}/.config/nixos\").homeConfigurations.generic.options.programs.nixvim.type.getSubOptions []"; + nixos.expr = "(builtins.getFlake \"/home/${vars.user}/.config/nixos\").nixosConfigurations.callisto.options"; + home-manager.expr = "(builtins.getFlake \"/home/${vars.user}/.config/nixos\").nixosConfigurations.callisto.options.home-manager.users.type.getSubOptions []"; + #niri.expr = "(builtins.getFlake \"/home/${vars.user}/.config/nixos\").nixosConfigurations.callisto.config.home-manager.users.${vars.user}.programs.niri.settings"; }; }; };