Skip to content

Commit

Permalink
nix: update to latest nixpkgs-unstable (a bit of a rough one)
Browse files Browse the repository at this point in the history
- Cherry picked NixOS/nixpkgs#159516
- Starship workaround: NixOS/nixpkgs#160876
  • Loading branch information
jrolfs committed Feb 24, 2022
1 parent bc08a57 commit 167d478
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 22 deletions.
9 changes: 6 additions & 3 deletions home/.nixpkgs/darwin-configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

let
overlays = import ./overlays.nix;
starship = pkgs.callPackage ./pkgs/starship.nix {
inherit (pkgs.darwin.apple_sdk.frameworks) Security;
};
in
{
imports = [
Expand Down Expand Up @@ -29,7 +32,7 @@ in
pkgs.ripgrep
pkgs.sd
pkgs.skim
pkgs.starship
starship # https://github.com/NixOS/nixpkgs/issues/160876#issuecomment-1046370485
pkgs.tealdeer
pkgs.yq

Expand Down Expand Up @@ -91,8 +94,8 @@ in
pkgs.neovim
pkgs.vim-vint

pkgs.python39Packages.pynvim
pkgs.python39Packages.grip
pkgs.python310Packages.pynvim
pkgs.python310Packages.grip

#
# Network utilities
Expand Down
4 changes: 0 additions & 4 deletions home/.nixpkgs/overlays.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ rec {
# buildInputs = oldAttrs.buildInputs ++ [ super.pkgs.tree-sitter ];
# });

nixUnstable = super.nixUnstable.override {
patches = [ patches/unset-is-macho.patch ];
};

darwin-zsh-completions = super.runCommandNoCC "darwin-zsh-completions-0.0.0"
{ preferLocalBuild = true; }
''
Expand Down
13 changes: 0 additions & 13 deletions home/.nixpkgs/patches/unset-is-macho.patch

This file was deleted.

54 changes: 54 additions & 0 deletions home/.nixpkgs/pkgs/starship.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{ lib
, stdenv
, fetchFromGitHub
, rustPlatform
, pkg-config
, openssl
, installShellFiles
, libiconv
, nixosTests
, Security
}:

rustPlatform.buildRustPackage rec {
pname = "starship";
version = "1.2.1";

src = fetchFromGitHub {
owner = "starship";
repo = pname;
rev = "v${version}";
sha256 = "sha256-5MJA8eHo1enOHlLpAOF1iDvOHCS/Nw0sc84VWu9nApE=";
};

nativeBuildInputs = [ installShellFiles ] ++ lib.optionals stdenv.isLinux [ pkg-config ];

buildInputs = lib.optionals stdenv.isLinux [ openssl ]
++ lib.optionals stdenv.isDarwin [ libiconv Security ];

buildFeatures = lib.optional (!stdenv.isDarwin) "notify-rust";

postInstall = ''
for shell in bash fish zsh; do
STARSHIP_CACHE=$TMPDIR $out/bin/starship completions $shell > starship.$shell
installShellCompletion starship.$shell
done
'';

cargoSha256 = "sha256-DTQQFxj6stzlVzSdmv4J4Nsf8X/VMlwvfIumnuK0YDo=";

preCheck = ''
HOME=$TMPDIR
'';

passthru.tests = {
inherit (nixosTests) starship;
};

meta = with lib; {
description = "A minimal, blazing fast, and extremely customizable prompt for any shell";
homepage = "https://starship.rs";
license = licenses.isc;
maintainers = with maintainers; [ bbigras danth davidtwco Br1ght0ne Frostman marsam ];
};
}
2 changes: 1 addition & 1 deletion nix-darwin
Submodule nix-darwin updated 42 files
+2 −2 .github/workflows/debug.yml
+13 −7 .github/workflows/test.yml
+5 −0 README.md
+2 −2 doc/manual/options-to-docbook.xsl
+23 −6 eval-config.nix
+0 −1 flake.nix
+12 −2 modules/documentation/default.nix
+1 −1 modules/environment/default.nix
+1 −1 modules/fonts/default.nix
+1 −1 modules/homebrew.nix
+3 −0 modules/module-list.nix
+5 −3 modules/nix/default.nix
+6 −6 modules/nix/nixpkgs.nix
+1 −1 modules/programs/ssh/default.nix
+1 −1 modules/programs/vim.nix
+2 −2 modules/security/pki/default.nix
+76 −0 modules/services/cachix-agent.nix
+1 −1 modules/services/chunkwm.nix
+1 −1 modules/services/dnsmasq.nix
+1 −2 modules/services/mail/offlineimap.nix
+71 −0 modules/services/monitoring/telegraf.nix
+1 −1 modules/services/ofborg/default.nix
+1 −1 modules/services/postgresql/default.nix
+1 −1 modules/services/privoxy/default.nix
+2 −2 modules/services/spacebar/default.nix
+2 −2 modules/services/yabai/default.nix
+36 −12 modules/system/defaults-write.nix
+2 −2 modules/system/defaults/NSGlobalDomain.nix
+94 −2 modules/system/defaults/dock.nix
+1 −1 modules/system/defaults/loginwindow.nix
+1 −1 modules/system/defaults/screencapture.nix
+1 −1 modules/system/defaults/spaces.nix
+38 −0 modules/system/defaults/universalaccess.nix
+1 −1 modules/system/patches.nix
+1 −1 modules/system/shells.nix
+2 −2 modules/users/user.nix
+1 −51 pkgs/darwin-installer/configuration.nix
+60 −0 pkgs/darwin-installer/installer.nix
+3 −3 pkgs/darwin-uninstaller/configuration.nix
+1 −1 pkgs/nix-tools/darwin-option.sh
+1 −1 pkgs/nix-tools/darwin-rebuild.sh
+6 −0 tests/system-defaults-write.nix
2 changes: 1 addition & 1 deletion nixpkgs

0 comments on commit 167d478

Please sign in to comment.