diff options
author | Xinglu Chen <public@yoctocell.xyz> | 2021-02-04 16:55:29 +0100 |
---|---|---|
committer | Xinglu Chen <public@yoctocell.xyz> | 2021-02-04 17:02:18 +0100 |
commit | f6fc471adb26c78ac2d606304f60d493aba99dc0 (patch) | |
tree | d763fbdc6dcfc58ea1459baf6de1540568f35a0b | |
parent | 85ed63ed6c8750a51e18085544774b729711a39a (diff) |
Make repository a nix flake
Make git-email.el a nix flake for an easier installation process for
Nix users. It currently exposes two packages:
- git-email-full -- This includes all the optional libraries
- git-email -- This only includes the core `git-email.el` library
They both get the source from directory from the git repository,
meaning they will get updates as soon as a commit is made.
* default.nix: Add file.
* flake.lock: Add file.
* flake.nix: Add file.
-rw-r--r-- | default.nix | 29 | ||||
-rw-r--r-- | flake.lock | 43 | ||||
-rw-r--r-- | flake.nix | 17 |
3 files changed, 89 insertions, 0 deletions
diff --git a/default.nix b/default.nix new file mode 100644 index 0000000..9fa551a --- /dev/null +++ b/default.nix @@ -0,0 +1,29 @@ +{ lib, nix-gitignore, emacsPackages }: +let + inherit (emacsPackages) trivialBuild; + flakeRoot = toString ../.; +in +lib.recurseIntoAttrs rec { + + git-email-full = trivialBuild rec { + pname = "git-email-full"; + version = "git"; + src = nix-gitignore.gitignoreSource (flakeRoot + ".gitignore") ./.; + packageRequires = with emacsPackages; [ + magit + transient + notmuch + ]; + }; + + git-email = trivialBuild rec { + pname = "git-email"; + version = "git"; + src = builtins.filterSource + (path: type: + baseNameOf path != "git-email-magit.el" && + baseNameOf path != "git-email-notmuch.el" && + baseNameOf path != "git-email-gnus.el" + ) ./.; + }; +} diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..52c007e --- /dev/null +++ b/flake.lock @@ -0,0 +1,43 @@ +{ + "nodes": { + "flake-utils": { + "locked": { + "lastModified": 1610051610, + "narHash": "sha256-U9rPz/usA1/Aohhk7Cmc2gBrEEKRzcW4nwPWMPwja4Y=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "3982c9903e93927c2164caa727cd3f6a0e6d14cc", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1612407036, + "narHash": "sha256-3wFGXSK9tQU/6dPfwjNUxygeZCbYxe0O0JXVyj1G2tk=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "04d5f1e3a87d413181af5d6dd68568228addf1c3", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..176f27e --- /dev/null +++ b/flake.nix @@ -0,0 +1,17 @@ +{ + description = "git-email.el flake"; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = { self, nixpkgs, flake-utils }: + flake-utils.lib.eachDefaultSystem (system: + let pkgs = nixpkgs.legacyPackages.${system}; + in + rec { + packages = pkgs.lib.recurseIntoAttrs (pkgs.callPackage ./. {}); + defaultPackage = packages.git-email-full; + }); +} |