Skip to content

Commit

Permalink
Add README and create derivation in flake.nix
Browse files Browse the repository at this point in the history
Signed-off-by: Humaid Alqasimi <[email protected]>
  • Loading branch information
humaidq committed Jun 23, 2024
1 parent 0ee6f5a commit 737804d
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 11 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ feeds/
static/sfeed.html
*\~
resources/_gen
result
38 changes: 38 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# huma.id

<div align="center">
<h3 align="center">huma.id website</h3>
<p align="center">Source of my personal website</p>
</div>

## Description

The source of my personal website, which includes a list of my projects, a
blog, a recipes page, and more.

The website is generated using [Hugo].

## Prerequisites

- [Nix](https://zero-to-nix.com/start/install) (with flakes enabled)
- Optional: [nix-direnv]
- If not using nix-direnv, you need to run `nix develop` to load
dependencies in your shell.

## Building

To build without cloning:

```
nix build github:humaidq/huma.id
```

The output would be in `./result`.

## Usage

This package is imported by [dotfiles] repository.

[dotfiles]: https://github.com/humaidq/dotfiles
[Hugo]: https://gohugo.io
[nix-direnv]: https://github.com/nix-community/nix-direnv
2 changes: 1 addition & 1 deletion config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ preserveTaxonomyNames = true
pygmentsUseClasses = true
pygmentsCodeFences = true
disableHugoGeneratorInject = true
enableGitInfo = true
enableGitInfo = false
[Params]
name = "Humaid Alqasimi"
image = "avatar.webp"
Expand Down
40 changes: 30 additions & 10 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,34 @@
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
inputs.flake-utils.url = "github:numtide/flake-utils";

outputs = { nixpkgs, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
{
devShells.default = pkgs.mkShell {
packages = [ pkgs.hugo ];
};
});
outputs = {
nixpkgs,
flake-utils,
...
}:
flake-utils.lib.eachDefaultSystem (system: let
pkgs = nixpkgs.legacyPackages.${system};
in rec {
devShells.default = pkgs.mkShell {
packages = [pkgs.hugo];
};

packages.site = pkgs.stdenv.mkDerivation {
name = "humaid-site";
src = ./.;
buildInputs = [
pkgs.hugo
];

buildPhase = ''
${pkgs.hugo}/bin/hugo
'';

installPhase = ''
cp -r public $out
'';
};

defaultPackage = packages.site;
});
}

0 comments on commit 737804d

Please sign in to comment.