From 2369e5e9e473c38b0e4c62af44da86501d393085 Mon Sep 17 00:00:00 2001 From: polsevev Date: Thu, 15 May 2025 23:05:53 +0200 Subject: [PATCH] use flake for new server --- nixos/ares/flake.nix | 21 +++++++++++++++++++++ nixos/deploy.sh | 2 +- 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 nixos/ares/flake.nix diff --git a/nixos/ares/flake.nix b/nixos/ares/flake.nix new file mode 100644 index 0000000..3e605fb --- /dev/null +++ b/nixos/ares/flake.nix @@ -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 + ]; + }; + }; +} \ No newline at end of file diff --git a/nixos/deploy.sh b/nixos/deploy.sh index 777577a..75e6e82 100755 --- a/nixos/deploy.sh +++ b/nixos/deploy.sh @@ -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