Compare commits

...

6 commits

Author SHA1 Message Date
a3fdd0211a snohawk: return to dwm 2024-09-11 19:47:42 -07:00
0256eae39c snowhawk: enable niri settings 2024-09-11 19:45:33 -07:00
8b2effd885 niri: hmModule 2024-09-11 19:41:37 -07:00
a4ebdc26a9 niri: displayManager config 2024-09-11 18:44:30 -07:00
8cae0adfb3 snowhawk: enable niri 2024-09-11 18:29:49 -07:00
2d490033f3 flake: add niri 2024-09-11 17:36:19 -07:00
6 changed files with 431 additions and 3 deletions

View file

@ -5,7 +5,10 @@ let
inherit system;
config.allowUnfree = true;
overlays = [ self.overlays.default ];
overlays = [
self.overlays.default
inputs.niri.overlays.niri
];
});
lib = nixpkgs.lib.extend (import ./lib);
@ -28,6 +31,7 @@ rec {
./hosts/${hostname}/hardware-configuration.nix
./hosts/${hostname}/configuration.nix
inputs.home-manager.nixosModules.default
inputs.niri.nixosModules.niri
{
home-manager.extraSpecialArgs = {
inherit inputs self pkgs;

View file

@ -126,6 +126,24 @@
"type": "indirect"
}
},
"flake-parts_3": {
"inputs": {
"nixpkgs-lib": "nixpkgs-lib"
},
"locked": {
"lastModified": 1725234343,
"narHash": "sha256-+ebgonl3NbiKD2UD0x4BszCZQ6sTfL4xioaM49o5B3Y=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "567b938d64d4b4112ee253b9274472dc3a346eb6",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"git-hooks": {
"inputs": {
"flake-compat": "flake-compat_2",
@ -258,6 +276,65 @@
"type": "github"
}
},
"niri": {
"inputs": {
"flake-parts": "flake-parts_3",
"niri-stable": "niri-stable",
"niri-unstable": "niri-unstable",
"nixpkgs": [
"nixpkgs"
],
"nixpkgs-stable": "nixpkgs-stable",
"xwayland-satellite-stable": "xwayland-satellite-stable",
"xwayland-satellite-unstable": "xwayland-satellite-unstable"
},
"locked": {
"lastModified": 1726061420,
"narHash": "sha256-nEjj3UZKg4W8K5XUwqR+WeuiND5Qw4xK1tD5h4GzJ8A=",
"owner": "sodiboo",
"repo": "niri-flake",
"rev": "74c0df9dca8d218120f57f83c51224bf36a472df",
"type": "github"
},
"original": {
"owner": "sodiboo",
"repo": "niri-flake",
"type": "github"
}
},
"niri-stable": {
"flake": false,
"locked": {
"lastModified": 1723290956,
"narHash": "sha256-13xynDWoOqogUKZTf6lz267hEQGdCE+BE6acs2G3j8k=",
"owner": "YaLTeR",
"repo": "niri",
"rev": "9063a5dbdc0d4470dc1e13ce5749838e32af6a44",
"type": "github"
},
"original": {
"owner": "YaLTeR",
"ref": "v0.1.8",
"repo": "niri",
"type": "github"
}
},
"niri-unstable": {
"flake": false,
"locked": {
"lastModified": 1725957188,
"narHash": "sha256-XjDbhHG2qxTmuX8rcIob4T7AM33NjgTA5QBcexjI0aU=",
"owner": "YaLTeR",
"repo": "niri",
"rev": "087a50a19c87175bc6c2a3b7ddc886f98f26f7c4",
"type": "github"
},
"original": {
"owner": "YaLTeR",
"repo": "niri",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1725432240,
@ -274,7 +351,35 @@
"type": "github"
}
},
"nixpkgs-lib": {
"locked": {
"lastModified": 1725233747,
"narHash": "sha256-Ss8QWLXdr2JCBPcYChJhz4xJm+h/xjl4G0c0XlP6a74=",
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/356624c12086a18f2ea2825fed34523d60ccc4e3.tar.gz"
},
"original": {
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/356624c12086a18f2ea2825fed34523d60ccc4e3.tar.gz"
}
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1725930920,
"narHash": "sha256-RVhD9hnlTT2nJzPHlAqrWqCkA7T6CYrP41IoVRkciZM=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "44a71ff39c182edaf25a7ace5c9454e7cba2c658",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-24.05",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-stable_2": {
"locked": {
"lastModified": 1721524707,
"narHash": "sha256-5NctRsoE54N86nWd0psae70YSLfrOek3Kv1e8KoXe/0=",
@ -312,6 +417,7 @@
"fish_theme": "fish_theme",
"home-manager": "home-manager",
"neovim-overlay": "neovim-overlay",
"niri": "niri",
"nixpkgs": "nixpkgs",
"repo-clone": "repo-clone",
"sops-nix": "sops-nix"
@ -322,7 +428,7 @@
"nixpkgs": [
"nixpkgs"
],
"nixpkgs-stable": "nixpkgs-stable"
"nixpkgs-stable": "nixpkgs-stable_2"
},
"locked": {
"lastModified": 1725540166,
@ -337,6 +443,39 @@
"repo": "sops-nix",
"type": "github"
}
},
"xwayland-satellite-stable": {
"flake": false,
"locked": {
"lastModified": 1718165778,
"narHash": "sha256-dwF9nI54a6Fo9XU5s4qmvMXSgCid3YQVGxch00qEMvI=",
"owner": "Supreeeme",
"repo": "xwayland-satellite",
"rev": "b6d281967cb0b7bf1dfdb8d0f597b517dc4aa5c5",
"type": "github"
},
"original": {
"owner": "Supreeeme",
"ref": "v0.4",
"repo": "xwayland-satellite",
"type": "github"
}
},
"xwayland-satellite-unstable": {
"flake": false,
"locked": {
"lastModified": 1723095288,
"narHash": "sha256-cUlTHg/F0tUpjS/uAIYKwrIRaKwuzdyFo3IiST6E7Fc=",
"owner": "Supreeeme",
"repo": "xwayland-satellite",
"rev": "95afa163a60167cd97bf6afa870bc117a1be3d03",
"type": "github"
},
"original": {
"owner": "Supreeeme",
"repo": "xwayland-satellite",
"type": "github"
}
}
},
"root": "root",

View file

@ -7,6 +7,7 @@
home-manager = { url = "github:nix-community/home-manager"; inputs.nixpkgs.follows = "nixpkgs"; };
sops-nix = { url = "github:mic92/sops-nix"; inputs.nixpkgs.follows = "nixpkgs"; };
dunst-theme = { url = "github:d2718nis/rose-pine-dunst"; flake = false; };
niri = { url = "github:sodiboo/niri-flake"; inputs.nixpkgs.follows = "nixpkgs"; };
repo-clone.url = "git+https://git.zynh.me/Zynh0722/repo-clone";
fish_theme = { url = "git+https://git.zynh.me/Zynh0722/omf-theme"; flake = false; };

263
home/modules/niri.nix Normal file
View file

@ -0,0 +1,263 @@
{ config, lib, ... }:
let
inherit (lib) mkIf mkEnableOption;
cfg = config.snowhawk.niri;
in
{
options.snowhawk.niri = {
enable = mkEnableOption "niri home-manager module";
};
config = mkIf cfg.enable {
programs.niri.settings = {
environment = {
DISPLAY = ":0";
};
binds = {
# Keys consist of modifiers separated by + signs, followed by an XKB key name
# in the end. To find an XKB name for a particular key, you may use a program
# like wev.
#
# "Mod" is a special modifier equal to Super when running on a TTY, and to Alt
# when running as a winit window.
#
# Most actions that you can bind here can also be invoked programmatically with
# `niri msg action do-something`.
# Mod-Shift-/, which is usually the same as Mod-?,
# shows a list of important hotkeys.
"Mod+Shift+Slash".action.show-hotkey-overlay = { };
# Suggested binds for running programs: terminal, app launcher, screen locker.
"Mod+T".action.spawn = "alacritty";
"Mod+D".action.spawn = "fuzzel";
"Super+Alt+L".action.spawn = "swaylock";
# You can also use a shell. Do this if you need pipes, multiple commands, etc.
# Note: the entire command goes as a single argument in the end.
# Mod+T { spawn "bash" "-c" "notify-send hello && exec alacritty"; }
# Example volume keys mappings for PipeWire & WirePlumber.
# The allow-when-locked=true property makes them work even when the session is locked.
"XF86AudioRaiseVolume" = {
allow-when-locked = true;
action.spawn = [ "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.1+" ];
};
"XF86AudioLowerVolume" = {
allow-when-locked = true;
action.spawn = [ "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.1-" ];
};
"XF86AudioMute" = {
allow-when-locked = true;
action.spawn = [ "wpctl" "set-mute" "@DEFAULT_AUDIO_SINK@" "toggle" ];
};
"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+Ctrl+Left".action.move-column-left = { };
"Mod+Ctrl+Down".action.move-window-down = { };
"Mod+Ctrl+Up".action.move-window-up = { };
"Mod+Ctrl+Right".action.move-column-right = { };
"Mod+Ctrl+H".action.move-column-left = { };
"Mod+Ctrl+J".action.move-window-down = { };
"Mod+Ctrl+K".action.move-window-up = { };
"Mod+Ctrl+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+Ctrl+1".action.move-column-to-workspace = 1;
"Mod+Ctrl+2".action.move-column-to-workspace = 2;
"Mod+Ctrl+3".action.move-column-to-workspace = 3;
"Mod+Ctrl+4".action.move-column-to-workspace = 4;
"Mod+Ctrl+5".action.move-column-to-workspace = 5;
"Mod+Ctrl+6".action.move-column-to-workspace = 6;
"Mod+Ctrl+7".action.move-column-to-workspace = 7;
"Mod+Ctrl+8".action.move-column-to-workspace = 8;
"Mod+Ctrl+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 = { };
};
};
};
}

View file

@ -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`).
{ pkgs, inputs, lib, config, self, ... }:
{ pkgs, inputs, lib, config, ... }:
{
imports = [

21
modules/niri.nix Normal file
View file

@ -0,0 +1,21 @@
{ config, lib, ... }:
let
inherit (lib) mkIf mkEnableOption;
cfg = config.snowhawk.niri;
in
{
options.snowhawk.niri = {
enable = mkEnableOption "niri nixos module";
};
config = mkIf cfg.enable {
programs.niri.enable = true;
services.displayManager.defaultSession = "niri";
services.displayManager.enable = true;
services.displayManager.sddm.enable = true;
services.displayManager.sddm.wayland.enable = true;
};
}