summaryrefslogtreecommitdiff
path: root/server/flake.nix
diff options
context:
space:
mode:
Diffstat (limited to 'server/flake.nix')
-rw-r--r--server/flake.nix73
1 files changed, 73 insertions, 0 deletions
diff --git a/server/flake.nix b/server/flake.nix
new file mode 100644
index 0000000..47a9d09
--- /dev/null
+++ b/server/flake.nix
@@ -0,0 +1,73 @@
+{
+ description = "jakezerrer.com";
+
+ inputs = {
+ nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
+ disko = {
+ url = "github:nix-community/disko";
+ inputs.nixpkgs.follows = "nixpkgs";
+ };
+ treefmt-nix.url = "github:numtide/treefmt-nix";
+ nixos-facter-modules.url = "github:numtide/nixos-facter-modules";
+ sops-nix = {
+ url = "github:Mic92/sops-nix";
+ inputs.nixpkgs.follows = "nixpkgs";
+ };
+ };
+
+ outputs =
+ {
+ self,
+ nixpkgs,
+ disko,
+ nixos-facter-modules,
+ treefmt-nix,
+ sops-nix,
+ }:
+ {
+ devShells = {
+ aarch64-darwin.default =
+ let
+ pkgs = import nixpkgs { system = "aarch64-darwin"; };
+ treefmt = treefmt-nix.lib.evalModule pkgs {
+ projectRootFile = "flake.nix";
+ programs.nixfmt.enable = true;
+ };
+ in
+ pkgs.mkShell {
+ buildInputs = [
+ treefmt.config.build.wrapper
+ pkgs.nixos-rebuild-ng
+ pkgs.sops
+ pkgs.age
+ pkgs.ssh-to-age
+ ];
+ };
+ };
+ nixosConfigurations = {
+ bootstrap = nixpkgs.lib.nixosSystem {
+ system = "x86_64-linux";
+ modules = [
+ disko.nixosModules.disko
+ sops-nix.nixosModules.sops
+ ./disk-config.nix
+ ./bootstrap.nix
+ nixos-facter-modules.nixosModules.facter
+ { config.facter.reportPath = ./facter.json; }
+ ];
+ };
+
+ server = nixpkgs.lib.nixosSystem {
+ system = "x86_64-linux";
+ modules = [
+ disko.nixosModules.disko
+ sops-nix.nixosModules.sops
+ ./disk-config.nix
+ ./server.nix
+ nixos-facter-modules.nixosModules.facter
+ { config.facter.reportPath = ./facter.json; }
+ ];
+ };
+ };
+ };
+}