This commit is contained in:
beanigen 2025-06-24 19:25:44 +08:00
parent 91321fb3f6
commit 4eae98a4ec
No known key found for this signature in database
6 changed files with 240 additions and 102 deletions

View file

@ -188,9 +188,9 @@
}; };
}; };
xdg.portal = { /* xdg.portal = {
enable = true; enable = true;
}; }; */
# Configure network proxy if necessary # Configure network proxy if necessary
# networking.proxy.default = "http://user:password@proxy:port/"; # networking.proxy.default = "http://user:password@proxy:port/";

View file

@ -15,7 +15,7 @@
enable = true; enable = true;
tempBat = 80; tempBat = 80;
tempAc = 95; tempAc = 95;
coreOffset = -75; coreOffset = -73;
gpuOffset = -95; gpuOffset = -95;
}; };
boot.kernelModules = [ "kvm-intel" "sierra_net" ]; boot.kernelModules = [ "kvm-intel" "sierra_net" ];

View file

@ -62,6 +62,7 @@
}; };
home-manager.useGlobalPkgs = true; home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = 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; home-manager.users.maya = ./home;
} }
]; ];

View file

@ -1,13 +1,10 @@
{config, pkgs, lib, inputs, vars, ...}:{ {config, pkgs, lib, inputs, vars, ...}:{
imports = [ 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 #aux files to make finding specific things easier
./nixvim ./nixvim
./sway.nix ./sway.nix
./theming.nix ./theming.nix
./niri.nix
./packages.nix #general user packages not managed by home-manager but i want to install via hm anyways ./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 ./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.home-manager.enable = (!vars.isNixOS); #value is set in flake.nix
programs.foot.enable = true; programs.foot.enable = true;
programs.foot.settings.main.font = "monospace:size=10"; programs.foot.settings.main.font = "monospace:size=10";
programs.foot.settings.colors.alpha = 0.8;
programs.ncmpcpp.enable = true; programs.ncmpcpp.enable = true;
programs.ncmpcpp.settings.tags_separator = ";"; 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 = { # programs.obs-studio = {
# enable = true; # enable = true;
# plugins = with pkgs.obs-studio-plugins; [ # plugins = with pkgs.obs-studio-plugins; [

View file

@ -1,106 +1,249 @@
{lib, osConfig, pkgs, inputs, vars, config, ...}:{ {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 = { programs.niri = {
settings = { settings = {
input.touchpad = {
accel-profile = "flat";
click-method = "clickfinger";
scroll-factor = 0.3;
tap = false;
};
input.trackpoint = {
accel-profile = "flat";
};
prefer-no-csd = true; prefer-no-csd = true;
input.focus-follows-mouse.enable = 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"; "Mod+Return".action = spawn "foot";
"XF86AudioRaiseVolume".action = spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "5%+"; "XF86AudioRaiseVolume".action = spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "5%+";
"XF86AudioLowerVolume".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"; "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+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+W".action = spawn "hyprlock";
"Mod+T".action = spawn "foot" "--title" "music" "--app-id" "mpd-control-foot" "ncmpcpp"; "Mod+T".action = spawn "foot" "--title" "music" "--app-id" "mpd-control-foot" "ncmpcpp";
"Mod+Shift+Q" = { "Mod+Shift+Q" = {
repeat = false; repeat = false;
action = close-window; action = close-window;
}; };
"Mod+Y" = { "XF86AudioMicMute" = {
repeat = false; allow-when-locked = true;
action = toggle-overview; action.spawn = [ "wpctl" "set-mute" "@DEFAULT_AUDIO_SOURCE@" "toggle" ];
}; };
"Mod+Left".action = focus-column-left;
"Mod+Down".action = focus-window-down; "Mod+Q".action.close-window = {};
"Mod+Up".action = focus-window-up;
"Mod+Right".action = focus-column-right; "Mod+Left".action.focus-column-left = {};
"Mod+H".action = focus-column-left; "Mod+Down".action.focus-window-down = {};
"Mod+N".action = focus-window-down; "Mod+Up".action.focus-window-up = {};
"Mod+E".action = focus-window-up; "Mod+Right".action.focus-column-right = {};
"Mod+I".action = focus-column-right; "Mod+H".action.focus-column-left = {};
"Mod+Shift+Left".action = move-column-left; "Mod+J".action.focus-window-down = {};
"Mod+Shift+Down".action = move-window-down; "Mod+K".action.focus-window-up = {};
"Mod+Shift+Up".action = move-window-up; "Mod+L".action.focus-column-right = {};
"Mod+Shift+Right".action = move-column-right;
"Mod+Shift+H".action = move-column-left; "Mod+Shift+Left".action.move-column-left = {};
"Mod+Shift+N".action = move-window-down; "Mod+Shift+Down".action.move-window-down = {};
"Mod+Shift+E".action = move-window-up; "Mod+Shift+Up".action.move-window-up = {};
"Mod+Shift+I".action = move-column-right; "Mod+Shift+Right".action.move-column-right = {};
"Mod+Home".action = focus-column-first; "Mod+Shift+H".action.move-column-left = {};
"Mod+End".action = focus-column-last; "Mod+Shift+J".action.move-window-down = {};
"Mod+Shift+Home".action = move-column-to-first; "Mod+Shift+K".action.move-window-up = {};
"Mod+Shift+End".action = move-column-to-last; "Mod+Shift+L".action.move-column-right = {};
"Print".action = screenshot;
"Ctrl+Print".action = screenshot-window; # Alternative commands that move across workspaces when reaching
"Mod+Shift+F".action = quit; # the first or last window in a column.
"Mod+Shift+T".action = power-off-monitors; # Mod+J { focus-window-or-workspace-down; }
"Mod+Shift+Space".action = toggle-window-floating; # Mod+K { focus-window-or-workspace-up; }
"Mod+Shift+V".action = switch-focus-between-floating-and-tiling; # Mod+Ctrl+J { move-window-down-or-to-workspace-down; }
"Mod+F".action = maximize-column; # Mod+Ctrl+K { move-window-up-or-to-workspace-up; }
"Mod+Alt+F".action = fullscreen-window;
"Mod+Ctrl+F".action = expand-column-to-available-width; "Mod+Home".action.focus-column-first = {};
"Mod+1".action = focus-workspace 1; "Mod+End".action.focus-column-last = {};
"Mod+2".action = focus-workspace 2; "Mod+Ctrl+Home".action.move-column-to-first = {};
"Mod+3".action = focus-workspace 3; "Mod+Ctrl+End".action.move-column-to-last = {};
"Mod+4".action = focus-workspace 4;
"Mod+5".action = focus-workspace 5; /* "Mod+Shift+Left".action.focus-monitor-left = {};
"Mod+6".action = focus-workspace 6; "Mod+Shift+Down".action.focus-monitor-down = {};
"Mod+7".action = focus-workspace 7; "Mod+Shift+Up".action.focus-monitor-up = {};
"Mod+8".action = focus-workspace 8; "Mod+Shift+Right".action.focus-monitor-right = {};
"Mod+9".action = focus-workspace 9; "Mod+Shift+H".action.focus-monitor-left = {};
"Mod+Ctrl+Left".action = focus-monitor-left; "Mod+Shift+J".action.focus-monitor-down = {};
"Mod+Ctrl+Down".action = focus-monitor-down; "Mod+Shift+K".action.focus-monitor-up = {};
"Mod+Ctrl+Up".action = focus-monitor-up; "Mod+Shift+L".action.focus-monitor-right = {};
"Mod+Ctrl+Right".action = focus-monitor-right; */
"Mod+Ctrl+H".action = focus-monitor-left; "Mod+Shift+Ctrl+Left".action.move-column-to-monitor-left = {};
"Mod+Ctrl+N".action = focus-monitor-down; "Mod+Shift+Ctrl+Down".action.move-column-to-monitor-down = {};
"Mod+Ctrl+E".action = focus-monitor-up; "Mod+Shift+Ctrl+Up".action.move-column-to-monitor-up = {};
"Mod+Ctrl+I".action = focus-monitor-right; "Mod+Shift+Ctrl+Right".action.move-column-to-monitor-right = {};
"Mod+Shift+Ctrl+Left".action = move-column-to-monitor-left; "Mod+Shift+Ctrl+H".action.move-column-to-monitor-left = {};
"Mod+Shift+Ctrl+Down".action = move-column-to-monitor-down; "Mod+Shift+Ctrl+J".action.move-column-to-monitor-down = {};
"Mod+Shift+Ctrl+Up".action = move-column-to-monitor-up; "Mod+Shift+Ctrl+K".action.move-column-to-monitor-up = {};
"Mod+Shift+Ctrl+Right".action = move-column-to-monitor-right; "Mod+Shift+Ctrl+L".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; # Alternatively, there are commands to move just a single window:
"Mod+Shift+Ctrl+E".action = move-column-to-monitor-up; # Mod+Shift+Ctrl+Left { move-window-to-monitor-left; }
"Mod+Shift+Ctrl+I".action = move-column-to-monitor-right; # ...
"Mod+Page_Down".action = focus-workspace-down;
"Mod+Page_Up".action = focus-workspace-up; # And you can also move a whole workspace to another monitor:
"Mod+L".action = focus-workspace-down; # Mod+Shift+Ctrl+Left { move-workspace-to-monitor-left; }
"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+Page_Down".action.focus-workspace-down = {};
"Mod+Ctrl+L".action = move-column-to-workspace-down; "Mod+Page_Up".action.focus-workspace-up = {};
"Mod+Ctrl+U".action = move-column-to-workspace-up; "Mod+U".action.focus-workspace-down = {};
"Mod+Shift+Page_Down".action = move-workspace-down; "Mod+I".action.focus-workspace-up = {};
"Mod+Shift+Page_Up".action = move-workspace-up; "Mod+Ctrl+Page_Down".action.move-column-to-workspace-down = {};
"Mod+Shift+L".action = move-workspace-down; "Mod+Ctrl+Page_Up".action.move-column-to-workspace-up = {};
"Mod+Shift+U".action = move-workspace-up; "Mod+Ctrl+U".action.move-column-to-workspace-down = {};
"Mod+Comma".action = consume-window-into-column; "Mod+Ctrl+I".action.move-column-to-workspace-up = {};
"Mod+Period".action = expel-window-from-column;
"Mod+P".action = switch-preset-column-width; # Alternatively, there are commands to move just a single window:
"Mod+Shift+P".action = switch-preset-window-height; # Mod+Ctrl+Page_Down { move-window-to-workspace-down; }
"Mod+Ctrl+P".action = reset-window-height; # ...
"Mod+C".action = center-column;
"Mod+Ctrl+C".action = center-visible-columns; "Mod+Shift+Page_Down".action.move-workspace-down = {};
"Mod+Minus".action = set-column-width "-10%"; "Mod+Shift+Page_Up".action.move-workspace-up = {};
"Mod+Equal".action = set-column-width "+10%"; "Mod+Shift+U".action.move-workspace-down = {};
"Mod+Shift+Minus".action = set-window-height "-10%"; "Mod+Shift+I".action.move-workspace-up = {};
"Mod+Shift+Equal".action = set-window-height "+10%";
# 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 = [ spawn-at-startup = [
{command = ["waybar"];} {command = ["waybar"];}
{command = ["xwayland-satellite"];} {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 = { environment = {
DISPLAY = ":0"; DISPLAY = ":0";
@ -132,6 +275,7 @@
layout = { layout = {
focus-ring = { focus-ring = {
enable = true; enable = true;
width = 2;
active = {color = "rgb(203 166 247)";}; active = {color = "rgb(203 166 247)";};
inactive = {color = "rgb(68 12 136)";}; inactive = {color = "rgb(68 12 136)";};
}; };

View file

@ -31,11 +31,11 @@
servers.nixd = { servers.nixd = {
enable = true; enable = true;
extraOptions.offset_encoding = "utf-8"; extraOptions.offset_encoding = "utf-8";
settings.nixpkgs.expr = "import <nixpkgs>{}"; settings.nixpkgs.expr = "import (builtins.getFlake \"/home/${vars.user}/.config/nixos\").inputs.nixpkgs {}";
settings.options = { settings.options = {
nixos.expr = "(builtins.getFlake \"/home/${vars.user}/.config/nixos\").nixosConfigurations.apollo.options"; nixos.expr = "(builtins.getFlake \"/home/${vars.user}/.config/nixos\").nixosConfigurations.callisto.options";
home-manager.expr = "(builtins.getFlake \"/home/${vars.user}/.config/nixos\").homeConfigurations.generic.options"; home-manager.expr = "(builtins.getFlake \"/home/${vars.user}/.config/nixos\").nixosConfigurations.callisto.options.home-manager.users.type.getSubOptions []";
nixvim.expr = "(builtins.getFlake \"/home/${vars.user}/.config/nixos\").homeConfigurations.generic.options.programs.nixvim.type.getSubOptions []"; #niri.expr = "(builtins.getFlake \"/home/${vars.user}/.config/nixos\").nixosConfigurations.callisto.config.home-manager.users.${vars.user}.programs.niri.settings";
}; };
}; };
}; };