-
-
Notifications
You must be signed in to change notification settings - Fork 101
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use flake-compat for shell.nix and default.nix compatibility.
- Loading branch information
1 parent
0cb304f
commit d017448
Showing
5 changed files
with
140 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -83,3 +83,6 @@ sile.1 | |
/.version-prev | ||
/.tarball-version | ||
/.built-subdirs | ||
|
||
# Nix symlink to builds | ||
/result |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# https://nixos.wiki/wiki/Flakes#Using_flakes_project_from_a_legacy_Nix | ||
(import ( | ||
let | ||
lock = builtins.fromJSON (builtins.readFile ./flake.lock); | ||
in fetchTarball { | ||
url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz"; | ||
sha256 = lock.nodes.flake-compat.locked.narHash; } | ||
) { | ||
src = ./.; | ||
}).defaultNix |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
{ | ||
description = "Simon’s Improved Layout Engine"; | ||
|
||
# To make user overrides of the nixpkgs flake not take effect | ||
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; | ||
inputs.flake-utils.url = "github:numtide/flake-utils"; | ||
|
||
# https://nixos.wiki/wiki/Flakes#Using_flakes_project_from_a_legacy_Nix | ||
inputs.flake-compat = { | ||
url = "github:edolstra/flake-compat"; | ||
flake = false; | ||
}; | ||
|
||
outputs = { self | ||
, nixpkgs | ||
, flake-utils | ||
, flake-compat | ||
}: | ||
flake-utils.lib.eachDefaultSystem (system: | ||
let | ||
pkgs = import nixpkgs { | ||
inherit system; | ||
}; | ||
# Use the expression from Nixpkgs instead of rewriting it here. | ||
sile = pkgs.sile.overrideAttrs(oldAttr: rec { | ||
version = "${(pkgs.lib.importJSON ./package.json).version}-flake"; | ||
src = builtins.filterSource | ||
(path: type: type != "directory" || baseNameOf path != ".git") | ||
./.; | ||
# Don't build the manual as it's time consuming, and it requires fonts | ||
# that are not available in the sandbox due to internet connection | ||
# missing in the sandbox. | ||
configureFlags = pkgs.lib.lists.remove "--with-manual" oldAttr.configureFlags; | ||
nativeBuildInputs = oldAttr.nativeBuildInputs ++ [ | ||
pkgs.autoreconfHook | ||
]; | ||
# This switch between the hooks can be moved to Nixpkgs' | ||
postPatch = oldAttr.preConfigure; | ||
preConfigure = ""; | ||
meta = oldAttr.meta // { | ||
changelog = "https://github.com/sile-typesetter/sile/raw/master/CHANGELOG.md"; | ||
}; | ||
}); | ||
in rec { | ||
devShell = pkgs.mkShell { | ||
inherit (sile) checkInputs nativeBuildInputs buildInputs; | ||
}; | ||
packages.sile = sile; | ||
defaultPackage = sile; | ||
apps.sile = { | ||
type = "app"; | ||
program = "${sile}/bin/sile"; | ||
}; | ||
defaultApp = apps.sile; | ||
} | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# https://nixos.wiki/wiki/Flakes#Using_flakes_project_from_a_legacy_Nix | ||
(import ( | ||
let | ||
lock = builtins.fromJSON (builtins.readFile ./flake.lock); | ||
in fetchTarball { | ||
url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz"; | ||
sha256 = lock.nodes.flake-compat.locked.narHash; } | ||
) { | ||
src = ./.; | ||
}).shellNix |