Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Check

on:
push:
pull_request:

permissions:
contents: read

jobs:
check:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Check out source
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
with:
persist-credentials: false
- name: Install Nix
uses: cachix/install-nix-action@13d8dd58da0234aa297dedd986986ccb8e7f3e24
- name: Check package, tests, schema, formatting, and runtime
run: nix flake check --no-write-lock-file --print-build-logs
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/yae
.pre-commit-config.yaml
result
/yae.json
.DS_Store
21 changes: 9 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,8 @@ which functions similar to [niv](https://github.com/nmattia/niv/) and [`npins`](
mainline sources. This requires additional upgrade commands in the CLI and
more effort to maintain. A Yae environment is a single file and can be placed
anywhere and read just as simply.
2. Yae has a simple and coherent source tree. niv has a total of 10000 LOC
(lines of code), `npins` sits at almost 6000 LOC flat, and Yae stands at just
shy of 1500 LOC when looking at all files. Yae's core source code itself sits
at just 462 LOC, which is much, **much** smaller than that of niv and `npins`'
core trees. This is all to say that Yae implements everything needed to functionally
replace niv and `npins` in any workflow, and in much more efficient and concise
codebase.
2. Yae has a small, coherent source tree focused on fetching sources and
updating their versions and hashes.
3. Yae is simple by nature in design and usage philosophy.

niv and `npins` are great, but are far too ~~overkill~~ overengineered for me
Expand Down Expand Up @@ -62,16 +57,16 @@ yae add \
zen-browser-twilight-bin \
'https://github.com/zen-browser/desktop/releases/download/{version}/zen.linux-specific.tar.bz2'

# Adds a Yae dependency named `zen-browser-bin` pinned at tag `1.0.1-a.7`
# This command adds a Yae dependency named `zen-browser-bin` starting at tag `1.0.1-a.7`.
yae add \
--type git \
--version 1.0.1-a.7 \
--unpack \
zen-browser-bin \
'https://github.com/zen-browser/desktop/releases/download/{version}/zen.linux-specific.tar.bz2'

# Adds a Yae dependency named `yaak` pinned at tag `2024.10.1` with tag trimming
# for updates
# This command adds a Yae dependency named `yaak` starting at tag `2024.10.1` with tag
# trimming for updates.
yae add \
--type git \
--unpack=false \
Expand All @@ -89,6 +84,8 @@ yae update
yae update zen-browser-twilight-bin
```

Use `--pin` when adding a source to prevent version and content updates.

## Installation

You can either install Yae through the flake that this repository exposes or
Expand Down Expand Up @@ -201,8 +198,8 @@ COMMANDS:
GLOBAL OPTIONS:
--sources value Sources path (default: "./yae.json")
--debug Enable debug output (default: false)
--silent Silence log output (default: false)
--dry-run Prevents writing to disk (default: false)
--silent Only log errors (default: false)
--dry-run Preview changes without saving the sources file (downloads may still populate the Nix store) (default: false)
--help, -h show help

COPYRIGHT:
Expand Down
10 changes: 8 additions & 2 deletions examples/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# Examples

If Nixpkgs ever goes out of date in these examples, just run `yae update`!
Run `yae update` inside an example directory to refresh its Nixpkgs hash.
The source uses `type: binary` because the archive URL follows a moving branch;
Yae rehashes that URL instead of discovering release tags. Both examples share
one `yae.json` through a symbolic link.

A moving URL may no longer match the saved hash when downloaded on a fresh
machine. Run the update before evaluating the example in that case.

## [Nixpkgs](https://github.com/Fuwn/yae/tree/main/examples/nixpkgs)

Expand All @@ -11,7 +17,7 @@ Nixpkgs as a flake output.
Note that the flake has no inputs. This is because Yae directly manages the
Nixpkgs source.

This example is extremely useful and is intended be adapted to suite the specific
This example is extremely useful and is intended to be adapted to suit the specific
needs of flake-less Nix configurations, like classic Nix shells and flake-less system
configurations.

Expand Down
4 changes: 2 additions & 2 deletions examples/nixpkgs-simple/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
outputs =
{ self }:
let
nixpkgs = (builtins.fromJSON (builtins.readFile "${self}/yae.json")).nixpkgs;
inherit (builtins.fromJSON (builtins.readFile "${self}/yae.json")) nixpkgs;

pkgs =
import
Expand All @@ -13,6 +13,6 @@
};
in
{
packages.${pkgs.system}.hello = pkgs.hello;
packages.${pkgs.system} = { inherit (pkgs) hello; };
};
}
4 changes: 2 additions & 2 deletions examples/nixpkgs/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
outputs =
{ self }:
let
nixpkgs = (builtins.fromJSON (builtins.readFile "${self}/yae.json")).nixpkgs;
inherit (builtins.fromJSON (builtins.readFile "${self}/yae.json")) nixpkgs;

systemsFlakeExposed = [
"x86_64-linux"
Expand Down Expand Up @@ -40,7 +40,7 @@
};
in
{
hello = pkgs.hello;
inherit (pkgs) hello;
}
);
};
Expand Down
4 changes: 1 addition & 3 deletions examples/nixpkgs/yae.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
"sha256": "1wn29537l343lb0id0byk0699fj0k07m1n2d7jx2n0ssax55vhwy",
"hash": "sha256-nsNdSldaAyu6PE3YUA+YQLqUDJh+gRbBooMMekZJwvI=",
"unpack": true,
"type": "git",
"version": "nixos-unstable",
"url_template": "https://github.com/NixOS/nixpkgs/archive/{version}.tar.gz"
"type": "binary"
}
}
92 changes: 5 additions & 87 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading