Compare commits

...

3 commits

Author SHA1 Message Date
8dfca530b8
Update dependencies 2024-08-19 19:58:28 +02:00
e37f6f6e47
flake: Rewrite to use flake-parts and crane 2024-08-19 19:20:35 +02:00
fed01275fd
flake.lock: Update
Flake lock file updates:

• Updated input 'flake-utils':
    'github:numtide/flake-utils/dbabf0ca0c0c4bce6ea5eaf65af5cb694d2082c7?narHash=sha256-Y5wKlQSkgEK2weWdOu4J3riRd%2BkV/VCgHsqLNTTWQ/0%3D' (2023-06-25)
  → 'github:numtide/flake-utils/b1d9ab70662946ef0850d488da1c9019f3a9752a?narHash=sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ%3D' (2024-03-11)
• Updated input 'naersk':
    'github:nmattia/naersk/714e701eb4ca2491d34d794b98be4b994a796ae7?narHash=sha256-9lGDg8K1ASjTThzYjctdgd35WqocIIeakQXs5tAbQsM%3D' (2023-07-01)
  → 'github:nmattia/naersk/3fb418eaf352498f6b6c30592e3beb63df42ef11?narHash=sha256-r/xppY958gmZ4oTfLiHN0ZGuQ%2BRSTijDblVgVLFi1mw%3D' (2024-07-23)
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/cd99c2b3c9f160cd004318e0697f90bbd5960825?narHash=sha256-cdW6qUL71cNWhHCpMPOJjlw0wzSRP0pVlRn2vqX/VVg%3D' (2023-07-01)
  → 'github:NixOS/nixpkgs/9aa35efbea27d320d0cdc5f922f0890812affb60?narHash=sha256-hVESnM7Eiz93%2B4DeiE0a1TwMeaeph1ytRJ5QtqxYRWg%3D' (2024-08-18)
• Updated input 'rust-overlay':
    'github:oxalica/rust-overlay/f9b92316727af9e6c7fee4a761242f7f46880329?narHash=sha256-CLTufJ29VxNOIZ8UTg0lepsn3X03AmopmaLTTeHDCL4%3D' (2023-07-03)
  → 'github:oxalica/rust-overlay/c7d36e0947826e0751a5214ffe82533fbc909bc0?narHash=sha256-b1g7w0sw%2BMDAhUAeCoX1vlTghsqcDZkxr%2Bk9OZmxPa8%3D' (2024-08-19)
• Removed input 'rust-overlay/flake-utils'
2024-08-19 17:14:05 +02:00
3 changed files with 589 additions and 510 deletions

873
Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -1,51 +1,50 @@
{ {
"nodes": { "nodes": {
"flake-utils": { "crane": {
"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": { "inputs": {
"nixpkgs": [ "nixpkgs": [
"nixpkgs" "nixpkgs"
] ]
}, },
"locked": { "locked": {
"lastModified": 1688229166, "lastModified": 1724006180,
"narHash": "sha256-9lGDg8K1ASjTThzYjctdgd35WqocIIeakQXs5tAbQsM=", "narHash": "sha256-PVxPj0Ga2fMYMtcT9ARCthF+4U71YkOT7ZjgD/vf1Aw=",
"owner": "nmattia", "owner": "ipetkov",
"repo": "naersk", "repo": "crane",
"rev": "714e701eb4ca2491d34d794b98be4b994a796ae7", "rev": "7ce92819802bc583b7e82ebc08013a530f22209f",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nmattia", "owner": "ipetkov",
"ref": "master", "repo": "crane",
"repo": "naersk", "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",
"type": "github" "type": "github"
} }
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1688221086, "lastModified": 1724015816,
"narHash": "sha256-cdW6qUL71cNWhHCpMPOJjlw0wzSRP0pVlRn2vqX/VVg=", "narHash": "sha256-hVESnM7Eiz93+4DeiE0a1TwMeaeph1ytRJ5QtqxYRWg=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "cd99c2b3c9f160cd004318e0697f90bbd5960825", "rev": "9aa35efbea27d320d0cdc5f922f0890812affb60",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -55,29 +54,38 @@
"type": "github" "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": { "root": {
"inputs": { "inputs": {
"flake-utils": "flake-utils", "crane": "crane",
"naersk": "naersk", "flake-parts": "flake-parts",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs",
"rust-overlay": "rust-overlay" "rust-overlay": "rust-overlay"
} }
}, },
"rust-overlay": { "rust-overlay": {
"inputs": { "inputs": {
"flake-utils": [
"flake-utils"
],
"nixpkgs": [ "nixpkgs": [
"nixpkgs" "nixpkgs"
] ]
}, },
"locked": { "locked": {
"lastModified": 1688351637, "lastModified": 1724034091,
"narHash": "sha256-CLTufJ29VxNOIZ8UTg0lepsn3X03AmopmaLTTeHDCL4=", "narHash": "sha256-b1g7w0sw+MDAhUAeCoX1vlTghsqcDZkxr+k9OZmxPa8=",
"owner": "oxalica", "owner": "oxalica",
"repo": "rust-overlay", "repo": "rust-overlay",
"rev": "f9b92316727af9e6c7fee4a761242f7f46880329", "rev": "c7d36e0947826e0751a5214ffe82533fbc909bc0",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -85,21 +93,6 @@
"repo": "rust-overlay", "repo": "rust-overlay",
"type": "github" "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", "root": "root",

113
flake.nix
View file

@ -1,60 +1,105 @@
{ {
inputs = { inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils"; flake-parts.url = "github:hercules-ci/flake-parts";
naersk = { crane = {
url = "github:nmattia/naersk/master"; url = "github:ipetkov/crane";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
rust-overlay = { rust-overlay = {
url = "github:oxalica/rust-overlay"; url = "github:oxalica/rust-overlay";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "flake-utils";
}; };
}; };
outputs = { outputs =
self, { self, ... }@inputs:
nixpkgs, inputs.flake-parts.lib.mkFlake { inherit inputs; } {
flake-utils, systems = [ "x86_64-linux" ];
naersk,
rust-overlay, imports = [ inputs.flake-parts.flakeModules.easyOverlay ];
perSystem =
{
pkgs,
system,
config,
...
}: }:
flake-utils.lib.eachDefaultSystem (system: let let
overlays = [(import rust-overlay)]; overlays = [ (import inputs.rust-overlay) ];
pkgs = import nixpkgs {inherit system overlays;};
naersk-lib = pkgs.callPackage naersk {};
rustToolchain = pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml; rustToolchain = pkgs.rust-bin.stable.latest.default.override {
extensions = [
"rustfmt"
"clippy"
];
};
crane-lib = (inputs.crane.mkLib pkgs).overrideToolchain rustToolchain;
pname = "pamedia";
version = "0.3.0";
src = crane-lib.cleanCargoSource ./.;
buildInputs = [ buildInputs = [
rustToolchain rustToolchain
pkgs.libpulseaudio.dev pkgs.libpulseaudio.dev
]; ];
nativeBuildInputs = [ nativeBuildInputs = [ pkgs.pkg-config ];
pkgs.pkgconf
];
in rec {
packages.pamedia = naersk-lib.buildPackage {
inherit buildInputs nativeBuildInputs;
root = ./.; cargoArtifacts = crane-lib.buildDepsOnly {
pname = "pamedia"; inherit
}; src
packages.default = packages.pamedia; buildInputs
nativeBuildInputs
defaultApp = flake-utils.lib.mkApp { pname
drv = self.defaultPackage."${system}"; version
;
}; };
overlays = final: prev: { pamedia = crane-lib.buildPackage {
pamedia = packages.pamedia; inherit
cargoArtifacts
src
buildInputs
nativeBuildInputs
pname
version
;
}; };
devShell = with pkgs; 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 { mkShell {
buildInputs = [cargo rustc rustfmt pre-commit rustPackages.clippy cargo-edit cargo-feature cargo-outdated rust-analyzer] ++ buildInputs; packages = [
nativeBuildInputs = [libnotify] ++ nativeBuildInputs; cargo
rustc
rustfmt
pre-commit
rustPackages.clippy
cargo-edit
cargo-feature
rust-analyzer
libnotify
];
inputsFrom = [ config.packages.pamedia ];
}; };
}); };
};
} }