Compare commits
2 Commits
d8c04a227c
...
c1bd2ea1d7
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c1bd2ea1d7 | ||
|
|
bd9ac68acf |
85
README.org
85
README.org
@@ -0,0 +1,85 @@
|
||||
* Installing
|
||||
|
||||
** Fresh system (nixos USB drive)
|
||||
|
||||
1. Open a nix-shell with git:
|
||||
> nix-shell -p git
|
||||
|
||||
2. Clone the flake
|
||||
> git clone https://git.lajuntament.space/marc/samfelag.git
|
||||
|
||||
3. Partition the disk
|
||||
|
||||
3.0 Locate the disk
|
||||
> lsblk
|
||||
|
||||
3.1 Create the partition table
|
||||
You can use GParted or fdisk (example of the latter):
|
||||
> sudo fdisk <<device: e.g /dev/nvme0n1>>
|
||||
|
||||
> Command (m for help): g
|
||||
Created a new GPT disklabel (GUID: CF653F38-902C-0648-B8AF-B4E07A8E0E8C).
|
||||
|
||||
> Command (m for help): n
|
||||
> Partition number (1-128, default 1):
|
||||
> First sector (2048-2000409230, default 2048):
|
||||
> Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-2000409230, default 2000409230): +512M
|
||||
Created a new partition 1 of type 'Linux filesystem' and of size 512 MiB.
|
||||
|
||||
> Command (m for help): t
|
||||
Selected partition 1
|
||||
> Partition type or alias (type L to list all): 1
|
||||
Changed type of partition 'Linux filesystem' to 'EFI System'.
|
||||
|
||||
> Command (m for help): n
|
||||
> Partition number (2-128, default 2):
|
||||
> First sector (1050624-2000409230, default 1050624):
|
||||
> Last sector, +/-sectors or +/-size{K,M,G,T,P} (1050624-2000409230, default 2000409230): -8G
|
||||
Created a new partition 2 of type 'Linux filesystem' and of size 945.4 GiB.
|
||||
|
||||
> Command (m for help): n
|
||||
> Partition number (3-128, default 3):
|
||||
> First sector (1983631360-2000409230, default 1983631360):
|
||||
> Last sector, +/-sectors or +/-size{K,M,G,T,P} (1983631360-2000409230, default 2000409230):
|
||||
Created a new partition 3 of type 'Linux filesystem' and of size 8 GiB.
|
||||
|
||||
> Command (m for help): t
|
||||
> Partition number (1-3, default 3): 3
|
||||
> Partition type or alias (type L to list all): 19
|
||||
Changed type of partition 'Linux filesystem' to 'Linux swap'.
|
||||
|
||||
> Command (m for help): p
|
||||
Disk /dev/nvme0n1: 953.87 GiB, 1024209543168 bytes, 2000409264 sectors
|
||||
Disk model: Micron MTFDKBA1T0TFH
|
||||
Units: sectors of 1 * 512 = 512 bytes
|
||||
Sector size (logical/physical): 512 bytes / 512 bytes
|
||||
I/O size (minimum/optimal): 512 bytes / 512 bytes
|
||||
Disklabel type: gpt
|
||||
Disk identifier: CF653F38-902C-0648-B8AF-B4E07A8E0E8C
|
||||
|
||||
Device Start End Sectors Size Type
|
||||
/dev/nvme0n1p1 2048 1050623 1048576 512M EFI System
|
||||
/dev/nvme0n1p2 1050624 1983631359 1982580736 945.4G Linux filesystem
|
||||
/dev/nvme0n1p3 1983631360 2000409230 16777871 8G Linux swap
|
||||
|
||||
> Command (m for help): w
|
||||
The partition table has been altered.
|
||||
Calling ioctl() to re-read partition table.
|
||||
Syncing disks.
|
||||
|
||||
3.1 Create the boot partition
|
||||
> sudo mkfs.fat -F 32 <<device: e.g. /dev/nvme0n1p1>>
|
||||
> sudo fatlabel /dev/nvme0n1p1 BOOT
|
||||
|
||||
3.2 Create the root partition
|
||||
> sudo mkfs.ext4 <<device: e.g. /dev/nvme0n1p2>> -L nixos
|
||||
|
||||
3.3 Create the swap partition
|
||||
> sudo mkswap <<device: e.g. /dev/nvme0n1p3>> -L swap
|
||||
|
||||
4. Create the host nix configuration
|
||||
If the host is not present under system/hosts, create a new folder for the host.
|
||||
Generate the hardware configuration file, you can use nixos-generate-config as a base:
|
||||
|
||||
> nixos-generate-config --dir <<host directory>> --no-filesystems
|
||||
|
||||
|
||||
28
system/hosts/reykjavik/default.nix
Normal file
28
system/hosts/reykjavik/default.nix
Normal file
@@ -0,0 +1,28 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./hardware.nix
|
||||
];
|
||||
|
||||
# - Basic --------------------------------------
|
||||
|
||||
networking.hostName = "reykjavik";
|
||||
|
||||
samfelag.modules.user = {
|
||||
name = "marc";
|
||||
};
|
||||
|
||||
# - Bootloader ---------------------------------
|
||||
|
||||
boot.loader.grub.enable = true;
|
||||
boot.loader.grub.device = "/dev/nvme0n1";
|
||||
boot.loader.grub.useOSProber = true;
|
||||
|
||||
# - Services -----------------------------------
|
||||
|
||||
samfelag.profiles.desktop.enable = true;
|
||||
|
||||
system.stateVersion = "22.05";
|
||||
|
||||
}
|
||||
41
system/hosts/reykjavik/hardware.nix
Normal file
41
system/hosts/reykjavik/hardware.nix
Normal file
@@ -0,0 +1,41 @@
|
||||
{ config, lib, pkgs, modulesPath, ... }:
|
||||
|
||||
{
|
||||
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
|
||||
|
||||
boot = {
|
||||
initrd = {
|
||||
availableKernelModules = [ "xhci_pci" "thunderbolt" "ahci" "nvme" "usb_storage" "usbhid" "sd_mod" ];
|
||||
kernelModules = [ ];
|
||||
};
|
||||
kernelModules = [ "kvm-intel" ];
|
||||
extraModulePackages = [ ];
|
||||
};
|
||||
|
||||
fileSystems = {
|
||||
"/" = {
|
||||
device = "/dev/disk/by-label/nixos";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
"/boot" = {
|
||||
device = "/dev/disk/by-label/BOOT";
|
||||
fsType = "vfat";
|
||||
};
|
||||
};
|
||||
|
||||
swapDevices = [
|
||||
{ device = "/dev/disk/by-label/swap"; }
|
||||
];
|
||||
|
||||
networking = {
|
||||
useDHCP = lib.mkDefault true;
|
||||
interfaces = {
|
||||
enp92s0.useDHCP = lib.mkDefault true;
|
||||
wlp0s20f3.useDHCP = lib.mkDefault true;
|
||||
};
|
||||
};
|
||||
|
||||
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
|
||||
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
}
|
||||
2
system/hosts/reykjavik/readme.org
Normal file
2
system/hosts/reykjavik/readme.org
Normal file
@@ -0,0 +1,2 @@
|
||||
* Reykjavik
|
||||
Portàtil Lenovo Legion 5 15ITH6H
|
||||
Reference in New Issue
Block a user