diff --git a/flake.lock b/flake.lock index b3459e3..eda44ca 100644 --- a/flake.lock +++ b/flake.lock @@ -18,6 +18,43 @@ "type": "github" } }, + "flake-utils_2": { + "inputs": { + "systems": "systems_2" + }, + "locked": { + "lastModified": 1726560853, + "narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "gate": { + "inputs": { + "flake-utils": "flake-utils_2", + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1726748661, + "narHash": "sha256-Xj5wL6nT0x9axWnzovgdnrxxdu8YNyXybuXV+58JS/w=", + "owner": "kolyma-labs", + "repo": "gate", + "rev": "580300ed93993032a3881c7461e6572b34f83b8d", + "type": "github" + }, + "original": { + "owner": "kolyma-labs", + "repo": "gate", + "type": "github" + } + }, "home-manager": { "inputs": { "nixpkgs": [ @@ -41,11 +78,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1726320982, - "narHash": "sha256-RuVXUwcYwaUeks6h3OLrEmg14z9aFXdWppTWPMTwdQw=", + "lastModified": 1726447378, + "narHash": "sha256-2yV8nmYE1p9lfmLHhOCbYwQC/W8WYfGQABoGzJOb1JQ=", "owner": "nixos", "repo": "nixpkgs", - "rev": "8f7492cce28977fbf8bd12c72af08b1f6c7c3e49", + "rev": "086b448a5d54fd117f4dc2dee55c9f0ff461bdc1", "type": "github" }, "original": { @@ -71,11 +108,28 @@ "type": "github" } }, + "nixpkgs_2": { + "locked": { + "lastModified": 1726320982, + "narHash": "sha256-RuVXUwcYwaUeks6h3OLrEmg14z9aFXdWppTWPMTwdQw=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "8f7492cce28977fbf8bd12c72af08b1f6c7c3e49", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-24.05", + "repo": "nixpkgs", + "type": "github" + } + }, "root": { "inputs": { "flake-utils": "flake-utils", + "gate": "gate", "home-manager": "home-manager", - "nixpkgs": "nixpkgs", + "nixpkgs": "nixpkgs_2", "nixpkgs-unstable": "nixpkgs-unstable" } }, @@ -93,6 +147,21 @@ "repo": "default", "type": "github" } + }, + "systems_2": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 5c62e94..26bf463 100644 --- a/flake.nix +++ b/flake.nix @@ -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 @@ -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 + 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 diff --git a/modules/home/nixpkgs/default.nix b/modules/home/nixpkgs/default.nix index d5ec21a..37b906e 100644 --- a/modules/home/nixpkgs/default.nix +++ b/modules/home/nixpkgs/default.nix @@ -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 diff --git a/modules/nixos/nixpkgs.nix b/modules/nixos/nixpkgs.nix index cc23ae4..5d3894f 100644 --- a/modules/nixos/nixpkgs.nix +++ b/modules/nixos/nixpkgs.nix @@ -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 diff --git a/modules/server/caddy/kolyma-1.nix b/modules/server/caddy/kolyma-1.nix index 03864bb..5fde009 100644 --- a/modules/server/caddy/kolyma-1.nix +++ b/modules/server/caddy/kolyma-1.nix @@ -1,6 +1,7 @@ { config , lib , pkgs +, inputs , ... }: { config = { @@ -19,7 +20,8 @@ "http://2a01:4f8:161:714c::" ]; extraConfig = '' - reverse_proxy 127.0.0.1:8440 + root * ${pkgs.personal.gate}/www + file_server ''; }; diff --git a/modules/server/container/kolyma-1.nix b/modules/server/container/kolyma-1.nix index 0ebc111..13549d3 100644 --- a/modules/server/container/kolyma-1.nix +++ b/modules/server/container/kolyma-1.nix @@ -9,16 +9,6 @@ ]; virtualisation.oci-containers.containers = { - # _ __ __ _ __ - # | | / /__ / /_ _____(_) /____ - # | | /| / / _ \/ __ \/ ___/ / __/ _ \ - # | |/ |/ / __/ /_/ (__ ) / /_/ __/ - # |__/|__/\___/_.___/____/_/\__/\___/ - website = { - image = "ghcr.io/kolyma-labs/gate:3014ffb25d3e15351d5c70afe0ef2f00242cc14c294aaf0facc2741041de30fb"; - ports = [ "8440:80" ]; - }; - # _______ __ ____ # / ____(_) /_ / __ \__ ______ ____ ___ _____ # / / __/ / __/ / /_/ / / / / __ \/ __ \/ _ \/ ___/ diff --git a/modules/server/container/kolyma-2.nix b/modules/server/container/kolyma-2.nix index bdfb5fe..789e1c9 100644 --- a/modules/server/container/kolyma-2.nix +++ b/modules/server/container/kolyma-2.nix @@ -9,16 +9,6 @@ ]; virtualisation.oci-containers.containers = { - # _ __ __ _ __ - # | | / /__ / /_ _____(_) /____ - # | | /| / / _ \/ __ \/ ___/ / __/ _ \ - # | |/ |/ / __/ /_/ (__ ) / /_/ __/ - # |__/|__/\___/_.___/____/_/\__/\___/ - website = { - image = "ghcr.io/kolyma-labs/gate:3014ffb25d3e15351d5c70afe0ef2f00242cc14c294aaf0facc2741041de30fb"; - ports = [ "8440:80" ]; - }; - # _______ __ __ __ # / ____(_) /_/ / ____ _/ /_ # / / __/ / __/ / / __ `/ __ \ diff --git a/modules/server/container/kolyma-3.nix b/modules/server/container/kolyma-3.nix index 887d186..f376469 100644 --- a/modules/server/container/kolyma-3.nix +++ b/modules/server/container/kolyma-3.nix @@ -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" ]; diff --git a/modules/server/container/kolyma-4.nix b/modules/server/container/kolyma-4.nix index f46726d..b635dbc 100644 --- a/modules/server/container/kolyma-4.nix +++ b/modules/server/container/kolyma-4.nix @@ -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 = [ ]; } diff --git a/overlays/default.nix b/overlays/default.nix index 2c21f95..8332799 100644 --- a/overlays/default.nix +++ b/overlays/default.nix @@ -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