From 9d245a633329c93d4d796cd540774c46e0194c25 Mon Sep 17 00:00:00 2001 From: Tim Keller Date: Sat, 1 Aug 2026 12:10:39 -0500 Subject: simplify flake to only expose userChrome as a string instead of as a derivation --- flake.nix | 41 ++++++++++------------------------------- 1 file changed, 10 insertions(+), 31 deletions(-) (limited to 'flake.nix') diff --git a/flake.nix b/flake.nix index 08be40f..adc3eea 100644 --- a/flake.nix +++ b/flake.nix @@ -1,42 +1,21 @@ { description = "Firefox userChrome.css"; - - inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; - flake-utils.url = "github:numtide/flake-utils"; - }; - + inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; outputs = + { self, nixpkgs }: { - self, - nixpkgs, - flake-utils, - }: - flake-utils.lib.eachDefaultSystem ( - system: - let - pkgs = nixpkgs.legacyPackages.${system}; - in - { - packages.default = pkgs.stdenvNoCC.mkDerivation { - pname = "firefox-userchrome"; - version = "1.0.0"; - src = ./.; - dontBuild = true; - installPhase = '' - mkdir -p $out/chrome - cp userChrome.css $out/chrome/userChrome.css - ''; - }; + userChrome = builtins.readFile ./userChrome.css; - # `nix fmt` formats userChrome.css with prettier - formatter = pkgs.writeShellApplication { + # `nix fmt` formats userChrome.css with prettier + formatter = nixpkgs.lib.mapAttrs ( + system: pkgs: + pkgs.writeShellApplication { name = "fmt"; runtimeInputs = [ pkgs.prettier ]; text = '' prettier --write userChrome.css ''; - }; - } - ); + } + ) nixpkgs.legacyPackages; + }; } -- cgit v1.2.3