File tree Expand file tree Collapse file tree 5 files changed +111
-0
lines changed Expand file tree Collapse file tree 5 files changed +111
-0
lines changed Original file line number Diff line number Diff line change 11/target
22** /* .rs.bk
33.vscode
4+ # nix build artifacts
5+ result /
Original file line number Diff line number Diff line change 1+ {
2+ inputs . nixpkgs . url = "github:NixOS/nixpkgs/nixos-unstable" ;
3+
4+ outputs = {
5+ self ,
6+ nixpkgs ,
7+ } : let
8+ systems = [ "x86_64-linux" "aarch64-linux" ] ;
9+ forEachSystem = nixpkgs . lib . genAttrs systems ;
10+ pkgsForEach = nixpkgs . legacyPackages ;
11+ in {
12+ packages = forEachSystem ( system : {
13+ default = pkgsForEach . ${ system } . callPackage ./nix/package.nix { } ;
14+ } ) ;
15+
16+ devShells = forEachSystem ( system : {
17+ default = pkgsForEach . ${ system } . callPackage ./nix/shell.nix { } ;
18+ } ) ;
19+
20+ hydraJobs = self . packages ;
21+ } ;
22+ }
Original file line number Diff line number Diff line change 1+ {
2+ lib ,
3+ rustPlatform ,
4+ pkg-config ,
5+ openssl ,
6+ } : let
7+ fs = lib . fileset ;
8+ in
9+ rustPlatform . buildRustPackage ( finalAttrs : {
10+ pname = "mpd-discord-rpc" ;
11+ version = ( builtins . fromTOML ( builtins . readFile ../Cargo.toml ) ) . package . version ;
12+
13+ src = fs . toSource {
14+ root = ../. ;
15+ fileset = fs . unions [
16+ ( fs . fileFilter ( file : builtins . any file . hasExt [ "rs" ] ) ../src )
17+ ../Cargo.lock
18+ ../Cargo.toml
19+ ] ;
20+ } ;
21+
22+ nativeBuildInputs = [ pkg-config ] ;
23+ buildInputs = [ openssl ] ;
24+
25+ cargoLock . lockFile = "${ finalAttrs . src } /Cargo.lock" ;
26+ enableParallelBuilding = true ;
27+
28+ meta = {
29+ description = "Displays your currently playing song / album / artist from MPD in Discord" ;
30+ homepage = "https://github.com/JakeStanger/mpd-discord-rpc" ;
31+ license = lib . licenses . mit ;
32+ platforms = lib . platforms . linux ;
33+ maintainers = with lib . maintainers ; [
34+ JakeStanger
35+ fazzi
36+ ] ;
37+ mainProgram = "mpd-discord-rpc" ;
38+ } ;
39+ } )
Original file line number Diff line number Diff line change 1+ {
2+ mkShell ,
3+ rust-analyzer ,
4+ rustfmt ,
5+ rustc ,
6+ clippy ,
7+ cargo ,
8+ rustPlatform ,
9+ } :
10+ mkShell {
11+ name = "rust" ;
12+ packages = [
13+ rust-analyzer
14+ rustfmt
15+ clippy
16+ cargo
17+ rustc
18+ ] ;
19+
20+ RUST_SRC_PATH = "${ rustPlatform . rustLibSrc } " ;
21+ }
You can’t perform that action at this time.
0 commit comments