Commit fda25a70aa

fda25a70aa135566549537cd4cd93a1d0be20afb

parent: 9981f93fab

Unsigned

dafixxer <prmboy@proton.me> · 2023-09-10 15:16 UTC

nixifying youtube-tui

Layout: unified · split

.envrc added +1
@@ -0,0 +1 @@
1use flake
.github/workflows/build_nix.yml added +13
@@ -0,0 +1,13 @@
1name: "Build legacy Nix package on Ubuntu"
2
3on:
4 push:
5
6jobs:
7 build:
8 runs-on: ubuntu-latest
9 steps:
10 - uses: actions/checkout@v2
11 - uses: cachix/install-nix-action@v12
12 - name: Building package
13 run: nix-build . -A defaultPackage.x86_64-linux
default.nix added +13
@@ -0,0 +1,13 @@
1(import
2 (
3 let
4 lock = builtins.fromJSON (builtins.readFile ./flake.lock);
5 in
6 fetchTarball {
7 url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
8 sha256 = lock.nodes.flake-compat.locked.narHash;
9 }
10 )
11 {
12 src = ./.;
13 }).defaultNix
flake.lock added +130
@@ -0,0 +1,130 @@
1{
2 "nodes": {
3 "flake-utils": {
4 "inputs": {
5 "systems": "systems"
6 },
7 "locked": {
8 "lastModified": 1692799911,
9 "narHash": "sha256-3eihraek4qL744EvQXsK1Ha6C3CR7nnT8X2qWap4RNk=",
10 "owner": "numtide",
11 "repo": "flake-utils",
12 "rev": "f9e7cf818399d17d347f847525c5a5a8032e4e44",
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"
32 },
33 "original": {
34 "owner": "numtide",
35 "repo": "flake-utils",
36 "type": "github"
37 }
38 },
39 "nixpkgs": {
40 "locked": {
41 "lastModified": 1694183432,
42 "narHash": "sha256-YyPGNapgZNNj51ylQMw9lAgvxtM2ai1HZVUu3GS8Fng=",
43 "owner": "nixos",
44 "repo": "nixpkgs",
45 "rev": "db9208ab987cdeeedf78ad9b4cf3c55f5ebd269b",
46 "type": "github"
47 },
48 "original": {
49 "owner": "nixos",
50 "ref": "nixos-unstable",
51 "repo": "nixpkgs",
52 "type": "github"
53 }
54 },
55 "nixpkgs_2": {
56 "locked": {
57 "lastModified": 1681358109,
58 "narHash": "sha256-eKyxW4OohHQx9Urxi7TQlFBTDWII+F+x2hklDOQPB50=",
59 "owner": "NixOS",
60 "repo": "nixpkgs",
61 "rev": "96ba1c52e54e74c3197f4d43026b3f3d92e83ff9",
62 "type": "github"
63 },
64 "original": {
65 "owner": "NixOS",
66 "ref": "nixpkgs-unstable",
67 "repo": "nixpkgs",
68 "type": "github"
69 }
70 },
71 "root": {
72 "inputs": {
73 "flake-utils": "flake-utils",
74 "nixpkgs": "nixpkgs",
75 "rust-overlay": "rust-overlay"
76 }
77 },
78 "rust-overlay": {
79 "inputs": {
80 "flake-utils": "flake-utils_2",
81 "nixpkgs": "nixpkgs_2"
82 },
83 "locked": {
84 "lastModified": 1694225334,
85 "narHash": "sha256-f3uOfcfmG53biFl6zHPHSFrBucLGQp0LpRYQJlozZSA=",
86 "owner": "oxalica",
87 "repo": "rust-overlay",
88 "rev": "1b4fad9dccece45c25b9ebda607427d69a8f1eae",
89 "type": "github"
90 },
91 "original": {
92 "owner": "oxalica",
93 "repo": "rust-overlay",
94 "type": "github"
95 }
96 },
97 "systems": {
98 "locked": {
99 "lastModified": 1681028828,
100 "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
101 "owner": "nix-systems",
102 "repo": "default",
103 "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
104 "type": "github"
105 },
106 "original": {
107 "owner": "nix-systems",
108 "repo": "default",
109 "type": "github"
110 }
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 }
127 },
128 "root": "root",
129 "version": 7
130}
flake.nix added +51
@@ -0,0 +1,51 @@
1{
2 inputs = {
3 nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
4 flake-utils.url = "github:numtide/flake-utils";
5 rust-overlay.url = "github:oxalica/rust-overlay";
6 };
7
8 outputs = { self, nixpkgs, flake-utils, rust-overlay, ... }:
9 flake-utils.lib.eachDefaultSystem (system:
10 let
11 overlays = [ (import rust-overlay) ];
12 pkgs = import nixpkgs { inherit system overlays; };
13 rustVersion = pkgs.rust-bin.stable.latest.default;
14 toml = builtins.fromTOML (builtins.readFile ./Cargo.toml);
15
16 rustPlatform = pkgs.makeRustPlatform {
17 cargo = rustVersion;
18 rustc = rustVersion;
19 };
20
21 myRustBuild = rustPlatform.buildRustPackage {
22 pname =
23 toml.package.name; # make this what ever your cargo.toml package.name is
24 version = "v${toml.package.version}";
25 src = ./.; # the folder with the cargo.toml
26
27 cargoLock.lockFile = ./Cargo.lock;
28
29 buildInputs = with pkgs; [
30 openssl
31 xorg.libxcb
32 libsixel
33 mpv
34 ];
35
36 nativeBuildInputs = with pkgs; [
37 pkg-config
38 python3
39 ];
40 };
41
42 in
43 {
44 defaultPackage = myRustBuild;
45 devShell = pkgs.mkShell {
46 buildInputs =
47 [ (rustVersion.override { extensions = [ "rust-src" ]; }) ];
48 };
49 });
50}
51
shell.nix added +13
@@ -0,0 +1,13 @@
1(import
2 (
3 let
4 lock = builtins.fromJSON (builtins.readFile ./flake.lock);
5 in
6 fetchTarball {
7 url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
8 sha256 = lock.nodes.flake-compat.locked.narHash;
9 }
10 )
11 {
12 src = ./.;
13 }).shellNix