Files
moonix/flake.nix
T
nevaforget ec881f6401 feat: drop moonlock and moonset
The power menu is a Quickshell popout in the moonarch config now, and it
was the last caller of moonlock. Inputs, package entries and both build
recipes are gone, together with the generated /etc configs and the
moonlock PAM stack — swaylock's comes from programs.niri.enable.
2026-08-14 17:48:52 +02:00

119 lines
3.4 KiB
Nix

# ABOUTME: Flake for running the Moonarch desktop on NixOS.
# ABOUTME: Pulls the Moonarch project repos as sources and builds them with Nix.
{
description = "NixOS configuration for a niri and Quickshell Wayland desktop";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
nixos-hardware.url = "github:NixOS/nixos-hardware";
# Declarative partitioning. Consumed by modules/disk.nix.
disko = {
url = "github:nix-community/disko/latest";
inputs.nixpkgs.follows = "nixpkgs";
};
# Project sources. These repos are not flakes themselves, they are
# consumed as plain source trees pinned to a release tag.
moonarch = {
url = "git+https://gitea.moonarch.de/nevaforget/moonarch.git";
flake = false;
};
sweet-cursors = {
url = "git+https://gitea.moonarch.de/nevaforget/Sweet-cursors.git";
flake = false;
};
# Not packaged in nixpkgs.
stasis = {
url = "github:saltnpepper97/stasis/v1.4.1";
flake = false;
};
};
outputs = { self, nixpkgs, ... }@inputs:
let
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
moonarchPackages = {
sweet-cursors = pkgs.callPackage ./pkgs/sweet-cursors.nix {
src = inputs.sweet-cursors;
version = "0-unstable";
};
stasis = pkgs.callPackage ./pkgs/stasis.nix {
src = inputs.stasis;
version = "1.4.1";
};
moonarch-scripts = pkgs.callPackage ./pkgs/moonarch-scripts.nix {
src = inputs.moonarch;
};
};
# Colloid overrides, used by the desktop session and by the greeter.
# Defined once so the two cannot drift apart.
themePackages = {
gtk = pkgs.colloid-gtk-theme.override {
themeVariants = [ "grey" ];
colorVariants = [ "dark" ];
tweaks = [ "catppuccin" ];
};
icons = pkgs.colloid-icon-theme.override {
schemeVariants = [ "catppuccin" ];
colorVariants = [ "grey" ];
};
};
in
{
packages.${system} = moonarchPackages;
# Makes the packages and the moonarch source tree available to every
# module without threading arguments through by hand.
nixosModules.moonarch = { ... }: {
imports = [
inputs.disko.nixosModules.disko
./modules/disk.nix
./modules/desktop.nix
./modules/greetd.nix
./modules/services.nix
];
_module.args = {
moonarchSrc = inputs.moonarch;
moonarchPkgs = moonarchPackages;
moonarchThemes = themePackages;
};
};
nixosConfigurations = {
# QEMU/KVM test VM.
testvm = nixpkgs.lib.nixosSystem {
inherit system;
modules = [
./hosts/testvm
self.nixosModules.moonarch
];
};
# ThinkPad T14 Gen 3 (AMD Ryzen 7 PRO 6850U).
# Needs hosts/thinkpad/hardware-configuration.nix from the installer
# before it evaluates — see README.
thinkpad = nixpkgs.lib.nixosSystem {
inherit system;
modules = [
inputs.nixos-hardware.nixosModules.lenovo-thinkpad-t14-amd-gen3
./hosts/thinkpad
self.nixosModules.moonarch
];
};
};
devShells.${system}.default = pkgs.mkShell {
packages = with pkgs; [ nixpkgs-fmt ];
};
};
}