diff --git a/.gitignore b/.gitignore index 6bf1823..d344ba6 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -starter/config.json +config.json diff --git a/starter/README.md b/README.md similarity index 100% rename from starter/README.md rename to README.md diff --git a/starter/configuration.nix b/configuration.nix similarity index 100% rename from starter/configuration.nix rename to configuration.nix diff --git a/starter/disko-config.nix b/disko-config.nix similarity index 100% rename from starter/disko-config.nix rename to disko-config.nix diff --git a/starter/env/baserow.env b/env/baserow.env similarity index 100% rename from starter/env/baserow.env rename to env/baserow.env diff --git a/starter/env/n8n.env b/env/n8n.env similarity index 100% rename from starter/env/n8n.env rename to env/n8n.env diff --git a/flake.lock b/flake.lock index 8c618e8..946432d 100644 --- a/flake.lock +++ b/flake.lock @@ -1,24 +1,85 @@ { "nodes": { + "base-config": { + "inputs": { + "nixpkgs": "nixpkgs", + "nixpkgs-unstable": "nixpkgs-unstable" + }, + "locked": { + "lastModified": 1741872348, + "narHash": "sha256-4d0S59c/rR5lcfqeqw3z+k4FlDwyci6dwrwMPgKuO/g=", + "ref": "stable", + "rev": "50af8d01fb5d5d5616bd1d5c38ced9946f863ca4", + "revCount": 6, + "type": "git", + "url": "https://code.m3tam3re.com/m3tam3re/self-host-playbook-base" + }, + "original": { + "ref": "stable", + "type": "git", + "url": "https://code.m3tam3re.com/m3tam3re/self-host-playbook-base" + } + }, + "disko": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1741786315, + "narHash": "sha256-VT65AE2syHVj6v/DGB496bqBnu1PXrrzwlw07/Zpllc=", + "owner": "nix-community", + "repo": "disko", + "rev": "0d8c6ad4a43906d14abd5c60e0ffe7b587b213de", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "disko", + "type": "github" + } + }, "nixpkgs": { "locked": { - "lastModified": 1741379970, - "narHash": "sha256-Wh7esNh7G24qYleLvgOSY/7HlDUzWaL/n4qzlBePpiw=", + "lastModified": 1741600792, + "narHash": "sha256-yfDy6chHcM7pXpMF4wycuuV+ILSTG486Z/vLx/Bdi6Y=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "36fd87baa9083f34f7f5027900b62ee6d09b1f2f", + "rev": "ebe2788eafd539477f83775ef93c3c7e244421d3", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixos-unstable", + "ref": "nixos-24.11", "repo": "nixpkgs", "type": "github" } }, + "nixpkgs-unstable": { + "locked": { + "lastModified": 1741708242, + "narHash": "sha256-cNRqdQD4sZpN7JLqxVOze4+WsWTmv2DGH0wNCOVwrWc=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "b62d2a95c72fb068aecd374a7262b37ed92df82b", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "b62d2a95c72fb068aecd374a7262b37ed92df82b", + "type": "github" + } + }, "root": { "inputs": { - "nixpkgs": "nixpkgs" + "base-config": "base-config", + "disko": "disko", + "nixpkgs": [ + "base-config", + "nixpkgs" + ] } } }, diff --git a/flake.nix b/flake.nix index 0b0ba0b..f114302 100644 --- a/flake.nix +++ b/flake.nix @@ -1,29 +1,40 @@ { - description = "Self Host Playbook!"; + description = "Self-hosted server setup with Portainer, n8n, and Baserow"; inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + base-config = { + # url = "path:/home/m3tam3re/p/nix/self-host-playbook-base"; + url = "git+https://code.m3tam3re.com/m3tam3re/self-host-playbook-base?ref=stable"; + }; + nixpkgs = { + url = "github:NixOS/nixpkgs/nixos-24.11"; + follows = "base-config/nixpkgs"; + }; + disko = { + url = "github:nix-community/disko"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; - outputs = {nixpkgs, ...}: let - systems = [ - "aarch64-linux" - "i686-linux" - "x86_64-linux" - "aarch64-darwin" - "x86_64-darwin" - ]; - forAllSystems = nixpkgs.lib.genAttrs systems; - in { - templates = { - starter = { - description = '' - Description here! - ''; - path = ./starter; + outputs = { + self, + base-config, + nixpkgs, + ... + } @ inputs: { + nixosConfigurations.nixos = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + (base-config.nixosModules.default { + tier = "starter"; + jsonConfig = builtins.fromJSON (builtins.readFile ./config.json); + }) # Pass tier here + inputs.disko.nixosModules.disko + ./configuration.nix + ]; + specialArgs = { + inherit self; }; }; - formatter = - forAllSystems (system: nixpkgs.legacyPackages.${system}.alejandra); }; } diff --git a/starter/install.sh b/install.sh similarity index 100% rename from starter/install.sh rename to install.sh diff --git a/starter/flake.lock b/starter/flake.lock deleted file mode 100644 index 946432d..0000000 --- a/starter/flake.lock +++ /dev/null @@ -1,88 +0,0 @@ -{ - "nodes": { - "base-config": { - "inputs": { - "nixpkgs": "nixpkgs", - "nixpkgs-unstable": "nixpkgs-unstable" - }, - "locked": { - "lastModified": 1741872348, - "narHash": "sha256-4d0S59c/rR5lcfqeqw3z+k4FlDwyci6dwrwMPgKuO/g=", - "ref": "stable", - "rev": "50af8d01fb5d5d5616bd1d5c38ced9946f863ca4", - "revCount": 6, - "type": "git", - "url": "https://code.m3tam3re.com/m3tam3re/self-host-playbook-base" - }, - "original": { - "ref": "stable", - "type": "git", - "url": "https://code.m3tam3re.com/m3tam3re/self-host-playbook-base" - } - }, - "disko": { - "inputs": { - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1741786315, - "narHash": "sha256-VT65AE2syHVj6v/DGB496bqBnu1PXrrzwlw07/Zpllc=", - "owner": "nix-community", - "repo": "disko", - "rev": "0d8c6ad4a43906d14abd5c60e0ffe7b587b213de", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "disko", - "type": "github" - } - }, - "nixpkgs": { - "locked": { - "lastModified": 1741600792, - "narHash": "sha256-yfDy6chHcM7pXpMF4wycuuV+ILSTG486Z/vLx/Bdi6Y=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "ebe2788eafd539477f83775ef93c3c7e244421d3", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-24.11", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs-unstable": { - "locked": { - "lastModified": 1741708242, - "narHash": "sha256-cNRqdQD4sZpN7JLqxVOze4+WsWTmv2DGH0wNCOVwrWc=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "b62d2a95c72fb068aecd374a7262b37ed92df82b", - "type": "github" - }, - "original": { - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "b62d2a95c72fb068aecd374a7262b37ed92df82b", - "type": "github" - } - }, - "root": { - "inputs": { - "base-config": "base-config", - "disko": "disko", - "nixpkgs": [ - "base-config", - "nixpkgs" - ] - } - } - }, - "root": "root", - "version": 7 -} diff --git a/starter/flake.nix b/starter/flake.nix deleted file mode 100644 index f114302..0000000 --- a/starter/flake.nix +++ /dev/null @@ -1,40 +0,0 @@ -{ - description = "Self-hosted server setup with Portainer, n8n, and Baserow"; - - inputs = { - base-config = { - # url = "path:/home/m3tam3re/p/nix/self-host-playbook-base"; - url = "git+https://code.m3tam3re.com/m3tam3re/self-host-playbook-base?ref=stable"; - }; - nixpkgs = { - url = "github:NixOS/nixpkgs/nixos-24.11"; - follows = "base-config/nixpkgs"; - }; - disko = { - url = "github:nix-community/disko"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - }; - - outputs = { - self, - base-config, - nixpkgs, - ... - } @ inputs: { - nixosConfigurations.nixos = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - modules = [ - (base-config.nixosModules.default { - tier = "starter"; - jsonConfig = builtins.fromJSON (builtins.readFile ./config.json); - }) # Pass tier here - inputs.disko.nixosModules.disko - ./configuration.nix - ]; - specialArgs = { - inherit self; - }; - }; - }; -} diff --git a/starter/version.json b/version.json similarity index 100% rename from starter/version.json rename to version.json