Better disko setup
This commit is contained in:
parent
f0d56df191
commit
51ab89cd98
37
flake.lock
generated
37
flake.lock
generated
@ -1,5 +1,25 @@
|
||||
{
|
||||
"nodes": {
|
||||
"disko": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1748225455,
|
||||
"narHash": "sha256-AzlJCKaM4wbEyEpV3I/PUq5mHnib2ryEy32c+qfj6xk=",
|
||||
"owner": "nix-community",
|
||||
"repo": "disko",
|
||||
"rev": "a894f2811e1ee8d10c50560551e50d6ab3c392ba",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-community",
|
||||
"repo": "disko",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-compat": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
@ -54,6 +74,21 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"impermanence": {
|
||||
"locked": {
|
||||
"lastModified": 1737831083,
|
||||
"narHash": "sha256-LJggUHbpyeDvNagTUrdhe/pRVp4pnS6wVKALS782gRI=",
|
||||
"owner": "nix-community",
|
||||
"repo": "impermanence",
|
||||
"rev": "4b3e914cdf97a5b536a889e939fb2fd2b043a170",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-community",
|
||||
"repo": "impermanence",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nix-minecraft": {
|
||||
"inputs": {
|
||||
"flake-compat": "flake-compat",
|
||||
@ -114,7 +149,9 @@
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"disko": "disko",
|
||||
"home-manager": "home-manager",
|
||||
"impermanence": "impermanence",
|
||||
"nix-minecraft": "nix-minecraft",
|
||||
"nix-modpack": "nix-modpack",
|
||||
"nixpkgs": "nixpkgs"
|
||||
|
24
modules/nixos/disko.nix
Normal file
24
modules/nixos/disko.nix
Normal file
@ -0,0 +1,24 @@
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
inputs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.disko;
|
||||
profile = import "${inputs.self}/profiles/disko/${cfg.profile}.nix";
|
||||
in
|
||||
{
|
||||
options.modules.disko = {
|
||||
enable = mkEnableOption "Disko module";
|
||||
profile = mkOption {
|
||||
type = types.str;
|
||||
default = null;
|
||||
description = "The profile to use for the disko module.";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable { disko.devices = profile.disko.devices; };
|
||||
}
|
@ -33,7 +33,7 @@
|
||||
rootFsOptions = {
|
||||
compression = "zstd";
|
||||
};
|
||||
mountpoint = "none";
|
||||
mountpoint = null;
|
||||
postCreateHook = "zfs list -t snapshot -H -o name | grep -E '^zroot@blank$' || zfs snapshot zroot@blank";
|
||||
|
||||
datasets = {
|
||||
@ -41,6 +41,14 @@
|
||||
type = "zfs_fs";
|
||||
mountpoint = "/";
|
||||
};
|
||||
nix = {
|
||||
type = "zfs_fs";
|
||||
mountpoint = "/nix";
|
||||
};
|
||||
persist = {
|
||||
type = "zfs_fs";
|
||||
mountpoint = "/persist";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -19,6 +19,10 @@ in
|
||||
# Enabled modules
|
||||
modules = {
|
||||
profiles.base.enable = true;
|
||||
disko = {
|
||||
enable = true;
|
||||
profile = "vm";
|
||||
};
|
||||
ssh.enable = true;
|
||||
};
|
||||
|
||||
@ -36,6 +40,9 @@ in
|
||||
# Machine platform
|
||||
nixpkgs.hostPlatform = "x86_64-linux";
|
||||
|
||||
# Set hostid
|
||||
networking.hostId = "deadbeef";
|
||||
|
||||
# Hardware configuration
|
||||
hardware.enableRedistributableFirmware = true;
|
||||
boot.initrd.availableKernelModules = [
|
||||
@ -51,21 +58,6 @@ in
|
||||
boot.extraModulePackages = [ ];
|
||||
hardware.cpu.intel.updateMicrocode = true;
|
||||
|
||||
# Filesystems
|
||||
fileSystems."/" = {
|
||||
device = "/dev/disk/by-partlabel/root";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
fileSystems."/boot" = {
|
||||
device = "/dev/disk/by-partlabel/EFI";
|
||||
fsType = "vfat";
|
||||
options = [
|
||||
"fmask=0077"
|
||||
"dmask=0077"
|
||||
];
|
||||
};
|
||||
|
||||
# Swapfile
|
||||
swapDevices = [
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user