Skip to content

Instantly share code, notes, and snippets.

@knoopx
Last active July 14, 2025 16:58
Show Gist options
  • Save knoopx/48f4288a6490c175f42462e01006ee72 to your computer and use it in GitHub Desktop.
Save knoopx/48f4288a6490c175f42462e01006ee72 to your computer and use it in GitHub Desktop.
test niri config without rebuilding os
# nix run --offline path:.#test-niri-config
{
inputs = {
nixpkgs.url = "nixpkgs/nixpkgs-unstable";
};
outputs = {nixpkgs, ...}: let
system = "x86_64-linux";
variable = "example";
pkgs = import nixpkgs {inherit system;};
config = pkgs.writeText "niri.config" ''
// ${variable}
'';
in {
packages.${system}.test-niri-config = pkgs.writeShellScriptBin "test-niri-config" ''
${pkgs.niri}/bin/niri -c "${config}"
'';
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment