Felix Springer's Homepage hosted on felixspringer.xyz.
You can use regular flake commands such as nix build
, nix develop
or nix flake check
.
The source code is split up into subflakes, which also have their own development environments and checks. These are just regular nix files, but follow the naming conventions of flakes.
- Setup: Nix overlays and configuration
- Server: HTTP server executable
- Blog: Blog articles and related content
- Files: Downloadable files
- Static: Static files directly visible from HTML
- Config: Runtime configuration with static files
- Final: Wrapper and NixOS module
GitHub Actions pushes Nix results to Cachix. Use this binary cache to speed up your local builds.
Configure your NixOS configuration to trust the binary cache.
{
nix.settings = {
substituters = [
"https://jumper149-homepage.cachix.org"
];
trusted-public-keys = [
"jumper149-homepage.cachix.org-1:6QyrYeIOaS9aVpUx0qcLHW2s0/Klv7LrvZBYHMSW4F4="
];
};
}
Use a NixOS system flake to enable the service.
{ ... }: {
inputs = {
nixpkgs = {
type = "github";
owner = "NixOS";
repo = "nixpkgs";
ref = "nixos-unstable";
};
homepage = {
type = "github";
owner = "jumper149";
repo = "homepage";
ref = "main";
};
};
outputs = { self, nixpkgs, homepage }@inputs: {
nixosConfigurations.default = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = { inherit inputs; };
modules = [
({ config, pkgs, lib, inputs, ... }: {
imports = [
inputs.homepage.nixosModules.default
];
services.homepage = {
enable = true;
config = {
port = 8008;
base-url = {
scheme = "https";
authority = {
host = "example.com";
port = null;
};
path = [];
};
};
};
services.nginx = {
enable = true;
virtualHosts."example.com" = {
onlySSL = true;
enableACME = true;
locations."/" = {
proxyPass = "http://127.0.0.1:${toString config.services.homepage.config.port}/";
};
};
};
})
# ...
];
};
};
}