Skip to content

Commit

Permalink
add flake check, move modules into machines folder
Browse files Browse the repository at this point in the history
  • Loading branch information
cottand committed Aug 10, 2024
1 parent 73d9532 commit e267955
Show file tree
Hide file tree
Showing 13 changed files with 37 additions and 9 deletions.
17 changes: 16 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build Images
name: Main

permissions:
contents: read
Expand All @@ -18,6 +18,21 @@ env:
REGISTRY_IMAGE: "ghcr.io/cottand/selfhosted"

jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: cachix/install-nix-action@v22
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}

- uses: DeterminateSystems/magic-nix-cache-action@main

- name: Flake check
run: |
nix check .
build-images:
runs-on: ubuntu-latest
steps:
Expand Down
2 changes: 1 addition & 1 deletion hive.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ in
imports = [
./machines/${name}/definition.nix
./machines/_default
./modules
./machines/modules
home-manager.nixosModules.home-manager
cottand.nixosModules.seaweedBinaryCache
cottand.nixosModules.dcottaRootCa
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 10 additions & 0 deletions scripts/all-images/default.nix
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# For every image to be built in CI,
# this produces a JSON-formatted file like:
#
# {
# <name1>: <image_targz_1>,
# <name2>: <image_targz_2>,
# ...etc
# }
#
# You can build and cat this file to build all images.
{ self, writeText, system, ... }:
let
services = self.legacyPackages.${system}.services;
Expand Down
12 changes: 5 additions & 7 deletions scripts/default.nix
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
{ self, callPackage, nomad, jq, nix, bws, writeShellScriptBin, writeScriptBin, yaegi, ... }: rec {

# buildAllImages = callPackage (import ./buildAllImages) {};

buildYaegiScript = name: filePath: writeScriptBin name ''
#! ${yaegi}/bin/yaegi
${builtins.readFile filePath}
'';
# buildYaegiScript = name: filePath: writeScriptBin name ''
# #! ${yaegi}/bin/yaegi
# ${builtins.readFile filePath}
# '';

# templates a nomad nix file into JSON and calls nomad run on it
# usage: nixmad path/to/job.nix
Expand All @@ -30,5 +28,5 @@
${jq}/bin/jq -n --arg value "$SECRET" '{ "value": $value }'
'';

all-images = callPackage (import ./all-images) { inherit self; };
all-images = callPackage ./all-images { inherit self; };
}
5 changes: 5 additions & 0 deletions services/default.nix
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Collection of services used in this repo.
#
# The source code does not need to live here, but every attribute of this set must return
# the built binary and that itself has to have an extra `.image` attribute, which is
# the OCI image to be built and run.
{ callPackage, writeText, ... }: {
s-portfolio-stats = callPackage (import ./s-portfolio-stats) { };
}

0 comments on commit e267955

Please sign in to comment.