-
1
-
2
-
3
-
4
-
5
-
6
-
7
-
8
-
9
-
10
-
11
-
12
-
13
-
14
-
15
-
16
-
17
-
18
-
19
-
20
-
21
-
22
-
23
-
24
-
25
-
26
-
27
-
28
-
29
-
30
-
31
-
32
-
33
-
34
-
35
-
36
-
37
-
38
-
39
-
40
-
41
-
42
-
43
-
44
-
45
-
46
-
47
-
48
-
49
-
50
-
51
-
52
-
53
-
54
-
55
-
56
-
57
-
58
-
59
-
60
-
61
-
62
-
63
-
64
-
65
-
66
-
67
-
68
-
69
-
70
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
# For building an image for XVM
# https://lantian.pub/en/article/modify-computer/nixos-low-ram-vps.lantian/
# https://unnamed.website/posts/nixvm/
disko = {
url = "github:nix-community/disko/latest";
inputs.nixpkgs.follows = "nixpkgs";
};
# https://crystalwobsite.gay/posts/2025-02-09-deploying_nixos
# https://lantian.pub/en/article/modify-website/nixos-initial-config-flake-deploy.lantian/#batch-deployment-with-deploy-rs
deploy-rs = {
url = "github:serokell/deploy-rs";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
inputs@{ self, nixpkgs, ... }:
let
system = "x86_64-linux";
pkgs = import nixpkgs { inherit system; };
# Use the deploy-rs binaries from nixpkgs but lib from the flake
deployPkgs = import nixpkgs {
inherit system;
overlays = [
inputs.deploy-rs.overlays.default
(self: super: {
deploy-rs = {
inherit (pkgs) deploy-rs;
lib = super.deploy-rs.lib;
};
})
];
};
in
{
nixosConfigurations = {
# Very creative name, I know
ThinkPad-X1-Yoga-Gen-6 = nixpkgs.lib.nixosSystem {
modules = [
./configuration.nix
./ThinkPad-X1-Yoga-Gen-6
];
};
# I ran out of name ideas sorry
Unnamed-Server = nixpkgs.lib.nixosSystem {
modules = [
./configuration.nix
./Unnamed-Server
inputs.disko.nixosModules.disko
];
};
};
deploy.nodes.Unnamed-Server = {
hostname = "unnamed.website";
profiles.system = {
user = "root";
interactiveSudo = true;
path = deployPkgs.deploy-rs.lib.activate.nixos self.nixosConfigurations.Unnamed-Server;
# Download everything on the local system, then copy it over
# Otherwise my tiny tiny server sometimes runs out of RAM while downloading
fastConnection = true;
};
};
packages.${system}.image = self.nixosConfigurations.Unnamed-Server.config.system.build.diskoImages;
# I love autoformatters
formatter.${system} = pkgs.nixfmt-tree;
};
}