forked from adriankarlen/textfox
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add Nix support via home-manager module (adriankarlen#17)
* "Upload flake, hm module and package nix files" * Add flake.lock * Update options property * Install sidebery when module is enabled * Update README to include Nix info
- Loading branch information
Showing
5 changed files
with
198 additions
and
0 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
description = "A flake that exposes a home-manager module for textfox"; | ||
|
||
inputs = { | ||
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; | ||
nur.url = github:nix-community/NUR; | ||
}; | ||
|
||
outputs = { self, nixpkgs, nur } @ inputs: let | ||
forAllSystems = nixpkgs.lib.genAttrs ["x86_64-linux" "aarch64-linux" "x86_64-darwin"]; | ||
pkgsForEach = nixpkgs.legacyPackages; | ||
in { | ||
packages = forAllSystems (system: { | ||
default = pkgsForEach.${system}.callPackage ./nix/default.nix {}; | ||
}); | ||
|
||
homeManagerModules.default = import ./nix/hm-module.nix inputs; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{stdenv, fetchFromGithub, ...}: | ||
|
||
stdenv.mkDerivation { | ||
pname = "textfox"; | ||
version = "git"; | ||
|
||
src = ../.; | ||
|
||
installPhase = '' | ||
mkdir -p $out/chrome | ||
cp -r chrome/* $out/chrome | ||
cp user.js $out/user.js | ||
''; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
inputs: {config, lib, pkgs, ...}: | ||
let | ||
cfg = config.textfox; | ||
inherit (pkgs.stdenv.hostPlatform) system; | ||
package = inputs.self.packages.${system}.default; | ||
in { | ||
|
||
imports = [ | ||
inputs.nur.hmModules.nur | ||
]; | ||
|
||
options.textfox = { | ||
enable = lib.mkEnableOption "Enable textfox"; | ||
profile = lib.mkOption { | ||
type = lib.types.str; | ||
description = "The profile to apply the textfox configuration to"; | ||
}; | ||
}; | ||
|
||
config = lib.mkIf cfg.enable { | ||
programs.firefox = { | ||
enable = true; | ||
profiles."${cfg.profile}" = { | ||
extraConfig = builtins.readFile "${package}/user.js"; | ||
extensions = [ config.nur.repos.rycee.firefox-addons.sidebery ]; | ||
}; | ||
}; | ||
|
||
home.file.".mozilla/firefox/${cfg.profile}/chrome" = { | ||
source = "${package}/chrome"; | ||
recursive = true; | ||
}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters