drop flake-utils
This commit is contained in:
parent
716290c3bf
commit
e94415e1e0
2 changed files with 64 additions and 86 deletions
116
flake.nix
116
flake.nix
|
|
@ -3,21 +3,25 @@
|
|||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
rust-overlay = {
|
||||
url = "github:oxalica/rust-overlay";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, flake-utils, rust-overlay }:
|
||||
flake-utils.lib.eachSystem [ "x86_64-linux" "aarch64-linux" ]
|
||||
(system:
|
||||
outputs = { self, nixpkgs, rust-overlay }:
|
||||
let
|
||||
systems = [ "x86_64-linux" "aarch64-linux" ];
|
||||
forAllSystems = nixpkgs.lib.genAttrs systems;
|
||||
|
||||
pkgsFor = system: import nixpkgs {
|
||||
inherit system;
|
||||
overlays = [ rust-overlay.overlays.default ];
|
||||
};
|
||||
|
||||
perSystem = system:
|
||||
let
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
overlays = [ rust-overlay.overlays.default ];
|
||||
};
|
||||
pkgs = pkgsFor system;
|
||||
|
||||
rustToolchain = pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
|
||||
|
||||
|
|
@ -44,7 +48,7 @@
|
|||
in
|
||||
{
|
||||
# `nix develop` — full dev environment.
|
||||
devShells.default = pkgs.mkShell ({
|
||||
devShell = pkgs.mkShell ({
|
||||
name = "headroom-dev";
|
||||
|
||||
nativeBuildInputs = nativeBuildTools ++ [
|
||||
|
|
@ -69,58 +73,66 @@
|
|||
} // commonEnv);
|
||||
|
||||
# `nix build` — the final packaged daemon + CLI.
|
||||
packages = rec {
|
||||
default = headroom;
|
||||
headroom = rustPlatform.buildRustPackage ({
|
||||
pname = "headroom";
|
||||
# Pull from the workspace Cargo.toml — the per-crate
|
||||
# manifests use `version.workspace = true` which evaluates
|
||||
# to a table here, not a string.
|
||||
version = (builtins.fromTOML (builtins.readFile ./Cargo.toml)).workspace.package.version;
|
||||
|
||||
headroom = rustPlatform.buildRustPackage ({
|
||||
pname = "headroom";
|
||||
# Pull from the workspace Cargo.toml — the per-crate
|
||||
# manifests use `version.workspace = true` which evaluates
|
||||
# to a table here, not a string.
|
||||
version = (builtins.fromTOML (builtins.readFile ./Cargo.toml)).workspace.package.version;
|
||||
src = ./.;
|
||||
|
||||
src = ./.;
|
||||
cargoLock = {
|
||||
lockFile = ./Cargo.lock;
|
||||
# allowBuiltinFetchGit = true;
|
||||
};
|
||||
|
||||
cargoLock = {
|
||||
lockFile = ./Cargo.lock;
|
||||
# allowBuiltinFetchGit = true;
|
||||
};
|
||||
nativeBuildInputs = nativeBuildTools;
|
||||
buildInputs = nativeAudioBuildInputs;
|
||||
|
||||
nativeBuildInputs = nativeBuildTools;
|
||||
buildInputs = nativeAudioBuildInputs;
|
||||
# We ship one binary from the workspace: `headroom` (cli + daemon).
|
||||
cargoBuildFlags = [ "-p" "headroom-cli" ];
|
||||
doCheck = true;
|
||||
cargoTestFlags = [ "--workspace" ];
|
||||
|
||||
# We ship one binary from the workspace: `headroom` (cli + daemon).
|
||||
cargoBuildFlags = [ "-p" "headroom-cli" ];
|
||||
doCheck = true;
|
||||
cargoTestFlags = [ "--workspace" ];
|
||||
# Install the systemd user unit (templated with @bindir@
|
||||
# so the unit refers to the absolute path of the binary in
|
||||
# this derivation, never to whatever happens to be on
|
||||
# PATH) and ship the canonical profiles under
|
||||
# share/headroom/profiles so users / modules can copy
|
||||
# them into XDG_CONFIG_HOME on first run.
|
||||
postInstall = ''
|
||||
install -Dm644 contrib/systemd/headroom.service \
|
||||
"$out/lib/systemd/user/headroom.service"
|
||||
substituteInPlace "$out/lib/systemd/user/headroom.service" \
|
||||
--replace-fail '@bindir@' "$out/bin"
|
||||
|
||||
# Install the systemd user unit (templated with @bindir@
|
||||
# so the unit refers to the absolute path of the binary in
|
||||
# this derivation, never to whatever happens to be on
|
||||
# PATH) and ship the canonical profiles under
|
||||
# share/headroom/profiles so users / modules can copy
|
||||
# them into XDG_CONFIG_HOME on first run.
|
||||
postInstall = ''
|
||||
install -Dm644 contrib/systemd/headroom.service \
|
||||
"$out/lib/systemd/user/headroom.service"
|
||||
substituteInPlace "$out/lib/systemd/user/headroom.service" \
|
||||
--replace-fail '@bindir@' "$out/bin"
|
||||
mkdir -p "$out/share/headroom/profiles"
|
||||
cp -r profiles/. "$out/share/headroom/profiles/"
|
||||
'';
|
||||
|
||||
mkdir -p "$out/share/headroom/profiles"
|
||||
cp -r profiles/. "$out/share/headroom/profiles/"
|
||||
'';
|
||||
meta = with pkgs.lib; {
|
||||
description = "AGC + compressor + true-peak limiter daemon for PipeWire";
|
||||
license = licenses.gpl3Plus;
|
||||
platforms = platforms.linux;
|
||||
mainProgram = "headroom";
|
||||
};
|
||||
} // commonEnv);
|
||||
};
|
||||
in
|
||||
{
|
||||
devShells = forAllSystems (system: {
|
||||
default = (perSystem system).devShell;
|
||||
});
|
||||
|
||||
meta = with pkgs.lib; {
|
||||
description = "AGC + compressor + true-peak limiter daemon for PipeWire";
|
||||
license = licenses.gpl3Plus;
|
||||
platforms = platforms.linux;
|
||||
mainProgram = "headroom";
|
||||
};
|
||||
} // commonEnv);
|
||||
};
|
||||
packages = forAllSystems (system:
|
||||
let ps = perSystem system; in rec {
|
||||
default = headroom;
|
||||
headroom = ps.headroom;
|
||||
});
|
||||
|
||||
formatter = forAllSystems (system: (pkgsFor system).nixpkgs-fmt);
|
||||
|
||||
formatter = pkgs.nixpkgs-fmt;
|
||||
}) // {
|
||||
# System-independent outputs — modules.
|
||||
nixosModules.default = import ./nix/nixos-module.nix self;
|
||||
homeModules.default = import ./nix/home-module.nix self;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue