1
1
Fork 0

Compare commits

...

9 commits

Author SHA1 Message Date
4386de1eba
nix: update flake.lock
Signed-off-by: Myned <dev@bjork.tech>
2024-12-23 13:03:40 -05:00
1bb9f42a98
niri: initial module
Signed-off-by: Myned <dev@bjork.tech>
2024-12-23 13:03:34 -05:00
c7252afcee
xwayland-satellite: initial module
Signed-off-by: Myned <dev@bjork.tech>
2024-12-23 13:02:46 -05:00
77598282a9
sudo: explicitly enable module
Signed-off-by: Myned <dev@bjork.tech>
2024-12-23 13:02:31 -05:00
c6aa6332a8
tuigreet: remember user session
Signed-off-by: Myned <dev@bjork.tech>
2024-12-23 13:01:19 -05:00
359471a2fc
nixos.sh: always use --show-trace
Signed-off-by: Myned <dev@bjork.tech>
2024-12-23 13:01:04 -05:00
f293589381
waybar: modify config
Signed-off-by: Myned <dev@bjork.tech>
2024-12-23 13:00:46 -05:00
b790e73b6a
walker: use layer instead of window
Signed-off-by: Myned <dev@bjork.tech>
2024-12-23 13:00:19 -05:00
b07d0ef6fe
agenix: move vm secrets to vm.nix
Signed-off-by: Myned <dev@bjork.tech>
2024-12-23 12:59:31 -05:00
22 changed files with 594 additions and 26 deletions

View file

@ -65,6 +65,7 @@
hyprlock = flake "github:hyprwm/hyprlock" // unstable "nixpkgs";
hyprpaper = flake "github:hyprwm/hyprpaper" // unstable "nixpkgs";
hyprpicker = flake "github:hyprwm/hyprpicker" // unstable "nixpkgs";
niri = flake "github:sodiboo/niri-flake" // unstable "nixpkgs";
nix-flatpak = flake "github:gmodena/nix-flatpak?ref=v0.5.1";
nix-vscode-extensions = flake "github:nix-community/nix-vscode-extensions" // unstable "nixpkgs";
nixd = flake "github:nix-community/nixd" // unstable "nixpkgs";
@ -131,6 +132,7 @@
inputs.arion.nixosModules.arion
inputs.disko.nixosModules.disko
inputs.fw-fanctrl.nixosModules.default
inputs.niri.nixosModules.niri
];
home-manager.users.${config.custom.username}.imports = [

110
flake.lock generated
View file

@ -1744,6 +1744,64 @@
"type": "github"
}
},
"niri": {
"inputs": {
"niri-stable": "niri-stable",
"niri-unstable": "niri-unstable",
"nixpkgs": [
"nixpkgs-unstable"
],
"nixpkgs-stable": "nixpkgs-stable_4",
"xwayland-satellite-stable": "xwayland-satellite-stable",
"xwayland-satellite-unstable": "xwayland-satellite-unstable"
},
"locked": {
"lastModified": 1734836603,
"narHash": "sha256-aRB/OEMtWwv1fVMhIJdGzt1emRrn001AamOtsXglAU0=",
"owner": "sodiboo",
"repo": "niri-flake",
"rev": "9afc24d82ebabdd2b0b7dba8a5f1ce1b42a81fc1",
"type": "github"
},
"original": {
"owner": "sodiboo",
"repo": "niri-flake",
"type": "github"
}
},
"niri-stable": {
"flake": false,
"locked": {
"lastModified": 1731483594,
"narHash": "sha256-Qjf7alRbPPERfiZsM9EMKX+HwjESky1tieh5PJIkLwE=",
"owner": "YaLTeR",
"repo": "niri",
"rev": "75c79116a7e40cbc0e110ce0cdd500e896458679",
"type": "github"
},
"original": {
"owner": "YaLTeR",
"ref": "v0.1.10.1",
"repo": "niri",
"type": "github"
}
},
"niri-unstable": {
"flake": false,
"locked": {
"lastModified": 1734725239,
"narHash": "sha256-ItBmHHSikVrkkh2wD6U0A8pxG1Tk0s90pH9RlK9OB/A=",
"owner": "YaLTeR",
"repo": "niri",
"rev": "b014c267ae199f7022bf691333e64ad6d05907f1",
"type": "github"
},
"original": {
"owner": "YaLTeR",
"repo": "niri",
"type": "github"
}
},
"nix": {
"inputs": {
"flake-compat": "flake-compat_4",
@ -2121,6 +2179,22 @@
}
},
"nixpkgs-stable_4": {
"locked": {
"lastModified": 1734529975,
"narHash": "sha256-ze3IJksru9dN0keqUxY0WNf8xrwfs8Ty/z9v/keyBbg=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "72d11d40b9878a67c38f003c240c2d2e1811e72a",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-24.05",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-stable_5": {
"locked": {
"lastModified": 1733730953,
"narHash": "sha256-dlK7n82FEyZlHH7BFHQAM5tua+lQO1Iv7aAtglc1O5s=",
@ -2316,13 +2390,14 @@
"hyprpicker": "hyprpicker",
"jovian-nixos": "jovian-nixos",
"lifx-cli": "lifx-cli",
"niri": "niri",
"nix-flatpak": "nix-flatpak",
"nix-index-database-stable": "nix-index-database-stable",
"nix-index-database-unstable": "nix-index-database-unstable",
"nix-vscode-extensions": "nix-vscode-extensions",
"nixd": "nixd",
"nixos-hardware": "nixos-hardware",
"nixpkgs-stable": "nixpkgs-stable_4",
"nixpkgs-stable": "nixpkgs-stable_5",
"nixpkgs-staging-next": "nixpkgs-staging-next",
"nixpkgs-unstable": "nixpkgs-unstable",
"steamtinkerlaunch": "steamtinkerlaunch",
@ -2655,6 +2730,39 @@
"repo": "xdg-desktop-portal-hyprland",
"type": "github"
}
},
"xwayland-satellite-stable": {
"flake": false,
"locked": {
"lastModified": 1730166465,
"narHash": "sha256-nq7bouXQXaaPPo/E+Jbq+wNHnatD4dY8OxSrRqzvy6s=",
"owner": "Supreeeme",
"repo": "xwayland-satellite",
"rev": "a713cf46cb7db84a0d1b57c3a397c610cad3cf98",
"type": "github"
},
"original": {
"owner": "Supreeeme",
"ref": "v0.5",
"repo": "xwayland-satellite",
"type": "github"
}
},
"xwayland-satellite-unstable": {
"flake": false,
"locked": {
"lastModified": 1734745564,
"narHash": "sha256-JQNl4pqonVVPQ2JzEOLUcPVRNj//FFFNRDyvQoOkG7s=",
"owner": "Supreeeme",
"repo": "xwayland-satellite",
"rev": "94da1af75326d89ecb12aba0cc9362e93ffdc766",
"type": "github"
},
"original": {
"owner": "Supreeeme",
"repo": "xwayland-satellite",
"type": "github"
}
}
},
"root": "root",

View file

@ -95,6 +95,10 @@
flake = false;
url = "github:Rawa/lifx-cli";
};
niri = {
inputs.nixpkgs.follows = "nixpkgs-unstable";
url = "github:sodiboo/niri-flake";
};
nix-flatpak.url = "github:gmodena/nix-flatpak?ref=v0.5.1";
nix-index-database-stable = {
inputs.nixpkgs.follows = "nixpkgs-stable";

View file

@ -54,6 +54,19 @@ in {
};
home-manager.users.${config.custom.username} = {
programs.niri.settings.outputs = {
"eDP-1" = {
background-color = "#073642";
mode = with config.custom; {
inherit width height;
refresh = refresh + 0.0;
};
scale = config.custom.scale;
};
};
wayland.windowManager.hyprland.settings = {
device = [
{

View file

@ -31,7 +31,7 @@ in {
# TODO: Use option for border size
border = mkOption {default = 2;};
gap = mkOption {default = 5;};
gap = mkOption {default = 15;};
padding = mkOption {default = 51;}; # ?? journalctl --user -u waybar.service | grep height:
rounding = mkOption {default = 10;};

View file

@ -8,6 +8,7 @@ with lib; {
#// gnome.enable = true;
hyprland.enable = true;
#// kde.enable = true;
niri.enable = true;
#// sway.enable = true;
};
}

View file

@ -53,16 +53,6 @@ in {
options.custom.desktops.hyprland.binds.enable = mkOption {default = false;};
config = mkIf cfg.enable {
age.secrets = let
secret = filename: {
file = "${inputs.self}/secrets/${filename}";
owner = config.custom.username;
group = "users";
};
in {
"desktop/vm/myndows.pass" = secret "desktop/vm/myndows.pass";
};
home-manager.users.${config.custom.username} = {
wayland.windowManager.hyprland.settings = let
# Reverse mods and key for alphabetical sorting

View file

@ -0,0 +1,125 @@
{
config,
lib,
pkgs,
...
}:
with lib; let
audio = "~/.local/bin/audio";
cat = "${pkgs.coreutils}/bin/cat";
clipse = "${pkgs.clipse}/bin/clipse";
codium = "${config.home-manager.users.${config.custom.username}.programs.vscode.package}/bin/codium";
gnome-text-editor = "${pkgs.gnome-text-editor}/bin/gnome-text-editor";
hyprlock = "${config.home-manager.users.${config.custom.username}.programs.hyprlock.package}/bin/hyprlock";
hyprpicker = "${pkgs.hyprpicker}/bin/hyprpicker";
inhibit = config.home-manager.users.${config.custom.username}.home.file.".local/bin/inhibit".source;
jq = "${pkgs.jq}/bin/jq";
kill = "${pkgs.procps}/bin/kill";
kitty = "${config.home-manager.users.${config.custom.username}.programs.kitty.package}/bin/kitty";
left = config.home-manager.users.${config.custom.username}.home.file.".local/bin/left".source;
libreoffice = "${config.custom.programs.libreoffice.package}/bin/libreoffice";
loginctl = "${pkgs.systemd}/bin/loginctl";
menu = config.home-manager.users.${config.custom.username}.home.file.".local/bin/menu".source;
nautilus = "${pkgs.nautilus}/bin/nautilus";
networkmanager_dmenu = "${pkgs.networkmanager_dmenu}/bin/networkmanager_dmenu";
notify-send = "${pkgs.libnotify}/bin/notify-send";
niri = "${config.programs.niri.package}/bin/niri";
obsidian = "${pkgs.obsidian}/bin/obsidian";
onlyoffice-desktopeditors = "${pkgs.onlyoffice-bin}/bin/onlyoffice-desktopeditors --system-title-bar --xdg-desktop-portal";
pkill = "${pkgs.procps}/bin/pkill";
playerctl = "${pkgs.playerctl}/bin/playerctl";
power = config.home-manager.users.${config.custom.username}.home.file.".local/bin/power".source;
remote = config.home-manager.users.${config.custom.username}.home.file.".local/bin/remote".source;
rofi-rbw = "${pkgs.rofi-rbw}/bin/rofi-rbw";
rm = "${pkgs.coreutils}/bin/rm";
sleep = "${pkgs.coreutils}/bin/sleep";
smile = "${pkgs.smile}/bin/smile";
steam = "${config.programs.steam.package}/bin/steam";
swayosd-client = "${pkgs.swayosd}/bin/swayosd-client";
systemctl = "${pkgs.systemd}/bin/systemctl";
toggle = "~/.local/bin/toggle";
virt-manager = "${config.programs.virt-manager.package}/bin/virt-manager";
vrr = config.home-manager.users.${config.custom.username}.home.file.".local/bin/vrr".source;
walker = "${config.home-manager.users.${config.custom.username}.programs.walker.package}/bin/walker";
waydroid = "${pkgs.waydroid}/bin/waydroid";
window = config.home-manager.users.${config.custom.username}.home.file.".local/bin/window".source;
workspace = config.home-manager.users.${config.custom.username}.home.file.".local/bin/workspace".source;
zoom = config.home-manager.users.${config.custom.username}.home.file.".local/bin/zoom".source;
cfg = config.custom.desktops.niri.binds;
in {
options.custom.desktops.niri.binds = {
enable = mkOption {default = false;};
};
config = mkIf cfg.enable {
home-manager.users.${config.custom.username} = {
# https://github.com/YaLTeR/niri/wiki/Configuration:-Key-Bindings
#?? Mod = Super/Win, Alt when nested; Mod5 = AltGr
#?? wev
programs.niri.settings.binds = let
# Swap modifiers and key for alphabetical sorting
#?? (key "KEY" "MODIFIERS" (ACTION "ARGUMENT"))
key = key: modifiers: action: {
name = "${
if (isString modifiers)
then "${modifiers}+"
else ""
}${key}";
value = {inherit action;};
};
in
listToAttrs (with config.home-manager.users.${config.custom.username}.lib.niri.actions; [
(key "0" "Mod" (spawn [swayosd-client "--output-volume" "mute-toggle"]))
(key "A" "Mod" focus-column-or-monitor-left)
(key "A" "Mod+Shift" move-column-left-or-to-monitor-left)
(key "Apostrophe" "Mod" screenshot)
(key "Apostrophe" "Mod+Ctrl+Shift" screenshot-screen)
(key "Apostrophe" "Mod+Shift" screenshot-window)
(key "Backslash" "Mod" (spawn inhibit))
(key "Bracketleft" "Mod" (switch-layout "prev"))
(key "Bracketright" "Mod" (switch-layout "next"))
(key "Delete" "Ctrl+Alt" quit)
(key "Delete" "Mod" (spawn [playerctl] "play-pause"))
(key "Down" "Mod" (spawn [swayosd-client "--brightness" "lower"]))
(key "Equal" "Mod" (spawn [swayosd-client "--output-volume" "raise"]))
(key "L" "Mod+Shift" suspend)
(key "L" "Mod" (spawn [hyprlock "--immediate" "&" niri "msg" "power-off-monitors"]))
(key "Left" "Mod" (spawn [playerctl "previous"]))
(key "Minus" "Mod" (spawn [swayosd-client "--output-volume" "lower"]))
(key "Q" "Mod" close-window)
(key "R" "Mod" focus-window-or-workspace-down)
(key "R" "Mod+Shift" move-window-down-or-to-workspace-down)
(key "Return" "Mod" maximize-column)
(key "Return" "Mod+Shift" fullscreen-window)
(key "Right" "Mod" (spawn [playerctl "next"]))
(key "S" "Mod" focus-column-or-monitor-right)
(key "S" "Mod+Shift" move-column-right-or-to-monitor-right)
(key "Slash" "Mod+Shift" show-hotkey-overlay)
(key "T" "Mod" (spawn kitty))
(key "Up" "Mod" (spawn [swayosd-client "--brightness" "raise"]))
(key "W" "Mod" focus-window-or-workspace-up)
(key "W" "Mod+Shift" move-window-up-or-to-workspace-up)
(key "X" "Mod" switch-preset-column-width)
(key "Z" "Mod" switch-preset-window-height)
# BUG: Release binds execute with all binds involving that modifier
# https://github.com/YaLTeR/niri/issues/605
#// (key "Super_L" "Mod" spawn menu)
(key "Space" "Mod" (spawn menu))
# Media keys
# https://github.com/xkbcommon/libxkbcommon/blob/master/include/xkbcommon/xkbcommon-keysyms.h
(key "XF86AudioMute" null (spawn [swayosd-client "--output-volume" "mute-toggle"])) # F1
(key "XF86AudioLowerVolume" null (spawn [swayosd-client "--output-volume" "lower"])) # F2
(key "XF86AudioRaiseVolume" null (spawn [swayosd-client "--output-volume" "raise"])) # F3
(key "XF86AudioPrev" null (spawn [playerctl "previous"])) # F4
(key "XF86AudioPlay" null (spawn [playerctl "play-pause"])) # F5
(key "XF86AudioNext" null (spawn [playerctl "next"])) # F6
(key "XF86MonBrightnessDown" null (spawn [swayosd-client "--brightness" "lower"])) # F7
(key "XF86MonBrightnessUp" null (spawn [swayosd-client "--brightness" "raise"])) # F8
(key "XF86AudioMedia" null (spawn [notify-send "test"])) # F12
]);
};
};
}

View file

@ -0,0 +1,46 @@
{
config,
inputs,
lib,
pkgs,
...
}:
with lib; let
cfg = config.custom.desktops.niri;
in {
options.custom.desktops.niri = {
enable = mkOption {default = false;};
xwayland = mkOption {default = true;};
};
config = mkIf cfg.enable {
custom.desktops.niri = mkIf config.custom.full {
binds.enable = true;
input.enable = true;
layout.enable = true;
misc.enable = true;
rules.enable = true;
};
# https://github.com/YaLTeR/niri
# https://github.com/sodiboo/niri-flake
# https://github.com/sodiboo/niri-flake/blob/main/docs.md
programs.niri = {
enable = true;
package = pkgs.niri; # nixpkgs
};
nixpkgs.overlays = [inputs.niri.overlays.niri];
#!! Disabled bundled KDE polkit agent
# https://github.com/sodiboo/niri-flake?tab=readme-ov-file#additional-notes
systemd.user.services.niri-flake-polkit.enable = false;
# Enable rootless Xwayland
custom.services.xwayland-satellite.enable = cfg.xwayland;
home-manager.users.${config.custom.username} = {
programs.niri.package = config.programs.niri.package;
};
};
}

View file

@ -0,0 +1,56 @@
{
config,
lib,
...
}:
with lib; let
cfg = config.custom.desktops.niri.input;
in {
options.custom.desktops.niri.input = {
enable = mkOption {default = false;};
};
config = mkIf cfg.enable {
home-manager.users.${config.custom.username} = {
# https://github.com/YaLTeR/niri/wiki/Configuration:-Input
programs.niri.settings.input = {
keyboard = {
repeat-delay = 300;
repeat-rate = 40;
};
touchpad = {
accel-profile = "adaptive";
accel-speed = 0.3;
click-method = "clickfinger"; # Multi-finger click
dwt = true; # Disable while typing
dwtp = true; # Disable while trackpointing
scroll-factor = 0.5;
};
mouse = {
# BUG: Applies to trackball device, switch to "flat" when per-device configuration is supported
# https://github.com/YaLTeR/niri/issues/371
accel-profile = "adaptive";
accel-speed = 0.0;
};
trackball = {
accel-profile = "adaptive";
accel-speed = 0.5;
middle-emulation = true;
};
power-key-handling.enable = false;
focus-follows-mouse = {
enable = true;
max-scroll-amount = "70%";
};
workspace-auto-back-and-forth = true;
};
};
};
}

View file

@ -0,0 +1,66 @@
{
config,
lib,
...
}:
with lib; let
cfg = config.custom.desktops.niri.layout;
in {
options.custom.desktops.niri.layout = {
enable = mkOption {default = false;};
};
config = mkIf cfg.enable {
home-manager.users.${config.custom.username} = {
# https://github.com/YaLTeR/niri/wiki/Configuration:-Layout
programs.niri.settings.layout = let
gap = config.custom.gap / 2;
in {
gaps = gap;
#// center-focused-column = "always";
always-center-single-column = true;
# TODO: Uncomment after next release > v1.10.1
# https://github.com/YaLTeR/niri/wiki/Configuration:-Layout#empty-workspace-above-first
#// empty-workspace-above-first = true;
preset-column-widths = [
{proportion = 0.5;}
{proportion = 0.3;}
{proportion = 1.0;}
{proportion = 0.7;} # Default
];
default-column-width = {proportion = 0.7;};
preset-window-heights = [
{proportion = 0.7;}
{proportion = 0.5;}
{proportion = 0.3;}
{proportion = 1.0;} # Default
];
border = {
enable = true;
width = config.custom.border;
active.color = "#d33682";
inactive.color = "#586e75";
};
focus-ring.enable = false;
insert-hint = {
enable = true;
display.color = "#d3368280";
};
struts = {
left = gap;
right = gap;
top = gap;
bottom = gap;
};
};
};
};
}

View file

@ -0,0 +1,42 @@
{
config,
lib,
...
}:
with lib; let
niri = "${config.programs.niri.package}/bin/niri";
cfg = config.custom.desktops.niri.misc;
in {
options.custom.desktops.niri.misc = {
enable = mkOption {default = false;};
};
config = mkIf cfg.enable {
home-manager.users.${config.custom.username} = {
programs.niri.settings = {
# https://github.com/YaLTeR/niri/wiki/Configuration:-Miscellaneous
# HACK: Inherit home-manager environment variables in lieu of upstream fix
# https://github.com/nix-community/home-manager/issues/2659
# https://github.com/YaLTeR/niri/wiki/Configuration:-Miscellaneous#environment
environment = mapAttrs (name: value: builtins.toString value) config.home-manager.users.${config.custom.username}.home.sessionVariables;
cursor = {
hide-after-inactive-ms = 1000 * 15; # Milliseconds
hide-when-typing = true;
};
hotkey-overlay.skip-at-startup = true;
prefer-no-csd = true; # Electron windows have odd borders otherwise
# https://github.com/YaLTeR/niri/wiki/Configuration:-Switch-Events
switch-events = {
# Turn display off while inhibiting suspend
lid-close.action.spawn = [niri "msg" "action" "power-off-monitors"];
lid-open.action.spawn = [niri "msg" "action" "power-on-monitors"];
};
};
};
};
}

View file

@ -0,0 +1,32 @@
{
config,
lib,
...
}:
with lib; let
cfg = config.custom.desktops.niri.rules;
in {
options.custom.desktops.niri.rules = {
enable = mkOption {default = false;};
};
config = mkIf cfg.enable {
home-manager.users.${config.custom.username} = {
# https://github.com/YaLTeR/niri/wiki/Configuration:-Window-Rules
programs.niri.settings.window-rules = [
{
geometry-corner-radius = let
radius = config.custom.rounding + 0.0; # Convert to float
in {
top-left = radius;
top-right = radius;
bottom-right = radius;
bottom-left = radius;
};
clip-to-geometry = true;
}
];
};
};
}

View file

@ -32,7 +32,7 @@ in {
search.placeholder = "";
# HACK: Window client required to send Esc key on Hyprland
as_window = true; # Disable layer
#// as_window = true; # Disable layer
# https://github.com/abenz1267/walker/wiki/Modules
# https://github.com/PapirusDevelopmentTeam/papirus-icon-theme/tree/master/Papirus/64x64

View file

@ -60,7 +60,9 @@ in {
systemd.enable = true; # Start on login
# ?? waybar --log-level debug
style = ''
style = let
gap = toString config.custom.gap;
in ''
* {
border-radius: 50px;
color: #93a1a1;
@ -70,7 +72,7 @@ in {
}
.horizontal > box {
margin: 0 ${toString config.custom.gap}px ${toString config.custom.gap}px;
margin: 0 ${gap}px ${gap}px;
}
${readFile ./style.css}
@ -125,7 +127,7 @@ in {
reload_style_on_change = true; # Reload CSS when modified
## GLOBAL ##
layer = "bottom";
layer = "top";
position = "bottom";
## POSITION ##
@ -134,7 +136,8 @@ in {
"custom/inhibitor"
"custom/vpn"
"custom/vm"
"hyprland/workspaces"
(mkIf config.custom.desktops.hyprland.enable "hyprland/workspaces")
(mkIf config.custom.desktops.niri.enable "niri/workspaces")
];
modules-center = [
"clock"
@ -214,6 +217,27 @@ in {
};
};
# https://github.com/Alexays/Waybar/wiki/Module:-Niri
# https://www.nerdfonts.com/cheat-sheet
"niri/workspaces" = {
format = "{icon}";
format-icons = {
android = "";
dropdown = "󰞷";
game = "󰊴";
hidden = "";
music = "󰝚";
office = "󰈙";
password = "󰌾";
pip = "󰹙";
scratchpad = "";
steam = "󰓓";
terminal = "";
vm = "󰢹";
wallpaper = "󰏩";
};
};
cava = cava-config;
# https://github.com/Alexays/Waybar/wiki/Module:-Clock

View file

@ -42,7 +42,7 @@ tooltip label {
.horizontal > box {
background: #002b36;
border: 2px #073642 solid;
border: 2px #586e75 solid;
padding: 4px;
}

View file

@ -41,9 +41,9 @@ _build() {
else
# Build current system
if [[ "${argc_builder:-}" == nh ]]; then
nh os "$1" -- ${argc_extra:+"${argc_extra[@]}"}
nh os "$1" -- --show-trace ${argc_extra:+"${argc_extra[@]}"}
elif [[ "${argc_builder:-}" == nixos ]]; then
sudo nixos-rebuild "$1" ${argc_extra:+"${argc_extra[@]}"}
sudo nixos-rebuild "$1" --show-trace ${argc_extra:+"${argc_extra[@]}"}
fi
fi

View file

@ -5,7 +5,6 @@
...
}:
with lib; let
Hyprland = "${config.programs.hyprland.package}/bin/Hyprland";
systemd-cat = "${pkgs.systemd}/bin/systemd-cat";
tuigreet = "${pkgs.greetd.tuigreet}/bin/tuigreet";
@ -21,9 +20,10 @@ in {
settings.default_session = {
command = lib.concatStringsSep " " [
"${tuigreet}"
tuigreet
"--session-wrapper '${systemd-cat} --identifier wm'" # ?? journalctl --identifier wm
"--remember"
"--remember-user-session"
"--time"
"--asterisks"
"--window-padding 1"

View file

@ -0,0 +1,47 @@
{
config,
lib,
pkgs,
...
}:
with lib; let
xwayland-satellite = "${pkgs.xwayland-satellite}/bin/xwayland-satellite";
cfg = config.custom.services.xwayland-satellite;
in {
options.custom.services.xwayland-satellite.enable = mkOption {default = false;};
config = mkIf cfg.enable {
# HACK: Use official module if added
# BUG: Fractional scaling is currently not supported
# https://github.com/Supreeeme/xwayland-satellite/issues/11
# Rootless Xwayland support as a user service
# https://github.com/Supreeeme/xwayland-satellite
# https://github.com/Supreeeme/xwayland-satellite/blob/main/resources/xwayland-satellite.service
systemd.user.services.xwayland-satellite = {
enable = true;
unitConfig = {
Description = "Xwayland outside your Wayland";
BindsTo = ["graphical-session.target"];
PartOf = ["graphical-session.target"];
After = ["graphical-session.target"];
Requisite = ["graphical-session.target"];
};
serviceConfig = {
Type = "notify";
NotifyAccess = "all";
ExecStart = xwayland-satellite;
StandardOutput = "journal";
};
wantedBy = ["graphical-session.target"];
};
environment.sessionVariables = {
DISPLAY = ":0"; # Assume first display
};
};
}

View file

@ -25,7 +25,7 @@ in {
#// i18n.defaultLocale = "C.UTF-8";
sessionVariables = {
GDK_SCALE = toString config.custom.scale; # Steam HiDPI
GDK_SCALE = mkIf (!config.custom.services.xwayland-satellite.enable) (toString config.custom.scale); # Steam HiDPI
# https://wiki.nixos.org/wiki/Wayland#Electron_and_Chromium
NIXOS_OZONE_WL = mkIf cfg.wayland "1";

View file

@ -12,13 +12,15 @@ in {
config = mkIf cfg.enable {
# Bypass password prompts
security = {
sudo.wheelNeedsPassword = false;
sudo = {
enable = true;
wheelNeedsPassword = false;
};
# https://wiki.nixos.org/wiki/Sway#Using_Home_Manager
# https://wiki.archlinux.org/title/Polkit#Bypass_password_prompt
polkit = {
enable = true;
# https://wiki.archlinux.org/title/Polkit#Bypass_password_prompt
extraConfig = ''
polkit.addRule(function(action, subject) {
if (subject.isInGroup("wheel")) { return polkit.Result.YES; }

View file

@ -27,6 +27,16 @@ in {
};
config = mkIf cfg.enable {
age.secrets = let
secret = filename: {
file = "${inputs.self}/secrets/${filename}";
owner = config.custom.username;
group = "users";
};
in {
"desktop/vm/myndows.pass" = secret "desktop/vm/myndows.pass";
};
virtualisation = {
# https://wiki.nixos.org/wiki/Libvirt
# https://libvirt.org