update
This commit is contained in:
21
flake.lock
generated
21
flake.lock
generated
@@ -1,5 +1,25 @@
|
|||||||
{
|
{
|
||||||
"nodes": {
|
"nodes": {
|
||||||
|
"disko": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1766150702,
|
||||||
|
"narHash": "sha256-P0kM+5o+DKnB6raXgFEk3azw8Wqg5FL6wyl9jD+G5a4=",
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "disko",
|
||||||
|
"rev": "916506443ecd0d0b4a0f4cf9d40a3c22ce39b378",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "disko",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"hardware": {
|
"hardware": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1767070591,
|
"lastModified": 1767070591,
|
||||||
@@ -92,6 +112,7 @@
|
|||||||
},
|
},
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
|
"disko": "disko",
|
||||||
"hardware": "hardware",
|
"hardware": "hardware",
|
||||||
"home-manager": "home-manager",
|
"home-manager": "home-manager",
|
||||||
"impermanence": "impermanence",
|
"impermanence": "impermanence",
|
||||||
|
|||||||
@@ -18,6 +18,11 @@
|
|||||||
inputs.home-manager.follows = "home-manager";
|
inputs.home-manager.follows = "home-manager";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
disko = {
|
||||||
|
url = "github:nix-community/disko";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
|
|
||||||
sops-nix = {
|
sops-nix = {
|
||||||
url = "github:mic92/sops-nix";
|
url = "github:mic92/sops-nix";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
|||||||
5
hosts/common/optional/ephemeral-btrfs.nix
Normal file
5
hosts/common/optional/ephemeral-btrfs.nix
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
|
||||||
|
}: {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,44 +1,93 @@
|
|||||||
# 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, ... }:
|
|
||||||
|
|
||||||
{
|
{inputs, ... }: {
|
||||||
imports =
|
imports = [
|
||||||
[ (modulesPath + "/installer/scan/not-detected.nix")
|
inputs.disko.nixosModules.disko
|
||||||
|
../common/optional/ephermal-btrfs.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "usbhid" "usb_storage" "sd_mod" ];
|
boot = {
|
||||||
boot.initrd.kernelModules = [ ];
|
initrd = {
|
||||||
boot.kernelModules = [ "kvm-amd" ];
|
availableKernelModules = [
|
||||||
boot.extraModulePackages = [ ];
|
"nvme"
|
||||||
|
"xhci_pci"
|
||||||
fileSystems."/" =
|
"ahci"
|
||||||
{ device = "/dev/disk/by-uuid/cdcfbbfa-ae65-48ff-acfd-1ceba3376f2f";
|
"usb_storage"
|
||||||
fsType = "ext4";
|
"usbhid"
|
||||||
};
|
"sd_mod"
|
||||||
|
|
||||||
fileSystems."/boot" =
|
|
||||||
{ device = "/dev/disk/by-uuid/7C92-2CC6";
|
|
||||||
fsType = "vfat";
|
|
||||||
options = [ "fmask=0077" "dmask=0077" ];
|
|
||||||
};
|
|
||||||
|
|
||||||
swapDevices =
|
|
||||||
[ { device = "/dev/disk/by-uuid/f8b826c3-629d-4e11-a902-d076d16be33b"; }
|
|
||||||
];
|
];
|
||||||
|
kernelModules = ["kvm-amd"];
|
||||||
|
};
|
||||||
|
loader = {
|
||||||
|
systemd-boot = {
|
||||||
|
enable = true;
|
||||||
|
consoleMode = "max";
|
||||||
|
};
|
||||||
|
efi.canTouchEfiVariables = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
disko.devices.disk.main = {
|
||||||
# (the default) this is the recommended approach. When using systemd-networkd it's
|
device = "/dev/nvme0n1";
|
||||||
# still possible to use this option, but it's recommended to use it in conjunction
|
type = "disk";
|
||||||
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
|
content = {
|
||||||
networking.useDHCP = lib.mkDefault true;
|
type = "gpt";
|
||||||
# networking.interfaces.enp3s0.useDHCP = lib.mkDefault true;
|
partions = {
|
||||||
# networking.interfaces.enp4s0.useDHCP = lib.mkDefault true;
|
boot = {
|
||||||
# networking.interfaces.enp5s0f0np0.useDHCP = lib.mkDefault true;
|
size = "1M";
|
||||||
# networking.interfaces.enp5s0f1np1.useDHCP = lib.mkDefault true;
|
type = "EF02";
|
||||||
# networking.interfaces.wlp6s0.useDHCP = lib.mkDefault true;
|
};
|
||||||
|
esp = {
|
||||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
name = "ESP";
|
||||||
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
size = "512M";
|
||||||
|
type = "EF00";
|
||||||
|
content = {
|
||||||
|
type = "filesystem";
|
||||||
|
format = "vfat";
|
||||||
|
mountpoint = "/boot";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
luks = {
|
||||||
|
size = "100%";
|
||||||
|
content = {
|
||||||
|
name = "root";
|
||||||
|
type = "luks";
|
||||||
|
settings.allowDiscards = true;
|
||||||
|
content = {
|
||||||
|
type = "btrfs";
|
||||||
|
postCreateHook = ''
|
||||||
|
MNTPOINT=$(mktemp -d)
|
||||||
|
mount -t btrfs "$device" "$MNTPOINT"
|
||||||
|
trap 'umount $MNTPOINT; rm -d $MNTPOINT' EXIT
|
||||||
|
btrfs subvolume snapshot -r $MNTPOINT/root $MNTPOINT/root-blank
|
||||||
|
'';
|
||||||
|
subvolumes = {
|
||||||
|
"/root" = {
|
||||||
|
mountOptions = ["compress=zstd"];
|
||||||
|
mountpoint = "/";
|
||||||
|
};
|
||||||
|
"/nix" = {
|
||||||
|
mountOptions = ["compress=zstd" "noatime"];
|
||||||
|
mountpoint = "/nix";
|
||||||
|
};
|
||||||
|
"/persist" = {
|
||||||
|
mountOptions = ["compress=zstd"];
|
||||||
|
mountpoint = "/persist";
|
||||||
|
};
|
||||||
|
"/swap" = {
|
||||||
|
mountOptions = ["compress=zstd" "noatime"];
|
||||||
|
mountpoint = "/swap";
|
||||||
|
swap.swapfile = {
|
||||||
|
size = "60G";
|
||||||
|
path = "swapfile";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user