Skip to content

Commit

Permalink
nix: Build the 'docs' in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
alcarney committed Jan 20, 2024
1 parent 14358ca commit 1b9c548
Show file tree
Hide file tree
Showing 6 changed files with 118 additions and 3 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: 'Docs'
on:
push:
branches:
- main

jobs:
docs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main

- name: Nix Cache
uses: DeterminateSystems/magic-nix-cache-action@main

- name: Build Docs
run: |
nix build .
- name: 'Upload Artifact'
uses: actions/upload-artifact@v4
with:
name: 'out'
path: result/
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,4 @@ vim/plugged

zsh/antigen.zsh
*.sqlite
result
19 changes: 19 additions & 0 deletions docs/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
stdenv,
python3Packages,
}:

let awdur = python3Packages.awdur; in

stdenv.mkDerivation {
pname = "dotfiles-site";
version = "1.0";

src = ./.;

buildCommand = ''
mkdir $out
${awdur}/bin/awdur bind "$src/index.rst"
cp out.html $out
'';
}
4 changes: 4 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Dotfiles
========

Here lies the dotfiles.
55 changes: 55 additions & 0 deletions flake.lock

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

14 changes: 11 additions & 3 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,23 @@
inputs = {
nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-23.11";
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";

awdur = {
url = "github:swyddfa/awdur";
inputs.nixpkgs.follows = "nixpkgs";
};

home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
};

outputs = { nixpkgs-stable, nixpkgs, home-manager, ... }:
outputs = { awdur, nixpkgs-stable, nixpkgs, home-manager, ... }:
let
system = "x86_64-linux";
pkgs-stable = nixpkgs-stable.legacyPackages.${system};
pkgs = nixpkgs.legacyPackages.${system};
pkgs = import nixpkgs { inherit system; overlays = [awdur.overlays.default];};
in {
homeConfigurations."alex" = home-manager.lib.homeManagerConfiguration {
# Use the latest and greatest for the user env.
Expand All @@ -28,9 +34,11 @@
# to pass through arguments to home.nix
};

# Use stable branch for the base system.
packages."${system}".default = pkgs.callPackage ./docs {};

nixosConfigurations.alex-desktop = nixpkgs-stable.lib.nixosSystem {
inherit system;
# Use stable branch for the base system.
pkgs = pkgs-stable;
modules = [ ./systems/alex-desktop/configuration.nix ];
};
Expand Down

0 comments on commit 1b9c548

Please sign in to comment.