Skip to content

Commit

Permalink
Convert to Nix flakes (#20)
Browse files Browse the repository at this point in the history
https://nixos.wiki/wiki/Flakes

"Flakes" don't assume impure global nixpkgs, rather refer to them
directly via the combination of `inputs` in `flake.nix` and the
`flake.lock` file.

- `default.nix` renamed to `build.nix` with minimal changes
- the import of `tt-rss.nix` was moved into the flake 

github action changes:
- bump to v24
- no need for nix_path, since the flake refers to the exact `nixpkgs`
- added `flake check`
- flakes are automatically supported by the action, so no changes were
required
  • Loading branch information
gdamjan authored Dec 13, 2023
1 parent 3235385 commit 586e4e6
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 9 deletions.
10 changes: 4 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,12 @@ jobs:
ci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: cachix/install-nix-action@v22
with:
nix_path: nixpkgs=channel:nixos-23.05
- uses: cachix/install-nix-action@v24

# build without systemd support for now, since the closure becomes larger
- run: nix-build --arg withSystemd false
- run: nix build --no-update-lock-file
- run: nix flake check --no-update-lock-file

- name: Prepare artifacts
run: |
Expand Down
4 changes: 1 addition & 3 deletions default.nix → build.nix
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
{ pkgs ? import <nixpkgs> {}, withSystemd ? true }:
{ pkgs, ttRss, withSystemd ? true }:

let

ttRss = (import ./tt-rss.nix { inherit pkgs; });

php = (pkgs.php.override {
embedSupport = true;
cliSupport = true;
Expand Down
27 changes: 27 additions & 0 deletions flake.lock

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

13 changes: 13 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
description = ''Portable "Tiny Tiny Rss" service run by uwsgi-php and built with Nix'';

inputs.nixpkgs.url = github:NixOS/nixpkgs/nixos-23.11;

outputs = { self, nixpkgs, ... }:
let
pkgs = import nixpkgs { system = "x86_64-linux"; };
ttRss = (import ./tt-rss.nix { inherit pkgs; });
in {
packages.x86_64-linux.default = (import ./build.nix { inherit pkgs ttRss; withSystemd = false; });
};
}

0 comments on commit 586e4e6

Please sign in to comment.