Compare commits
No commits in common. "8dfca530b890ddf93e5f7b10ec62a817dd3f2fdb" and "ef2135b690569b15b454dd37384b4e569f6a33a7" have entirely different histories.
8dfca530b8
...
ef2135b690
3 changed files with 499 additions and 578 deletions
851
Cargo.lock
generated
851
Cargo.lock
generated
File diff suppressed because it is too large
Load diff
99
flake.lock
99
flake.lock
|
@ -1,50 +1,51 @@
|
|||
{
|
||||
"nodes": {
|
||||
"crane": {
|
||||
"flake-utils": {
|
||||
"inputs": {
|
||||
"systems": "systems"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1687709756,
|
||||
"narHash": "sha256-Y5wKlQSkgEK2weWdOu4J3riRd+kV/VCgHsqLNTTWQ/0=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "dbabf0ca0c0c4bce6ea5eaf65af5cb694d2082c7",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"naersk": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1724006180,
|
||||
"narHash": "sha256-PVxPj0Ga2fMYMtcT9ARCthF+4U71YkOT7ZjgD/vf1Aw=",
|
||||
"owner": "ipetkov",
|
||||
"repo": "crane",
|
||||
"rev": "7ce92819802bc583b7e82ebc08013a530f22209f",
|
||||
"lastModified": 1688229166,
|
||||
"narHash": "sha256-9lGDg8K1ASjTThzYjctdgd35WqocIIeakQXs5tAbQsM=",
|
||||
"owner": "nmattia",
|
||||
"repo": "naersk",
|
||||
"rev": "714e701eb4ca2491d34d794b98be4b994a796ae7",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "ipetkov",
|
||||
"repo": "crane",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-parts": {
|
||||
"inputs": {
|
||||
"nixpkgs-lib": "nixpkgs-lib"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1722555600,
|
||||
"narHash": "sha256-XOQkdLafnb/p9ij77byFQjDf5m5QYl9b2REiVClC+x4=",
|
||||
"owner": "hercules-ci",
|
||||
"repo": "flake-parts",
|
||||
"rev": "8471fe90ad337a8074e957b69ca4d0089218391d",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "hercules-ci",
|
||||
"repo": "flake-parts",
|
||||
"owner": "nmattia",
|
||||
"ref": "master",
|
||||
"repo": "naersk",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1724015816,
|
||||
"narHash": "sha256-hVESnM7Eiz93+4DeiE0a1TwMeaeph1ytRJ5QtqxYRWg=",
|
||||
"lastModified": 1688221086,
|
||||
"narHash": "sha256-cdW6qUL71cNWhHCpMPOJjlw0wzSRP0pVlRn2vqX/VVg=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "9aa35efbea27d320d0cdc5f922f0890812affb60",
|
||||
"rev": "cd99c2b3c9f160cd004318e0697f90bbd5960825",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -54,38 +55,29 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs-lib": {
|
||||
"locked": {
|
||||
"lastModified": 1722555339,
|
||||
"narHash": "sha256-uFf2QeW7eAHlYXuDktm9c25OxOyCoUOQmh5SZ9amE5Q=",
|
||||
"type": "tarball",
|
||||
"url": "https://github.com/NixOS/nixpkgs/archive/a5d394176e64ab29c852d03346c1fc9b0b7d33eb.tar.gz"
|
||||
},
|
||||
"original": {
|
||||
"type": "tarball",
|
||||
"url": "https://github.com/NixOS/nixpkgs/archive/a5d394176e64ab29c852d03346c1fc9b0b7d33eb.tar.gz"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"crane": "crane",
|
||||
"flake-parts": "flake-parts",
|
||||
"flake-utils": "flake-utils",
|
||||
"naersk": "naersk",
|
||||
"nixpkgs": "nixpkgs",
|
||||
"rust-overlay": "rust-overlay"
|
||||
}
|
||||
},
|
||||
"rust-overlay": {
|
||||
"inputs": {
|
||||
"flake-utils": [
|
||||
"flake-utils"
|
||||
],
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1724034091,
|
||||
"narHash": "sha256-b1g7w0sw+MDAhUAeCoX1vlTghsqcDZkxr+k9OZmxPa8=",
|
||||
"lastModified": 1688351637,
|
||||
"narHash": "sha256-CLTufJ29VxNOIZ8UTg0lepsn3X03AmopmaLTTeHDCL4=",
|
||||
"owner": "oxalica",
|
||||
"repo": "rust-overlay",
|
||||
"rev": "c7d36e0947826e0751a5214ffe82533fbc909bc0",
|
||||
"rev": "f9b92316727af9e6c7fee4a761242f7f46880329",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -93,6 +85,21 @@
|
|||
"repo": "rust-overlay",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"systems": {
|
||||
"locked": {
|
||||
"lastModified": 1681028828,
|
||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"type": "github"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
|
|
127
flake.nix
127
flake.nix
|
@ -1,105 +1,60 @@
|
|||
{
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
||||
flake-parts.url = "github:hercules-ci/flake-parts";
|
||||
crane = {
|
||||
url = "github:ipetkov/crane";
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
naersk = {
|
||||
url = "github:nmattia/naersk/master";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
rust-overlay = {
|
||||
url = "github:oxalica/rust-overlay";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
inputs.flake-utils.follows = "flake-utils";
|
||||
};
|
||||
};
|
||||
|
||||
outputs =
|
||||
{ self, ... }@inputs:
|
||||
inputs.flake-parts.lib.mkFlake { inherit inputs; } {
|
||||
systems = [ "x86_64-linux" ];
|
||||
outputs = {
|
||||
self,
|
||||
nixpkgs,
|
||||
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 {};
|
||||
|
||||
imports = [ inputs.flake-parts.flakeModules.easyOverlay ];
|
||||
rustToolchain = pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
|
||||
|
||||
perSystem =
|
||||
{
|
||||
pkgs,
|
||||
system,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
let
|
||||
overlays = [ (import inputs.rust-overlay) ];
|
||||
buildInputs = [
|
||||
rustToolchain
|
||||
pkgs.libpulseaudio.dev
|
||||
];
|
||||
nativeBuildInputs = [
|
||||
pkgs.pkgconf
|
||||
];
|
||||
in rec {
|
||||
packages.pamedia = naersk-lib.buildPackage {
|
||||
inherit buildInputs nativeBuildInputs;
|
||||
|
||||
rustToolchain = pkgs.rust-bin.stable.latest.default.override {
|
||||
extensions = [
|
||||
"rustfmt"
|
||||
"clippy"
|
||||
];
|
||||
};
|
||||
root = ./.;
|
||||
pname = "pamedia";
|
||||
};
|
||||
packages.default = packages.pamedia;
|
||||
|
||||
crane-lib = (inputs.crane.mkLib pkgs).overrideToolchain rustToolchain;
|
||||
defaultApp = flake-utils.lib.mkApp {
|
||||
drv = self.defaultPackage."${system}";
|
||||
};
|
||||
|
||||
pname = "pamedia";
|
||||
version = "0.3.0";
|
||||
overlays = final: prev: {
|
||||
pamedia = packages.pamedia;
|
||||
};
|
||||
|
||||
src = crane-lib.cleanCargoSource ./.;
|
||||
|
||||
buildInputs = [
|
||||
rustToolchain
|
||||
pkgs.libpulseaudio.dev
|
||||
];
|
||||
nativeBuildInputs = [ pkgs.pkg-config ];
|
||||
|
||||
cargoArtifacts = crane-lib.buildDepsOnly {
|
||||
inherit
|
||||
src
|
||||
buildInputs
|
||||
nativeBuildInputs
|
||||
pname
|
||||
version
|
||||
;
|
||||
};
|
||||
|
||||
pamedia = crane-lib.buildPackage {
|
||||
inherit
|
||||
cargoArtifacts
|
||||
src
|
||||
buildInputs
|
||||
nativeBuildInputs
|
||||
pname
|
||||
version
|
||||
;
|
||||
};
|
||||
|
||||
in
|
||||
{
|
||||
_module.args.pkgs = import inputs.nixpkgs { inherit system overlays; };
|
||||
|
||||
packages = {
|
||||
inherit pamedia;
|
||||
};
|
||||
packages.default = config.packages.pamedia;
|
||||
|
||||
overlayAttrs = {
|
||||
inherit (config.packages) pamedia;
|
||||
};
|
||||
|
||||
devShells.default =
|
||||
with pkgs;
|
||||
mkShell {
|
||||
packages = [
|
||||
cargo
|
||||
rustc
|
||||
rustfmt
|
||||
pre-commit
|
||||
rustPackages.clippy
|
||||
cargo-edit
|
||||
cargo-feature
|
||||
rust-analyzer
|
||||
libnotify
|
||||
];
|
||||
inputsFrom = [ config.packages.pamedia ];
|
||||
};
|
||||
devShell = with pkgs;
|
||||
mkShell {
|
||||
buildInputs = [cargo rustc rustfmt pre-commit rustPackages.clippy cargo-edit cargo-feature cargo-outdated rust-analyzer] ++ buildInputs;
|
||||
nativeBuildInputs = [libnotify] ++ nativeBuildInputs;
|
||||
};
|
||||
};
|
||||
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue