Skip to content

Commit

Permalink
adding gate + trying static hosting
Browse files Browse the repository at this point in the history
  • Loading branch information
orzklv committed Sep 19, 2024
1 parent 352f9e8 commit 463f1c5
Show file tree
Hide file tree
Showing 10 changed files with 113 additions and 67 deletions.
77 changes: 73 additions & 4 deletions flake.lock

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

42 changes: 25 additions & 17 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@

# Flake utils for eachSystem
flake-utils.url = "github:numtide/flake-utils";

# Main homepage website
gate.url = "github:kolyma-labs/gate";
};

# In this context, outputs are mostly about getting home-manager what it
Expand All @@ -35,29 +38,34 @@
, nixpkgs-unstable
, home-manager
, flake-utils
, gate
, ...
} @ inputs:
let
# Self instance pointer
outputs = self;

afes = flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
# Nixpkgs packages for the current system
{
# Your custom packages
# Acessible through 'nix build', 'nix shell', etc
packages = import ./pkgs { inherit pkgs; };

# Formatter for your nix files, available through 'nix fmt'
# Other options beside 'alejandra' include 'nixpkgs-fmt'
formatter = pkgs.nixpkgs-fmt;

# Development shells
devShells.default = import ./shell.nix { inherit pkgs; };
});
afes = flake-utils.lib.eachDefaultSystem
(system:
let
# Packages for the current <arch>
pkgs = nixpkgs.legacyPackages.${system};
in
# Nixpkgs packages for the current system
{
# Your custom packages
# Acessible through 'nix build', 'nix shell', etc
packages = import ./pkgs {
inherit pkgs;
};

# Formatter for your nix files, available through 'nix fmt'
# Other options beside 'alejandra' include 'nixpkgs-fmt'
formatter = pkgs.nixpkgs-fmt;

# Development shells
devShells.default = import ./shell.nix { inherit pkgs; };
});

afse = {
# Nixpkgs and Home-Manager helpful functions
Expand Down
1 change: 1 addition & 0 deletions modules/home/nixpkgs/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
outputs.overlays.additions
outputs.overlays.modifications
outputs.overlays.unstable-packages
outputs.overlays.personal-packages

# You can also add overlays exported from other flakes:
# neovim-nightly-overlay.overlays.default
Expand Down
1 change: 1 addition & 0 deletions modules/nixos/nixpkgs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
outputs.overlays.additions
outputs.overlays.modifications
outputs.overlays.unstable-packages
outputs.overlays.personal-packages

# You can also add overlays exported from other flakes:
# neovim-nightly-overlay.overlays.default
Expand Down
4 changes: 3 additions & 1 deletion modules/server/caddy/kolyma-1.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{ config
, lib
, pkgs
, inputs
, ...
}: {
config = {
Expand All @@ -19,7 +20,8 @@
"http://2a01:4f8:161:714c::"
];
extraConfig = ''
reverse_proxy 127.0.0.1:8440
root * ${pkgs.personal.gate}/www
file_server
'';
};

Expand Down
10 changes: 0 additions & 10 deletions modules/server/container/kolyma-1.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,6 @@
];

virtualisation.oci-containers.containers = {
# _ __ __ _ __
# | | / /__ / /_ _____(_) /____
# | | /| / / _ \/ __ \/ ___/ / __/ _ \
# | |/ |/ / __/ /_/ (__ ) / /_/ __/
# |__/|__/\___/_.___/____/_/\__/\___/
website = {
image = "ghcr.io/kolyma-labs/gate:3014ffb25d3e15351d5c70afe0ef2f00242cc14c294aaf0facc2741041de30fb";
ports = [ "8440:80" ];
};

# _______ __ ____
# / ____(_) /_ / __ \__ ______ ____ ___ _____
# / / __/ / __/ / /_/ / / / / __ \/ __ \/ _ \/ ___/
Expand Down
10 changes: 0 additions & 10 deletions modules/server/container/kolyma-2.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,6 @@
];

virtualisation.oci-containers.containers = {
# _ __ __ _ __
# | | / /__ / /_ _____(_) /____
# | | /| / / _ \/ __ \/ ___/ / __/ _ \
# | |/ |/ / __/ /_/ (__ ) / /_/ __/
# |__/|__/\___/_.___/____/_/\__/\___/
website = {
image = "ghcr.io/kolyma-labs/gate:3014ffb25d3e15351d5c70afe0ef2f00242cc14c294aaf0facc2741041de30fb";
ports = [ "8440:80" ];
};

# _______ __ __ __
# / ____(_) /_/ / ____ _/ /_
# / / __/ / __/ / / __ `/ __ \
Expand Down
10 changes: 0 additions & 10 deletions modules/server/container/kolyma-3.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,6 @@
];

virtualisation.oci-containers.containers = {
# _ __ __ _ __
# | | / /__ / /_ _____(_) /____
# | | /| / / _ \/ __ \/ ___/ / __/ _ \
# | |/ |/ / __/ /_/ (__ ) / /_/ __/
# |__/|__/\___/_.___/____/_/\__/\___/
website = {
image = "ghcr.io/kolyma-labs/gate@sha256:3014ffb25d3e15351d5c70afe0ef2f00242cc14c294aaf0facc2741041de30fb";
ports = [ "8440:80" ];
};

khakimovs = {
image = "ghcr.io/khakimovs/website@sha256:87827e103623f301dff0b55dfea34ee9a841c5a5718a065b777a1e2d730db494";
ports = [ "8441:3000" ];
Expand Down
18 changes: 3 additions & 15 deletions modules/server/container/kolyma-4.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,9 @@
outputs.nixosModules.docker
];

virtualisation.oci-containers.containers = {
# _ __ __ _ __
# | | / /__ / /_ _____(_) /____
# | | /| / / _ \/ __ \/ ___/ / __/ _ \
# | |/ |/ / __/ /_/ (__ ) / /_/ __/
# |__/|__/\___/_.___/____/_/\__/\___/
website = {
image = "ghcr.io/kolyma-labs/gate@sha256:3014ffb25d3e15351d5c70afe0ef2f00242cc14c294aaf0facc2741041de30fb";
ports = [ "8440:80" ];
};
};
virtualisation.oci-containers.containers = { };

# Necessary firewall rules for docker containers
# networking.firewall.allowedUDPPorts = [
# ];
# networking.firewall.allowedTCPPorts = [
# ];
networking.firewall.allowedUDPPorts = [ ];
networking.firewall.allowedTCPPorts = [ ];
}
7 changes: 7 additions & 0 deletions overlays/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@
# This one brings our custom packages from the 'pkgs' directory
additions = final: _prev: import ../pkgs { pkgs = final; };

# Make input added packages accesible via pkgs
personal-packages = final: _prev: rec {
personal = {
gate = inputs.gate.packages."${final.system}".default;
};
};

# This one contains whatever you want to overlay
# You can change versions, add patches, set compilation flags, anything really.
# https://nixos.wiki/wiki/Overlays
Expand Down

0 comments on commit 463f1c5

Please sign in to comment.