Add homebrew package to flake
This commit is contained in:
@@ -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; });
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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/"))
|
||||||
|
|||||||
@@ -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 {
|
||||||
|
|||||||
@@ -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 ];
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -1,8 +1,10 @@
|
|||||||
{ pkgs, ... }:
|
{ nixunstable, flake-utils }:
|
||||||
|
|
||||||
|
flake-utils.lib.eachDefaultSystemMap (system:
|
||||||
let
|
let
|
||||||
callPackage = pkgs.lib.callPackageWith pkgs;
|
pkgs = (import nixunstable { inherit system; });
|
||||||
lib = pkgs.lib;
|
lib = pkgs.lib;
|
||||||
|
callPackage = pkgs.lib.callPackageWith pkgs;
|
||||||
python = pkgs.packages.python3;
|
python = pkgs.packages.python3;
|
||||||
cp = pkgs.packages.python3.pkgs.callPackage;
|
cp = pkgs.packages.python3.pkgs.callPackage;
|
||||||
in {
|
in {
|
||||||
@@ -16,9 +18,11 @@ in {
|
|||||||
inherit pkgs;
|
inherit pkgs;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
brew = pkgs.callPackage ./homebrew.nix {};
|
||||||
|
|
||||||
xonsh-direnv = pkgs.callPackage ./xonsh-direnv.nix {
|
xonsh-direnv = pkgs.callPackage ./xonsh-direnv.nix {
|
||||||
buildPythonPackage = pkgs.python3.pkgs.buildPythonPackage;
|
buildPythonPackage = pkgs.python3.pkgs.buildPythonPackage;
|
||||||
fetchPypi = pkgs.python.pkgs.fetchPypi;
|
fetchPypi = pkgs.python.pkgs.fetchPypi;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user