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"
}
},
"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": {
"inputs": {
"nixpkgs": [
@@ -112,6 +129,7 @@
"inputs": {
"deploy-rs": "deploy-rs",
"disko": "disko",
"grasswren": "grasswren",
"home-manager": "home-manager",
"nixpkgs": "nixpkgs_2",
"sops-nix": "sops-nix"
+43 -44
View File
@@ -10,68 +10,67 @@
sops-nix.url = "github:Mic92/sops-nix";
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 = {
desktop = nixpkgs.lib.nixosSystem {
desktop = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = {
inherit inputs;
};
modules = [
specialArgs = { inherit inputs; };
modules = [
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";
specialArgs = {
inherit inputs;
};
modules = [
./hosts/vps/default.nix
];
};
};
specialArgs = { inherit inputs; };
modules = [
home-manager.nixosModules.home-manager
./hosts/vps/default.nix
];
};
};
homeConfigurations.lilac = home-manager.lib.homeManagerConfiguration {
pkgs = import nixpkgs {
system = "x86_64-linux";
};
modules = [
./home/lilac.nix
];
};
pkgs = import nixpkgs { system = "x86_64-linux"; };
modules = [
./home/lilac.nix
];
};
# nix run github:nix-community/nixos-anywhere -- --flake .#<CONFIGURATION> --phases install root@<ADDRESS>
# nix run github:serokell/deploy-rs
# nix run github:nix-community/nixos-anywhere -- --flake .#<CONFIGURATION> --phases install root@<ADDRESS>
# nix run github:serokell/deploy-rs
deploy.nodes = {
vps = {
vps = {
hostname = "10.0.0.3";
sshUser = "root";
magicRollbackTimeout = 120;
profiles.system = {
sshUser = "root";
magicRollbackTimeout = 120;
profiles.system = {
user = "root";
remoteBuild = false;
path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.vps;
};
};
remoteBuild = false;
path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.vps;
};
};
desktop = {
desktop = {
hostname = "10.0.0.2";
sshUser = "root";
magicRollbackTimeout = 120;
profiles.system = {
sshUser = "root";
magicRollbackTimeout = 120;
profiles.system = {
user = "root";
remoteBuild = false;
path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.desktop;
};
};
remoteBuild = false;
path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.desktop;
};
};
};
checks = {
x86_64-linux = deploy-rs.lib.x86_64-linux.deployChecks self.deploy;
+5
View File
@@ -4,5 +4,10 @@
home.username = "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 = {
EDITOR = "hx";
};
+12 -14
View File
@@ -3,25 +3,25 @@
{
imports = [
./hardware-configuration.nix
../../modules/network.nix
../../modules/ssh.nix
../../modules/wireguard.nix
../../modules/site.nix
../../modules/gitea.nix
];
boot.kernel.sysctl = {
"net.ipv4.ip_forward" = 1;
};
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.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";
@@ -55,9 +55,7 @@
pulse.enable = true;
};
programs.git.enable = true;
programs.zsh.enable = true;
nixpkgs.config.allowUnfree = true;
nix.settings.experimental-features = [ "nix-command" "flakes" ];
system.stateVersion = "26.05";
}
+3
View File
@@ -12,6 +12,9 @@
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ ];
boot.extraModulePackages = [ ];
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
boot.kernelPackages = pkgs.linuxPackages_latest;
fileSystems."/" =
{ device = "/dev/disk/by-uuid/d7450680-7d53-4842-83c5-7fc32526dff1";
+15 -18
View File
@@ -2,29 +2,26 @@
{
imports = [
./hardware-configuration.nix
../../modules/network.nix
../../modules/ssh.nix
../../modules/wireguard.nix
../../modules/http-forwarding.nix
./hardware-configuration.nix
../../modules/network.nix
../../modules/ssh.nix
../../modules/wireguard.nix
../../modules/http-forwarding.nix
];
network.node = "vps";
network.node = "vps";
networking.hostName = "vps";
networking.firewall.allowedTCPPorts = [ 80 443 ];
nix.settings.experimental-features = [
"nix-command"
"flakes"
];
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
environment.systemPackages = with pkgs; [
git
wireguard-tools
nftables
vim
];
users.root = import ../../home/root.nix;
};
programs.zsh.enable = true;
users.users.root.shell = pkgs.zsh;
nix.settings.experimental-features = [ "nix-command" "flakes" ];
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
'';
};
}