From 4fac81aa6a498ac348c05722898f8baa8ea0b7c6 Mon Sep 17 00:00:00 2001 From: Christopher James Hayward Date: Mon, 14 Mar 2022 20:17:10 -0400 Subject: [PATCH] Use custom firefox shim to keep trash out of $HOME --- README.org | 12 +++++++++--- flake.nix | 1 + modules/firefox.nix | 11 ++++++++--- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/README.org b/README.org index 24a7ec1..da8fd03 100644 --- a/README.org +++ b/README.org @@ -481,6 +481,7 @@ nixos = nixpkgs.lib.nixosSystem { <> <> <> + <> <> ]; }; @@ -795,12 +796,17 @@ in { #+BEGIN_SRC nix :noweb yes :tangle modules/firefox.nix # <> -{ pkgs, ... }: +{ config, pkgs, ... }: -{ +let + myFirefox = pkgs.writeShellScriptBin "firefox" '' + HOME=~/.local/share/mozilla ${pkgs.firefox-bin}/bin/firefox + ''; + +in { # NOTE: Use the binary until module is developed. environment.systemPackages = [ - pkgs.firefox-bin + myFirefox ]; } #+END_SRC diff --git a/flake.nix b/flake.nix index 2b77537..db9ed42 100644 --- a/flake.nix +++ b/flake.nix @@ -25,6 +25,7 @@ ./modules/hugo.nix ./modules/flakes.nix ./modules/cachix.nix + ./modules/firefox.nix inputs.home-manager.nixosModules.home-manager { home-manager.useGlobalPkgs = true; home-manager.useUserPackages = true; diff --git a/modules/firefox.nix b/modules/firefox.nix index 89dbf54..10560f7 100644 --- a/modules/firefox.nix +++ b/modules/firefox.nix @@ -1,9 +1,14 @@ # This file is controlled by /etc/dotfiles/README.org -{ pkgs, ... }: +{ config, pkgs, ... }: -{ +let + myFirefox = pkgs.writeShellScriptBin "firefox" '' + HOME=~/.local/share/mozilla ${pkgs.firefox-bin}/bin/firefox + ''; + +in { # NOTE: Use the binary until module is developed. environment.systemPackages = [ - pkgs.firefox-bin + myFirefox ]; }