Compare commits
1 commit
main
...
enobayram/
Author | SHA1 | Date | |
---|---|---|---|
6ef9397736 |
18
.github/workflows/flakehub-publish.yml
vendored
Normal file
18
.github/workflows/flakehub-publish.yml
vendored
Normal file
|
@ -0,0 +1,18 @@
|
|||
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,11 +5,7 @@
|
|||
To use, add the following to your `flake.nix`:
|
||||
|
||||
```nix
|
||||
inputs.flake-compat = {
|
||||
url = "git+https://git.lix.systems/lix-project/flake-compat";
|
||||
# Optional:
|
||||
flake = false;
|
||||
};
|
||||
inputs.flake-compat.url = "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz";
|
||||
```
|
||||
|
||||
Afterwards, create a `default.nix` file containing the following:
|
||||
|
@ -17,13 +13,10 @@ Afterwards, create a `default.nix` file containing the following:
|
|||
```nix
|
||||
(import
|
||||
(
|
||||
let
|
||||
lock = builtins.fromJSON (builtins.readFile ./flake.lock);
|
||||
inherit (lock.nodes.flake-compat.locked) narHash rev url;
|
||||
in
|
||||
builtins.fetchTarball {
|
||||
url = "${url}/archive/${rev}.tar.gz";
|
||||
sha256 = narHash;
|
||||
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 = ./.; }
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
# containing 'defaultNix' (to be used in 'default.nix'), 'shellNix'
|
||||
# (to be used in 'shell.nix').
|
||||
|
||||
{ src, system ? builtins.currentSystem or "unknown-system" }:
|
||||
{ src, fetchTarball ? builtins.fetchTarball, system ? builtins.currentSystem or "unknown-system" }:
|
||||
|
||||
let
|
||||
|
||||
|
@ -73,7 +73,7 @@ let
|
|||
shortRev = builtins.substring 0 7 info.rev;
|
||||
}
|
||||
else
|
||||
# FIXME: add Mercurial inputs.
|
||||
# FIXME: add Mercurial, tarball inputs.
|
||||
throw "flake input has unsupported input type '${info.type}'";
|
||||
|
||||
callFlake4 = flakeSrc: locks:
|
||||
|
@ -110,8 +110,6 @@ let
|
|||
if builtins.isPath src
|
||||
then
|
||||
if dirOf (toString src) == builtins.storeDir
|
||||
# `builtins.storePath` is not available in pure-eval mode.
|
||||
&& builtins ? currentSystem
|
||||
then
|
||||
# If it's already a store path, don't copy it again.
|
||||
builtins.storePath src
|
||||
|
@ -228,8 +226,6 @@ let
|
|||
|
||||
in
|
||||
rec {
|
||||
inputs = result.inputs // { self = result; };
|
||||
|
||||
defaultNix =
|
||||
(builtins.removeAttrs result ["__functor"])
|
||||
// (if result ? defaultPackage.${system} then { default = result.defaultPackage.${system}; } else {})
|
||||
|
|
Loading…
Reference in a new issue