From 6577b9e49b28c4bb69b17e682230fdb6c03c4f60 Mon Sep 17 00:00:00 2001 From: Noah Masur <7386960+nmasur@users.noreply.github.com> Date: Sat, 18 Feb 2023 10:24:54 -0500 Subject: [PATCH] initial setup for swan and staff --- flake.nix | 9 ++++- {hosts => generators}/aws/default.nix | 0 {hosts => generators}/aws/main.tf | 0 {hosts => generators}/aws/workflow.yml | 0 generators/staff/default.nix | 17 +++++++++ hosts/swan/default.nix | 48 ++++++++++++++++++++++++++ 6 files changed, 73 insertions(+), 1 deletion(-) rename {hosts => generators}/aws/default.nix (100%) rename {hosts => generators}/aws/main.tf (100%) rename {hosts => generators}/aws/workflow.yml (100%) create mode 100644 generators/staff/default.nix create mode 100644 hosts/swan/default.nix diff --git a/flake.nix b/flake.nix index 4f0f859..32a5875 100644 --- a/flake.nix +++ b/flake.nix @@ -128,6 +128,7 @@ tempest = import ./hosts/tempest { inherit inputs globals overlays; }; hydra = import ./hosts/hydra { inherit inputs globals overlays; }; flame = import ./hosts/flame { inherit inputs globals overlays; }; + swan = import ./hosts/swan { inherit inputs globals overlays; }; }; darwinConfigurations = { @@ -149,7 +150,13 @@ aws = { "${system}" = - import ./hosts/aws { inherit inputs globals system overlays; }; + import ./generators/aws { inherit inputs globals system overlays; }; + }; + + staff = { + "${system}" = import ./generators/staff { + inherit inputs globals system overlays; + }; }; neovim = let pkgs = import nixpkgs { inherit system overlays; }; diff --git a/hosts/aws/default.nix b/generators/aws/default.nix similarity index 100% rename from hosts/aws/default.nix rename to generators/aws/default.nix diff --git a/hosts/aws/main.tf b/generators/aws/main.tf similarity index 100% rename from hosts/aws/main.tf rename to generators/aws/main.tf diff --git a/hosts/aws/workflow.yml b/generators/aws/workflow.yml similarity index 100% rename from hosts/aws/workflow.yml rename to generators/aws/workflow.yml diff --git a/generators/staff/default.nix b/generators/staff/default.nix new file mode 100644 index 0000000..01555f2 --- /dev/null +++ b/generators/staff/default.nix @@ -0,0 +1,17 @@ +# The Staff +# ISO configuration for my USB drive + +{ inputs, globals, overlays, ... }: + +with inputs; + +nixos-generators.nixosGenerate { + inherit system; + format = "install-iso"; + modules = [{ + networking.hostName = "staff"; + users.extraUsers.root.openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB+AbmjGEwITk5CK9y7+Rg27Fokgj9QEjgc9wST6MA3s" + ]; + }]; +} diff --git a/hosts/swan/default.nix b/hosts/swan/default.nix new file mode 100644 index 0000000..fee6e9e --- /dev/null +++ b/hosts/swan/default.nix @@ -0,0 +1,48 @@ +# The Swan +# System configuration for my home NAS server + +{ inputs, globals, overlays, ... }: + +with inputs; + +nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + specialArgs = { }; + modules = [ + ./hardware-configuration.nix + ../../modules + ../../nixos + (removeAttrs globals [ "mail.server" ]) + wsl.nixosModules.wsl + home-manager.nixosModules.home-manager + { + server = true; + gui.enable = false; + theme = { colors = (import ../../colorscheme/gruvbox).dark; }; + nixpkgs.overlays = overlays; + wsl.enable = false; + caddy.enable = true; + + networking.hostName = "swan"; + + # Disable passwords, only use SSH key + publicKey = + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB+AbmjGEwITk5CK9y7+Rg27Fokgj9QEjgc9wST6MA3s"; + + # Clone dotfiles + dotfiles.enable = true; + + neovim.enable = true; + + boot.zfs.enabled = true; + boot.kernelPackages = + config.boot.zfs.package.latestCompatibleLinuxPackages; + boot.zfs.extraPools = [ "mypool" ]; + services.zfs.autoScrub.enable = true; + services.zfs.autoScrub.interval = "daily"; + + services.nfs.server.enable = true; + + } + ]; +}