Now Emacs works on the Macbook

This commit is contained in:
Andrea Ciceri 2021-10-11 23:58:20 +02:00
parent b4d239d34b
commit 3f39ace857
No known key found for this signature in database
GPG key ID: AAFD2423608B645B
9 changed files with 158 additions and 127 deletions

View file

@ -189,6 +189,7 @@
system = "x86_64-darwin"; system = "x86_64-darwin";
modules = [ home.darwinModules.home-manager ./hosts/mbp ]; modules = [ home.darwinModules.home-manager ./hosts/mbp ];
inputs = { inherit darwin; }; inputs = { inherit darwin; };
specialArgs = { inherit emacs-overlay; };
}; };
}; };
} }

View file

@ -1,4 +1,4 @@
{pkgs, home-manager, ...}: { pkgs, home-manager, emacs-overlay, ... }:
{ {
imports = [ imports = [
../../users/andreaciceri ../../users/andreaciceri
@ -14,6 +14,8 @@
enableSSHSupport = true; enableSSHSupport = true;
}; };
nixpkgs.overlays = [ (import ../../pkgs) emacs-overlay.overlay ];
nix = { nix = {
package = pkgs.nixUnstable; package = pkgs.nixUnstable;
extraOptions = '' extraOptions = ''

View file

@ -1,4 +1,4 @@
{ pkgs, ...}: { pkgs, emacs-overlay, ... }:
{ {
imports = [ imports = [
./configuration.nix ./configuration.nix

View file

@ -2,5 +2,7 @@ final: prev: {
# keep sources this first # keep sources this first
sources = prev.callPackage (import ./_sources/generated.nix) { }; sources = prev.callPackage (import ./_sources/generated.nix) { };
customEmacs = prev.callPackage (import ./emacs) { }; customEmacs = prev.callPackage (import ./emacs) { };
ungoogled-chromium = import ./ungoogled-chromium { inherit prev; };
vscodium = import ./vscodium { inherit prev; };
# then, call packages with `final.callPackage` # then, call packages with `final.callPackage`
} }

View file

@ -0,0 +1,10 @@
{ prev, pkgs, ... }:
prev.runCommandNoCC "wrap-chromium"
{ buildInputs = with pkgs; [ makeWrapper ]; }
''
makeWrapper ${c}/bin/chromium $out/bin/chromium \
--add-flags "--enable-features=UseOzonePlatform" \
--add-flags "--ozone-platform=wayland"
ln -sf ${c}/share $out/share
''

10
pkgs/vscodium/default.nix Normal file
View file

@ -0,0 +1,10 @@
{ prev, pkgs, ... }:
prev.runCommandNoCC "codium"
{ buildInputs = with pkgs; [ makeWrapper ]; }
''
makeWrapper ${prev.vscodium}/bin/codium $out/bin/codium \
--add-flags "--enable-features=UseOzonePlatform" \
--add-flags "--ozone-platform=wayland"
ln -sf ${prev.vscodium}/share $out/share
''

View file

@ -0,0 +1,7 @@
{
config = {
networking.firewall.extraCommands = ''
iptables -I INPUT -p udp -m udp --dport 32768:60999 -j ACCEPT
'';
};
}

View file

@ -1,4 +1,4 @@
{ config, lib, pkgs, ... }: { { config, lib, pkgs, emacs-overlay, ... }: {
home-manager.users."andreaciceri" = { ... }: { home-manager.users."andreaciceri" = { ... }: {
imports = [ imports = [
../profiles/bat ../profiles/bat
@ -6,10 +6,10 @@
../profiles/zsh ../profiles/zsh
../profiles/direnv ../profiles/direnv
../profiles/exa ../profiles/exa
../profiles/emacs
]; ];
home.packages = with pkgs; [ home.packages = with pkgs; [
yarn yarn
]; ];
}; };
} }

View file

@ -12,10 +12,9 @@
}; };
home.packages = with pkgs; [ home.packages = with pkgs; [
python-language-server
fd fd
ag ag
nixpkgs-fmt nixpkgs-fmt
rnix-lsp rnix-lsp
]; ] ++ (if config.network.hostname != "mbp" then python-language-server else [ ]);
} }