Skip to content

Commit

Permalink
Merge pull request #63 from jonboh/master
Browse files Browse the repository at this point in the history
fix nix build CI
  • Loading branch information
Siriusmart authored Sep 23, 2024
2 parents 7ecf6c7 + 75c8cec commit 4888866
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 121 deletions.
10 changes: 4 additions & 6 deletions .github/workflows/build_nix.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
name: "Build legacy Nix package on Ubuntu"

name: "Build Nix package on Ubuntu"
on:
push:

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: cachix/install-nix-action@v12
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v27
- name: Building package
run: nix-build . -A defaultPackage.x86_64-linux
run: nix build ".#defaultPackage.x86_64-linux"
13 changes: 0 additions & 13 deletions default.nix

This file was deleted.

58 changes: 12 additions & 46 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

87 changes: 44 additions & 43 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,47 +5,48 @@
rust-overlay.url = "github:oxalica/rust-overlay";
};

outputs = { self, nixpkgs, flake-utils, rust-overlay, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
overlays = [ (import rust-overlay) ];
pkgs = import nixpkgs { inherit system overlays; };
rustVersion = pkgs.rust-bin.stable.latest.default;
toml = builtins.fromTOML (builtins.readFile ./Cargo.toml);

rustPlatform = pkgs.makeRustPlatform {
cargo = rustVersion;
rustc = rustVersion;
};

myRustBuild = rustPlatform.buildRustPackage {
pname =
toml.package.name; # make this what ever your cargo.toml package.name is
version = "v${toml.package.version}";
src = ./.; # the folder with the cargo.toml

cargoLock.lockFile = ./Cargo.lock;

buildInputs = with pkgs; [
openssl
xorg.libxcb
libsixel
mpv
];

nativeBuildInputs = with pkgs; [
pkg-config
python3
];
};

in
{
defaultPackage = myRustBuild;
devShell = pkgs.mkShell {
buildInputs =
[ (rustVersion.override { extensions = [ "rust-src" ]; }) ];
};
});
outputs = {
self,
nixpkgs,
flake-utils,
rust-overlay,
...
}:
flake-utils.lib.eachDefaultSystem (system: let
overlays = [(import rust-overlay)];
pkgs = import nixpkgs {inherit system overlays;};
rustVersion = pkgs.rust-bin.stable.latest.default;
toml = builtins.fromTOML (builtins.readFile ./Cargo.toml);

rustPlatform = pkgs.makeRustPlatform {
cargo = rustVersion;
rustc = rustVersion;
};

youtube-tui = rustPlatform.buildRustPackage {
pname =
toml.package.name; # make this what ever your cargo.toml package.name is
version = "v${toml.package.version}";
src = ./.; # the folder with the cargo.toml

cargoLock.lockFile = ./Cargo.lock;

buildInputs = with pkgs; [
openssl
xorg.libxcb
libsixel
mpv
];

nativeBuildInputs = with pkgs; [
pkg-config
python3
];
};
in {
defaultPackage = youtube-tui;
devShell = pkgs.mkShell {
buildInputs = [(rustVersion.override {extensions = ["rust-src"];})];
};
});
}

13 changes: 0 additions & 13 deletions shell.nix

This file was deleted.

0 comments on commit 4888866

Please sign in to comment.