Add an example nixos config using this site
This commit is contained in:
parent
09a424d956
commit
f2f8efdc1d
4 changed files with 173 additions and 0 deletions
49
nixos-configuration/flake.nix
Normal file
49
nixos-configuration/flake.nix
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
{
|
||||
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
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue