Skip to content

Commit

Permalink
99 papercuts
Browse files Browse the repository at this point in the history
  • Loading branch information
Enzime committed Jul 10, 2024
1 parent bb1aa00 commit 36a8d8e
Show file tree
Hide file tree
Showing 10 changed files with 60 additions and 25 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
- Fixed `joplin-desktop` by installing it outside of Nixpkgs
- Use `discord` without OpenASAR on macOS
- Changed `rectangle` and `aldente` to autostart
- Replaced `dockutil` with `system.defaults.dock.persistent-apps`
- Use `armcord` on `aarch64-linux`
- Removed `x11vnc`
- Removed `gnome`
Expand Down
8 changes: 8 additions & 0 deletions hosts/chi/darwin-configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,12 @@
type = "git";
url = "file:///Users/${user}/Projects/nix-darwin";
};

system.defaults.dock.persistent-apps = [
# Update this when firefox-bin-unwrapped is merged
(assert pkgs.firefox.meta.unsupported && pkgs.firefox-bin.meta.unsupported;
"/Applications/Firefox.app")
"${pkgs.utm}/Applications/UTM.app"
"/System/Applications/System Settings.app"
];
}
5 changes: 5 additions & 0 deletions hosts/echo/darwin-configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,9 @@
publicHostKey =
"c3NoLWVkMjU1MTkgQUFBQUMzTnphQzFsWkRJMU5URTVBQUFBSUpCV2N4Yi9CbGFxdDFhdU90RStGOFFVV3JVb3RpQzVxQkorVXVFV2RWQ2Igcm9vdEBuaXhvcwo=";
}];

system.defaults.dock.persistent-apps = [
"/System/Volumes/Preboot/Cryptexes/App/System/Applications/Safari.app"
"/System/Applications/System Settings.app"
];
}
15 changes: 14 additions & 1 deletion hosts/hermes/darwin-configuration.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ user, ... }:
{ user, pkgs, ... }:

{
networking.knownNetworkServices = [ "Wi-Fi" ];
Expand All @@ -15,4 +15,17 @@
type = "git";
url = "file:///Users/${user}/Code/nix-darwin";
};

system.defaults.dock.persistent-apps = [
# Update this when firefox-bin-unwrapped is merged
(assert pkgs.firefox.meta.unsupported && pkgs.firefox-bin.meta.unsupported;
"/Applications/Firefox.app")
"/System/Applications/Utilities/Terminal.app"
"/Applications/1Password.app"
"${pkgs.vscode}/Applications/Visual Studio Code.app"
"${pkgs.spotify}/Applications/Spotify.app"
"/System/Applications/Calendar.app"
"/Applications/Joplin.app"
"/System/Applications/System Settings.app"
];
}
16 changes: 11 additions & 5 deletions modules/firefox.nix
Original file line number Diff line number Diff line change
@@ -1,21 +1,27 @@
{
hmModule = { config, pkgs, lib, ... }:
let inherit (pkgs.stdenv) hostPlatform;
let
inherit (pkgs.stdenv) hostPlatform;

firefoxUnsupported = pkgs.firefox.meta.unsupported
&& pkgs.firefox-bin.meta.unsupported;
in {
home.activation.setDefaultBrowser = lib.mkIf hostPlatform.isDarwin
# Update this to ~/Applications/Home Manager Apps/Firefox.app when firefox-bin-unwrapped is merged
(lib.hm.dag.entryAfter [ "writeBoundary" ] ''
if ! ${lib.getExe pkgs.defaultbrowser} firefox; then
/usr/bin/open ~/Applications/Home\ Manager\ Apps/Firefox.app
/usr/bin/open ${
assert firefoxUnsupported;
"/Applications/Firefox.app"
}
${lib.getExe pkgs.defaultbrowser} firefox
fi
'');

programs.firefox.enable = true;
programs.firefox.package = if hostPlatform.isDarwin then
# Leaving this until firefox-bin-unwrapped is merged
assert (pkgs.firefox.meta.unsupported
&& pkgs.firefox-bin.meta.unsupported);
pkgs.emptyDirectory
assert firefoxUnsupported; pkgs.emptyDirectory
else
pkgs.firefox;
programs.firefox.profiles.base = {
Expand Down
6 changes: 6 additions & 0 deletions modules/graphical-minimal.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
environment.systemPackages =
builtins.attrValues { inherit (pkgs) rectangle; };

launchd.user.agents.rectangle = {
serviceConfig.ProgramArguments =
[ "/Applications/Nix Apps/Rectangle.app/Contents/MacOS/Rectangle" ];
serviceConfig.RunAtLoad = true;
};

# Close Terminal if shell exited cleanly
system.activationScripts.extraUserActivation.text = ''
if [[ -f ~/Library/Preferences/com.apple.Terminal.plist ]]; then
Expand Down
13 changes: 1 addition & 12 deletions modules/graphical.nix
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
hmModule = { config, pkgs, lib, ... }:
let
inherit (pkgs.stdenv) hostPlatform;
inherit (lib) mkIf optionalAttrs;
inherit (lib) optionalAttrs;
in {
home.packages = builtins.attrValues ({
inherit (pkgs) qalculate-gtk remmina;
Expand All @@ -44,17 +44,6 @@

programs.vscode.package = pkgs.vscode;

# WORKAROUND: home-manager uses `sudo -u` to run activation scripts as the correct user
# however dockutil uses `SUDO_USER` to determine the user who ran the command
# meaning that it attempts to edit root's Dock intead of the current user
home.activation.updateDock = mkIf hostPlatform.isDarwin
(lib.hm.dag.entryAfter [ "writeBoundary" ] ''
echo "adding Visual Studio Code.app to the dock"
SUDO_USER= ${
lib.getExe pkgs.dockutil
} --add "${config.programs.vscode.package}/Applications/Visual Studio Code.app" --replacing "Visual Studio Code"
'');

home.file.".ssh/config".text = let
_1password-agent = if hostPlatform.isDarwin then
"~/Library/Group Containers/2BUA8C4S2C.com.1password/t/agent.sock"
Expand Down
6 changes: 6 additions & 0 deletions modules/laptop.nix
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@
environment.systemPackages =
builtins.attrValues { inherit (pkgs) aldente; };

launchd.user.agents.alDente = {
serviceConfig.ProgramArguments =
[ "/Applications/Nix Apps/AlDente.app/Contents/MacOS/AlDente" ];
serviceConfig.RunAtLoad = true;
};

system.defaults.trackpad.Clicking = true;

# WORKAROUND: Setting this via `system.defaults` won't check the checkbox
Expand Down
7 changes: 5 additions & 2 deletions modules/personal.nix
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,12 @@
inherit (pkgs) gramps;
} // optionalAttrs (!hostPlatform.isLinux || !hostPlatform.isAarch64) {
# Runs on everything except `aarch64-linux`
inherit (pkgs) discord joplin-desktop;
discord = if hostPlatform.isLinux then
pkgs.discord.override { withOpenASAR = true; }
else
pkgs.discord;
} // optionalAttrs (hostPlatform.isLinux && hostPlatform.isx86_64) {
inherit (pkgs) signal-desktop;
inherit (pkgs) joplin-desktop signal-desktop;
} // optionalAttrs (hostPlatform.isLinux && hostPlatform.isAarch64) {
inherit (pkgs) armcord;
});
Expand Down
5 changes: 0 additions & 5 deletions overlays/discord.nix

This file was deleted.

0 comments on commit 36a8d8e

Please # to comment.