Host : Split configs to modules.

This commit is contained in:
Dmitry Voronin 2024-03-29 09:05:08 +03:00
parent e8aa27c9ef
commit 3750ffd4b4
16 changed files with 121 additions and 110 deletions

View file

@ -1,26 +1,7 @@
{ lib, pkgs, ... }: {
{ ... }: {
imports = [
./Filesystem.nix
./Tablet.nix
./Vpn.nix
];
environment.systemPackages = with pkgs; [
networkmanager-l2tp
gnome.networkmanager-l2tp
# networkmanager_strongswan
# strongswan
# strongswanNM
];
# Filesystems.
fileSystems."/storage/hot" = {
device = "/dev/storage/hot";
fsType = "ext4";
options = [ "nofail" ];
};
fileSystems."/storage/cold" = {
device = "/dev/storage/cold";
fsType = "ext4";
options = [ "nofail" ];
};
}

13
host/dasha/Filesystem.nix Normal file
View file

@ -0,0 +1,13 @@
{ ... }: {
fileSystems."/storage/hot" = {
device = "/dev/storage/hot";
fsType = "ext4";
options = [ "nofail" ];
};
fileSystems."/storage/cold" = {
device = "/dev/storage/cold";
fsType = "ext4";
options = [ "nofail" ];
};
}

9
host/dasha/Vpn.nix Normal file
View file

@ -0,0 +1,9 @@
{ ... }: {
environment.systemPackages = with pkgs; [
networkmanager-l2tp
gnome.networkmanager-l2tp
# networkmanager_strongswan
# strongswan
# strongswanNM
];
}

View file

@ -1,22 +1,5 @@
{ config, pkgs, ... }: {
imports = [ ];
# Filesystems.
fileSystems."/storage/hot" = {
device = "/dev/storage/hot";
fsType = "ext4";
options = [ "nofail" ];
};
fileSystems."/storage/cold_1" = {
device = "/dev/storage/cold_1";
fsType = "ext4";
options = [ "noauto" "nofail" ];
};
fileSystems."/storage/cold_2" = {
device = "/dev/storage/cold_2";
fsType = "ext4";
options = [ "noauto" "nofail" ];
};
{ ... }: {
imports = [
./Filesystem.nix
];
}

View file

@ -0,0 +1,19 @@
{ ... }: {
fileSystems."/storage/hot" = {
device = "/dev/storage/hot";
fsType = "ext4";
options = [ "nofail" ];
};
fileSystems."/storage/cold_1" = {
device = "/dev/storage/cold_1";
fsType = "ext4";
options = [ "noauto" "nofail" ];
};
fileSystems."/storage/cold_2" = {
device = "/dev/storage/cold_2";
fsType = "ext4";
options = [ "noauto" "nofail" ];
};
}

View file

@ -1,22 +1,6 @@
{ lib, ... }: {
imports = [ ];
# Grub.
boot.loader.systemd-boot.enable = lib.mkForce false;
boot.loader.efi.canTouchEfiVariables = lib.mkForce false;
boot.loader.grub.enable = true;
boot.loader.grub.device = "/dev/sda";
boot.loader.grub.useOSProber = true;
fileSystems."/" = lib.mkForce {
device = "/dev/sda2";
fsType = "ext4";
};
fileSystems."/boot" = lib.mkForce {
device = "/dev/sda1";
fsType = "vfat";
};
# Root password.
users.users.root.hashedPassword = lib.mkForce "$y$j9T$d4HfwutZr.eNHuLJYRuro/$7swZfgCNS6jEXHFCxsW5um/68jX9BRiiZD1BYcm/gD/";
{ ... }: {
imports = [
./Grub.nix
./Root.nix
];
}

16
host/fsight/Grub.nix Normal file
View file

@ -0,0 +1,16 @@
{ lib, ... }: {
boot.loader.systemd-boot.enable = lib.mkForce false;
boot.loader.efi.canTouchEfiVariables = lib.mkForce false;
boot.loader.grub.enable = true;
boot.loader.grub.device = "/dev/sda";
boot.loader.grub.useOSProber = true;
fileSystems."/" = lib.mkForce {
device = "/dev/sda2";
fsType = "ext4";
};
fileSystems."/boot" = lib.mkForce {
device = "/dev/sda1";
fsType = "vfat";
};
}

3
host/fsight/Root.nix Normal file
View file

@ -0,0 +1,3 @@
{ lib, ... }: {
users.users.root.hashedPassword = lib.mkForce "$y$j9T$d4HfwutZr.eNHuLJYRuro/$7swZfgCNS6jEXHFCxsW5um/68jX9BRiiZD1BYcm/gD/";
}

View file

@ -1,38 +1,10 @@
{ config, pkgs, lib, ... }: {
{ ... }: {
imports = [
./Backup.nix
./Filesystem.nix
./Network.nix
./Nextcloud.nix
./PhotosProcess.nix
./YandexMusic.nix
];
# Network.
networking.networkmanager.insertNameservers = [
"1.1.1.1"
"8.8.8.8"
];
networking.extraHosts = ''
10.1.0.2 git.voronind.com
10.1.0.2 iot.voronind.com
10.1.0.2 pass.voronind.com
'';
# Filesystems.
fileSystems."/storage/cold_1" = {
device = "/dev/storage/cold_1";
fsType = "ext4";
options = [ "nofail" ];
};
fileSystems."/storage/cold_2" = {
device = "/dev/storage/cold_2";
fsType = "ext4";
options = [ "nofail" ];
};
fileSystems."/storage/hot" = {
device = "/dev/storage/hot";
fsType = "ext4";
options = [ "nofail" ];
};
}

19
host/home/Filesystem.nix Normal file
View file

@ -0,0 +1,19 @@
{ ... }: {
fileSystems."/storage/cold_1" = {
device = "/dev/storage/cold_1";
fsType = "ext4";
options = [ "nofail" ];
};
fileSystems."/storage/cold_2" = {
device = "/dev/storage/cold_2";
fsType = "ext4";
options = [ "nofail" ];
};
fileSystems."/storage/hot" = {
device = "/dev/storage/hot";
fsType = "ext4";
options = [ "nofail" ];
};
}

11
host/home/Network.nix Normal file
View file

@ -0,0 +1,11 @@
{ ... }: {
networking.networkmanager.insertNameservers = [
"1.1.1.1"
"8.8.8.8"
];
networking.extraHosts = ''
10.1.0.2 git.voronind.com
10.1.0.2 iot.voronind.com
10.1.0.2 pass.voronind.com
'';
}

View file

@ -1,10 +1,5 @@
{ ... }: {
imports = [ ];
# Filesystems.
fileSystems."/storage/hot" = {
device = "/dev/storage/hot";
fsType = "ext4";
options = [ "nofail" ];
};
imports = [
./Filesystem.nix
];
}

View file

@ -0,0 +1,7 @@
{ ... }: {
fileSystems."/storage/hot" = {
device = "/dev/storage/hot";
fsType = "ext4";
options = [ "nofail" ];
};
}

View file

@ -1,5 +1,3 @@
{ config, pkgs, ... }: {
{ ... }: {
imports = [ ];
environment.systemPackages = with pkgs; [ ];
}

View file

@ -1,8 +1,6 @@
{ config, lib, ... }: {
{ ... }: {
imports = [
./Foot.nix
./Fprint.nix
];
# Foot font override.
environment.variables.FOOT_CONFIG = lib.mkForce ./foot/Foot.ini;
}

3
host/work/Foot.nix Normal file
View file

@ -0,0 +1,3 @@
{ lib, ... }: {
environment.variables.FOOT_CONFIG = lib.mkForce ./foot/Foot.ini;
}