fix flake check errors + add gha

This commit is contained in:
Vivian 2022-09-10 19:44:16 +02:00
parent 5b8ac77646
commit c0ec0f9754
3 changed files with 48 additions and 18 deletions

View file

@ -37,3 +37,21 @@ jobs:
- name: "Build NixOS config ❄️"
run: |
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

View file

@ -36,7 +36,7 @@
inherit (nixpkgs) lib;
inherit (builtins) filter mapAttrs attrValues concatLists;
util = import ./util.nix inputs;
util = import ./util.nix inputs;
system = "x86_64-linux";
# import and add realm to list of tags
@ -64,7 +64,7 @@
in
{
# Make the nixosConfigurations, mostly for vault-secrets
nixosConfigurations = util.mkNixosConfigurations specialArgs hosts;
nixosConfigurations = util.mkNixosConfigurations specialArgs nixHosts;
# Make the coleman configuration
colmena = lib.foldr (el: acc: acc // util.mkColmenaHost el)

View file

@ -28,27 +28,39 @@ rec {
mkNixosSystem = specialArgs: { hostname, realm, system ? "x86_64-linux", ... }@host: {
"${hostname}.${realm}" = lib.nixosSystem {
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
name = if realm == "thalassa" then hostname else "${hostname}.${realm}";
in{
"${name}" = {
imports = resolve_imports host;
networking = {
hostName = hostname;
domain = realm;
};
deployment = {
inherit tags;
targetHost = ip;
allowLocalDeployment = (type == "local");
targetUser = null; # Defaults to $USER
mkColmenaHost = { ip ? null, hostname, tags, realm, type ? "lxc", ... }@host:
let
name = if realm == "thalassa" then hostname else "${hostname}.${realm}";
in
{
"${name}" = {
imports = resolve_imports host;
networking = {
hostName = hostname;
domain = realm;
};
deployment = {
inherit tags;
targetHost = ip;
allowLocalDeployment = (type == "local");
targetUser = null; # Defaults to $USER
};
};
};
};
mkNixosConfigurations = specialArgs: hosts: lib.foldr (el: acc: acc // mkNixosSystem specialArgs el) { } hosts;
}