summaryrefslogtreecommitdiffstats
path: root/flake.nix
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--flake.nix153
1 files changed, 33 insertions, 120 deletions
diff --git a/flake.nix b/flake.nix
index 57b49a1..7b53d40 100644
--- a/flake.nix
+++ b/flake.nix
@@ -3,146 +3,59 @@
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
- systems.url = "github:nix-systems/x86_64-linux";
- crane = {
- url = "github:ipetkov/crane";
- inputs = {
- nixpkgs.follows = "nixpkgs";
- };
- };
- rust-overlay = {
- url = "github:oxalica/rust-overlay";
- inputs = {
- nixpkgs.follows = "nixpkgs";
- };
- };
-
- # inputs for following
- flake-compat = {
- url = "github:edolstra/flake-compat";
- flake = false;
- };
- flake-utils = {
- url = "github:numtide/flake-utils";
- inputs = {
- systems.follows = "systems";
- };
- };
- lpm = {
- url = "git+https://codeberg.org/bpeetz/lpm.git";
- inputs = {
- systems.follows = "systems";
- rust-overlay.follows = "rust-overlay";
- nixpkgs.follows = "nixpkgs";
- crane.follows = "crane";
- flake-utils.follows = "flake-utils";
- flake-compat.follows = "flake-compat";
- };
- };
- flake_version_update = {
- url = "git+https://codeberg.org/soispha/flake_version_update.git";
- inputs = {
- systems.follows = "systems";
- nixpkgs.follows = "nixpkgs";
- flake-utils.follows = "flake-utils";
- };
- };
treefmt-nix = {
url = "github:numtide/treefmt-nix";
inputs = {
nixpkgs.follows = "nixpkgs";
};
};
-
- # data
- essay = {
- url = "git+https://codeberg.org/bpeetz/kant_and_free_software.git";
- inputs = {
- crane.follows = "crane";
- flake-compat.follows = "flake-compat";
- flake-utils.follows = "flake-utils";
- flake_version_update.follows = "flake_version_update";
- lpm.follows = "lpm";
- nixpkgs.follows = "nixpkgs";
- rust-overlay.follows = "rust-overlay";
- systems.follows = "systems";
- };
- };
- facharbeit = {
- url = "git+https://codeberg.org/bpeetz/facharbeit.git";
- inputs = {
- crane.follows = "crane";
- flake-compat.follows = "flake-compat";
- flake-utils.follows = "flake-utils";
- flake_version_update.follows = "flake_version_update";
- lpm.follows = "lpm";
- treefmt-nix.follows = "treefmt-nix";
- nixpkgs.follows = "nixpkgs";
- rust-overlay.follows = "rust-overlay";
- systems.follows = "systems";
- };
- };
};
outputs = {
self,
- essay,
- facharbeit,
- flake-utils,
nixpkgs,
treefmt-nix,
...
- }:
- flake-utils.lib.eachDefaultSystem (
- system: let
- pkgs = nixpkgs.legacyPackages.${system};
- treefmtEval = import ./treefmt.nix {inherit treefmt-nix pkgs;};
- build = pkgs.stdenv.mkDerivation {
- pname = "b-peetz.de";
- version = "v1.0";
- src = ./src;
+ }: let
+ system = "x86_64-linux";
+ pkgs = nixpkgs.legacyPackages.${system};
+ treefmtEval = import ./treefmt.nix {inherit treefmt-nix pkgs;};
- # Run local
- preferLocalBuild = true;
- allowSubstitutes = false;
+ build = pkgs.callPackage ./package.nix {};
+ check = pkgs.stdenv.mkDerivation {
+ # Add the source name, to force this to rerun (needed because it's a FOD).
+ name = "zola-check-${./src}";
+ src = ./src;
- nativeBuildInputs = [];
- buildPhase = ''
- install -D ${essay.outputs.packages."${system}".default}/philosophy/kant_and_free_software.pdf ./writings/philosophy/kant_and_free_software.pdf
- # NOTE: This link is for backward compatibility, as I have given out links with that url <2024-07-13>
- ln --symbolic --relative ./writings/philosophy/kant_and_free_software.pdf ./dead-trees/kant_and_free_software.pdf
- ln --symbolic --relative ./writings/philosophy/kant_and_free_software.pdf ./dead-trees/philosophy/kant_and_free_software.pdf
+ # Allow network access for link checking
+ outputHash = "sha256-d6xi4mKdjkX2JFicDIv5niSzpyI0m/Hnm8GGAIU04kY=";
+ outputHashMode = "recursive";
- install -D ${facharbeit.outputs.packages."${system}".default}/chemistry/facharbeit.pdf ./writings/chemistry/facharbeit.pdf
- # NOTE: This link is for backward compatibility, as I have given out links with that url <2024-07-13>
- ln --symbolic --relative ./writings/chemistry/facharbeit.pdf ./dead-trees/raman_spectrometer.pdf
- ln --symbolic --relative ./writings/chemistry/facharbeit.pdf ./dead-trees/chemistry/facharbeit.pdf
- '';
- installPhase = ''
- install -d $out/
- cp --recursive . $out/
- '';
- };
- in {
- packages = {
- default = build;
- };
+ # Run local
+ preferLocalBuild = true;
+ allowSubstitutes = false;
- checks = {
- inherit build;
- formatting = treefmtEval.config.build.check self;
- };
+ nativeBuildInputs = [pkgs.zola pkgs.findutils];
- formatter = treefmtEval.config.build.wrapper;
+ buildPhase = ''
+ zola check
+ '';
- devShells = {
- default = pkgs.mkShell {
- packages = [];
- };
- };
- }
- );
+ installPhase = "touch $out";
+ };
+ in {
+ packages."${system}" = {
+ default = build;
+ };
+
+ checks."${system}" = {
+ inherit build check;
+ formatting = treefmtEval.config.build.check self;
+ };
+
+ formatter."${system}" = treefmtEval.config.build.wrapper;
+ };
}
# vim: ts=2