Flake cleanup
This commit is contained in:
parent
9043ee4fa5
commit
e44c8501c9
4 changed files with 51 additions and 45 deletions
|
@ -1,7 +0,0 @@
|
||||||
(import (
|
|
||||||
fetchTarball {
|
|
||||||
url = "https://github.com/edolstra/flake-compat/archive/99f1c2157fba4bfe6211a321fd0ee43199025dbf.tar.gz";
|
|
||||||
sha256 = "0x2jn3vrawwv9xp15674wjz9pixwjyj3j771izayl962zziivbx2"; }
|
|
||||||
) {
|
|
||||||
src = ./.;
|
|
||||||
}).defaultNix
|
|
55
flake.nix
55
flake.nix
|
@ -1,43 +1,60 @@
|
||||||
{
|
{
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
||||||
utils.url = "github:numtide/flake-utils";
|
flake-utils.url = "github:numtide/flake-utils";
|
||||||
naersk = {
|
naersk = {
|
||||||
url = "github:nmattia/naersk/master";
|
url = "github:nmattia/naersk/master";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
|
rust-overlay = {
|
||||||
|
url = "github:oxalica/rust-overlay";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
inputs.flake-utils.follows = "flake-utils";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { self, nixpkgs, utils, naersk }:
|
outputs = {
|
||||||
utils.lib.eachDefaultSystem (system:
|
self,
|
||||||
let
|
nixpkgs,
|
||||||
pkgs = import nixpkgs { inherit system; };
|
flake-utils,
|
||||||
|
naersk,
|
||||||
|
rust-overlay,
|
||||||
|
}:
|
||||||
|
flake-utils.lib.eachDefaultSystem (system: let
|
||||||
|
overlays = [(import rust-overlay)];
|
||||||
|
pkgs = import nixpkgs {inherit system overlays;};
|
||||||
naersk-lib = pkgs.callPackage naersk {};
|
naersk-lib = pkgs.callPackage naersk {};
|
||||||
in
|
|
||||||
rec {
|
|
||||||
|
|
||||||
defaultPackage = naersk-lib.buildPackage {
|
rustToolchain = pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
|
||||||
|
|
||||||
|
buildInputs = [
|
||||||
|
rustToolchain
|
||||||
|
pkgs.libpulseaudio.dev
|
||||||
|
];
|
||||||
|
nativeBuildInputs = [
|
||||||
|
pkgs.pkgconf
|
||||||
|
];
|
||||||
|
in rec {
|
||||||
|
packages.pamedia = naersk-lib.buildPackage {
|
||||||
|
inherit buildInputs nativeBuildInputs;
|
||||||
|
|
||||||
root = ./.;
|
root = ./.;
|
||||||
pname = "pamedia";
|
pname = "pamedia";
|
||||||
buildInputs = with pkgs; [ libpulseaudio ];
|
|
||||||
nativeBuildInputs = with pkgs; [ pkg-config ];
|
|
||||||
};
|
};
|
||||||
|
packages.default = packages.pamedia;
|
||||||
|
|
||||||
defaultApp = utils.lib.mkApp {
|
defaultApp = flake-utils.lib.mkApp {
|
||||||
drv = self.defaultPackage."${system}";
|
drv = self.defaultPackage."${system}";
|
||||||
};
|
};
|
||||||
|
|
||||||
overlays = final: prev: {
|
overlays = final: prev: {
|
||||||
pamedia = defaultPackage;
|
pamedia = packages.pamedia;
|
||||||
};
|
};
|
||||||
|
|
||||||
devShell = with pkgs; mkShell {
|
devShell = with pkgs;
|
||||||
buildInputs = [ cargo rustc rustfmt pre-commit rustPackages.clippy cargo-edit cargo-feature cargo-outdated ] ++ defaultPackage.buildInputs;
|
mkShell {
|
||||||
nativeBuildInputs = [ ] ++ defaultPackage.nativeBuildInputs;
|
buildInputs = [cargo rustc rustfmt pre-commit rustPackages.clippy cargo-edit cargo-feature cargo-outdated rust-analyzer] ++ buildInputs;
|
||||||
RUST_SRC_PATH = rustPlatform.rustLibSrc;
|
nativeBuildInputs = [libnotify] ++ nativeBuildInputs;
|
||||||
};
|
};
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
3
rust-toolchain.toml
Normal file
3
rust-toolchain.toml
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
[toolchain]
|
||||||
|
channel = "stable"
|
||||||
|
components = [ "rustfmt", "clippy" ]
|
|
@ -1,7 +0,0 @@
|
||||||
(import (
|
|
||||||
fetchTarball {
|
|
||||||
url = "https://github.com/edolstra/flake-compat/archive/99f1c2157fba4bfe6211a321fd0ee43199025dbf.tar.gz";
|
|
||||||
sha256 = "0x2jn3vrawwv9xp15674wjz9pixwjyj3j771izayl962zziivbx2"; }
|
|
||||||
) {
|
|
||||||
src = ./.;
|
|
||||||
}).shellNix
|
|
Loading…
Reference in a new issue