Skip to content

Commit

Permalink
feat(recover): add gparted
Browse files Browse the repository at this point in the history
  • Loading branch information
klarkc committed Dec 19, 2023
1 parent c7718f9 commit fc3ceed
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 15 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/result
/*.img
19 changes: 10 additions & 9 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -33,34 +33,34 @@
};

# TODO: find a faster way to run recover in devShell
recover-vm = pkgs.writeShellApplication {
mk-recover-vm = args: pkgs.writeShellApplication {
name = "recover-vm";
text = ''
TMPD=$(mktemp -d)
echo "$TMPD"
IMG="$TMPD/recover-efi.img"
BIOS="$TMPD/recover-efi-bios.img"
IMG="recover-efi.img"
BIOS="recover-efi-bios.img"
ARGS="${args}"
cp -ui --reflink=auto ${pkgs.OVMF.fd}/FV/OVMF.fd "$BIOS"
chmod a+w "$BIOS"
cp -ui --reflink=auto ${recover-efi}/nixos.img "$IMG"
chmod a+w "$IMG"
qemu-system-${platform} \
-nographic \
-bios "$BIOS" \
-drive file="$IMG",format=raw \
-m 2G
rm -Rf "$TMPD"
-m 2G \
$ARGS
'';
runtimeInputs = with pkgs; [ tree rsync qemu ];
};
recover-vm = mk-recover-vm "";
recover-kvm = mk-recover-vm "--enable-kvm";
in
{
nixosConfigurations = {
inherit recover;
};

packages.${system} = {
inherit recover-efi recover-vm;
inherit recover-efi recover-vm recover-kvm;
};

devShells.${system}.default =
Expand All @@ -69,6 +69,7 @@
packages =
[
recover-vm
recover-kvm
];

};
Expand Down
48 changes: 42 additions & 6 deletions recover.nix
Original file line number Diff line number Diff line change
@@ -1,15 +1,32 @@
{ lib, pkgs, ... }: {
hardware.enableAllFirmware = true;
nix = {
extraOptions = ''
experimental-features = nix-command flakes repl-flake
'';
};
nixpkgs.config.allowUnfree = true;
hardware.enableAllFirmware = true;
users = {
users.root.password = "root";
users.recover = {
password = "recover";
isNormalUser = true;
home = "/home/recover";
description = "Recover";
extraGroups = [ "wheel" "networkmanager" ];
};
mutableUsers = false;
};
networking = {
hostName = "recover";
hostName = "recover-os";
networkmanager.enable = true;
};
boot = {
kernelParams = [
"copytoram"
"console=ttyS0,115200"
"console=tty1"
"boot.shell_on_fail"
];
supportedFilesystems = [
"btrfs"
"exfat"
Expand Down Expand Up @@ -61,11 +78,30 @@
wget
which
zip
ntfs3g
f2fs-tools
jfsutils
nilfs-utils
reiserfsprogs
xfsprogs
xfsdump
gparted
];

services.openssh = {
enable = true;
settings.PermitRootLogin = "yes";
services = {
openssh.enable = true;

xserver = {
enable = true;
windowManager.xmonad.enable = true;
displayManager = {
defaultSession = "none+xmonad";
autoLogin = {
enable = true;
user = "recover";
};
};
};
};

programs = {
Expand Down

0 comments on commit fc3ceed

Please sign in to comment.