greetd.nix configures services.displayManager.regreet and keeps niri as the greeter compositor, so niri-greeter.kdl stays the shared file that carries the German keyboard layout. The moongreet input, its package and pkgs/moongreet.nix are gone. extraCss goes through builtins.readFile: the module only recognises a direct /nix/store child as a path, so passing the file path as a string wrote the path itself into /etc/greetd/regreet.css. desktop.nix installs swaylock, seeds ~/.config/swaylock/config with the wallpaper rewritten to the store path, and now owns the moonlock PAM stack. The Colloid overrides moved to flake.nix so the greeter and the desktop share one derivation. initial_session is set per host because the accounts differ. greetd's restart option flips itself off, verified. flake.lock still pins moonarch at the pushed revision; it needs `nix flake update moonarch` once the moonarch commit is pushed.
254 lines
8.6 KiB
Nix
254 lines
8.6 KiB
Nix
# ABOUTME: Deploys the XDG configs from the moonarch repo and the package set.
|
|
# ABOUTME: Niri, Quickshell, terminal, theming, portals.
|
|
|
|
{ pkgs, lib, moonarchSrc, moonarchPkgs, moonarchThemes, ... }:
|
|
|
|
let
|
|
xdg = "${moonarchSrc}/defaults/xdg";
|
|
etc = "${moonarchSrc}/defaults/etc";
|
|
|
|
# waypaper calls `swww`/`swww-daemon`, but the maintained successor ships as
|
|
# `awww`. Same compatibility symlinks the Arch package creates.
|
|
swww-compat = pkgs.runCommand "swww-compat" { } ''
|
|
mkdir -p "$out/bin"
|
|
ln -s ${pkgs.awww}/bin/awww "$out/bin/swww"
|
|
ln -s ${pkgs.awww}/bin/awww-daemon "$out/bin/swww-daemon"
|
|
'';
|
|
|
|
wallpaper = "${moonarchSrc}/defaults/backgrounds/wallpaper.jpg";
|
|
|
|
# waypaper's config points at /usr/share/moonarch/wallpaper.jpg, which does
|
|
# not exist here. Generated with the store path instead of copied verbatim.
|
|
waypaperConfig = pkgs.runCommand "waypaper-config.ini" { } ''
|
|
substitute ${xdg}/waypaper/config.ini "$out" \
|
|
--replace-fail /usr/share/moonarch/wallpaper.jpg ${wallpaper}
|
|
'';
|
|
|
|
# Same treatment for swaylock's wallpaper path. swaylock searches
|
|
# ~/.swaylock/config, $XDG_CONFIG_HOME/swaylock/config and
|
|
# SYSCONFDIR/swaylock/config — and its sysconfdir is inside the store here,
|
|
# so the home copy seeded below is the only one it ever reads.
|
|
swaylockConfig = pkgs.runCommand "swaylock-config" { } ''
|
|
substitute ${xdg}/swaylock/config "$out" \
|
|
--replace-fail /usr/share/moonarch/wallpaper.jpg ${wallpaper}
|
|
'';
|
|
in
|
|
{
|
|
# --- XDG configs -> /etc/xdg/ ---
|
|
#
|
|
# Deployed verbatim from the moonarch repo; defaults/ stays the single
|
|
# source of truth for both distros.
|
|
#
|
|
# defaults/xdg/walker/ is not deployed: the Quickshell launcher covers it.
|
|
environment.etc = {
|
|
# niri reads /etc/niri, not /etc/xdg/niri. Both are provided: the former
|
|
# is what niri actually loads, the latter keeps the layout consistent with
|
|
# the Arch package and with any user config that includes it.
|
|
"niri/config.kdl".source = "${xdg}/niri/config.kdl";
|
|
"xdg/niri/config.kdl".source = "${xdg}/niri/config.kdl";
|
|
"xdg/quickshell/moonarch".source = "${xdg}/quickshell/moonarch";
|
|
"xdg/foot/foot.ini".source = "${xdg}/foot/foot.ini";
|
|
"xdg/fastfetch/config.jsonc".source = "${xdg}/fastfetch/config.jsonc";
|
|
# defaults/xdg/kanshi/config is an empty placeholder — on Arch too. kanshi
|
|
# rejects it ("failed to parse config file") and restarts in a loop, so it
|
|
# is not deployed. Monitor profiles are machine specific and belong in
|
|
# ~/.config/kanshi/config.
|
|
"xdg/Kvantum/kvantum.kvconfig".source = "${xdg}/Kvantum/kvantum.kvconfig";
|
|
"xdg/qt6ct/qt6ct.conf".source = "${xdg}/qt6ct/qt6ct.conf";
|
|
"xdg/gtk-3.0/settings.ini".source = "${xdg}/gtk-3.0/settings.ini";
|
|
"xdg/gtk-4.0/settings.ini".source = "${xdg}/gtk-4.0/settings.ini";
|
|
"xdg/pipewire/pipewire.conf.d/99-input-denoising.conf".source =
|
|
"${xdg}/pipewire/pipewire.conf.d/99-input-denoising.conf";
|
|
# Kept for layout parity with the Arch package; waypaper itself only reads
|
|
# the copy in the home directory, seeded below.
|
|
"xdg/waypaper/config.ini".source = waypaperConfig;
|
|
|
|
# stasis reads /etc/stasis/ as its system-wide fallback, never /etc/xdg/.
|
|
"stasis/stasis.rune".source = "${xdg}/stasis/stasis.rune";
|
|
|
|
# moonlock and moonset fall back to /usr/share/moonarch/wallpaper.jpg,
|
|
# which does not exist here, so the wallpaper is pointed at the store path
|
|
# explicitly. Both read these files as their system-wide config.
|
|
"moonlock/moonlock.toml".text = ''
|
|
background_path = "${wallpaper}"
|
|
'';
|
|
# blur matches the value set in ~/.config/moonset/moonset.toml on Arch.
|
|
"moonset/moonset.toml".text = ''
|
|
background_path = "${wallpaper}"
|
|
background_blur = 20.0
|
|
'';
|
|
|
|
# Configs outside /etc/xdg/ in the Arch package as well.
|
|
"mpv/mpv.conf".source = "${etc}/mpv/mpv.conf";
|
|
"xdg-desktop-portal/niri-portals.conf".source =
|
|
"${etc}/xdg-desktop-portal/niri-portals.conf";
|
|
};
|
|
|
|
# Generic-family defaults. Same content as
|
|
# defaults/etc/fonts/conf.d/65-moonarch-fonts.conf, but routed through the
|
|
# fontconfig module: /etc/fonts/conf.d/ is owned by NixOS and rejects
|
|
# environment.etc entries.
|
|
# localConf is written to /etc/fonts/local.conf verbatim, so it has to be a
|
|
# complete XML document — not just the inner elements.
|
|
fonts.fontconfig.localConf = ''
|
|
<?xml version="1.0"?>
|
|
<!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">
|
|
<fontconfig>
|
|
<description>Moonarch generic-family defaults</description>
|
|
<!-- binding="strong" required: the default weak <prefer> ranks behind
|
|
stock generic fallbacks, so it would not take effect. -->
|
|
<alias binding="strong">
|
|
<family>sans-serif</family>
|
|
<prefer>
|
|
<family>UbuntuSans Nerd Font</family>
|
|
</prefer>
|
|
</alias>
|
|
<alias binding="strong">
|
|
<family>monospace</family>
|
|
<prefer>
|
|
<family>UbuntuSansMono Nerd Font</family>
|
|
</prefer>
|
|
</alias>
|
|
</fontconfig>
|
|
'';
|
|
|
|
# --- Compositor ---
|
|
programs.niri.enable = true;
|
|
|
|
# niri searches $XDG_CONFIG_HOME/niri/config.kdl, then /etc/niri/config.kdl —
|
|
# not /etc/xdg. On Arch a one-line ~/.config/niri/config.kdl bridges there
|
|
# via `include`; here the system path is used directly, so nothing has to be
|
|
# placed in the home directory.
|
|
|
|
# config.kdl spawns the polkit agent by its FHS path
|
|
# (/usr/lib/polkit-gnome/...). Provide that path rather than diverging the
|
|
# config, which is shared with Arch.
|
|
systemd.tmpfiles.rules = [
|
|
"d /usr/lib 0755 root root -"
|
|
"L+ /usr/lib/polkit-gnome - - - - ${pkgs.polkit_gnome}/libexec"
|
|
];
|
|
|
|
# --- Shell ---
|
|
programs.zsh.enable = true;
|
|
|
|
# --- Theme, systemwide instead of the gsettings calls in post-install.sh ---
|
|
programs.dconf = {
|
|
enable = true;
|
|
profiles.user.databases = [{
|
|
settings."org/gnome/desktop/interface" = {
|
|
gtk-theme = "Colloid-Grey-Dark-Catppuccin";
|
|
icon-theme = "Colloid-Grey-Catppuccin-Dark";
|
|
color-scheme = "prefer-dark";
|
|
font-name = "UbuntuSans Nerd Font 11";
|
|
};
|
|
}];
|
|
};
|
|
|
|
# --- Portals ---
|
|
xdg.portal = {
|
|
enable = true;
|
|
extraPortals = with pkgs; [ xdg-desktop-portal-gnome xdg-desktop-portal-gtk ];
|
|
};
|
|
|
|
fonts.packages = with pkgs; [
|
|
nerd-fonts.ubuntu-sans
|
|
openmoji-color
|
|
];
|
|
|
|
environment.systemPackages = with pkgs; [
|
|
# Own programs
|
|
moonarchPkgs.moonset
|
|
moonarchPkgs.sweet-cursors
|
|
moonarchPkgs.stasis
|
|
moonarchPkgs.moonarch-scripts
|
|
# Only still installed because moonset's Lock action invokes moonlock by
|
|
# name and has no lock_command option. Idle and lid-close use swaylock.
|
|
moonarchPkgs.moonlock
|
|
|
|
# Session lock
|
|
swaylock
|
|
|
|
# Compositor extras
|
|
xwayland-satellite
|
|
kanshi
|
|
|
|
# Bar, notifications, clipboard.
|
|
# Neither waybar nor swaync are installed: the Quickshell bar owns both
|
|
# roles. The "kept as a reserve" notes in the Arch config date from the
|
|
# migration and do not apply to a fresh setup.
|
|
quickshell
|
|
libnotify
|
|
cliphist
|
|
wl-clipboard
|
|
|
|
# Display and wallpaper
|
|
wlsunset
|
|
nwg-look
|
|
brightnessctl
|
|
awww
|
|
swww-compat
|
|
waypaper
|
|
|
|
# Terminal
|
|
foot
|
|
|
|
# Audio
|
|
pavucontrol
|
|
alsa-utils
|
|
|
|
# Network and bluetooth
|
|
networkmanagerapplet
|
|
blueman
|
|
|
|
# File manager stack
|
|
gvfs
|
|
udisks2
|
|
ntfs3g
|
|
|
|
# Theming. Same derivations the greeter uses, see flake.nix.
|
|
moonarchThemes.gtk
|
|
moonarchThemes.icons
|
|
libsForQt5.qtstyleplugin-kvantum
|
|
qt6Packages.qtstyleplugin-kvantum
|
|
qt6Packages.qt6ct
|
|
qt6.qt5compat
|
|
|
|
# CLI tools referenced by zshrc and the helper scripts
|
|
bat
|
|
btop
|
|
eza
|
|
fastfetch
|
|
fd
|
|
fzf
|
|
jq
|
|
lazygit
|
|
ripgrep
|
|
neovim
|
|
git
|
|
|
|
# System
|
|
fwupd
|
|
upower
|
|
polkit_gnome
|
|
wdisplays
|
|
wl-color-picker
|
|
];
|
|
|
|
# Polkit agent for privilege prompts inside the session.
|
|
security.polkit.enable = true;
|
|
|
|
# Seed configs for programs that read only from the home directory and have
|
|
# no system-wide fallback. 'C' copies once and never overwrites, so user
|
|
# edits survive. This is what post-install.sh does imperatively on Arch.
|
|
systemd.user.tmpfiles.rules = [
|
|
"C %h/.config/waypaper/config.ini 0644 - - - ${waypaperConfig}"
|
|
"C %h/.config/swaylock/config 0644 - - - ${swaylockConfig}"
|
|
];
|
|
|
|
# PAM stack for moonlock, shipped by the package but owned by the system.
|
|
# swaylock needs none of this: programs.niri.enable brings
|
|
# security.pam.services.swaylock with it. Goes away with moonlock.
|
|
security.pam.services.moonlock.text =
|
|
builtins.readFile "${moonarchPkgs.moonlock}/share/moonlock/moonlock-pam";
|
|
}
|