From 62bf4d5660367c0ad77aa1e66d9ba937a5fbbff5 Mon Sep 17 00:00:00 2001 From: Emmet Date: Sat, 20 May 2023 19:58:54 -0500 Subject: [PATCH] Added rust + compiled ytsub! --- flake.nix | 4 +++- user/home.nix | 7 ++++++- user/lang/rust/rust.nix | 8 ++++++++ user/pkgs/ytsub.nix | 28 ++++++++++++++++++++++++++++ 4 files changed, 45 insertions(+), 2 deletions(-) create mode 100644 user/lang/rust/rust.nix create mode 100644 user/pkgs/ytsub.nix diff --git a/flake.nix b/flake.nix index e8d1f2b..5548d10 100644 --- a/flake.nix +++ b/flake.nix @@ -7,6 +7,7 @@ home-manager.inputs.nixpkgs.follows = "nixpkgs"; nix-doom-emacs.url = "github:nix-community/nix-doom-emacs"; stylix.url = "github:danth/stylix"; + rust-overlay.url = "github:oxalica/rust-overlay"; eaf = { url = "github:emacs-eaf/emacs-application-framework"; flake = false; @@ -17,7 +18,7 @@ }; }; - outputs = { self, nixpkgs, home-manager, nix-doom-emacs, stylix, eaf, eaf-browser, ... }@inputs: + outputs = { self, nixpkgs, home-manager, nix-doom-emacs, stylix, eaf, eaf-browser, rust-overlay, ... }@inputs: let system = "x86_64-linux"; name = "emmet"; @@ -28,6 +29,7 @@ pkgs = import nixpkgs { inherit system; config = { allowUnfree = true; }; + overlays = [ rust-overlay.overlays.default ]; }; lib = nixpkgs.lib; diff --git a/user/home.nix b/user/home.nix index b91c465..613e33d 100644 --- a/user/home.nix +++ b/user/home.nix @@ -19,6 +19,7 @@ ./app/games/games.nix # Various videogame apps ./style/stylix.nix # Styling and themes for my apps ./lang/cc/cc.nix # C and C++ tools + ./lang/rust/rust.nix # Rust tools #./lang/python/python.nix # Python #./lang/python/python-packages.nix # Extra Python packages I want ./lang/haskell/haskell.nix # Haskell tools @@ -28,6 +29,7 @@ home.stateVersion = "22.11"; # Please read the comment before changing. + home.packages = with pkgs; [ # Core zsh @@ -91,7 +93,8 @@ hunspell hunspellDicts.en_US-large pandoc nodePackages.mermaid-cli - + (pkgs.callPackage ./pkgs/ytsub.nix { }) + # Various dev packages texinfo libffi zlib @@ -156,4 +159,6 @@ EDITOR = "emacsclient"; }; + # extra packages + } diff --git a/user/lang/rust/rust.nix b/user/lang/rust/rust.nix new file mode 100644 index 0000000..414f084 --- /dev/null +++ b/user/lang/rust/rust.nix @@ -0,0 +1,8 @@ +{ config, pkgs, ... }: + +{ + home.packages = with pkgs; [ + # Rust setup + rustup + ]; +} diff --git a/user/pkgs/ytsub.nix b/user/pkgs/ytsub.nix new file mode 100644 index 0000000..4b01ce8 --- /dev/null +++ b/user/pkgs/ytsub.nix @@ -0,0 +1,28 @@ +{ lib, pkgs, ... }: +let + rustPlatform = pkgs.makeRustPlatform { + cargo = pkgs.rust-bin.stable.latest.minimal; + rustc = pkgs.rust-bin.stable.latest.minimal; + }; +in +rustPlatform.buildRustPackage rec { + pname = "ytsub"; + version = "0.4.0"; + + src = fetchTarball { + url = "https://github.com/sarowish/ytsub/archive/refs/tags/v0.4.0.tar.gz"; + sha256 = "1124mf5r2507d2939833xkavy2vi2rbws67dkim4vwah376k3rlf"; + }; + + cargoSha256 = "sha256-pv4eKD2XgaDAJqSf3JzfnsayofmOSy4XRzZ8rkZrHAo="; + + buildNoDefaultFeatures = true; + buildFeatures = [ "bundled_sqlite" ]; + + meta = with lib; { + description = "A subscriptions only TUI Youtube client that uses the Invidious API"; + homepage = "https://github.com/sarowish/ytsub"; + license = licenses.gpl3Only; + maintainers = []; + }; +}