niri-tag/flake.nix
atagen 5145085672
All checks were successful
Nix Build / nix build (push) Successful in 1m28s
satisfy nixpkgs pedantry
2025-12-03 12:06:50 +11:00

80 lines
2.1 KiB
Nix

{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
systems.url = "github:nix-systems/default-linux";
naersk.url = "github:nix-community/naersk";
niri = {
flake = false;
url = "github:YaLTeR/niri";
};
};
outputs =
inputs:
with inputs;
let
getSystem = pkgs: pkgs.stdenv.hostPlatform.system;
getPackages = builtins.attrValues;
forAllSystems =
function: nixpkgs.lib.genAttrs (import systems) (system: function nixpkgs.legacyPackages.${system});
deps = forAllSystems (pkgs: {
naersk = pkgs.callPackages naersk { };
build = getPackages {
inherit (pkgs)
cargo
rustc
pkg-config
systemdLibs
;
};
dev = getPackages {
inherit (pkgs)
rust-analyzer
rustfmt
clippy
;
};
});
in
{
devShells = forAllSystems (pkgs: {
default = pkgs.mkShell {
packages = with deps.${getSystem pkgs}; build ++ dev;
RUST_SRC_DIR = "${pkgs.rustPlatform.rustLibSrc}";
RUST_LOG = "debug";
shellHook = ''
cp --no-preserve=mode,ownership -R ${niri} niri/
'';
};
});
packages = forAllSystems (pkgs: {
unstable = deps.${getSystem pkgs}.naersk.buildPackage {
src = ./.;
preConfigure = ''
cp -R ${niri} niri/
'';
meta.mainProgram = "niri-tag";
};
stable = deps.${getSystem pkgs}.naersk.buildPackage {
src = ./.;
preConfigure = ''
cp -R ${niri} niri/
'';
meta.mainProgram = "niri-tag";
};
default = self.packages.${getSystem pkgs}.unstable;
});
nixosModules.default = self.nixosModules.niri-tag;
nixosModules.niri-tag =
{ pkgs, ... }:
{
imports = [
./module.nix
];
services.niri-tag.package = self.packages.${getSystem pkgs}.unstable;
};
};
}