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 {}) //
(import ./modules-linux {}) //
(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.packages = with pkgs; [
bitwarden-cli
brew
diffutils
findutils
git
+4
View File
@@ -1,6 +1,7 @@
# vim: set ft=python:
from os import getcwd, uname
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):
@@ -19,3 +20,6 @@ xontrib load coreutils
$PATH.insert(0, Path("~/.nix-profile/bin").expanduser())
$PATH.insert(0, Path("~/src/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;
brew = super.callPackage ./homebrew.nix {};
enwiki-dump = super.callPackage ./enwiki-dump.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
callPackage = pkgs.lib.callPackageWith pkgs;
lib = pkgs.lib;
python = pkgs.packages.python3;
cp = pkgs.packages.python3.pkgs.callPackage;
in {
datadog-api-client = callPackage ./datadog-api-client.nix {
inherit pkgs lib;
buildPythonPackage = python.pkgs.buildPythonPackage;
fetchPypi = pkgs.python.pkgs.fetchPypi;
};
flake-utils.lib.eachDefaultSystemMap (system:
let
pkgs = (import nixunstable { inherit system; });
lib = pkgs.lib;
callPackage = pkgs.lib.callPackageWith pkgs;
python = pkgs.packages.python3;
cp = pkgs.packages.python3.pkgs.callPackage;
in {
datadog-api-client = callPackage ./datadog-api-client.nix {
inherit pkgs lib;
buildPythonPackage = python.pkgs.buildPythonPackage;
fetchPypi = pkgs.python.pkgs.fetchPypi;
};
hms = pkgs.callPackage ./hms.nix {
inherit pkgs;
};
hms = pkgs.callPackage ./hms.nix {
inherit pkgs;
};
xonsh-direnv = pkgs.callPackage ./xonsh-direnv.nix {
buildPythonPackage = pkgs.python3.pkgs.buildPythonPackage;
fetchPypi = pkgs.python.pkgs.fetchPypi;
};
brew = pkgs.callPackage ./homebrew.nix {};
}
xonsh-direnv = pkgs.callPackage ./xonsh-direnv.nix {
buildPythonPackage = pkgs.python3.pkgs.buildPythonPackage;
fetchPypi = pkgs.python.pkgs.fetchPypi;
};
}
)