From 26d55fa278b70010e0fe8a9f1db3f609d5ef7ffa Mon Sep 17 00:00:00 2001 From: Youwen Wu Date: Sun, 10 Nov 2024 20:36:09 -0800 Subject: [PATCH] refactor: add zen browser for aarch64-linux --- flake.lock | 68 ++++++++++++++++++- overlays/default.nix | 8 +++ .../linux/packages/aarch-64/default.nix | 7 +- .../youwen/linux/packages/common-packages.nix | 2 + .../youwen/linux/packages/x86_64/default.nix | 20 +++--- 5 files changed, 90 insertions(+), 15 deletions(-) diff --git a/flake.lock b/flake.lock index f6f4d64..4f30b8f 100755 --- a/flake.lock +++ b/flake.lock @@ -324,6 +324,24 @@ "type": "github" } }, + "flake-parts_4": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib_3" + }, + "locked": { + "lastModified": 1730504689, + "narHash": "sha256-hgmguH29K2fvs9szpq2r3pz2/8cJd2LPS+b4tfNFCwE=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "506278e768c2a08bec68eb62932193e341f55c90", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, "flake-utils": { "inputs": { "systems": "systems" @@ -755,6 +773,18 @@ "url": "https://github.com/NixOS/nixpkgs/archive/fb192fec7cc7a4c26d51779e9bab07ce6fa5597a.tar.gz" } }, + "nixpkgs-lib_3": { + "locked": { + "lastModified": 1730504152, + "narHash": "sha256-lXvH/vOfb4aGYyvFmZK/HlsNsr/0CVWlwYvo2rxJk3s=", + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/cc2f28000298e1269cea6612cd06ec9979dd5d7f.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/cc2f28000298e1269cea6612cd06ec9979dd5d7f.tar.gz" + } + }, "nixpkgs-stable": { "locked": { "lastModified": 1710695816, @@ -803,6 +833,22 @@ "type": "github" } }, + "nixpkgs_4": { + "locked": { + "lastModified": 1731139594, + "narHash": "sha256-IigrKK3vYRpUu+HEjPL/phrfh7Ox881er1UEsZvw9Q4=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "76612b17c0ce71689921ca12d9ffdc9c23ce40b2", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, "plugins-lsp-progress": { "flake": false, "locked": { @@ -882,7 +928,8 @@ "vesktop-bin": "vesktop-bin", "viminal": "viminal", "wallpapers": "wallpapers", - "zen-browser": "zen-browser" + "zen-browser": "zen-browser", + "zen-browser-source": "zen-browser-source" } }, "rust-analyzer-src": { @@ -1198,6 +1245,25 @@ "repo": "zen-browser-flake", "type": "github" } + }, + "zen-browser-source": { + "inputs": { + "flake-parts": "flake-parts_4", + "nixpkgs": "nixpkgs_4" + }, + "locked": { + "lastModified": 1731292739, + "narHash": "sha256-c0ED1Yu1AamD3RXsH1kLvvP8gdhGp/HB8AJfzJw7Ph0=", + "owner": "youwen5", + "repo": "zen-browser-source-flake", + "rev": "dc72f9d9456cd732ad9eb78f8e3d676aa807d554", + "type": "github" + }, + "original": { + "owner": "youwen5", + "repo": "zen-browser-source-flake", + "type": "github" + } } }, "root": "root", diff --git a/overlays/default.nix b/overlays/default.nix index 2ed005c..a11e647 100644 --- a/overlays/default.nix +++ b/overlays/default.nix @@ -5,6 +5,7 @@ }: let bleedingpkgs = inputs.bleedingpkgs.legacyPackages.${pkgs.system}; + inherit (pkgs) system; in # stablepkgs = inputs.stablepkgs.legacyPackages.${pkgs.system}; # nixpkgs-small = inputs.nixpkgs-unstable-small.legacyPackages.${pkgs.system}; @@ -12,6 +13,13 @@ in nixpkgs.overlays = [ (self: super: { _7zz = bleedingpkgs._7zz; + zen-browser = + if system == "x86_64-linux" then + inputs.zen-browser.packages.${system}.default + else if system == "aarch64-linux" then + inputs.zen-browser-source.packages.${system}.default + else + null; }) ]; } diff --git a/users/youwen/linux/packages/aarch-64/default.nix b/users/youwen/linux/packages/aarch-64/default.nix index e32c20a..c75dd2b 100644 --- a/users/youwen/linux/packages/aarch-64/default.nix +++ b/users/youwen/linux/packages/aarch-64/default.nix @@ -1,8 +1,11 @@ -{ pkgs, ... }: +{ inputs, pkgs, ... }: let createCommon = import ../common-packages.nix; in { - home.packages = (createCommon pkgs) ++ (with pkgs; [ ]); + home.packages = + (createCommon pkgs) + ++ [ + ]; } diff --git a/users/youwen/linux/packages/common-packages.nix b/users/youwen/linux/packages/common-packages.nix index 9cbf84c..e816652 100644 --- a/users/youwen/linux/packages/common-packages.nix +++ b/users/youwen/linux/packages/common-packages.nix @@ -39,4 +39,6 @@ pkgs: with pkgs; [ gcc hledger + + zen-browser ] diff --git a/users/youwen/linux/packages/x86_64/default.nix b/users/youwen/linux/packages/x86_64/default.nix index d0cc5a4..f5b13cf 100644 --- a/users/youwen/linux/packages/x86_64/default.nix +++ b/users/youwen/linux/packages/x86_64/default.nix @@ -10,18 +10,14 @@ in { home.packages = (createCommon pkgs) - ++ ( - with pkgs; - [ - bitwarden-desktop - modrinth-app - lutris - sbctl - r2modman - zoom-us - ] - ++ [ zen-browser ] - ); + ++ (with pkgs; [ + bitwarden-desktop + modrinth-app + lutris + sbctl + r2modman + zoom-us + ]); home.sessionVariables = { DEFAULT_BROWSER = "${zen-browser}/bin/zen";