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.lock | 34 ---------------------------------- flake.nix | 41 ++++++++++------------------------------- 2 files changed, 10 insertions(+), 65 deletions(-) diff --git a/flake.lock b/flake.lock index a57f1a1..e6d08bb 100644 --- a/flake.lock +++ b/flake.lock @@ -1,23 +1,5 @@ { "nodes": { - "flake-utils": { - "inputs": { - "systems": "systems" - }, - "locked": { - "lastModified": 1731533236, - "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, "nixpkgs": { "locked": { "lastModified": 1785454630, @@ -36,24 +18,8 @@ }, "root": { "inputs": { - "flake-utils": "flake-utils", "nixpkgs": "nixpkgs" } - }, - "systems": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } } }, "root": "root", 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