Refactor modules
Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
@@ -1,12 +1,8 @@
|
||||
{ inputs, ... }:
|
||||
|
||||
let
|
||||
vars = import ../../users/nick/vars.nix;
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
../../configuration.nix
|
||||
../../users/nick/home.nix
|
||||
../../user
|
||||
./configs/pipewire.nix
|
||||
];
|
||||
|
||||
@@ -23,5 +19,7 @@ in
|
||||
};
|
||||
|
||||
systemd.tmpfiles.rules = [ "d /persist/home/ 0755 root root -" ];
|
||||
services.getty.autologinUser = vars.user;
|
||||
|
||||
user.vars = import ../../user/nick.nix;
|
||||
user.autologin = true;
|
||||
}
|
@@ -1,63 +0,0 @@
|
||||
{
|
||||
disko.devices = {
|
||||
disk.main = {
|
||||
type = "disk";
|
||||
content = {
|
||||
type = "gpt";
|
||||
partitions = {
|
||||
boot = {
|
||||
name = "boot";
|
||||
size = "1M";
|
||||
type = "EF02";
|
||||
};
|
||||
esp = {
|
||||
name = "esp";
|
||||
size = "512M";
|
||||
type = "EF00";
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "vfat";
|
||||
mountpoint = "/boot";
|
||||
};
|
||||
};
|
||||
swap = {
|
||||
name = "swap";
|
||||
size = "32G";
|
||||
content = {
|
||||
type = "swap";
|
||||
resumeDevice = true;
|
||||
};
|
||||
};
|
||||
root = {
|
||||
name = "root";
|
||||
size = "100%";
|
||||
content = {
|
||||
name = "luks";
|
||||
type = "luks";
|
||||
settings = {
|
||||
allowDiscards = true;
|
||||
};
|
||||
content = {
|
||||
type = "btrfs";
|
||||
extraArgs = ["-f"];
|
||||
subvolumes = {
|
||||
"/root" = {
|
||||
mountpoint = "/";
|
||||
};
|
||||
"/persist" = {
|
||||
mountpoint = "/persist";
|
||||
mountOptions = ["subvol=persist" "compress=zstd" "noatime"];
|
||||
};
|
||||
"/nix" = {
|
||||
mountpoint = "/nix";
|
||||
mountOptions = ["subvol=nix" "compress=zstd" "noatime"];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
78
hosts/eirene/format.nix
Normal file
78
hosts/eirene/format.nix
Normal file
@@ -0,0 +1,78 @@
|
||||
{ config, lib, ... }:
|
||||
|
||||
let
|
||||
cfg = config.format;
|
||||
in
|
||||
{
|
||||
options.format = {
|
||||
device = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = "The device to format";
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
disko.devices = {
|
||||
disk.main = {
|
||||
type = "disk";
|
||||
device = cfg.device;
|
||||
content = {
|
||||
type = "gpt";
|
||||
partitions = {
|
||||
boot = {
|
||||
name = "boot";
|
||||
size = "1M";
|
||||
type = "EF02";
|
||||
};
|
||||
esp = {
|
||||
name = "esp";
|
||||
size = "512M";
|
||||
type = "EF00";
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "vfat";
|
||||
mountpoint = "/boot";
|
||||
};
|
||||
};
|
||||
swap = {
|
||||
name = "swap";
|
||||
size = "32G";
|
||||
content = {
|
||||
type = "swap";
|
||||
resumeDevice = true;
|
||||
};
|
||||
};
|
||||
root = {
|
||||
name = "root";
|
||||
size = "100%";
|
||||
content = {
|
||||
name = "luks";
|
||||
type = "luks";
|
||||
settings = {
|
||||
allowDiscards = true;
|
||||
};
|
||||
content = {
|
||||
type = "btrfs";
|
||||
extraArgs = ["-f"];
|
||||
subvolumes = {
|
||||
"/root" = {
|
||||
mountpoint = "/";
|
||||
};
|
||||
"/persist" = {
|
||||
mountpoint = "/persist";
|
||||
mountOptions = ["subvol=persist" "compress=zstd" "noatime"];
|
||||
};
|
||||
"/nix" = {
|
||||
mountpoint = "/nix";
|
||||
mountOptions = ["subvol=nix" "compress=zstd" "noatime"];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
@@ -1,22 +0,0 @@
|
||||
let
|
||||
vars = import ../../../users/nick/vars.nix;
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
../configuration.nix
|
||||
../disko.nix
|
||||
./hardware-configuration.nix
|
||||
];
|
||||
|
||||
disko.devices.disk.main.device = "/dev/vda";
|
||||
|
||||
boot.kernelParams = [ "video=Virtual-1:2560x1600@60" ];
|
||||
home-manager.users."${vars.user}".wayland.windowManager.hyprland.settings.monitor = "Virtual-1, 2560x1600@60, 0x0, 1";
|
||||
|
||||
networking.hostName = "eirene-vm";
|
||||
|
||||
fileSystems."/host" = {
|
||||
device = "host";
|
||||
fsType = "virtiofs";
|
||||
};
|
||||
}
|
15
hosts/eirene/vm/default.nix
Normal file
15
hosts/eirene/vm/default.nix
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
imports = [
|
||||
../format.nix
|
||||
./hardware-configuration.nix
|
||||
];
|
||||
|
||||
format.device = "/dev/vda";
|
||||
networking.hostName = "eirene-vm";
|
||||
boot.kernelParams = [ "video=Virtual-1:2560x1600@60" ];
|
||||
|
||||
fileSystems."/host" = {
|
||||
device = "host";
|
||||
fsType = "virtiofs";
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user