experimental: harbor disko schema
This commit is contained in:
@@ -13,6 +13,8 @@
|
|||||||
url = "github:Mic92/sops-nix";
|
url = "github:Mic92/sops-nix";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
|
disko.url = "github:nix-community/disko";
|
||||||
|
disko.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
plasma-manager = {
|
plasma-manager = {
|
||||||
url = "github:pjones/plasma-manager";
|
url = "github:pjones/plasma-manager";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
@@ -48,6 +50,7 @@
|
|||||||
self,
|
self,
|
||||||
nixpkgs,
|
nixpkgs,
|
||||||
nixpkgs-unstable,
|
nixpkgs-unstable,
|
||||||
|
disko,
|
||||||
nixos-hardware,
|
nixos-hardware,
|
||||||
home-manager,
|
home-manager,
|
||||||
nixos-cosmic,
|
nixos-cosmic,
|
||||||
@@ -120,6 +123,7 @@
|
|||||||
({...}: {nixpkgs.overlays = [overlay-unstable self.overlays.default audio.overlays.default];})
|
({...}: {nixpkgs.overlays = [overlay-unstable self.overlays.default audio.overlays.default];})
|
||||||
({...}: {nixpkgs.config.allowUnfree = true;})
|
({...}: {nixpkgs.config.allowUnfree = true;})
|
||||||
inputs.sops-nix.nixosModules.sops
|
inputs.sops-nix.nixosModules.sops
|
||||||
|
inputs.disko.nixosModules.disko
|
||||||
./modules
|
./modules
|
||||||
./hosts/harbor/configuration.nix
|
./hosts/harbor/configuration.nix
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
}: {
|
}: {
|
||||||
imports = [
|
imports = [
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
|
./disko.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
# Secret management
|
# Secret management
|
||||||
|
|||||||
71
hosts/harbor/disko.nix
Normal file
71
hosts/harbor/disko.nix
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
let
|
||||||
|
btrfsopt = [
|
||||||
|
"compress=zstd"
|
||||||
|
"noatime"
|
||||||
|
"ssd"
|
||||||
|
"space_cache=v2"
|
||||||
|
"user_subvol_rm_allowed"
|
||||||
|
];
|
||||||
|
in {
|
||||||
|
disko.devices = {
|
||||||
|
disk = {
|
||||||
|
main = {
|
||||||
|
type = "disk";
|
||||||
|
device = "/dev/sda";
|
||||||
|
content = {
|
||||||
|
type = "gpt";
|
||||||
|
partitions = {
|
||||||
|
boot = {
|
||||||
|
name = "boot";
|
||||||
|
size = "1M";
|
||||||
|
type = "ef02";
|
||||||
|
};
|
||||||
|
esp = {
|
||||||
|
name = "esp";
|
||||||
|
size = "500M";
|
||||||
|
type = "ef00";
|
||||||
|
content = {
|
||||||
|
type = "filesystem";
|
||||||
|
format = "vfat";
|
||||||
|
mountpoint = "/boot";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
luks = {
|
||||||
|
size = "100%";
|
||||||
|
content = {
|
||||||
|
type = "luks";
|
||||||
|
name = "nixos";
|
||||||
|
passwordFile = "/tmp/pass";
|
||||||
|
additionalKeyFiles = ["/nixos-enc.key"];
|
||||||
|
extraFormatArgs = [
|
||||||
|
"--type luks1"
|
||||||
|
"--iter-time 3000"
|
||||||
|
];
|
||||||
|
settings = {
|
||||||
|
allowDiscards = true;
|
||||||
|
};
|
||||||
|
content = {
|
||||||
|
type = "btrfs";
|
||||||
|
subvolumes = {
|
||||||
|
"@root" = {
|
||||||
|
mountpoint = "/";
|
||||||
|
mountOptions = btrfsopt;
|
||||||
|
};
|
||||||
|
"@home" = {
|
||||||
|
mountpoint = "/home";
|
||||||
|
mountOptions = btrfsopt;
|
||||||
|
};
|
||||||
|
"@nix" = {
|
||||||
|
mountpoint = "/nix";
|
||||||
|
mountOptions = btrfsopt;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user