update Puenktchen disko
This commit is contained in:
parent
c3968035cf
commit
d0317d9b39
2 changed files with 35 additions and 45 deletions
14
flake.nix
14
flake.nix
|
@ -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";
|
||||||
|
|
|
@ -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 = {
|
content = {
|
||||||
type = "luks";
|
type = "btrfs";
|
||||||
name = "crypted";
|
extraArgs = [ "-f" ]; # Override existing partition
|
||||||
# disable settings.keyFile if you want to use interactive password entry
|
# Subvolumes must set a mountpoint in order to be mounted,
|
||||||
#passwordFile = "/tmp/secret.key"; # Interactive
|
# unless their parent is mounted
|
||||||
settings = {
|
subvolumes = {
|
||||||
allowDiscards = true;
|
# Subvolume name is different from mountpoint
|
||||||
keyFile = "/tmp/secret.key";
|
"/rootfs" = {
|
||||||
};
|
mountOptions = [ "compress=zstd" "noatime" ];
|
||||||
additionalKeyFiles = [ "/tmp/additionalSecret.key" ];
|
mountpoint = "/";
|
||||||
content = {
|
};
|
||||||
type = "btrfs";
|
# Subvolume name is the same as the mountpoint
|
||||||
extraArgs = [ "-f" ];
|
"/home" = {
|
||||||
subvolumes = {
|
mountOptions = [ "compress=zstd" "noatime" ];
|
||||||
"/root" = {
|
mountpoint = "/home";
|
||||||
mountpoint = "/";
|
};
|
||||||
mountOptions = [ "compress=zstd" "noatime" ];
|
# Parent is not mounted so the mountpoint must be set
|
||||||
};
|
"/nix" = {
|
||||||
"/home" = {
|
mountOptions = [ "compress=zstd" "noatime" ];
|
||||||
mountpoint = "/home";
|
mountpoint = "/nix";
|
||||||
mountOptions = [ "compress=zstd" "noatime" ];
|
};
|
||||||
};
|
# Subvolume for the swapfile
|
||||||
"/nix" = {
|
"/swap" = {
|
||||||
mountpoint = "/nix";
|
mountpoint = "/.swapvol";
|
||||||
mountOptions = [ "compress=zstd" "noatime" ];
|
swap.swapfile.size = "40G";
|
||||||
};
|
|
||||||
"/mnt/data" = {
|
|
||||||
mountpoint = "/mnt/data";
|
|
||||||
mountOptions = [ "compress=zstd" "noatime" ];
|
|
||||||
};
|
|
||||||
"/swap" = {
|
|
||||||
mountpoint = "/.swapvol";
|
|
||||||
swap.swapfile.size = "20M";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -64,4 +54,4 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue