Commit 4750a76428

4750a76428216f29c61a478a7471d9debe5af627

parent: 7ecf6c7a4a

Unsigned

jonboh <jon.bosque.hernando@gmail.com> · 2024-09-22 15:01 UTC

fix nix build CI

Layout: unified · split

.github/workflows/build_nix.yml +1 −3
@@ -1,8 +1,6 @@
1name: "Build legacy Nix package on Ubuntu" 1name: "Build legacy Nix package on Ubuntu"
2
3on: 2on:
4 push: 3 push:
5
6jobs: 4jobs:
7 build: 5 build:
8 runs-on: ubuntu-latest 6 runs-on: ubuntu-latest
@@ -10,4 +8,4 @@ jobs:
10 - uses: actions/checkout@v2 8 - uses: actions/checkout@v2
11 - uses: cachix/install-nix-action@v12 9 - uses: cachix/install-nix-action@v12
12 - name: Building package 10 - name: Building package
13 run: nix-build . -A defaultPackage.x86_64-linux 11 run: nix build ".#defaultPackage.x86_64-linux"
flake.lock +12 −46
@@ -5,29 +5,11 @@
5 "systems": "systems" 5 "systems": "systems"
6 }, 6 },
7 "locked": { 7 "locked": {
8 "lastModified": 1692799911, 8 "lastModified": 1726560853,
9 "narHash": "sha256-3eihraek4qL744EvQXsK1Ha6C3CR7nnT8X2qWap4RNk=", 9 "narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=",
10 "owner": "numtide", 10 "owner": "numtide",
11 "repo": "flake-utils", 11 "repo": "flake-utils",
12 "rev": "f9e7cf818399d17d347f847525c5a5a8032e4e44", 12 "rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a",
13 "type": "github"
14 },
15 "original": {
16 "owner": "numtide",
17 "repo": "flake-utils",
18 "type": "github"
19 }
20 },
21 "flake-utils_2": {
22 "inputs": {
23 "systems": "systems_2"
24 },
25 "locked": {
26 "lastModified": 1681202837,
27 "narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=",
28 "owner": "numtide",
29 "repo": "flake-utils",
30 "rev": "cfacdce06f30d2b68473a46042957675eebb3401",
31 "type": "github" 13 "type": "github"
32 }, 14 },
33 "original": { 15 "original": {
@@ -38,11 +20,11 @@
38 }, 20 },
39 "nixpkgs": { 21 "nixpkgs": {
40 "locked": { 22 "locked": {
41 "lastModified": 1694183432, 23 "lastModified": 1726755586,
42 "narHash": "sha256-YyPGNapgZNNj51ylQMw9lAgvxtM2ai1HZVUu3GS8Fng=", 24 "narHash": "sha256-PmUr/2GQGvFTIJ6/Tvsins7Q43KTMvMFhvG6oaYK+Wk=",
43 "owner": "nixos", 25 "owner": "nixos",
44 "repo": "nixpkgs", 26 "repo": "nixpkgs",
45 "rev": "db9208ab987cdeeedf78ad9b4cf3c55f5ebd269b", 27 "rev": "c04d5652cfa9742b1d519688f65d1bbccea9eb7e",
46 "type": "github" 28 "type": "github"
47 }, 29 },
48 "original": { 30 "original": {
@@ -54,11 +36,11 @@
54 }, 36 },
55 "nixpkgs_2": { 37 "nixpkgs_2": {
56 "locked": { 38 "locked": {
57 "lastModified": 1681358109, 39 "lastModified": 1718428119,
58 "narHash": "sha256-eKyxW4OohHQx9Urxi7TQlFBTDWII+F+x2hklDOQPB50=", 40 "narHash": "sha256-WdWDpNaq6u1IPtxtYHHWpl5BmabtpmLnMAx0RdJ/vo8=",
59 "owner": "NixOS", 41 "owner": "NixOS",
60 "repo": "nixpkgs", 42 "repo": "nixpkgs",
61 "rev": "96ba1c52e54e74c3197f4d43026b3f3d92e83ff9", 43 "rev": "e6cea36f83499eb4e9cd184c8a8e823296b50ad5",
62 "type": "github" 44 "type": "github"
63 }, 45 },
64 "original": { 46 "original": {
@@ -77,15 +59,14 @@
77 }, 59 },
78 "rust-overlay": { 60 "rust-overlay": {
79 "inputs": { 61 "inputs": {
80 "flake-utils": "flake-utils_2",
81 "nixpkgs": "nixpkgs_2" 62 "nixpkgs": "nixpkgs_2"
82 }, 63 },
83 "locked": { 64 "locked": {
84 "lastModified": 1694225334, 65 "lastModified": 1726972233,
85 "narHash": "sha256-f3uOfcfmG53biFl6zHPHSFrBucLGQp0LpRYQJlozZSA=", 66 "narHash": "sha256-FlL/bNESOtDQoczRhmPfReNAmLqVg+dAX4HectPOOf0=",
86 "owner": "oxalica", 67 "owner": "oxalica",
87 "repo": "rust-overlay", 68 "repo": "rust-overlay",
88 "rev": "1b4fad9dccece45c25b9ebda607427d69a8f1eae", 69 "rev": "36d73192555e569d27579f6c486fea3ab768823c",
89 "type": "github" 70 "type": "github"
90 }, 71 },
91 "original": { 72 "original": {
@@ -108,21 +89,6 @@
108 "repo": "default", 89 "repo": "default",
109 "type": "github" 90 "type": "github"
110 } 91 }
111 },
112 "systems_2": {
113 "locked": {
114 "lastModified": 1681028828,
115 "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
116 "owner": "nix-systems",
117 "repo": "default",
118 "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
119 "type": "github"
120 },
121 "original": {
122 "owner": "nix-systems",
123 "repo": "default",
124 "type": "github"
125 }
126 } 92 }
127 }, 93 },
128 "root": "root", 94 "root": "root",
flake.nix +44 −43
@@ -5,47 +5,48 @@
5 rust-overlay.url = "github:oxalica/rust-overlay"; 5 rust-overlay.url = "github:oxalica/rust-overlay";
6 }; 6 };
7 7
8 outputs = { self, nixpkgs, flake-utils, rust-overlay, ... }: 8 outputs = {
9 flake-utils.lib.eachDefaultSystem (system: 9 self,
10 let 10 nixpkgs,
11 overlays = [ (import rust-overlay) ]; 11 flake-utils,
12 pkgs = import nixpkgs { inherit system overlays; }; 12 rust-overlay,
13 rustVersion = pkgs.rust-bin.stable.latest.default; 13 ...
14 toml = builtins.fromTOML (builtins.readFile ./Cargo.toml); 14 }:
15 15 flake-utils.lib.eachDefaultSystem (system: let
16 rustPlatform = pkgs.makeRustPlatform { 16 overlays = [(import rust-overlay)];
17 cargo = rustVersion; 17 pkgs = import nixpkgs {inherit system overlays;};
18 rustc = rustVersion; 18 rustVersion = pkgs.rust-bin.stable.latest.default;
19 }; 19 toml = builtins.fromTOML (builtins.readFile ./Cargo.toml);
20 20
21 myRustBuild = rustPlatform.buildRustPackage { 21 rustPlatform = pkgs.makeRustPlatform {
22 pname = 22 cargo = rustVersion;
23 toml.package.name; # make this what ever your cargo.toml package.name is 23 rustc = rustVersion;
24 version = "v${toml.package.version}"; 24 };
25 src = ./.; # the folder with the cargo.toml 25
26 26 youtube-tui = rustPlatform.buildRustPackage {
27 cargoLock.lockFile = ./Cargo.lock; 27 pname =
28 28 toml.package.name; # make this what ever your cargo.toml package.name is
29 buildInputs = with pkgs; [ 29 version = "v${toml.package.version}";
30 openssl 30 src = ./.; # the folder with the cargo.toml
31 xorg.libxcb 31
32 libsixel 32 cargoLock.lockFile = ./Cargo.lock;
33 mpv 33
34 ]; 34 buildInputs = with pkgs; [
35 35 openssl
36 nativeBuildInputs = with pkgs; [ 36 xorg.libxcb
37 pkg-config 37 libsixel
38 python3 38 mpv
39 ]; 39 ];
40 }; 40
41 41 nativeBuildInputs = with pkgs; [
42 in 42 pkg-config
43 { 43 python3
44 defaultPackage = myRustBuild; 44 ];
45 devShell = pkgs.mkShell { 45 };
46 buildInputs = 46 in {
47 [ (rustVersion.override { extensions = [ "rust-src" ]; }) ]; 47 defaultPackage = youtube-tui;
48 }; 48 devShell = pkgs.mkShell {
49 }); 49 buildInputs = [(rustVersion.override {extensions = ["rust-src"];})];
50 };
51 });
50} 52}
51