fix flake check errors + add gha
This commit is contained in:
parent
27b01771a0
commit
c29a87a53e
3 changed files with 48 additions and 18 deletions
18
.github/workflows/nixos.yml
vendored
18
.github/workflows/nixos.yml
vendored
|
@ -37,3 +37,21 @@ jobs:
|
||||||
- name: "Build NixOS config ❄️"
|
- name: "Build NixOS config ❄️"
|
||||||
run: |
|
run: |
|
||||||
nix run '.#' build
|
nix run '.#' build
|
||||||
|
check:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2.3.2
|
||||||
|
|
||||||
|
- name: "Install Nix ❄️"
|
||||||
|
uses: cachix/install-nix-action@v15
|
||||||
|
|
||||||
|
- name: "Install Cachix ❄️"
|
||||||
|
uses: cachix/cachix-action@v10
|
||||||
|
with:
|
||||||
|
name: 0x76-infra
|
||||||
|
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
|
||||||
|
|
||||||
|
- name: "Build NixOS config ❄️"
|
||||||
|
run: |
|
||||||
|
nix flake check
|
||||||
|
|
||||||
|
|
|
@ -64,7 +64,7 @@
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
# Make the nixosConfigurations, mostly for vault-secrets
|
# Make the nixosConfigurations, mostly for vault-secrets
|
||||||
nixosConfigurations = util.mkNixosConfigurations specialArgs hosts;
|
nixosConfigurations = util.mkNixosConfigurations specialArgs nixHosts;
|
||||||
|
|
||||||
# Make the coleman configuration
|
# Make the coleman configuration
|
||||||
colmena = lib.foldr (el: acc: acc // util.mkColmenaHost el)
|
colmena = lib.foldr (el: acc: acc // util.mkColmenaHost el)
|
||||||
|
|
18
util.nix
18
util.nix
|
@ -28,13 +28,25 @@ rec {
|
||||||
mkNixosSystem = specialArgs: { hostname, realm, system ? "x86_64-linux", ... }@host: {
|
mkNixosSystem = specialArgs: { hostname, realm, system ? "x86_64-linux", ... }@host: {
|
||||||
"${hostname}.${realm}" = lib.nixosSystem {
|
"${hostname}.${realm}" = lib.nixosSystem {
|
||||||
inherit system specialArgs;
|
inherit system specialArgs;
|
||||||
modules = resolve_imports host;
|
modules =
|
||||||
|
[
|
||||||
|
({ config, pkgs, ... }: {
|
||||||
|
nixpkgs.overlays = [ (import ./nixos/pkgs) ];
|
||||||
|
networking = {
|
||||||
|
hostName = hostname;
|
||||||
|
domain = realm;
|
||||||
|
};
|
||||||
|
})
|
||||||
|
] ++
|
||||||
|
(resolve_imports host);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
mkColmenaHost = { ip ? null, hostname, tags, realm, type ? "lxc", ... }@host: let
|
mkColmenaHost = { ip ? null, hostname, tags, realm, type ? "lxc", ... }@host:
|
||||||
|
let
|
||||||
name = if realm == "thalassa" then hostname else "${hostname}.${realm}";
|
name = if realm == "thalassa" then hostname else "${hostname}.${realm}";
|
||||||
in{
|
in
|
||||||
|
{
|
||||||
"${name}" = {
|
"${name}" = {
|
||||||
imports = resolve_imports host;
|
imports = resolve_imports host;
|
||||||
networking = {
|
networking = {
|
||||||
|
|
Loading…
Add table
Reference in a new issue