diff --git a/README.md b/README.md new file mode 100644 index 0000000..7ab1b54 --- /dev/null +++ b/README.md @@ -0,0 +1,17 @@ +## NixOS System flakes + +This is currently in heavy development. The goal is to create a reusable structure for Freelock infrastructure, to make recreating a host or building a new one a breeze. + +## Creating a new host + +Start with a bare NixOS install, sort out the hardware-specific needs (partitioning scheme - /boot, swap, /nix partitions, etc). + +1. Clone this repository. +2. Create a directory under hosts for the host, based on the hostname. +3. Copy the hardware-configuration.nix into the new directory. +4. Copy a default.nix from a similar host into the new directory. +5. Edit to include the appropriate modules and any host-specific settings. +6. Add a stanza in the top-level flake.nix for the new host. +7. Commit changes and push to central repo. +8. Delete /etc/nixos and move this directory into place (for servers at least -- can symlink if user-managed). +9. `sudo nixos-rebuild switch`. diff --git a/desktop/default.nix b/desktop/default.nix new file mode 100644 index 0000000..e69de29 diff --git a/desktop/dev.nix b/desktop/dev.nix new file mode 100644 index 0000000..e69de29 diff --git a/desktop/office.nix b/desktop/office.nix new file mode 100644 index 0000000..e69de29 diff --git a/configuration.nix b/hosts/desktop/valhalla/configuration.nix similarity index 97% rename from configuration.nix rename to hosts/desktop/valhalla/configuration.nix index bd65688..fb10324 100644 --- a/configuration.nix +++ b/hosts/desktop/valhalla/configuration.nix @@ -71,6 +71,11 @@ # Enable CUPS to print documents. services.printing.enable = true; + services.salt.minion.enable = true; + services.salt.minion.configuration = { + master = "salt.freelock.lan"; + location = [ "freelock" ]; + }; # Enable sound with pipewire. sound.enable = true; hardware.pulseaudio.enable = false; @@ -203,10 +208,10 @@ device = "/home/docker"; options = [ "bind" ]; }; - + # Allow Xdebug to use port 9003. networking.firewall.allowedTCPPorts = [ 9000 9003 ]; - + # Make it possible for ddev to modify the /etc/hosts file. # Otherwise you'll have to manually change the # hosts configuration after creating a new ddev project. diff --git a/hardware-configuration.nix b/hosts/desktop/valhalla/hardware-configuration.nix similarity index 100% rename from hardware-configuration.nix rename to hosts/desktop/valhalla/hardware-configuration.nix diff --git a/server/default.nix b/server/default.nix new file mode 100644 index 0000000..e69de29 diff --git a/server/docker.nix b/server/docker.nix new file mode 100644 index 0000000..e69de29 diff --git a/server/mail.nix b/server/mail.nix new file mode 100644 index 0000000..e69de29 diff --git a/server/ns.nix b/server/ns.nix new file mode 100644 index 0000000..e69de29 diff --git a/server/salt-master.nix b/server/salt-master.nix new file mode 100644 index 0000000..e69de29