This commit is contained in:
2026-01-21 16:54:09 +00:00
parent d294038801
commit dfbc1ea5a2
4 changed files with 76 additions and 27 deletions

View File

@@ -1,10 +1,10 @@
{ inputs, ... }: { inputs, lib, ... }:
{ {
imports = [ inputs.disko.nixosModules.disko ]; imports = [ inputs.disko.nixosModules.disko ];
disko.devices = { disko.devices = {
disk = { disk = {
main = { main = {
device = "/dev/mmcblk0"; device = "/dev/disk/by-label/NIXOS_SD";
type = "disk"; type = "disk";
content = { content = {
type = "gpt"; type = "gpt";
@@ -36,25 +36,10 @@
root = { root = {
size = "100%"; size = "100%";
content = { content = {
type = "btrfs"; type = "filesystem";
extraArgs = [ "-f" ]; # Override existing partition format = "ext4";
# Subvolumes must set a mountpoint in order to be mounted,
# unless their parent is mounted
subvolumes = {
# Subvolume name is different from mountpoint
"@" = {
mountpoint = "/"; mountpoint = "/";
}; };
# Subvolume name is the same as the mountpoint
"@home" = {
mountpoint = "/home";
};
# Parent is not mounted so the mountpoint must be set
"@nix" = {
mountpoint = "/nix";
};
};
};
}; };
}; };
}; };

View File

@@ -1,7 +1,36 @@
{ lib, inputs, ... }: {
lib,
inputs,
modulesPath,
...
}:
{ {
imports = [ imports = [
./disks.nix # ./disks.nix
inputs.nixos-hardware.nixosModules.raspberry-pi-4 inputs.nixos-hardware.nixosModules.raspberry-pi-4
(modulesPath + "/installer/sd-card/sd-image-aarch64.nix")
];
fileSystems = {
"/" = {
device = "/dev/disk/by-label/NIXOS_SD";
fsType = "ext4";
options = [ "noatime" ];
};
};
boot.supportedFilesystems = lib.mkForce [
"btrfs"
"reiserfs"
"vfat"
"ext4"
"f2fs"
"xfs"
"ntfs"
"cifs"
];
nixpkgs.overlays = [
# https://github.com/NixOS/nixpkgs/issues/126755#issuecomment-869149243
(final: super: {
makeModulesClosure = x: super.makeModulesClosure (x // { allowMissing = true; });
})
]; ];
} }

View File

@@ -120,6 +120,7 @@ in
services.libinput.enable = true; services.libinput.enable = true;
boot.binfmt.emulatedSystems = [ "aarch64-linux" ];
# Define a user account. Don't forget to set a password with passwd. # Define a user account. Don't forget to set a password with passwd.
users.users.doloro = { users.users.doloro = {
isNormalUser = true; isNormalUser = true;
@@ -135,6 +136,7 @@ in
# initialPassword = "sex"; # initialPassword = "sex";
}; };
users.mutableUsers = false; users.mutableUsers = false;
services.system76-scheduler.enable = true;
# programs.firefox.enable = true; # programs.firefox.enable = true;

View File

@@ -1,7 +1,40 @@
{ lib, inputs, ... }:
{ {
imports = [ lib,
./disks.nix pkgs,
inputs.nixos-hardware.nixosModules.raspberry-pi-4 inputs,
...
}:
{
users = {
mutableUsers = false;
users.doloro = {
isNormalUser = true;
extraGroups = [ "wheel" ];
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIE/4h+WCBBW82puv8SMdUbkWymF4amEMuZitgFztB6oZ" # laptop pub key
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBaa6Z5qtBSLEz+A4fQGYPfkOISsRQlmKkVbcx2zxML7" # pc pub key
]; ];
};
};
networking.hostName = "nixos-001-rp5";
services.openssh.enable = true;
boot = {
kernelPackages = pkgs.linuxKernel.packages.linux_rpi4;
initrd.availableKernelModules = [
"xhci_pci"
"usbhid"
"usb_storage"
];
loader = {
grub.enable = false;
generic-extlinux-compatible.enable = true;
};
};
hardware.enableRedistributableFirmware = true;
system.stateVersion = "25.11";
nixpkgs.hostPlatform = "aarch64-linux";
} }