aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFuwn <[email protected]>2024-09-13 06:05:03 -0700
committerFuwn <[email protected]>2024-09-13 06:09:51 -0700
commit11c3e7825e6785fb8f085b8c0d59c0bd8796a604 (patch)
tree27ba36e738361778f5722d44f245cc3117b65e9a
parentf6f43b6911b903a47403db44dcc0a22e07840499 (diff)
downloadpywal.nix-11c3e7825e6785fb8f085b8c0d59c0bd8796a604.tar.xz
pywal.nix-11c3e7825e6785fb8f085b8c0d59c0bd8796a604.zip
feat(nix): implement standalone mode
-rw-r--r--README.md42
-rw-r--r--default.nix12
-rw-r--r--flake.lock15
-rw-r--r--flake.nix1
4 files changed, 59 insertions, 11 deletions
diff --git a/README.md b/README.md
index 874e5e0..96d2fc6 100644
--- a/README.md
+++ b/README.md
@@ -8,25 +8,43 @@ Pywal colour schemes into any Home Manager configuration at evaluation-time.
I needed a pure (not `--impure`) Nix solution. I made a pure Nix solution. It
works well.
-## Usage
+## Installation
-### Flake
+### Standalone Home-Manager
+
+```nix
+{ pkgs, ... }:
+{
+ imports = [
+ (import (
+ pkgs.fetchFromGitHub {
+ owner = "Fuwn";
+ repo = "pywal-nix";
+ rev = "..."; # Use the current commit revision hash
+ hash = "..."; # Use the current commit sha256 hash
+ }
+ )).${builtins.currentSystem}.homeManagerModules.default
+ ];
+}
+```
+
+> You can use projects like [nurl](https://github.com/nix-community/nurl) and
+> [`nix-prefetch`](https://github.com/msteen/nix-prefetch) to simplify the
+> usage of `fetchFromGitHub`.
+
+### Flakes & Home-Manager
Add `pywal-nix` to your flake inputs.
```nix
{
- inputs = {
- pywal-nix = {
- url = "github:Fuwn/pywal-nix";
- inputs.nixpkgs.follows = "nixpkgs"; # Recommended
- };
+ inputs.pywal-nix = {
+ url = "github:Fuwn/pywal-nix";
+ inputs.nixpkgs.follows = "nixpkgs"; # Recommended
};
}
```
-### Home Manager
-
After adding `pywal-nix` to your flake inputs, consume it as a Home Manager
module.
@@ -42,8 +60,10 @@ inputs.home-manager.lib.homeManagerConfiguration {
# ...
```
-Finally, configure and access `pywal-nix` in your Home Manager configuration through
-the `pywal-nix` attribute.
+## Configuration & Usage
+
+Configure and access `pywal-nix` in your Home Manager configuration through the
+`pywal-nix` attribute.
```nix
{ pkgs, config, ... }:
diff --git a/default.nix b/default.nix
new file mode 100644
index 0000000..277b463
--- /dev/null
+++ b/default.nix
@@ -0,0 +1,12 @@
+(import (
+ let
+ lock = builtins.fromJSON (builtins.readFile ./flake.lock);
+ in
+ fetchTarball {
+ url =
+ lock.nodes.flake-compat.locked.url
+ or "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
+
+ sha256 = lock.nodes.flake-compat.locked.narHash;
+ }
+) { src = ./.; }).defaultNix
diff --git a/flake.lock b/flake.lock
index ff9c043..2ab446b 100644
--- a/flake.lock
+++ b/flake.lock
@@ -1,5 +1,19 @@
{
"nodes": {
+ "flake-compat": {
+ "locked": {
+ "lastModified": 1696426674,
+ "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
+ "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
+ "revCount": 57,
+ "type": "tarball",
+ "url": "https://api.flakehub.com/f/pinned/edolstra/flake-compat/1.0.1/018afb31-abd1-7bff-a5e4-cff7e18efb7a/source.tar.gz"
+ },
+ "original": {
+ "type": "tarball",
+ "url": "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz"
+ }
+ },
"nixpkgs": {
"locked": {
"lastModified": 1726137256,
@@ -17,6 +31,7 @@
},
"root": {
"inputs": {
+ "flake-compat": "flake-compat",
"nixpkgs": "nixpkgs",
"systems": "systems"
}
diff --git a/flake.nix b/flake.nix
index b42e222..376ed22 100644
--- a/flake.nix
+++ b/flake.nix
@@ -2,6 +2,7 @@
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs";
systems.url = "github:nix-systems/default";
+ flake-compat.url = "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz";
};
outputs =