diff --git a/flake.nix b/flake.nix index 8b91291..377e601 100644 --- a/flake.nix +++ b/flake.nix @@ -80,6 +80,7 @@ }; in { + nixosConfigurations."alyssum" = mkSystem nixpkgs "alyssum" "x86_64-linux" []; nixosConfigurations."anemone" = mkSystem nixpkgs "anemone" "x86_64-linux" []; nixosConfigurations."dandelion" = mkSystem nixpkgs "dandelion" "aarch64-linux" []; nixosConfigurations."hyacinth" = mkSystem nixpkgs "hyacinth" "x86_64-linux" []; diff --git a/hosts/alyssum/default.nix b/hosts/alyssum/default.nix new file mode 100644 index 0000000..5506e55 --- /dev/null +++ b/hosts/alyssum/default.nix @@ -0,0 +1,28 @@ +{ inputs, modules, modulesPath, ... }: { + networking.hostName = "alyssum"; + system.stateVersion = "25.11"; + time.timeZone = "Australia/Melbourne"; + + age.secrets = { + # acme_dns.file = ../../secrets/acme_dns.age; + }; + + imports = with modules.system; [ + (modulesPath + "/profiles/qemu-guest.nix") + home-manager + + base + kernel + nix-stable + packages + security + + ./filesystem.nix + ./kernel.nix + ./networking.nix + + ../../users/hana + ]; + + me.environment = "headless"; +} diff --git a/hosts/alyssum/filesystem.nix b/hosts/alyssum/filesystem.nix new file mode 100644 index 0000000..205106a --- /dev/null +++ b/hosts/alyssum/filesystem.nix @@ -0,0 +1,34 @@ +{ ... }: +let + bind = src: { + depends = [ "/nix" ]; + device = src; + fsType = "none"; + neededForBoot = true; + options = [ "bind" ]; + }; + + mkLabelMount = label: type: { + device = "/dev/disk/by-label/${label}"; + fsType = type; + options = [ "defaults" "relatime" ]; + }; + mkBtrfsMount = name: subvol: atime: mkLabelMount name "btrfs" // { + options = [ "autodefrag" "compress=zstd:3" "defaults" "discard=async" "space_cache=v2" "ssd" "subvol=${subvol}" (if atime then "relatime" else "noatime") ]; + }; + submount = mkBtrfsMount "alyssum"; +in { + fileSystems = { + "/" = { + device = "rootfs"; + fsType = "tmpfs"; + options = [ "defaults" "size=8G" "mode=755" ]; + }; + "/boot" = mkLabelMount "stem" "vfat"; + + "/nix" = submount "/@/nix" false; + "/persist" = (submount "/@/persist" true) // { neededForBoot = true; }; + "/persist/.snapshots" = submount "/snap/persist" false; + "/var/log/journal" = bind "/persist/journal"; + }; +} diff --git a/hosts/alyssum/kernel.nix b/hosts/alyssum/kernel.nix new file mode 100644 index 0000000..7ea7d43 --- /dev/null +++ b/hosts/alyssum/kernel.nix @@ -0,0 +1,10 @@ +{ ... }: { + boot = { + loader = { + efi.canTouchEfiVariables = true; + systemd-boot.enable = true; + }; + initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "xen_blkfront" ]; + initrd.kernelModules = [ "nvme" ]; + }; +} diff --git a/hosts/alyssum/networking.nix b/hosts/alyssum/networking.nix new file mode 100644 index 0000000..ee27faf --- /dev/null +++ b/hosts/alyssum/networking.nix @@ -0,0 +1,3 @@ +{ ... }: { + networking.useDHCP = true; +} diff --git a/hosts/alyssum/packages.nix b/hosts/alyssum/packages.nix new file mode 100644 index 0000000..2d4bd30 --- /dev/null +++ b/hosts/alyssum/packages.nix @@ -0,0 +1,14 @@ +{ pkgs, ... }: { + environment.systemPackages = with pkgs; [ + git + htop + jq + neovim + rsync + sshfs + wget + + kitty.terminfo + ]; + environment.variables.EDITOR = "nvim"; +}