From 3a59b99816402b44bcbc829030dd7f8146689f95 Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Fri, 21 Feb 2025 12:09:41 -0600 Subject: [PATCH] feat: installer takes a swap size --- packages/hosts/flipflop.nix | 5 ++++- packages/installer.nix | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/hosts/flipflop.nix b/packages/hosts/flipflop.nix index e702b1f..ed6eba9 100644 --- a/packages/hosts/flipflop.nix +++ b/packages/hosts/flipflop.nix @@ -85,7 +85,10 @@ }; imports = with hardware; [ - (diskoConfigurations.standardEncrypted { disk = "/dev/nvme0n1"; }) + (diskoConfigurations.standardWithHibernateSwap { + disk = "/dev/nvme0n1"; + swapSize = "16G"; + }) common-cpu-intel common-pc-ssd ]; diff --git a/packages/installer.nix b/packages/installer.nix index c8fb544..82a57b7 100644 --- a/packages/installer.nix +++ b/packages/installer.nix @@ -19,6 +19,8 @@ pkgs.writeShellApplication { cd nix fi + read -s -r -p 'Swap Size:' swap_size + echo read -s -r -p 'Disk Encryption Password:' pass1 echo read -s -r -p 'Disk Encryption Password (Again):' pass2 @@ -44,7 +46,8 @@ pkgs.writeShellApplication { github:nix-community/disko -- \ --flake '.#$partition_scheme' \ --mode disko \ - --arg disk '\"$disk_path\"'" + --arg disk '\"$disk_path\"' \ + --arg swapSize '\"$swap_size\"'" nix-shell --packages git \ --run "sudo nixos-install \