use flake for new server

This commit is contained in:
Rolf Martin Glomsrud 2025-05-15 23:05:53 +02:00
parent f6c6312385
commit 2369e5e9e4
2 changed files with 22 additions and 1 deletions

21
nixos/ares/flake.nix Normal file
View file

@ -0,0 +1,21 @@
{
description = "A simple NixOS flake";
inputs = {
# NixOS official package source, using the nixos-24.11 branch here
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11";
};
outputs = { self, nixpkgs, ... }@inputs: {
# Please replace my-nixos with your hostname
nixosConfigurations.ares = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
# Import the previous configuration.nix we used,
# so the old configuration file still takes effect
./configuration.nix
./nginx.nix
];
};
};
}

View file

@ -1,5 +1,5 @@
#!/bin/bash
nixos-rebuild --impure --flake $(pwd)/$2#$2 --build-host ansible@$1 --target-host ansible@$1 --fast --use-remote-sudo switch
nixos-rebuild --impure --flake $(pwd)/$2#$2 --build-host $2@$1 --target-host $2@$1 --fast --use-remote-sudo switch