This commit is contained in:
Lucy Hochkamp 2025-03-23 16:02:52 +01:00
parent 62df62c3aa
commit db11846811
No known key found for this signature in database
27 changed files with 887 additions and 64 deletions

35
modules/desktop/audio.nix Normal file
View file

@ -0,0 +1,35 @@
{
pkgs,
config,
lib,
...
}:
let
cfg = config.xyno.desktop.audio;
in
{
options.xyno.desktop.audio.enable = lib.mkEnableOption "enable pipewire and stuff";
config = lib.mkIf cfg.enable {
services.pipewire = {
enable = true;
# raopOpenFirewall = true; # airplay
pulse.enable = true;
extraConfig.pipewire = {
"9-clock-allow-higher" = {
"context.properties" = {
"default.clock.allowed-rates" = [ "44100" "48000" "96000" "192000" ];
};
};
# "10-raop-discover" = {
# "context.modules" = [
# {
# name = "libpipewire-module-raop-discover";
# args = { };
# }
# ];
# };
};
};
};
}

View file

@ -0,0 +1,53 @@
{
pkgs,
config,
lib,
...
}:
let
cfg = config.xyno.desktop.common-programs;
in
{
options.xyno.desktop.common-programs.enable =
lib.mkEnableOption "install some commonly used programs";
config = lib.mkIf cfg.enable {
home-manager.users.${config.xyno.system.user.name} = lib.mkIf config.xyno.presets.home-manager.enable ({...}: {
xyno.alacritty.enable = true;
xyno.helix.enable = true;
});
programs.steam = {
enable = true;
remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play
# dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server
localNetworkGameTransfers.openFirewall = true; # Open ports in the firewall for Steam Local Network Game Transfers
};
programs.evolution.enable = true;
services.gnome.evolution-data-server.enable = true;
services.flatpak.enable = true;
programs.fuse.userAllowOther = true;
programs.sway.enable = true;
programs.nix-ld.enable = true;
programs.gamescope.enable = true;
programs.wireshark.enable = true;
programs.kdeconnect.enable = true;
environment.systemPackages = with pkgs; [
element-desktop # this is not a place of honor
discord # shitcord
unstable.signal-desktop
obsidian
diebahn
vlc
lutris
libreoffice-qt6-fresh
inkscape
easyeffects
dune3d
appimage-run
unstable.keepassxc
inputs.zen-browser.packages."${pkgs.system}".default
];
};
}

View file

@ -26,9 +26,13 @@ in
};
config = lib.mkIf cfg.enable {
systemd.user.services.mako = {
unitConfig.PartOf = "graphical-session.target";
unitConfig.After = "graphical-session.target";
unitConfig.Requisite = "graphical-session.target";
serviceConfig.Restart = "on-failure";
wantedBy = [ cfg.wantedBy ];
script = "${cfg.package}/bin/mako -c ${makoConf}";
restartTrigers = makoConf;
restartTriggers = [makoConf];
};
};
}

View file

@ -12,7 +12,7 @@ let
"KeePassXC"
"org.gnome.NautilusPreviewer"
];
matchFloat = lib.concatStringSep "\n" (
matchFloat = lib.concatStringsSep "\n" (
map (x: ''
window-rule {
match app-id="${x}"
@ -29,12 +29,55 @@ in
waybar.enable = lib.mkDefault true;
mako.enable = lib.mkDefault true;
};
home-manager.users.${config.xyno.system.user.name} = lib.mkIf config.xyno.presets.home-manager.enable ({...}: {
xyno.dark-theme.enable = true;
});
# xdg.portal = {
# enable = true;
# wlr.enable = true;
# };
programs.niri.enable = true;
environment.etc."niri/config.kdl".text = ''
// xwayland
spawn-at-startup "${pkgs.xwayland-sattelite}/bin/xwayland-sattelite"
spawn-at-startup "${pkgs.xwayland-satellite}/bin/xwayland-satellite"
screenshot-path "~/Pictures/screenshots/screenshot-%Y-%m-%d %H-%M-%S.png"
// Indicate screencasted windows with red colors.
window-rule {
match is-window-cast-target=true
focus-ring {
active-color "#f38ba8"
inactive-color "#7d0d2d"
}
border {
inactive-color "#7d0d2d"
}
shadow {
color "#7d0d2d70"
}
tab-indicator {
active-color "#f38ba8"
inactive-color "#7d0d2d"
}
}
// Block out password managers from screencasts.
window-rule {
match app-id=r#"^org\.keepassxc\.KeePassXC$"#
match app-id=r#"^org\.gnome\.World\.Secrets$"#
block-out-from "screencast"
}
// Block out mako notifications from screencasts.
layer-rule {
match namespace="^notifications$"
block-out-from "screencast"
}
input {
workspace-auto-back-and-forth
focus-follows-mouse max-scroll-amount="10%"

View file

@ -0,0 +1,48 @@
{
pkgs,
config,
lib,
...
}:
let
cfg = config.xyno.desktop.swayidle;
makoConf = pkgs.writeText "mako.conf" ''
font=Source Sans Pro Nerd Font 11
background-color=#1d2021ff
border-color=#3c3836FF
text-color=#ebdbb2ff
progress-color=over #928374FF
'';
in
{
options.xyno.desktop.swayidle.enable = lib.mkEnableOption "enable swayidle and swaylock and stuff";
options.xyno.desktop.swayidle.wantedBy = lib.mkOption {
type = lib.types.str;
default = "niri.service";
};
options.xyno.desktop.swayidle.package = lib.mkOption {
type = lib.types.package;
default = pkgs.swayidle;
};
options.xyno.desktop.swayidle.swaylockPackage = lib.mkOption {
type = lib.types.package;
default = pkgs.swaylock-effects;
};
options.xyno.desktop.swayidle.swaylockArgs = lib.mkOption {
type = lib.types.str;
default = "--fade-in 2 --clock --timestr %T%z --datestr %F";
};
config = lib.mkIf cfg.enable {
environment.systemPackages = with cfg; [ package swaylockPackage ];
systemd.user.services.mako = {
unitConfig.PartOf = "graphical-session.target";
unitConfig.After = "graphical-session.target";
unitConfig.Requisite = "graphical-session.target";
serviceConfig.Restart = "on-failure";
wantedBy = [ cfg.wantedBy ];
script = "${cfg.package}/bin/mako -c ${makoConf}";
restartTrigers = makoConf;
};
};
}

View file

@ -15,7 +15,7 @@ in
};
options.xyno.desktop.waybar.package = lib.mkOption {
type = lib.types.package;
default = pkgs.waybar;
default = pkgs.unstable.waybar;
};
options.xyno.desktop.waybar.mode = lib.mkOption {
type = lib.types.str;
@ -23,24 +23,27 @@ in
};
config = lib.mkIf cfg.enable {
programs.waybar.enable = true;
programs.light.enable = true;
systemd.user.services.waybar.wantedBy = lib.mkForce [ cfg.wantedBy ];
environment.etc."xdg/waybar/config".text = builtins.toJSON {
mainBar = {
layer = "top";
position = "top";
height = 15;
modules-left =
(lib.mkIf (cfg.mode == "river") [
(lib.optional (cfg.mode == "river") [
"river/tags"
"river/layout"
"river/window"
])
++ (lib.mkIf (cfg.mode == "niri") [
++ (lib.optional (cfg.mode == "niri") [
"niri/workspaces"
"niri/window"
]);
modules-right = [
"tray"
"power_profiles_daemon"
"power-profiles-daemon"
"idle_inhibitor"
"wireplumber"
"battery"

View file

@ -0,0 +1,29 @@
{
pkgs,
lib,
config,
...
}:
let
cfg = config.xyno.hardware.kmonad;
in
{
options.xyno.hardware.kmonad.enable = lib.mkEnableOption "kmonad with xynos brain damage";
config = lib.mkIf cfg.enable {
services.kmonad = {
enable = true;
keyboards = {
builtin = {
device = "/dev/input/by-path/platform-i8042-serio-0-event-kbd";
config = builtins.readFile ./kmonad/builtin.kbd;
};
k70-office = {
device = "/dev/input/by-id/usb-Corsair_CORSAIR_K70_CORE_RGB_TKL_Mechanical_Gaming_Keyboard_599A4D472DCAC05584072AFB922E3BFB-event-kbd";
config = builtins.readFile ./kmonad/k70.kbd;
};
};
};
};
}

View file

@ -0,0 +1,89 @@
(defcfg
;; ** For Linux **
input (device-file "/dev/input/by-id/usb-04d9_USB-HID_Keyboard-event-kbd")
;; input (device-file "/dev/input/by-path/platform-i8042-serio-0-event-kbd")
output (uinput-sink "KMonad output")
;; ** For Windows **
;; input (low-level-hook)
;; output (send-event-sink)
;; ** For MacOS **
;; input (iokit-name "my-keyboard-product-string")
;; output (kext)
fallthrough true
)
(defsrc
esc f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
grv 1 2 3 4 5 6 7 8 9 0 - = bspc
tab q w e r t y u i o p [ ]
caps a s d f g h j k l ; ' \ ret
lsft 102d z x c v b n m , . / rsft
lctl lmet lalt spc ralt rmet cmp rctl
)
(defalias
ext (layer-toggle extend) ;; Bind 'ext' to the Extend Layer
)
(defalias
cpy C-c
pst C-v
cut C-x
udo C-z
all C-a
fnd C-f
bk Back
fw Forward
)
(defalias
num (layer-toggle num)
)
(deflayer colemak-dh
esc f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
grv 1 2 3 4 5 6 7 8 9 0 - = bspc
tab q w f p b j l u y ; [ ]
esc (tap-hold-next-release 200 a lctrl) (tap-hold-next-release 200 r ralt) (tap-hold-next-release 200 s lmet) t g m n (tap-hold-next-release 200 e rmet) (tap-hold-next-release 200 i lalt) (tap-hold-next-release 200 o rctrl) ' \\ ret
lsft z x c d v 102d k h , . / rsft
lctl lmet lalt spc ralt rmet _ _
)
(deflayer num
esc f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
grv 1 2 3 4 5 6 7 8 9 0 - = bspc
tab q w f p b j l u y ; [ ]
esc 1 2 3 4 5 6 7 8 9 0 ' \\ ret
lsft z x c d v 102d k h , . / rsft
lctl lmet lalt spc ralt rmet _ _
)
(deflayer colemak-dhk
esc f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
grv 1 2 3 4 5 6 7 8 9 0 - = bspc
tab q w f p b j l u y ; [ ]
@ext a r s t g k n e i o ' \\ ret
lsft z x c d v 102d m h , . / rsft
lctl lmet lalt spc ralt rmet _ _
)
(deflayer extend
_ play rewind previoussong nextsong ejectcd refresh brdn brup www mail prog1 prog2
_ f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 _
_ esc @bk @fnd @fw ins pgup home up end menu prnt slck
_ lalt lmet lsft lctl ralt pgdn lft down rght del caps _ _
_ @udo @cut @cpy tab @pst _ pgdn bks lsft lctl comp _
_ _ _ ret _ _ _ _
)
(deflayer empty
_ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _
)

View file

@ -0,0 +1,89 @@
(defcfg
;; ** For Linux **
input (device-file "/dev/input/by-id/usb-Corsair_CORSAIR_K70_CORE_RGB_TKL_Mechanical_Gaming_Keyboard_599A4D472DCAC05584072AFB922E3BFB-event-kbd")
;; input (device-file "/dev/input/by-path/platform-i8042-serio-0-event-kbd")
output (uinput-sink "KMonad output razer")
;; ** For Windows **
;; input (low-level-hook)
;; output (send-event-sink)
;; ** For MacOS **
;; input (iokit-name "my-keyboard-product-string")
;; output (kext)
fallthrough true
)
(defsrc
esc f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
grv 1 2 3 4 5 6 7 8 9 0 - = bspc
tab q w e r t y u i o p [ ]
caps a s d f g h j k l ; ' \ ret
lsft 102d z x c v b n m , . / rsft
lctl lmet lalt spc ralt rmet cmp rctl
)
(defalias
ext (layer-toggle extend) ;; Bind 'ext' to the Extend Layer
)
(defalias
cpy C-c
pst C-v
cut C-x
udo C-z
all C-a
fnd C-f
bk Back
fw Forward
)
(defalias
num (layer-toggle num)
)
(deflayer colemak-dh
esc f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
z 1 2 3 4 5 6 7 8 9 0 - = bspc
tab (tap-hold-next-release 200 q @num) w f p b j l u y (tap-hold-next-release 200 ; @num) [ ]
esc (tap-hold-next-release 200 a lctrl) (tap-hold-next-release 200 r ralt) (tap-hold-next-release 200 s lmet) t g m n (tap-hold-next-release 200 e rmet) (tap-hold-next-release 200 i lalt) (tap-hold-next-release 200 o rctrl) ' \\ ret
lsft z x c d v 102d k h , . / rsft
lctl lmet lalt spc ralt rmet _ _
)
(deflayer num
esc f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
grv 1 2 3 4 5 6 7 8 9 0 - = bspc
tab q w f p b j l u y ; [ ]
esc 1 2 3 4 5 6 7 8 9 0 ' \\ ret
lsft z x c d v 102d k h , . / rsft
lctl lmet lalt spc ralt rmet _ _
)
(deflayer colemak-dhk
esc f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
grv 1 2 3 4 5 6 7 8 9 0 - = bspc
tab q w f p b j l u y ; [ ]
@ext a r s t g k n e i o ' \\ ret
lsft z x c d v 102d m h , . / rsft
lctl lmet lalt spc ralt rmet _ _
)
(deflayer extend
_ play rewind previoussong nextsong ejectcd refresh brdn brup www mail prog1 prog2
_ f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 _
_ esc @bk @fnd @fw ins pgup home up end menu prnt slck
_ lalt lmet lsft lctl ralt pgdn lft down rght del caps _ _
_ @udo @cut @cpy tab @pst _ pgdn bks lsft lctl comp _
_ _ _ ret _ _ _ _
)
(deflayer empty
_ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _
)

View file

@ -1,8 +1,16 @@
[
./desktop/niri.nix
./desktop/waybar.nix
./desktop/mako.nix
./cli/fish.nix
./cli/starship.nix
./desktop/audio.nix
./desktop/common-programs.nix
./desktop/mako.nix
./desktop/niri.nix
./desktop/waybar.nix
./hardware/kmonad.nix
./networking/networkd.nix
./presets/cli.nix
./presets/gui.nix
./presets/home-manager.nix
./system/user.nix
]

View file

@ -0,0 +1,18 @@
{
pkgs,
config,
lib,
...
}:
let
cfg = config.xyno.networking.networkd;
in
{
options.xyno.networking.networkd.enable = lib.mkEnableOption "enable systemd networkd";
options.xyno.networking.networkd.enableWifi = lib.mkEnableOption "enable iwd";
config = lib.mkIf cfg.enable {
systemd.network.enable = true;
networking.useNetworkd = true;
networking.wireless.iwd.enable = cfg.enableWifi;
};
}

View file

@ -13,6 +13,7 @@ in
config = lib.mkIf cfg.enable {
xyno.cli.fish.enable = true;
xyno.cli.starship.enable = true;
security.sudo.enable = false;
environment.systemPackages = with pkgs; [
jq
bottom
@ -27,6 +28,7 @@ in
yt-dlp
helix
];
programs.mosh.enable = true;
environment.variables.EDITOR = "hx";
environment.variables.VISUAL = "hx";
@ -42,6 +44,7 @@ in
gl = "git log --graph";
p = "cd ~/proj";
ytl = ''yt-dlp -f "bv*+mergeall[vcodec=none]" --audio-multistreams'';
sudo = "run0";
};
};
}

View file

@ -9,14 +9,47 @@ let
in
{
options.xyno.presets.gui.enable = lib.mkEnableOption "enables xynos gui config";
config = cfg.enable {
config = lib.mkIf cfg.enable {
xyno.desktop.niri.enable = true;
xyno.desktop.audio.enable = lib.mkDefault true;
xyno.hardware.kmonad.enable = true;
# wayland on electron
environment.sessionVariables.NIXOS_OZONE_WL = "1";
services.displayManager.defaultSession = "niri";
services.displayManager.sddm = {
settings.General.DisplayServer = "wayland";
# gdm
services.xserver.displayManager.gdm.enable = true;
services.xserver.enable = true;
services.xserver.displayManager.gdm.wayland = true;
# ssh agent
programs.ssh.startAgent = true;
# setup printing
services.avahi = {
enable = true;
wayland.enable = true;
nssmdns4 = true;
nssmdns6 = true;
openFirewall = true;
};
services.printing.enable = true;
# enable the gnome shit
services.gnome.gnome-keyring.enable = true;
services.gnome.gnome-online-accounts.enable = true;
services.gnome.core-utilities.enable = true;
services.gnome.sushi.enable = true;
services.gnome.gnome-settings-daemon.enable = true;
services.gvfs.enable = true;
# fonts
fonts.packages = with pkgs; [
nerdfonts
cantarell-fonts
dejavu_fonts
source-code-pro # Default monospace font in 3.32
source-sans
b612
];
};
}

View file

@ -0,0 +1,22 @@
{
config,
lib,
inputs,
...
}:
let
cfg = config.xyno.presets.home-manager;
in
{
options.xyno.presets.home-manager.enable =
lib.mkEnableOption "enables home manager on the default user";
config = lib.mkIf cfg.enable {
home-manager.useGlobalPkgs = true;
home-manager.sharedModules = (import ../../hm-modules/module-list.nix) ++ [
inputs.nix-flatpak.homeManagerModules.nix-flatpak
];
home-manager.users.${config.xyno.system.user.name} = {pkgs, ... }: {
home.stateVersion = lib.mkDefault "24.11";
};
};
}

38
modules/system/user.nix Normal file
View file

@ -0,0 +1,38 @@
{
pkgs,
config,
lib,
...
}:
let
cfg = config.xyno.system.user;
in
{
options.xyno.system.user.enable = lib.mkEnableOption "enable a user with xynos config";
options.xyno.system.user.name = lib.mkOption {
type = lib.types.str;
default = "xyno";
};
config = lib.mkIf cfg.enable {
environment.homeBinInPath = true;
users.users.${cfg.name} = {
isNormalUser = true;
uid = 1000;
extraGroups = [
"wheel"
"cdrom"
"networkmanager"
"video"
"netdev"
"plugdev"
"dialout"
"tape"
"uucp"
"wireshark"
];
};
};
}