update how website is served

This commit is contained in:
2026-07-11 16:28:11 -04:00
parent 26af7b2dcd
commit e0ec38d87d
8 changed files with 133 additions and 76 deletions
Generated
+18
View File
@@ -55,6 +55,23 @@
"type": "github" "type": "github"
} }
}, },
"grasswren": {
"flake": false,
"locked": {
"lastModified": 1783801496,
"narHash": "sha256-awQZQVk5jz8ZyNCEnqarBZENKP7RvKHN8QRuDQJY7YA=",
"ref": "main",
"rev": "4d505fe6467e14b6e37b89e2e9e3a3b2bbf6649f",
"revCount": 4,
"type": "git",
"url": "https://code.grasswren.net/Lilac/Grasswren.git"
},
"original": {
"ref": "main",
"type": "git",
"url": "https://code.grasswren.net/Lilac/Grasswren.git"
}
},
"home-manager": { "home-manager": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@@ -112,6 +129,7 @@
"inputs": { "inputs": {
"deploy-rs": "deploy-rs", "deploy-rs": "deploy-rs",
"disko": "disko", "disko": "disko",
"grasswren": "grasswren",
"home-manager": "home-manager", "home-manager": "home-manager",
"nixpkgs": "nixpkgs_2", "nixpkgs": "nixpkgs_2",
"sops-nix": "sops-nix" "sops-nix": "sops-nix"
+43 -44
View File
@@ -10,68 +10,67 @@
sops-nix.url = "github:Mic92/sops-nix"; sops-nix.url = "github:Mic92/sops-nix";
sops-nix.inputs.nixpkgs.follows = "nixpkgs"; sops-nix.inputs.nixpkgs.follows = "nixpkgs";
grasswren.url = "git+https://code.grasswren.net/Lilac/Grasswren.git?ref=main";
grasswren.flake = false;
}; };
outputs = inputs@{ self, nixpkgs, deploy-rs, disko, home-manager, sops-nix, ... }: outputs = inputs@{ self, nixpkgs, deploy-rs, disko, home-manager, sops-nix, grasswren, ... }:
{ {
nixosConfigurations = { nixosConfigurations = {
desktop = nixpkgs.lib.nixosSystem { desktop = nixpkgs.lib.nixosSystem {
system = "x86_64-linux"; system = "x86_64-linux";
specialArgs = { specialArgs = { inherit inputs; };
inherit inputs; modules = [
};
modules = [
home-manager.nixosModules.home-manager home-manager.nixosModules.home-manager
sops-nix.nixosModules.sops sops-nix.nixosModules.sops
./hosts/desktop/default.nix ./hosts/desktop/default.nix
]; ];
}; };
vps = nixpkgs.lib.nixosSystem { vps = nixpkgs.lib.nixosSystem {
system = "x86_64-linux"; system = "x86_64-linux";
specialArgs = { specialArgs = { inherit inputs; };
inherit inputs; modules = [
}; home-manager.nixosModules.home-manager
modules = [
./hosts/vps/default.nix ./hosts/vps/default.nix
]; ];
}; };
}; };
homeConfigurations.lilac = home-manager.lib.homeManagerConfiguration { homeConfigurations.lilac = home-manager.lib.homeManagerConfiguration {
pkgs = import nixpkgs { pkgs = import nixpkgs { system = "x86_64-linux"; };
system = "x86_64-linux"; modules = [
}; ./home/lilac.nix
modules = [ ];
./home/lilac.nix };
];
};
# nix run github:nix-community/nixos-anywhere -- --flake .#<CONFIGURATION> --phases install root@<ADDRESS> # nix run github:nix-community/nixos-anywhere -- --flake .#<CONFIGURATION> --phases install root@<ADDRESS>
# nix run github:serokell/deploy-rs # nix run github:serokell/deploy-rs
deploy.nodes = { deploy.nodes = {
vps = { vps = {
hostname = "10.0.0.3"; hostname = "10.0.0.3";
sshUser = "root"; sshUser = "root";
magicRollbackTimeout = 120; magicRollbackTimeout = 120;
profiles.system = { profiles.system = {
user = "root"; user = "root";
remoteBuild = false; remoteBuild = false;
path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.vps; path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.vps;
}; };
}; };
desktop = { desktop = {
hostname = "10.0.0.2"; hostname = "10.0.0.2";
sshUser = "root"; sshUser = "root";
magicRollbackTimeout = 120; magicRollbackTimeout = 120;
profiles.system = { profiles.system = {
user = "root"; user = "root";
remoteBuild = false; remoteBuild = false;
path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.desktop; path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.desktop;
}; };
}; };
}; };
checks = { checks = {
x86_64-linux = deploy-rs.lib.x86_64-linux.deployChecks self.deploy; x86_64-linux = deploy-rs.lib.x86_64-linux.deployChecks self.deploy;
+5
View File
@@ -4,5 +4,10 @@
home.username = "root"; home.username = "root";
home.homeDirectory = "/root"; home.homeDirectory = "/root";
imports = [
./tools.nix
];
programs.home-manager.enable = true;
home.stateVersion = "26.05";
} }
+4
View File
@@ -28,6 +28,10 @@
}; };
}; };
programs.helix = {
enable = true;
};
home.sessionVariables = { home.sessionVariables = {
EDITOR = "hx"; EDITOR = "hx";
}; };
+12 -14
View File
@@ -3,25 +3,25 @@
{ {
imports = [ imports = [
./hardware-configuration.nix ./hardware-configuration.nix
../../modules/network.nix ../../modules/network.nix
../../modules/ssh.nix ../../modules/ssh.nix
../../modules/wireguard.nix ../../modules/wireguard.nix
../../modules/site.nix
../../modules/gitea.nix ../../modules/gitea.nix
]; ];
boot.kernel.sysctl = {
"net.ipv4.ip_forward" = 1;
};
network.node = "desktop"; network.node = "desktop";
nix.settings.experimental-features = [ "nix-command" "flakes" ];
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
boot.kernelPackages = pkgs.linuxPackages_latest;
networking.hostName = "desktop"; networking.hostName = "desktop";
networking.networkmanager.enable = true;
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
users.root = import ../../home/root.nix;
};
programs.zsh.enable = true;
users.users.root.shell = pkgs.zsh;
time.timeZone = "America/Toronto"; time.timeZone = "America/Toronto";
@@ -55,9 +55,7 @@
pulse.enable = true; pulse.enable = true;
}; };
programs.git.enable = true;
programs.zsh.enable = true;
nixpkgs.config.allowUnfree = true; nixpkgs.config.allowUnfree = true;
nix.settings.experimental-features = [ "nix-command" "flakes" ];
system.stateVersion = "26.05"; system.stateVersion = "26.05";
} }
+3
View File
@@ -12,6 +12,9 @@
boot.initrd.kernelModules = [ ]; boot.initrd.kernelModules = [ ];
boot.kernelModules = [ ]; boot.kernelModules = [ ];
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
boot.kernelPackages = pkgs.linuxPackages_latest;
fileSystems."/" = fileSystems."/" =
{ device = "/dev/disk/by-uuid/d7450680-7d53-4842-83c5-7fc32526dff1"; { device = "/dev/disk/by-uuid/d7450680-7d53-4842-83c5-7fc32526dff1";
+15 -18
View File
@@ -2,29 +2,26 @@
{ {
imports = [ imports = [
./hardware-configuration.nix ./hardware-configuration.nix
../../modules/network.nix
../../modules/ssh.nix ../../modules/network.nix
../../modules/wireguard.nix ../../modules/ssh.nix
../../modules/http-forwarding.nix ../../modules/wireguard.nix
../../modules/http-forwarding.nix
]; ];
network.node = "vps"; network.node = "vps";
networking.hostName = "vps"; networking.hostName = "vps";
networking.firewall.allowedTCPPorts = [ 80 443 ]; home-manager = {
nix.settings.experimental-features = [ useGlobalPkgs = true;
"nix-command" useUserPackages = true;
"flakes"
];
environment.systemPackages = with pkgs; [ users.root = import ../../home/root.nix;
git };
wireguard-tools programs.zsh.enable = true;
nftables users.users.root.shell = pkgs.zsh;
vim
];
nix.settings.experimental-features = [ "nix-command" "flakes" ];
system.stateVersion = "26.05"; system.stateVersion = "26.05";
} }
+33
View File
@@ -0,0 +1,33 @@
{ config, lib, pkgs, inputs, ... }:
let
website = pkgs.stdenv.mkDerivation {
name = "website";
src = inputs.grasswren;
nativeBuildInputs = [ pkgs.hugo ];
buildPhase = "hugo --minify";
installPhase = "cp -r public $out";
};
in
{
services.caddy = {
enable = true;
virtualHosts."grasswren.net".extraConfig = ''
encode
root * ${website}/home
file_server
'';
virtualHosts."blog.grasswren.net".extraConfig = ''
encode
root * ${website}/blog
file_server
'';
virtualHosts."birds.grasswren.net".extraConfig = ''
encode
root * ${website}/birds
file_server
'';
};
}