aboutsummaryrefslogtreecommitdiffstats
path: root/system
diff options
context:
space:
mode:
authorene <ene@sils.li>2023-02-04 11:54:55 +0100
committerene <ene@sils.li>2023-02-04 11:55:56 +0100
commit75b442acb64bac70294681ae6d318a470afeac3c (patch)
treef05216df9e251e826188d4e8bfa6024af14078a4 /system
parentFix(packages): Removed already by nixos managed ones (diff)
downloadnixos-config-75b442acb64bac70294681ae6d318a470afeac3c.zip
Feat: Made more configuration host independent
Diffstat (limited to '')
-rw-r--r--system/boot/boot.nix (renamed from hosts/IDOHVE/hardware/boot.nix)4
-rwxr-xr-xsystem/boot/boot_pictures/gnu.png (renamed from hosts/IDOHVE/hardware/boot_pictures/gnu.png)bin327518 -> 327518 bytes
-rwxr-xr-xsystem/boot/boot_pictures/gnulin_emb_1.png (renamed from hosts/IDOHVE/hardware/boot_pictures/gnulin_emb_1.png)bin207444 -> 207444 bytes
-rwxr-xr-xsystem/boot/boot_pictures/gnulin_emb_2.png (renamed from hosts/IDOHVE/hardware/boot_pictures/gnulin_emb_2.png)bin208347 -> 208347 bytes
-rw-r--r--system/filesystemLayouts/filesystemLayouts.nix62
-rw-r--r--system/system.nix6
6 files changed, 66 insertions, 6 deletions
diff --git a/hosts/IDOHVE/hardware/boot.nix b/system/boot/boot.nix
index 4cd94191..629e63ae 100644
--- a/hosts/IDOHVE/hardware/boot.nix
+++ b/system/boot/boot.nix
@@ -7,12 +7,8 @@
initrd = {
compressor = "lz4";
compressorArgs = ["-9"];
-
- # TODO check this:
- availableKernelModules = ["xhci_pci" "nvme" "rtsx_pci_sdmmc"];
};
- kernelModules = ["kvm-amd"];
kernelPackages = pkgs.linuxPackages_latest;
loader = {
grub = {
diff --git a/hosts/IDOHVE/hardware/boot_pictures/gnu.png b/system/boot/boot_pictures/gnu.png
index d07dee3e..d07dee3e 100755
--- a/hosts/IDOHVE/hardware/boot_pictures/gnu.png
+++ b/system/boot/boot_pictures/gnu.png
Binary files differ
diff --git a/hosts/IDOHVE/hardware/boot_pictures/gnulin_emb_1.png b/system/boot/boot_pictures/gnulin_emb_1.png
index 483f2681..483f2681 100755
--- a/hosts/IDOHVE/hardware/boot_pictures/gnulin_emb_1.png
+++ b/system/boot/boot_pictures/gnulin_emb_1.png
Binary files differ
diff --git a/hosts/IDOHVE/hardware/boot_pictures/gnulin_emb_2.png b/system/boot/boot_pictures/gnulin_emb_2.png
index 48cd6ad7..48cd6ad7 100755
--- a/hosts/IDOHVE/hardware/boot_pictures/gnulin_emb_2.png
+++ b/system/boot/boot_pictures/gnulin_emb_2.png
Binary files differ
diff --git a/system/filesystemLayouts/filesystemLayouts.nix b/system/filesystemLayouts/filesystemLayouts.nix
new file mode 100644
index 00000000..2f7c8fc2
--- /dev/null
+++ b/system/filesystemLayouts/filesystemLayouts.nix
@@ -0,0 +1,62 @@
+{
+ config,
+ lib,
+ ...
+}:
+with lib; let
+ cfg = config.system.filesystemLayout;
+in {
+ options = {
+ cfg.enable = mkEnableOption (mdDoc "filesysetemLayout");
+ cfg.mainDisk = mkOption {
+ type = lib.types.path;
+ example = literalExpression "/dev/disk/by-uuid/0442cb6d-f13a-4635-b487-fa76189774c5";
+ description = lib.mdDoc "Path to the main disk";
+ };
+ cfg.efiDisk = mkOption {
+ type = lib.types.path;
+ example = literalExpression "/dev/disk/by-uuid/5143-6136";
+ description = lib.mdDoc "Path to the main disk";
+ };
+ };
+
+ config = mkif cfg.enabled {
+ fileSystems = {
+ "/" = {
+ device = "none";
+ fsType = "tmpfs";
+ options = ["defaults" "size=2G" "mode=755"];
+ };
+ "/nix" = {
+ device = cfg.mainDisk;
+ fsType = "btrfs";
+ options = ["subvol=@nix" "compress-force=zstd:9"];
+ };
+ "/boot" = {
+ device = cfg.efiDisk;
+ fsType = "vfat";
+ };
+
+ "/srv/home" = {
+ device = cfg.mainDisk;
+ fsType = "btrfs";
+ options = ["subvol=@home" "compress-force=zstd:9"];
+ };
+ "/srv/nixos-config" = {
+ device = cfg.mainDisk;
+ fsType = "btrfs";
+ options = ["subvol=@nixos-config" "compress-force=zstd:9"];
+ };
+
+ "/etc/nixos" = {
+ device = "/srv/nix-config";
+ options = ["bind"];
+ };
+ "/home" = {
+ device = "/srv/home";
+ options = ["bind"];
+ };
+ };
+ swapDevices = [];
+ };
+}
diff --git a/system/system.nix b/system/system.nix
index 3a034742..17e78968 100644
--- a/system/system.nix
+++ b/system/system.nix
@@ -1,8 +1,10 @@
{config, ...}: {
imports = [
+ ./boot/boot.nix
+ ./filesystemLayouts/filesystemLayouts.nix
./locale/locale.nix
- ./users/users.nix
- ./sound/sound.nix
./packages/packages.nix
+ ./sound/sound.nix
+ ./users/users.nix
];
}