From 3a5173afa8152a63d812752efe7ff6b1fc355300 Mon Sep 17 00:00:00 2001 From: mat ess Date: Wed, 20 Apr 2022 21:26:30 -0400 Subject: [PATCH] Migrate some packages from brew to nix --- darwin/default.nix | 21 +++++++++++++-------- darwin/homebrew.nix | 7 ------- flake.nix | 18 ++++++++---------- home/copyApplications.nix | 9 ++++++--- home/default.nix | 10 ++++++++-- home/shells.nix | 2 +- 6 files changed, 36 insertions(+), 31 deletions(-) diff --git a/darwin/default.nix b/darwin/default.nix index a14df6d..9223c1a 100644 --- a/darwin/default.nix +++ b/darwin/default.nix @@ -1,4 +1,4 @@ -{ pkgs, lib, ... }: +{ config, pkgs, lib, ... }: { imports = [ @@ -11,15 +11,20 @@ # `home-manager` currently has issues adding them to `~/Applications` # Issue: https://github.com/nix-community/home-manager/issues/1341 environment.systemPackages = with pkgs; [ - # codium - # discord - # element-desktop - # firefox + discord-ptb + element-desktop + # firefox * + jitsi-meet kitty - # lagrange - # signal-desktop - # steam + lagrange + # mullvad-vpn * + obsidian + # signal-desktop * + slack + # steam * terminal-notifier + # zoom-us * + # *no nixpkgs darwin support T.T ]; # https://github.com/nix-community/home-manager/issues/423 diff --git a/darwin/homebrew.nix b/darwin/homebrew.nix index 6bc77fb..5e08919 100644 --- a/darwin/homebrew.nix +++ b/darwin/homebrew.nix @@ -52,22 +52,15 @@ in homebrew.casks = [ "aerial" "alfred" - "discord" - "element" "firefox" "gog-galaxy" - "jitsi-meet" "knockknock" - "lagrange" "lulu" "mullvadvpn" - "obsidian" "rectangle" "signal" - "slack" "steam" "twitch" - "vscodium" "zoom" ]; diff --git a/flake.nix b/flake.nix index 2ce066b..0045747 100644 --- a/flake.nix +++ b/flake.nix @@ -26,16 +26,14 @@ # Configuration for `nixpkgs` nixpkgsConfig = { config = { allowUnfree = true; }; - overlays = attrValues self.overlays; - # overlays = attrValues self.overlays ++ singleton ( - # # Sub in x86 version of packages that don't build on Apple Silicon yet - # final: prev: (optionalAttrs (prev.stdenv.system == "aarch64-darwin") { - # inherit (final.pkgs-x86) - # idris2 - # nix-index - # purescript; - # }) - # ); + # overlays = attrValues self.overlays; + overlays = attrValues self.overlays ++ singleton ( + # Sub in x86 version of packages that don't build on Apple Silicon yet + final: prev: (optionalAttrs (prev.stdenv.system == "aarch64-darwin") { + inherit (final.pkgs-x86) + vscodium; + }) + ); }; # Shared home-manager configs diff --git a/home/copyApplications.nix b/home/copyApplications.nix index e2ad6d2..b919076 100644 --- a/home/copyApplications.nix +++ b/home/copyApplications.nix @@ -1,9 +1,12 @@ -{ pkgs, lib, ... }: +# adapted from +# https://github.com/reckenrode/nixos-configs/blob/2acd7b0699fd57628deb7b8855b4d5f0ea8f8cb1/common/darwin/home-manager/copyApplications.nix + +{ config, pkgs, lib, ... }: { - home.activation = { + home.activation = lib.optionalAttrs pkgs.stdenv.isDarwin { copyApplications = lib.hm.dag.entryAfter [ "writeBoundary" ] '' - appsSrc="$newGenPath/home-path/Applications/" + appsSrc="${config.home.homeDirectory}/Applications/Nix Apps/" if [ -d "$appsSrc" ]; then baseDir="$HOME/Applications/Home Manager Apps" rsyncArgs="--archive --checksum --chmod=-w --copy-unsafe-links --delete" diff --git a/home/default.nix b/home/default.nix index 89426b3..f6f2bb0 100644 --- a/home/default.nix +++ b/home/default.nix @@ -7,6 +7,7 @@ ./kitty.nix ./neovim.nix ./shells.nix + ./copyApplications.nix ]; home.enableNixpkgsReleaseCheck = true; @@ -62,6 +63,11 @@ set-bat-colors ''; }; + # vscode + vscode = { + enable = true; + package = pkgs.vscodium; + }; }; # }}} @@ -117,8 +123,8 @@ home.file.".pijulconfig".text = '' [author] name = "mat" - full_name = "mat ess" - email = "mat@mat.services" + full_name = "${config.programs.git.userName}" + email = "${config.programs.git.userEmail}" ''; # https://docs.haskellstack.org/en/stable/yaml_configuration/#non-project-specific-config diff --git a/home/shells.nix b/home/shells.nix index 07d1cc8..42d4478 100644 --- a/home/shells.nix +++ b/home/shells.nix @@ -140,7 +140,7 @@ nd = "nix develop"; nf = "nix flake"; nr = "nix run"; - ns = "nix search"; + ns = "nix search nixpkgs"; # Other ".." = "cd ..";