2021-04-12 01:35:24 +01:00
|
|
|
{
|
|
|
|
description = "tlater.net host configuration";
|
|
|
|
|
|
|
|
inputs = {
|
|
|
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-20.09";
|
|
|
|
nixos-hardware.url = "github:nixos/nixos-hardware/master";
|
|
|
|
flake-utils.url = "github:numtide/flake-utils";
|
2021-04-12 01:44:10 +01:00
|
|
|
tlaternet-webserver = {
|
|
|
|
url = "git+https://gitea.tlater.net/tlaternet/tlaternet.git";
|
|
|
|
inputs = {
|
|
|
|
flake-utils.follows = "flake-utils";
|
|
|
|
nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
tlaternet-templates = {
|
|
|
|
url = "git+https://gitea.tlater.net/tlaternet/tlaternet-templates.git";
|
|
|
|
inputs = {
|
|
|
|
flake-utils.follows = "flake-utils";
|
|
|
|
nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
|
|
|
};
|
2021-04-12 01:35:24 +01:00
|
|
|
};
|
|
|
|
|
2021-04-12 01:44:10 +01:00
|
|
|
outputs = { nixpkgs, nixos-hardware, flake-utils, tlaternet-webserver
|
|
|
|
, tlaternet-templates, ... }@inputs:
|
|
|
|
let
|
|
|
|
overlays = [
|
|
|
|
(final: prev: {
|
|
|
|
tlaternet-webserver =
|
|
|
|
tlaternet-webserver.legacyPackages.${prev.system}.packages;
|
|
|
|
tlaternet-templates =
|
|
|
|
tlaternet-templates.legacyPackages.${prev.system}.packages;
|
2021-04-19 00:39:33 +01:00
|
|
|
local = import ./pkgs { pkgs = prev; };
|
2021-04-12 01:44:10 +01:00
|
|
|
})
|
|
|
|
];
|
|
|
|
|
|
|
|
in {
|
2021-04-12 01:35:24 +01:00
|
|
|
nixosConfigurations = {
|
|
|
|
tlaternet = nixpkgs.lib.nixosSystem {
|
|
|
|
system = "x86_64-linux";
|
|
|
|
|
|
|
|
modules = [
|
2021-04-18 02:58:49 +01:00
|
|
|
({ modulesPath, ... }: {
|
|
|
|
imports = [ (modulesPath + "/profiles/headless.nix") ];
|
|
|
|
nixpkgs.overlays = overlays;
|
|
|
|
})
|
2021-04-12 01:40:19 +01:00
|
|
|
(import ./modules)
|
|
|
|
|
2021-04-12 01:35:24 +01:00
|
|
|
(import ./configuration)
|
|
|
|
(import ./configuration/linode.nix)
|
|
|
|
(import ./configuration/hardware-configuration.nix)
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
vm = nixpkgs.lib.nixosSystem {
|
|
|
|
system = "x86_64-linux";
|
|
|
|
|
|
|
|
modules = [
|
2021-04-18 02:58:49 +01:00
|
|
|
({ modulesPath, ... }: {
|
|
|
|
imports = [ (modulesPath + "/profiles/headless.nix") ];
|
|
|
|
nixpkgs.overlays = overlays;
|
|
|
|
})
|
2021-04-12 01:40:19 +01:00
|
|
|
(import ./modules)
|
|
|
|
|
2021-04-12 01:35:24 +01:00
|
|
|
(import ./configuration)
|
|
|
|
({ ... }: {
|
|
|
|
users.users.tlater.password = "insecure";
|
2021-04-25 02:29:01 +01:00
|
|
|
|
|
|
|
# Disable graphical tty so -curses works
|
|
|
|
boot.kernelParams = [ "nomodeset" ];
|
|
|
|
|
|
|
|
# # Set up VM settings to match real VPS
|
2021-04-12 01:35:24 +01:00
|
|
|
# virtualisation.memorySize = 3941;
|
|
|
|
# virtualisation.cores = 2;
|
|
|
|
})
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
2021-04-22 22:32:54 +01:00
|
|
|
} // flake-utils.lib.eachDefaultSystem (system:
|
|
|
|
let pkgs = import nixpkgs { inherit system overlays; };
|
|
|
|
in {
|
|
|
|
devShell = with pkgs;
|
|
|
|
mkShell {
|
|
|
|
buildInputs = [ nixfmt git-lfs ];
|
|
|
|
shellHook = ''
|
|
|
|
export QEMU_OPTS="-m 3941 -smp 2 -curses"
|
|
|
|
export QEMU_NET_OPTS="hostfwd=::3022-:2222,hostfwd=::3080-:80,hostfwd=::3443-:443,hostfwd=::3021-:2221,hostfwd=::25565-:25565"
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
packages = import ./pkgs { inherit pkgs; };
|
|
|
|
});
|
2021-04-12 01:35:24 +01:00
|
|
|
}
|