create-a-static-blog-with-nix/nixos-configuration/flake.nix

49 lines
1.4 KiB
Nix

{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
our-site = {
url = "git+ssh://gitea@gitea.kalu.blue/tech-blog/create-a-static-blog-with-nix.git?ref=main&shallow=1";
inputs.nixpkgs.follows = "nixpkgs"; # Will use the same Nixpkgs as the NixOS system
};
};
outputs =
{ self, nixpkgs, ... }@inputs:
{
nixosConfigurations.my-server-name = nixpkgs.lib.nixosSystem {
specialArgs = {
# These will be passed as arguments to the modules
inherit inputs;
};
modules = [
# Essential for test VM
{
virtualisation.vmVariant = {
virtualisation = {
memorySize = 2048;
cores = 2;
# Disable graphics to avoid gtk error
graphics = false;
};
};
# Create a user, so we can login and test
users.users.test = {
isNormalUser = true;
# Never use this, use `hashedPassword` instead
initialPassword = nixpkgs.lib.mkForce "123123";
# So we can use `sudo` mainly for `sudo shutdown now` and to be able to debug `caddy`
group = "wheel";
};
}
# Some configuration
{
nixpkgs.hostPlatform = "x86_64-linux";
system.stateVersion = "25.11";
}
./my-static-site.nix
];
};
};
}