diff --git a/apps/de/default.nix b/apps/de/default.nix index 25c34e3..a9af9e4 100644 --- a/apps/de/default.nix +++ b/apps/de/default.nix @@ -1,6 +1,8 @@ { pkgs, ... }: { - imports = [ ./gtk.nix ]; + imports = [ + ./gtk.nix + ]; dconf.settings = let wallpaper = pkgs.fetchurl { diff --git a/apps/gui/default.nix b/apps/gui/default.nix index ffb0a61..19e9905 100644 --- a/apps/gui/default.nix +++ b/apps/gui/default.nix @@ -5,6 +5,7 @@ ./firefox.nix ./flameshot.nix ./ghostty.nix + ./niri.nix ./obs.nix ./spotify.nix ./wezterm.nix diff --git a/apps/gui/niri.nix b/apps/gui/niri.nix new file mode 100644 index 0000000..ac36582 --- /dev/null +++ b/apps/gui/niri.nix @@ -0,0 +1,125 @@ +{ pkgs, ... }: +{ + home.packages = with pkgs; [ + wofi + waybar + ]; + programs.niri = { + enable = true; + settings = { + input = { + #keyboard = { + # layout = "us"; + #}; + touchpad = { + tap = true; + natural-scroll = true; + }; + }; + + binds = { + "Mod+T" = { + action.spawn = "ghostty"; + }; + + # App launcher + "Mod+D" = { + action.spawn = [ + "wofi" + "--show" + "drun" + ]; + }; + + "Mod+Q" = { + action.close-window = { }; + }; + + "Mod+Shift+E" = { + action.quit = { }; + }; + + "Print" = { + action.spawn = "grim"; + }; + "Shift+Print" = { + action.spawn = [ + "sh" + "-c" + "grim -g \"$(slurp)\"" + ]; + }; + + "Mod+Left" = { + action.focus-column-left = { }; + }; + "Mod+Right" = { + action.focus-column-right = { }; + }; + "Mod+Up" = { + action.focus-window-up = { }; + }; + "Mod+Down" = { + action.focus-window-down = { }; + }; + + "Mod+Shift+Left" = { + action.move-column-left = { }; + }; + "Mod+Shift+Right" = { + action.move-column-right = { }; + }; + "Mod+Shift+Up" = { + action.move-window-up = { }; + }; + "Mod+Shift+Down" = { + action.move-window-down = { }; + }; + + "Mod+R" = { + action.switch-preset-column-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+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; + }; + }; + + layout = { + gaps = 16; + center-focused-column = "never"; + }; + + window-rules = [ + { + matches = [ { app-id = "firefox"; } ]; + default-column-width = { + proportion = 0.5; + }; + } + ]; + }; + }; +} diff --git a/flake.lock b/flake.lock index a3a1018..f94fd67 100644 --- a/flake.lock +++ b/flake.lock @@ -120,6 +120,62 @@ "type": "github" } }, + "niri": { + "inputs": { + "niri-stable": "niri-stable", + "niri-unstable": "niri-unstable", + "nixpkgs": "nixpkgs_4", + "nixpkgs-stable": "nixpkgs-stable", + "xwayland-satellite-stable": "xwayland-satellite-stable", + "xwayland-satellite-unstable": "xwayland-satellite-unstable" + }, + "locked": { + "lastModified": 1750270605, + "narHash": "sha256-JfuuBGrM36I7KB9UID5urRvjHWWjFW//gMxQ5g9PrSo=", + "owner": "sodiboo", + "repo": "niri-flake", + "rev": "da32eedd0d2c980fc90fe2b5cdd9080cc8c9f51f", + "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": 1750225787, + "narHash": "sha256-7O/8CChaOhSBSu94McHE0vyH0o+J5R4exq2DDq4zHAg=", + "owner": "YaLTeR", + "repo": "niri", + "rev": "ed14e8da8476d5fde27b14d1dde03256a2f6e11b", + "type": "github" + }, + "original": { + "owner": "YaLTeR", + "repo": "niri", + "type": "github" + } + }, "nixos-hardware": { "locked": { "lastModified": 1747900541, @@ -152,6 +208,22 @@ "type": "github" } }, + "nixpkgs-stable": { + "locked": { + "lastModified": 1750133334, + "narHash": "sha256-urV51uWH7fVnhIvsZIELIYalMYsyr2FCalvlRTzqWRw=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "36ab78dab7da2e4e27911007033713bab534187b", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-25.05", + "repo": "nixpkgs", + "type": "github" + } + }, "nixpkgs_2": { "locked": { "lastModified": 1733935885, @@ -186,15 +258,15 @@ }, "nixpkgs_4": { "locked": { - "lastModified": 1748190013, - "narHash": "sha256-R5HJFflOfsP5FBtk+zE8FpL8uqE7n62jqOsADvVshhE=", - "owner": "nixos", + "lastModified": 1750134718, + "narHash": "sha256-v263g4GbxXv87hMXMCpjkIxd/viIF7p3JpJrwgKdNiI=", + "owner": "NixOS", "repo": "nixpkgs", - "rev": "62b852f6c6742134ade1abdd2a21685fd617a291", + "rev": "9e83b64f727c88a7711a2c463a7b16eedb69a84c", "type": "github" }, "original": { - "owner": "nixos", + "owner": "NixOS", "ref": "nixos-unstable", "repo": "nixpkgs", "type": "github" @@ -217,6 +289,22 @@ } }, "nixpkgs_6": { + "locked": { + "lastModified": 1748190013, + "narHash": "sha256-R5HJFflOfsP5FBtk+zE8FpL8uqE7n62jqOsADvVshhE=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "62b852f6c6742134ade1abdd2a21685fd617a291", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_7": { "locked": { "lastModified": 1741037377, "narHash": "sha256-SvtvVKHaUX4Owb+PasySwZsoc5VUeTf1px34BByiOxw=", @@ -232,7 +320,7 @@ "type": "github" } }, - "nixpkgs_7": { + "nixpkgs_8": { "locked": { "lastModified": 1726937504, "narHash": "sha256-bvGoiQBvponpZh8ClUcmJ6QnsNKw0EMrCQJARK3bI1c=", @@ -248,7 +336,7 @@ "type": "github" } }, - "nixpkgs_8": { + "nixpkgs_9": { "locked": { "lastModified": 1743583204, "narHash": "sha256-F7n4+KOIfWrwoQjXrL2wD9RhFYLs2/GGe/MQY1sSdlE=", @@ -266,7 +354,7 @@ "nur": { "inputs": { "flake-parts": "flake-parts", - "nixpkgs": "nixpkgs_5", + "nixpkgs": "nixpkgs_6", "treefmt-nix": "treefmt-nix" }, "locked": { @@ -285,7 +373,7 @@ }, "pokego": { "inputs": { - "nixpkgs": "nixpkgs_6" + "nixpkgs": "nixpkgs_7" }, "locked": { "lastModified": 1741123315, @@ -308,8 +396,9 @@ "gomodinit": "gomodinit", "helix": "helix", "home-manager": "home-manager", + "niri": "niri", "nixos-hardware": "nixos-hardware", - "nixpkgs": "nixpkgs_4", + "nixpkgs": "nixpkgs_5", "nur": "nur", "pokego": "pokego", "spectre": "spectre", @@ -318,7 +407,7 @@ }, "spectre": { "inputs": { - "nixpkgs": "nixpkgs_7" + "nixpkgs": "nixpkgs_8" }, "locked": { "lastModified": 1732207908, @@ -366,7 +455,7 @@ }, "tclip": { "inputs": { - "nixpkgs": "nixpkgs_8", + "nixpkgs": "nixpkgs_9", "utils": "utils" }, "locked": { @@ -421,6 +510,39 @@ "repo": "flake-utils", "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": 1749315541, + "narHash": "sha256-bEik1BfVOFnWvtOrcOHluos/edJ8f+G2y1QySbt/0Ak=", + "owner": "Supreeeme", + "repo": "xwayland-satellite", + "rev": "da2ecb5be816de35e2efe23a408a1c49fe8b11ba", + "type": "github" + }, + "original": { + "owner": "Supreeeme", + "repo": "xwayland-satellite", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 04d9c1f..4b73e65 100644 --- a/flake.nix +++ b/flake.nix @@ -16,6 +16,7 @@ }; }; nixos-hardware.url = "github:nixos/nixos-hardware/master"; + niri.url = "github:sodiboo/niri-flake"; nur.url = "github:nix-community/NUR"; helix.url = "git+https://git.jolheiser.com/helix.drv.git"; gomodinit.url = "git+https://git.jolheiser.com/gomodinit.git"; @@ -30,6 +31,7 @@ nixpkgs, home-manager, nixos-hardware, + niri, agenix, ... }@inputs: @@ -103,7 +105,10 @@ homeConfigurations = { "jolheiser" = home-manager.lib.homeManagerConfiguration { inherit pkgs; - modules = homeManagerModules ++ [ ./apps/de ]; + modules = homeManagerModules ++ [ + niri.homeModules.niri + ./apps/de + ]; }; }; nixosConfigurations = { @@ -111,6 +116,7 @@ inherit system; modules = [ nixos-hardware.nixosModules.framework-13-7040-amd + niri.nixosModules.niri ./machines/genmaicha commonConfig ]; @@ -129,4 +135,19 @@ ]; }; }; + nixConfig = { + warn-dirty = false; + extra-experimental-features = [ + "nix-command" + "flakes" + ]; + extra-substituters = [ + "https://niri.cachix.org" + "https://jolheiser.cachix.org" + ]; + extra-trusted-public-keys = [ + "niri.cachix.org-1:Wv0OmO7PsuocRKzfDoJ3mulSl7Z6oezYhGhR+3W2964=" + "jolheiser.cachix.org-1:fiKkfTuHFqDK5ZOVxcqb4InUkKsrTvtMLISid7XvuVg=" + ]; + }; } diff --git a/machines/common/gui/default.nix b/machines/common/gui/default.nix index 907b59f..3330e35 100644 --- a/machines/common/gui/default.nix +++ b/machines/common/gui/default.nix @@ -1,6 +1,8 @@ { pkgs, ... }: { - imports = [ ../nogui ]; + imports = [ + ../nogui + ]; security = { rtkit.enable = true; @@ -14,19 +16,34 @@ pulseaudio.enable = false; xserver = { enable = true; - displayManager.lightdm.enable = true; - desktopManager.cinnamon.enable = true; + displayManager.gdm = { + enable = true; + wayland = true; + }; xkb = { layout = "us"; variant = ""; }; }; }; + xdg.portal = { + enable = true; + wlr.enable = true; + extraPortals = with pkgs; [ + xdg-desktop-portal-gtk + ]; + }; + fonts.packages = with pkgs.nerd-fonts; [ hack iosevka jetbrains-mono monaspace ]; - environment.systemPackages = [ pkgs.tailscale-systray ]; + environment.systemPackages = with pkgs; [ + tailscale-systray + grim + slurp + wl-clipboard + ]; }