From d6a58e53a2fad64133a60875d50d0a45196f9282 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cyryl=20P=C5=82otnicki?= Date: Sat, 26 Jun 2021 21:20:30 +0100 Subject: [PATCH] first successfull boot of reinstalled foureighty --- README.md | 9 ++++-- nixos/boxes/foureighty/default.nix | 7 +++++ .../foureighty/hardware-configuration.nix | 29 +++++-------------- 3 files changed, 20 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index f024401f..ec7052be 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,7 @@ parted /dev/nvme0n1 -- rm 1 parted /dev/nvme0n1 -- rm 2 parted /dev/nvme0n1 -- rm 3 parted /dev/nvme0n1 -- rm 4 +parted /dev/nvme0n1 -- rm 5 parted /dev/nvme0n1 -- mkpart ESP fat32 1MiB 1GiB parted /dev/nvme0n1 -- set 1 esp on parted /dev/nvme0n1 -- mkpart primary 1GiB 100% @@ -69,7 +70,9 @@ remote (nvme): mkfs.fat -F 32 -n boot /dev/nvme0n1p1 mkfs.btrfs -L nixos /dev/mapper/crypt sleep 1 -mount /dev/mapper/crypt /mnt +cryptsetup luksClose crypt +cryptsetup luksOpen /dev/nvme0n1p2 crypt +mount /dev/disk/by-label/nixos /mnt mkdir -p /mnt/boot mount /dev/disk/by-label/boot /mnt/boot nixos-generate-config --root /mnt @@ -90,14 +93,14 @@ mkdir -p /mnt/home/cyryl/dev/dotfiles/ tar -xvf /tmp/dotfiles.tar.gz -C /mnt/home/cyryl/dev/dotfiles cp /mnt/etc/nixos/hardware-configuration.nix /mnt/home/cyryl/dev/dotfiles/nixos/boxes/hostname/ nix-shell -p nixUnstable git -nixos-install --flake '.#hostname-bootstrap' +nixos-install --flake '.#bootstrap' reboot ``` ctrl-alt-f1 root login: ```bash -nixos-rebuild switch +# nixos-rebuild switch passwd cyryl chown cyryl -R /home/cyryl reboot diff --git a/nixos/boxes/foureighty/default.nix b/nixos/boxes/foureighty/default.nix index dc21f301..c27d7b5f 100644 --- a/nixos/boxes/foureighty/default.nix +++ b/nixos/boxes/foureighty/default.nix @@ -3,6 +3,7 @@ networking.hostName = "foureighty"; imports = [ + inputs.nixos-hardware.nixosModules.lenovo-thinkpad-t480 ./hardware-configuration.nix ../../boot.nix ../../common.nix @@ -18,6 +19,12 @@ ../../mercurial ]; + zramSwap = { + enable = true; + algorithm = "zstd"; + memoryPercent = 75; + }; + boot.kernelPackages = pkgs.linuxPackages_latest_hardened; time.timeZone = "Europe/London"; diff --git a/nixos/boxes/foureighty/hardware-configuration.nix b/nixos/boxes/foureighty/hardware-configuration.nix index 6476a188..b7c0df54 100644 --- a/nixos/boxes/foureighty/hardware-configuration.nix +++ b/nixos/boxes/foureighty/hardware-configuration.nix @@ -1,15 +1,6 @@ { config, lib, pkgs, inputs, ... }: - { - imports = [ - inputs.nixos-hardware.nixosModules.lenovo-thinkpad-t480 - ]; - boot = { - kernel.sysctl = { - "vm.swappiness" = 95; - }; - kernelModules = [ "kvm-intel" ]; initrd = { @@ -21,29 +12,23 @@ loader.systemd-boot.enable = true; }; - boot.initrd.luks.devices."crypt".device = "replaceme"; - - fileSystems."/" = { - device = "replaceme"; - fsType = "btrfs"; - }; + boot.initrd.luks.devices."crypt".device = "/dev/disk/by-uuid/c2deaeaa-cb76-4d29-a603-0cf42f6e829f"; fileSystems."/boot" = { - device = "replaceme"; + device = "/dev/disk/by-uuid/FC06-82E6"; fsType = "vfat"; }; + fileSystems."/" = { + device = "/dev/disk/by-uuid/cb12122c-f0ef-4c43-bac1-6b8410a51a54"; + fsType = "btrfs"; + }; + swapDevices = [ ]; powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; hardware.video.hidpi.enable = lib.mkDefault true; - zramSwap = { - enable = true; - algorithm = "zstd"; - memoryPercent = 75; - }; - nix.maxJobs = 2; nix.buildCores = 6; }