Compare commits

...

2 Commits

Author SHA1 Message Date
3888606d8c Host the static files required by the blog on a subdomain.
Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
2023-11-30 05:51:20 +00:00
28aad07d18 Add a swapfile. We run out of memory way too often.
Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
2023-11-30 05:46:47 +00:00
4 changed files with 161 additions and 5 deletions

View File

@ -1,4 +1,4 @@
{ pkgs, system, blog, ... }: { pkgs, system, blog, web-files, ... }:
let let
productionSite = blog.english { productionSite = blog.english {
ssl = true; ssl = true;
@ -8,7 +8,14 @@ let
drafts = true; drafts = true;
host = "drafts.danilafe.com"; host = "drafts.danilafe.com";
}; };
allVirtualHosts = map blog.virtualHostFor [productionSite draftSite]; webFiles = {
"static.danilafe.com" = {
root = web-files;
forceSSL = true;
enableACME = true;
};
};
allVirtualHosts = [webFiles] ++ map blog.virtualHostFor [productionSite draftSite];
in in
{ {
imports = [ imports = [

View File

@ -1,5 +1,25 @@
{ {
"nodes": { "nodes": {
"bergamot-elm": {
"inputs": {
"flake-utils": "flake-utils_5",
"nixpkgs": "nixpkgs_6"
},
"locked": {
"lastModified": 1701318122,
"narHash": "sha256-wOik1hcZ6xwTUQZmDo8cPB7tE0VoyQM99zUTjqB4xUI=",
"ref": "main",
"rev": "524796d74fbec2828bf3f8f3b7abd4c843d529b3",
"revCount": 33,
"type": "git",
"url": "https://dev.danilafe.com/Everything-I-Know-About-Types/bergamot-elm.git"
},
"original": {
"ref": "main",
"type": "git",
"url": "https://dev.danilafe.com/Everything-I-Know-About-Types/bergamot-elm.git"
}
},
"blog": { "blog": {
"inputs": { "inputs": {
"blog-source": "blog-source", "blog-source": "blog-source",
@ -100,6 +120,42 @@
"type": "github" "type": "github"
} }
}, },
"flake-utils_5": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1694529238,
"narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "ff7b65b44d01cf9ba6a71320833626af21126384",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_6": {
"inputs": {
"systems": "systems_2"
},
"locked": {
"lastModified": 1694529238,
"narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "ff7b65b44d01cf9ba6a71320833626af21126384",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"katex-html": { "katex-html": {
"inputs": { "inputs": {
"flake-utils": "flake-utils_2", "flake-utils": "flake-utils_2",
@ -216,6 +272,37 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs_6": {
"locked": {
"lastModified": 1701068326,
"narHash": "sha256-vmMceA+q6hG1yrjb+MP8T0YFDQIrW3bl45e7z24IEts=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "8cfef6986adfb599ba379ae53c9f5631ecd2fd9c",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_7": {
"locked": {
"lastModified": 1701319520,
"narHash": "sha256-xVghb4ELbEtJUdEmB4PR+sq/aoNP0VEcM6GczDh+Zss=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "db77de49336382a33b9490a88ba3fe483e2b605f",
"type": "github"
},
"original": {
"owner": "nixos",
"repo": "nixpkgs",
"type": "github"
}
},
"resume": { "resume": {
"inputs": { "inputs": {
"flake-utils": "flake-utils_4", "flake-utils": "flake-utils_4",
@ -238,7 +325,58 @@
"root": { "root": {
"inputs": { "inputs": {
"blog": "blog", "blog": "blog",
"nixpkgs": "nixpkgs_5" "nixpkgs": "nixpkgs_5",
"web-files": "web-files"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"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"
}
},
"web-files": {
"inputs": {
"bergamot-elm": "bergamot-elm",
"flake-utils": "flake-utils_6",
"nixpkgs": "nixpkgs_7"
},
"locked": {
"lastModified": 1701320080,
"narHash": "sha256-R5ydINHKWun80dTD7LGeI5IQvFXNkBpV242k4ZEXq/U=",
"ref": "master",
"rev": "aae85e76286a8e70eb2ecc295bc819043ff9eb23",
"revCount": 2,
"type": "git",
"url": "https://dev.danilafe.com/Nix-Configs/web-files.git"
},
"original": {
"type": "git",
"url": "https://dev.danilafe.com/Nix-Configs/web-files.git"
} }
} }
}, },

View File

@ -2,15 +2,20 @@
inputs = { inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
blog.url = "git+https://dev.danilafe.com/Nix-Configs/blog-static-flake.git"; blog.url = "git+https://dev.danilafe.com/Nix-Configs/blog-static-flake.git";
web-files.url = "git+https://dev.danilafe.com/Nix-Configs/web-files.git";
}; };
outputs = { self, nixpkgs, blog }: outputs = { self, nixpkgs, blog, web-files }:
let let
system = "x86_64-linux"; system = "x86_64-linux";
in in
{ {
nixosConfigurations.nixos-droplet-v2 = nixpkgs.lib.nixosSystem { nixosConfigurations.nixos-droplet-v2 = nixpkgs.lib.nixosSystem {
inherit system; inherit system;
specialArgs = { inherit system; blog = blog.lib."${system}"; }; specialArgs = {
inherit system;
blog = blog.lib."${system}";
web-files = web-files.defaultPackage."${system}";
};
modules = [ ./configuration.nix ]; modules = [ ./configuration.nix ];
}; };
}; };

View File

@ -3,4 +3,10 @@
imports = [ "${modulesPath}/profiles/qemu-guest.nix" ]; imports = [ "${modulesPath}/profiles/qemu-guest.nix" ];
boot.loader.grub.device = "/dev/vda"; boot.loader.grub.device = "/dev/vda";
fileSystems."/" = { device = "/dev/vda1"; fsType = "ext4"; }; fileSystems."/" = { device = "/dev/vda1"; fsType = "ext4"; };
swapDevices = [
{
device = "/var/lib/swapfile";
size = 2*1024;
}
];
} }