update Puenktchen disko

This commit is contained in:
willifan 2024-05-19 17:02:35 +02:00
parent c3968035cf
commit d0317d9b39
2 changed files with 35 additions and 45 deletions

View file

@ -2,24 +2,24 @@
description = "A simple NixOS flake"; description = "A simple NixOS flake";
inputs = { inputs = {
# NixOS official package source, using the nixos-23.11 branch here # NixOS official package source, using the nixos-23.11 branch here
nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-23.11"; nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-23.11";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
hardware.url = "github:nixos/nixos-hardware"; hardware.url = "github:nixos/nixos-hardware";
# Declarative dotfile management
home-manager = { home-manager = {
url = "github:nix-community/home-manager/"; url = "github:nix-community/home-manager/";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
# Declarative partitioning and formatting
disko = {
url = "github:nix-community/disko";
inputs.nixpkgs.follows = "nixpkgs";
};
# # Declarative partitioning and formatting
# disko = {
# url = "github:nix-community/disko";
# inputs.nixpkgs.follows = "nixpkgs";
# };
#
# # Secrets management. See ./docs/secretsmgmt.md # # Secrets management. See ./docs/secretsmgmt.md
# sops-nix = { # sops-nix = {
# url = "github:mic92/sops-nix"; # url = "github:mic92/sops-nix";

View file

@ -8,53 +8,43 @@
type = "gpt"; type = "gpt";
partitions = { partitions = {
ESP = { ESP = {
priority = 1;
name = "ESP";
size = "512M"; size = "512M";
type = "EF00"; type = "EF00";
content = { content = {
type = "filesystem"; type = "filesystem";
format = "vfat"; format = "vfat";
mountpoint = "/boot"; mountpoint = "/boot";
mountOptions = [
"defaults"
];
}; };
}; };
luks = { root = {
size = "100%"; size = "100%";
content = {
type = "luks";
name = "crypted";
# disable settings.keyFile if you want to use interactive password entry
#passwordFile = "/tmp/secret.key"; # Interactive
settings = {
allowDiscards = true;
keyFile = "/tmp/secret.key";
};
additionalKeyFiles = [ "/tmp/additionalSecret.key" ];
content = { content = {
type = "btrfs"; type = "btrfs";
extraArgs = [ "-f" ]; extraArgs = [ "-f" ]; # Override existing partition
# Subvolumes must set a mountpoint in order to be mounted,
# unless their parent is mounted
subvolumes = { subvolumes = {
"/root" = { # Subvolume name is different from mountpoint
"/rootfs" = {
mountOptions = [ "compress=zstd" "noatime" ];
mountpoint = "/"; mountpoint = "/";
mountOptions = [ "compress=zstd" "noatime" ];
}; };
# Subvolume name is the same as the mountpoint
"/home" = { "/home" = {
mountOptions = [ "compress=zstd" "noatime" ];
mountpoint = "/home"; mountpoint = "/home";
mountOptions = [ "compress=zstd" "noatime" ];
}; };
# Parent is not mounted so the mountpoint must be set
"/nix" = { "/nix" = {
mountOptions = [ "compress=zstd" "noatime" ];
mountpoint = "/nix"; mountpoint = "/nix";
mountOptions = [ "compress=zstd" "noatime" ];
};
"/mnt/data" = {
mountpoint = "/mnt/data";
mountOptions = [ "compress=zstd" "noatime" ];
}; };
# Subvolume for the swapfile
"/swap" = { "/swap" = {
mountpoint = "/.swapvol"; mountpoint = "/.swapvol";
swap.swapfile.size = "20M"; swap.swapfile.size = "40G";
};
}; };
}; };
}; };