Add homebrew package to flake

This commit is contained in:
Greg Hellings
2023-06-01 10:54:46 -05:00
parent 151c6786cc
commit 39a1e735e7
6 changed files with 74 additions and 21 deletions
+1 -1
View File
@@ -60,6 +60,6 @@
modules = (import ./modules-all {}) // modules = (import ./modules-all {}) //
(import ./modules-linux {}) // (import ./modules-linux {}) //
(import ./modules-darwin {}); (import ./modules-darwin {});
packages = import ./overlays/packages.nix { pkgs = nixstable; }; packages = (import ./overlays/packages.nix { inherit nixunstable flake-utils; });
}; };
} }
+1
View File
@@ -31,6 +31,7 @@
home.stateVersion = "22.05"; home.stateVersion = "22.05";
home.packages = with pkgs; [ home.packages = with pkgs; [
bitwarden-cli bitwarden-cli
brew
diffutils diffutils
findutils findutils
git git
+4
View File
@@ -1,6 +1,7 @@
# vim: set ft=python: # vim: set ft=python:
from os import getcwd, uname from os import getcwd, uname
from pathlib import Path from pathlib import Path
from sys import platform
#if uname().sysname == 'Darwin' and ('__NIX_DARWIN_SET_ENVIRONMENT_DONE' not in ${...} or not $__NIX_DARWIN_SET_ENVIRONMENT_DONE): #if uname().sysname == 'Darwin' and ('__NIX_DARWIN_SET_ENVIRONMENT_DONE' not in ${...} or not $__NIX_DARWIN_SET_ENVIRONMENT_DONE):
@@ -19,3 +20,6 @@ xontrib load coreutils
$PATH.insert(0, Path("~/.nix-profile/bin").expanduser()) $PATH.insert(0, Path("~/.nix-profile/bin").expanduser())
$PATH.insert(0, Path("~/src/bin").expanduser()) $PATH.insert(0, Path("~/src/bin").expanduser())
$PATH.insert(0, Path("~/.local/bin").expanduser()) $PATH.insert(0, Path("~/.local/bin").expanduser())
if platform == "darwin":
$PATH.append(Path("/opt/homebrew/bin/"))
+1
View File
@@ -80,6 +80,7 @@ in rec {
}; };
#fcitx-engines = if ! super.stdenv.isDarwin then super.fcitx5 else super.fcitx-engines; #fcitx-engines = if ! super.stdenv.isDarwin then super.fcitx5 else super.fcitx-engines;
brew = super.callPackage ./homebrew.nix {};
enwiki-dump = super.callPackage ./enwiki-dump.nix {}; enwiki-dump = super.callPackage ./enwiki-dump.nix {};
hms = super.callPackage ./hms.nix { hms = super.callPackage ./hms.nix {
+43
View File
@@ -0,0 +1,43 @@
{
lib,
pkgs,
stdenv,
bash,
curl,
git,
ruby,
...}:
stdenv.mkDerivation rec {
pname = "homebrew-installer";
version = "20230531";
src = pkgs.fetchFromGitHub {
owner = "Homebrew";
repo = "install";
rev = "716a1d024f32890ef75ea82c18a769abc24e9475";
sha256 = "sha256-xhxWWeCJm49bDzmBT2GHSC0CK1SoQArBhfh5sltGY5o=";
};
buildInputs = [
bash
curl
git
ruby
];
installPhase = ''
mkdir -p $out/bin/
cp ${src}/install.sh $out/bin/install-homebrew.sh
cp ${src}/uninstall.sh $out/bin/uninstall-homebrew.sh
'';
meta = with lib; {
description = "Runs the homebrew installer";
homepage = "https://github.com/Homebrew/";
license = licenses.bsd2;
platforms = [ "aarch64-darwin" "x86_64-darwin" ];
maintainers = [ maintainers.greg ];
};
}
+24 -20
View File
@@ -1,24 +1,28 @@
{ pkgs, ... }: { nixunstable, flake-utils }:
let flake-utils.lib.eachDefaultSystemMap (system:
callPackage = pkgs.lib.callPackageWith pkgs; let
lib = pkgs.lib; pkgs = (import nixunstable { inherit system; });
python = pkgs.packages.python3; lib = pkgs.lib;
cp = pkgs.packages.python3.pkgs.callPackage; callPackage = pkgs.lib.callPackageWith pkgs;
in { python = pkgs.packages.python3;
datadog-api-client = callPackage ./datadog-api-client.nix { cp = pkgs.packages.python3.pkgs.callPackage;
inherit pkgs lib; in {
buildPythonPackage = python.pkgs.buildPythonPackage; datadog-api-client = callPackage ./datadog-api-client.nix {
fetchPypi = pkgs.python.pkgs.fetchPypi; inherit pkgs lib;
}; buildPythonPackage = python.pkgs.buildPythonPackage;
fetchPypi = pkgs.python.pkgs.fetchPypi;
};
hms = pkgs.callPackage ./hms.nix { hms = pkgs.callPackage ./hms.nix {
inherit pkgs; inherit pkgs;
}; };
xonsh-direnv = pkgs.callPackage ./xonsh-direnv.nix { brew = pkgs.callPackage ./homebrew.nix {};
buildPythonPackage = pkgs.python3.pkgs.buildPythonPackage;
fetchPypi = pkgs.python.pkgs.fetchPypi;
};
} xonsh-direnv = pkgs.callPackage ./xonsh-direnv.nix {
buildPythonPackage = pkgs.python3.pkgs.buildPythonPackage;
fetchPypi = pkgs.python.pkgs.fetchPypi;
};
}
)