Compare commits
8
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
645a4163f5
|
||
|
|
4845485547
|
||
|
|
ac74b85231
|
||
|
|
42da578f75 | ||
|
|
dd50c4b4e5
|
||
|
|
8a1067b324
|
||
|
|
fc4f0afc46
|
||
|
|
006290ef05 |
+20
-9
@@ -2,8 +2,13 @@
|
|||||||
|
|
||||||
- The installations presented in this repository are always luks encrypted
|
- The installations presented in this repository are always luks encrypted
|
||||||
- For simplicity I'm using device labels rather than uuids
|
- For simplicity I'm using device labels rather than uuids
|
||||||
|
- Secure Boot has to be disabled in the firmware, the installer iso isn't signed
|
||||||
|
|
||||||
1. the partitioning layout should look somewhat like this after the installation
|
1. create the partitions with `cfdisk` or `fdisk` (gpt)
|
||||||
|
- `nvme0n1p1`: 2G, type `EFI System`, otherwise the firmware won't find the bootloader
|
||||||
|
- `nvme0n1p2`: the rest, type `Linux filesystem`
|
||||||
|
|
||||||
|
the layout should look somewhat like this after the installation
|
||||||
```bash
|
```bash
|
||||||
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
|
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
|
||||||
nvme0n1 259:0 0 476.9G 0 disk
|
nvme0n1 259:0 0 476.9G 0 disk
|
||||||
@@ -30,12 +35,13 @@ cryptsetup luksOpen /dev/nvme0n1p2 cryptroot
|
|||||||
pvcreate /dev/mapper/cryptroot
|
pvcreate /dev/mapper/cryptroot
|
||||||
# create a volume group inside
|
# create a volume group inside
|
||||||
vgcreate lvmroot /dev/mapper/cryptroot
|
vgcreate lvmroot /dev/mapper/cryptroot
|
||||||
# create the swap volume
|
# create the swap volume, half the ram (no hibernation)
|
||||||
lvcreate --size 8G lvmroot --name swap
|
lvcreate --size 16G lvmroot --name swap
|
||||||
# if you desire, create a home volume
|
# if you desire, create a home volume
|
||||||
lvcreate --size 150G lvmroot --name home
|
lvcreate --size 150G lvmroot --name home
|
||||||
# create the root volume
|
# create the root volume, leave some space in the vg to grow volumes later
|
||||||
lvcreate -l 100%FREE lvmroot --name root
|
# (lvextend -r -L +50G lvmroot/home works while mounted)
|
||||||
|
lvcreate -l 90%FREE lvmroot --name root
|
||||||
|
|
||||||
# format as usual for root partition
|
# format as usual for root partition
|
||||||
mkfs.ext4 -L "nixroot" /dev/mapper/lvmroot-root
|
mkfs.ext4 -L "nixroot" /dev/mapper/lvmroot-root
|
||||||
@@ -47,7 +53,7 @@ mkswap -L "nixswap" /dev/mapper/lvmroot-swap
|
|||||||
# mount root
|
# mount root
|
||||||
mount /dev/disk/by-label/nixroot /mnt
|
mount /dev/disk/by-label/nixroot /mnt
|
||||||
# mount boot
|
# mount boot
|
||||||
mount --mkdir /dev/nvme0n1p1 /mnt/boot
|
mount --mkdir /dev/disk/by-label/nixboot /mnt/boot
|
||||||
# again, if you did the home volume
|
# again, if you did the home volume
|
||||||
mount --mkdir /dev/disk/by-label/nixhome /mnt/home
|
mount --mkdir /dev/disk/by-label/nixhome /mnt/home
|
||||||
# turn on swap
|
# turn on swap
|
||||||
@@ -59,8 +65,7 @@ swapon /dev/disk/by-label/nixswap
|
|||||||
# generate templates and update the hardware-configuration.nix
|
# generate templates and update the hardware-configuration.nix
|
||||||
nixos-generate-config --root /mnt
|
nixos-generate-config --root /mnt
|
||||||
|
|
||||||
# add dm-crypt and dm-mod to the kernelModules
|
# no extra kernelModules needed, luks and lvm load dm_crypt and dm_mod themselves
|
||||||
boot.initrd.kernelModules = [ "dm-crypt" "dm-mod" ];
|
|
||||||
|
|
||||||
# add file systems using labels
|
# add file systems using labels
|
||||||
fileSystems."/" =
|
fileSystems."/" =
|
||||||
@@ -81,7 +86,13 @@ swapDevices =
|
|||||||
];
|
];
|
||||||
|
|
||||||
# point the bootloader to the luks device
|
# point the bootloader to the luks device
|
||||||
boot.initrd.luks.devices."cryptroot".device = "/dev/disk/by-label/nixcrypt";
|
boot.initrd.luks.devices."cryptroot" = {
|
||||||
|
device = "/dev/disk/by-label/nixcrypt";
|
||||||
|
# without this fstrim never reaches the ssd
|
||||||
|
allowDiscards = true;
|
||||||
|
# lower latency on nvme
|
||||||
|
bypassWorkqueues = true;
|
||||||
|
};
|
||||||
```
|
```
|
||||||
|
|
||||||
4. install nixos
|
4. install nixos
|
||||||
|
|||||||
Generated
+21
@@ -41,6 +41,26 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"nixos-hardware": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1790948122,
|
||||||
|
"narHash": "sha256-fDMYyzY1lI5b8RuCMrvoaIgTeRwNnTG4dNk1ucROlQE=",
|
||||||
|
"owner": "NixOS",
|
||||||
|
"repo": "nixos-hardware",
|
||||||
|
"rev": "0953bb1a609df63013176e3463393f8df993d3ef",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "NixOS",
|
||||||
|
"repo": "nixos-hardware",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1790689126,
|
"lastModified": 1790689126,
|
||||||
@@ -102,6 +122,7 @@
|
|||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"home-manager": "home-manager",
|
"home-manager": "home-manager",
|
||||||
|
"nixos-hardware": "nixos-hardware",
|
||||||
"nixpkgs": "nixpkgs",
|
"nixpkgs": "nixpkgs",
|
||||||
"nixvim": "nixvim",
|
"nixvim": "nixvim",
|
||||||
"noctalia": "noctalia"
|
"noctalia": "noctalia"
|
||||||
|
|||||||
@@ -11,6 +11,10 @@
|
|||||||
url = "github:noctalia-dev/noctalia-shell";
|
url = "github:noctalia-dev/noctalia-shell";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
|
nixos-hardware = {
|
||||||
|
url = "github:NixOS/nixos-hardware";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
nixvim = {
|
nixvim = {
|
||||||
url = "github:nix-community/nixvim";
|
url = "github:nix-community/nixvim";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
@@ -52,6 +56,7 @@
|
|||||||
default = mkHost "default";
|
default = mkHost "default";
|
||||||
neon = mkHost "neon";
|
neon = mkHost "neon";
|
||||||
argon = mkHost "argon";
|
argon = mkHost "argon";
|
||||||
|
krypton = mkHost "krypton";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,6 +51,8 @@ in
|
|||||||
boot.initrd.luks.devices = lib.mapAttrs (name: uuid: {
|
boot.initrd.luks.devices = lib.mapAttrs (name: uuid: {
|
||||||
device = "/dev/disk/by-uuid/${uuid}";
|
device = "/dev/disk/by-uuid/${uuid}";
|
||||||
keyFile = key name;
|
keyFile = key name;
|
||||||
|
# trim for ssds, ignored by drives without discard support
|
||||||
|
allowDiscards = true;
|
||||||
}) drives;
|
}) drives;
|
||||||
fileSystems = lib.mapAttrs' (
|
fileSystems = lib.mapAttrs' (
|
||||||
name: _:
|
name: _:
|
||||||
|
|||||||
@@ -22,18 +22,21 @@
|
|||||||
"usb_storage"
|
"usb_storage"
|
||||||
"sd_mod"
|
"sd_mod"
|
||||||
];
|
];
|
||||||
boot.initrd.kernelModules = [ "dm-crypt dm-mod" ];
|
boot.initrd.luks.devices."cryptroot" = {
|
||||||
boot.initrd.luks.devices."cryptroot".device = "/dev/disk/by-label/nixcrypt";
|
device = "/dev/disk/by-label/nixcrypt";
|
||||||
|
allowDiscards = true;
|
||||||
|
bypassWorkqueues = true;
|
||||||
|
};
|
||||||
boot.kernelModules = [ ];
|
boot.kernelModules = [ ];
|
||||||
boot.extraModulePackages = [ ];
|
boot.extraModulePackages = [ ];
|
||||||
|
|
||||||
fileSystems."/" = {
|
fileSystems."/" = {
|
||||||
device = "/dev/mapper/lvmroot-root";
|
device = "/dev/disk/by-label/nixroot";
|
||||||
fsType = "ext4";
|
fsType = "ext4";
|
||||||
};
|
};
|
||||||
|
|
||||||
fileSystems."/boot" = {
|
fileSystems."/boot" = {
|
||||||
device = "/dev/disk/by-uuid/AC1C-20EB";
|
device = "/dev/disk/by-label/nixboot";
|
||||||
fsType = "vfat";
|
fsType = "vfat";
|
||||||
options = [
|
options = [
|
||||||
"fmask=0022"
|
"fmask=0022"
|
||||||
@@ -42,12 +45,12 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
fileSystems."/home" = {
|
fileSystems."/home" = {
|
||||||
device = "/dev/mapper/lvmroot-home";
|
device = "/dev/disk/by-label/nixhome";
|
||||||
fsType = "ext4";
|
fsType = "ext4";
|
||||||
};
|
};
|
||||||
|
|
||||||
swapDevices = [
|
swapDevices = [
|
||||||
{ device = "/dev/mapper/lvmroot-swap"; }
|
{ device = "/dev/disk/by-label/nixswap"; }
|
||||||
];
|
];
|
||||||
|
|
||||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||||
|
|||||||
@@ -0,0 +1,35 @@
|
|||||||
|
# krypton: framework 13 pro, intel core ultra x7 358H
|
||||||
|
|
||||||
|
{ inputs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
inputs.nixos-hardware.nixosModules.framework-intel-core-ultra-series3
|
||||||
|
../../modules/nixos/appimage.nix
|
||||||
|
../../modules/nixos/astro.nix
|
||||||
|
../../modules/nixos/audio.nix
|
||||||
|
../../modules/nixos/bootloader.nix
|
||||||
|
../../modules/nixos/certificates.nix
|
||||||
|
../../modules/nixos/docker.nix
|
||||||
|
../../modules/nixos/gnupg.nix
|
||||||
|
../../modules/nixos/locales.nix
|
||||||
|
../../modules/nixos/networking.nix
|
||||||
|
../../modules/nixos/niri.nix
|
||||||
|
../../modules/nixos/noctalia.nix
|
||||||
|
../../modules/nixos/openssh.nix
|
||||||
|
../../modules/nixos/packages.nix
|
||||||
|
../../modules/nixos/protonvpn.nix
|
||||||
|
../../modules/nixos/sddm.nix
|
||||||
|
../../modules/nixos/services.nix
|
||||||
|
../../modules/nixos/settings.nix
|
||||||
|
../../modules/nixos/steam.nix
|
||||||
|
../../modules/nixos/users.nix
|
||||||
|
../../modules/nixos/vial.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
# host-specific niri config (input devices, laptop binds)
|
||||||
|
home-manager.users.aaron.imports = [ ./niri.nix ];
|
||||||
|
|
||||||
|
networking.hostName = "krypton";
|
||||||
|
system.stateVersion = "26.05"; # don't change
|
||||||
|
}
|
||||||
@@ -0,0 +1,60 @@
|
|||||||
|
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||||
|
# and may be overwritten by future invocations. Please make changes
|
||||||
|
# to /etc/nixos/configuration.nix instead.
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
modulesPath,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
(modulesPath + "/installer/scan/not-detected.nix")
|
||||||
|
];
|
||||||
|
|
||||||
|
boot.initrd.availableKernelModules = [
|
||||||
|
"xhci_pci"
|
||||||
|
"thunderbolt"
|
||||||
|
"nvme"
|
||||||
|
"usb_storage"
|
||||||
|
"sd_mod"
|
||||||
|
];
|
||||||
|
boot.initrd.kernelModules = [ "dm-snapshot" ];
|
||||||
|
boot.initrd.luks.devices."cryptroot" = {
|
||||||
|
device = "/dev/disk/by-label/nixcrypt";
|
||||||
|
allowDiscards = true;
|
||||||
|
bypassWorkqueues = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
boot.kernelModules = [ "kvm-intel" ];
|
||||||
|
boot.extraModulePackages = [ ];
|
||||||
|
|
||||||
|
fileSystems."/" = {
|
||||||
|
device = "/dev/disk/by-label/nixroot";
|
||||||
|
fsType = "ext4";
|
||||||
|
};
|
||||||
|
|
||||||
|
fileSystems."/boot" = {
|
||||||
|
device = "/dev/disk/by-label/nixboot";
|
||||||
|
fsType = "vfat";
|
||||||
|
options = [
|
||||||
|
"fmask=0022"
|
||||||
|
"dmask=0022"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
fileSystems."/home" = {
|
||||||
|
device = "/dev/disk/by-label/nixhome";
|
||||||
|
fsType = "ext4";
|
||||||
|
};
|
||||||
|
|
||||||
|
swapDevices = [
|
||||||
|
{ device = "/dev/disk/by-label/nixswap"; }
|
||||||
|
];
|
||||||
|
|
||||||
|
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||||
|
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||||
|
hardware.cpu.intel.npu.enable = true;
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
# krypton: framework 13 laptop, the built-in display is auto-configured by niri
|
||||||
|
|
||||||
|
{ lib, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
wayland.windowManager.niri.settings = {
|
||||||
|
input.touchpad = {
|
||||||
|
tap = { };
|
||||||
|
natural-scroll = { };
|
||||||
|
};
|
||||||
|
|
||||||
|
layout.gaps = lib.mkForce 10;
|
||||||
|
|
||||||
|
binds = {
|
||||||
|
"Print".screenshot = { };
|
||||||
|
"Ctrl+Print".screenshot-screen = { };
|
||||||
|
"Mod+Shift+P".power-off-monitors = { };
|
||||||
|
|
||||||
|
# finer brightness steps
|
||||||
|
"XF86MonBrightnessUp".spawn-sh = lib.mkForce "brightnessctl --class=backlight set +1%";
|
||||||
|
"XF86MonBrightnessDown".spawn-sh = lib.mkForce "brightnessctl --class=backlight set 1%-";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -1,5 +1,10 @@
|
|||||||
|
# neon: thinkpad t14 gen1 (intel)
|
||||||
|
|
||||||
|
{ inputs, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
|
inputs.nixos-hardware.nixosModules.lenovo-thinkpad-t14-intel-gen1
|
||||||
../../modules/nixos/appimage.nix
|
../../modules/nixos/appimage.nix
|
||||||
../../modules/nixos/astro.nix
|
../../modules/nixos/astro.nix
|
||||||
../../modules/nixos/audio.nix
|
../../modules/nixos/audio.nix
|
||||||
|
|||||||
@@ -25,7 +25,11 @@
|
|||||||
"dm-snapshot"
|
"dm-snapshot"
|
||||||
"cryptd"
|
"cryptd"
|
||||||
];
|
];
|
||||||
boot.initrd.luks.devices."cryptroot".device = "/dev/disk/by-label/nixcrypt";
|
boot.initrd.luks.devices."cryptroot" = {
|
||||||
|
device = "/dev/disk/by-label/nixcrypt";
|
||||||
|
allowDiscards = true;
|
||||||
|
bypassWorkqueues = true;
|
||||||
|
};
|
||||||
|
|
||||||
boot.kernelModules = [ "kvm-intel" ];
|
boot.kernelModules = [ "kvm-intel" ];
|
||||||
boot.extraModulePackages = [ ];
|
boot.extraModulePackages = [ ];
|
||||||
|
|||||||
Reference in New Issue
Block a user