Compare commits
11 commits
moduon/pur
...
main
Author | SHA1 | Date | |
---|---|---|---|
jade | fe7f6ec62b | ||
Charles Hall | e44e6cf654 | ||
Charles Hall | 8c1dda128e | ||
Charles Hall | 6327d063de | ||
Charles Hall | 1fadfb6600 | ||
jade | 33a2aba01c | ||
Charles Hall | 127c86e1d4 | ||
jade | 5adafc5bfb | ||
jade | 87e36b9f18 | ||
jade | 1be18e491b | ||
Rebecca Turner | baa7aa7bd0 |
18
.github/workflows/flakehub-publish.yml
vendored
18
.github/workflows/flakehub-publish.yml
vendored
|
@ -1,18 +0,0 @@
|
||||||
name: "Publish to FlakeHub"
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
tags:
|
|
||||||
- "v*.*.*"
|
|
||||||
jobs:
|
|
||||||
flakehub-publish:
|
|
||||||
runs-on: "ubuntu-latest"
|
|
||||||
permissions:
|
|
||||||
id-token: "write"
|
|
||||||
contents: "read"
|
|
||||||
steps:
|
|
||||||
- uses: "actions/checkout@v3"
|
|
||||||
- uses: "DeterminateSystems/nix-installer-action@main"
|
|
||||||
- uses: "DeterminateSystems/flakehub-push@main"
|
|
||||||
with:
|
|
||||||
name: "edolstra/flake-compat"
|
|
||||||
visibility: "public"
|
|
17
README.md
17
README.md
|
@ -5,7 +5,11 @@
|
||||||
To use, add the following to your `flake.nix`:
|
To use, add the following to your `flake.nix`:
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
inputs.flake-compat.url = "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz";
|
inputs.flake-compat = {
|
||||||
|
url = "git+https://git.lix.systems/lix-project/flake-compat";
|
||||||
|
# Optional:
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
```
|
```
|
||||||
|
|
||||||
Afterwards, create a `default.nix` file containing the following:
|
Afterwards, create a `default.nix` file containing the following:
|
||||||
|
@ -13,10 +17,13 @@ Afterwards, create a `default.nix` file containing the following:
|
||||||
```nix
|
```nix
|
||||||
(import
|
(import
|
||||||
(
|
(
|
||||||
let lock = builtins.fromJSON (builtins.readFile ./flake.lock); in
|
let
|
||||||
fetchTarball {
|
lock = builtins.fromJSON (builtins.readFile ./flake.lock);
|
||||||
url = lock.nodes.flake-compat.locked.url or "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
|
inherit (lock.nodes.flake-compat.locked) narHash rev url;
|
||||||
sha256 = lock.nodes.flake-compat.locked.narHash;
|
in
|
||||||
|
builtins.fetchTarball {
|
||||||
|
url = "${url}/archive/${rev}.tar.gz";
|
||||||
|
sha256 = narHash;
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
{ src = ./.; }
|
{ src = ./.; }
|
||||||
|
|
|
@ -73,7 +73,7 @@ let
|
||||||
shortRev = builtins.substring 0 7 info.rev;
|
shortRev = builtins.substring 0 7 info.rev;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
# FIXME: add Mercurial, tarball inputs.
|
# FIXME: add Mercurial inputs.
|
||||||
throw "flake input has unsupported input type '${info.type}'";
|
throw "flake input has unsupported input type '${info.type}'";
|
||||||
|
|
||||||
callFlake4 = flakeSrc: locks:
|
callFlake4 = flakeSrc: locks:
|
||||||
|
@ -109,7 +109,9 @@ let
|
||||||
# Massage `src` into a store path.
|
# Massage `src` into a store path.
|
||||||
if builtins.isPath src
|
if builtins.isPath src
|
||||||
then
|
then
|
||||||
if builtins ? currentSystem && dirOf (toString src) == builtins.storeDir
|
if dirOf (toString src) == builtins.storeDir
|
||||||
|
# `builtins.storePath` is not available in pure-eval mode.
|
||||||
|
&& builtins ? currentSystem
|
||||||
then
|
then
|
||||||
# If it's already a store path, don't copy it again.
|
# If it's already a store path, don't copy it again.
|
||||||
builtins.storePath src
|
builtins.storePath src
|
||||||
|
@ -226,6 +228,8 @@ let
|
||||||
|
|
||||||
in
|
in
|
||||||
rec {
|
rec {
|
||||||
|
inputs = result.inputs // { self = result; };
|
||||||
|
|
||||||
defaultNix =
|
defaultNix =
|
||||||
(builtins.removeAttrs result ["__functor"])
|
(builtins.removeAttrs result ["__functor"])
|
||||||
// (if result ? defaultPackage.${system} then { default = result.defaultPackage.${system}; } else {})
|
// (if result ? defaultPackage.${system} then { default = result.defaultPackage.${system}; } else {})
|
||||||
|
|
Loading…
Reference in a new issue