Re-add variants and reorganize things

This commit is contained in:
Geoffrey Frogeye 2024-02-17 18:39:09 +01:00
parent bf803d18a6
commit 8476bbde12
Signed by: geoffrey
GPG key ID: C72403E7F82E6AD8
18 changed files with 136 additions and 83 deletions

View file

@ -1,10 +1,12 @@
{ id, name, passwordFile ? "/should_not_be_needed_in_this_context", ... }: { pkgs, lib, config, ... }:
let
passwordFile = "/tmp/dotfiles_${config.networking.hostName}_password";
in
{ {
disko.devices = { disko.devices = {
disk = { disk = {
"${name}" = { "${config.networking.hostName}" = {
type = "disk"; type = "disk";
device = "/dev/disk/by-id/${id}";
content = { content = {
type = "gpt"; type = "gpt";
partitions = { partitions = {
@ -25,7 +27,7 @@
size = "100%"; size = "100%";
content = { content = {
type = "luks"; type = "luks";
name = "${name}"; name = "${config.networking.hostName}";
passwordFile = passwordFile; passwordFile = passwordFile;
settings = { settings = {
# Not having SSDs die fast is more important than crypto # Not having SSDs die fast is more important than crypto

12
curacao/default.nix Normal file
View file

@ -0,0 +1,12 @@
{ pkgs, lib, config, ... }:
{
config = {
networking.hostName = "curacao";
};
imports = [
./backup
./disko.nix
./features.nix
./hardware.nix
];
}

View file

@ -1,4 +1,4 @@
{ passwordFile ? "/should_not_be_needed_in_this_context", ... }: { pkgs, lib, config, ... }:
# TODO Find a way to use keys in filesystem # TODO Find a way to use keys in filesystem
# TODO Not relatime everywhere, thank you # TODO Not relatime everywhere, thank you
# TODO Default options # TODO Default options
@ -10,8 +10,10 @@ let
"space_cache" "space_cache"
]; ];
btrfs_args_ssd = btrfs_args_hdd ++ [ "ssd" ]; btrfs_args_ssd = btrfs_args_hdd ++ [ "ssd" ];
passwordFile = "/tmp/dotfiles_${config.networking.hostName}_password";
in in
{ {
boot.loader.efi.efiSysMountPoint = config.disko.devices.disk.razmo.content.partitions.esp.content.mountpoint;
disko.devices = { disko.devices = {
disk = { disk = {
razmo = { razmo = {
@ -32,7 +34,6 @@ in
# hibernation image is saved. That's what I'm doing with Arch, # hibernation image is saved. That's what I'm doing with Arch,
# but I'm setting resume=, should test if it actually works? # but I'm setting resume=, should test if it actually works?
# Untranslated options from /etc/crypttab: swap,cipher=aes-xts-plain64,size=256 # Untranslated options from /etc/crypttab: swap,cipher=aes-xts-plain64,size=256
# Untranslated options from /etc/fstab: defaults,pri=100
}; };
}; };
nixosboot = { nixosboot = {

13
curacao/features.nix Normal file
View file

@ -0,0 +1,13 @@
{ ... }:
{
frogeye = {
desktop = {
xorg = true;
};
dev = {
docker = true;
};
extra = true;
gaming = true;
};
}

View file

@ -10,4 +10,15 @@
# TODO Maybe we could? In case the HDD doesn't boot anymore? # TODO Maybe we could? In case the HDD doesn't boot anymore?
}; };
}; };
frogeye.desktop = {
x11_screens = [ "HDMI-1-0" "eDP-1" ];
maxVideoHeight = 1440;
numlock = true;
phasesBrightness = {
enable = true;
jour = "40000";
crepuscule = "10000";
nuit = "1";
};
};
} }

View file

@ -1,22 +0,0 @@
{ ... }:
{
frogeye = {
desktop = {
xorg = true;
x11_screens = [ "HDMI-1-0" "eDP-1" ];
maxVideoHeight = 1440;
numlock = true;
phasesBrightness = {
enable = true;
jour = "40000";
crepuscule = "10000";
nuit = "1";
};
};
dev = {
docker = true;
};
extra = true;
gaming = true;
};
}

View file

@ -1,16 +0,0 @@
{ pkgs, lib, config, ... }:
{
imports = [
./options.nix
./hardware.nix
./dk.nix
./backup
];
networking.hostName = "curacao";
boot = {
loader = {
efi.efiSysMountPoint = "/efi";
};
};
}

13
curacao/usb.nix Normal file
View file

@ -0,0 +1,13 @@
{ pkgs, lib, config, ... }:
{
config = {
boot.loader.grub.efiInstallAsRemovable = true;
disk."${config.networking.hostName}".device = "/dev/disk/by-id/usb-Kingston_DataTraveler_3.0_E0D55EA57414F510489F0F1A-0:0";
networking.hostName = "curacao-usb";
};
imports = [
../common/disko/single_uefi_btrfs.nix
./features.nix
./hardware.nix
];
}

View file

@ -102,14 +102,28 @@
nixosConfigurations.curacao = lib.nixosSystem { nixosConfigurations.curacao = lib.nixosSystem {
system = "x86_64-linux"; system = "x86_64-linux";
modules = [ modules = [
./curacao/os.nix ./curacao
nixos-hardware.nixosModules.dell-g3-3779
];
};
nixosConfigurations.curacao_usb = lib.nixosSystem {
system = "x86_64-linux";
modules = [
./curacao/usb.nix
nixos-hardware.nixosModules.dell-g3-3779 nixos-hardware.nixosModules.dell-g3-3779
]; ];
}; };
nixosConfigurations.pindakaas = lib.nixosSystem { nixosConfigurations.pindakaas = lib.nixosSystem {
system = "aarch64-linux"; system = "aarch64-linux";
modules = [ modules = [
./pindakaas/os.nix ./pindakaas
nixos-hardware.nixosModules.pine64-pinebook-pro
];
};
nixosConfigurations.pindakaas-sd = lib.nixosSystem {
system = "aarch64-linux";
modules = [
./pindakaas/sd.nix
nixos-hardware.nixosModules.pine64-pinebook-pro nixos-hardware.nixosModules.pine64-pinebook-pro
]; ];
}; };

13
os/boot/default.nix Normal file
View file

@ -0,0 +1,13 @@
{ pkgs, lib, config, ... }:
{
boot.loader = {
efi.canTouchEfiVariables = true;
grub = {
enable = true;
efiSupport = true;
device = "nodev"; # Don't install on MBR
};
};
}

View file

@ -4,6 +4,7 @@
../options.nix ../options.nix
../common/frogarized ../common/frogarized
./battery.nix ./battery.nix
./boot
./ccc ./ccc
./common.nix ./common.nix
./desktop.nix ./desktop.nix

11
pindakaas/default.nix Normal file
View file

@ -0,0 +1,11 @@
{ pkgs, lib, config, ... }:
{
config = {
disk."${config.networking.hostName}".device = "/dev/disk/by-id/mmc-DA4064_0x931f080f";
networking.hostName = "pindakaas";
};
imports = [
./hardware.nix
./features.nix
];
}

View file

@ -1,2 +0,0 @@
{ ... } @ args:
import ../dk/single_uefi_btrfs.nix (args // { id = "mmc-DA4064_0x931f080f"; name = "pindakaas"; })

9
pindakaas/features.nix Normal file
View file

@ -0,0 +1,9 @@
{ pkgs, lib, config, ... }:
{
config = {
frogeye = {
desktop.xorg = true;
extra = true;
};
};
}

View file

@ -6,24 +6,29 @@
# Otherwise it will not show stage1 echo and prompt # Otherwise it will not show stage1 echo and prompt
# UPST # UPST
kernelParams = ["console=tty0"]; kernelParams = [ "console=tty0" ];
# Pinebook supports UEFI, at least when tow-boot is installed on the SPI # Pinebook supports UEFI, at least when tow-boot is installed on the SPI
loader = { loader = {
# EFI Variables don't work (no generation appears in systemd-boot) # EFI Variables don't work (no generation appears in systemd-boot)
efi.canTouchEfiVariables = false; efi.canTouchEfiVariables = false;
grub.efiInstallAsRemovable = true;
};
};
# systemd-boot crashes after booting, so GRUB it is frogeye.desktop = {
grub = { x11_screens = [ "DP-1" "eDP-1" ];
maxVideoHeight = 720;
phasesBrightness = {
enable = true; enable = true;
efiSupport = true; jour = "3500";
efiInstallAsRemovable = true; crepuscule = "3000";
device = "nodev"; nuit = "700";
};
}; };
}; };
zramSwap = { # Not capable of building itself otherwise zramSwap = {
# Not capable of building itself otherwise
enable = true; enable = true;
memoryPercent = 150; # Factory settings memoryPercent = 150; # Factory settings
}; };

View file

@ -1,15 +0,0 @@
{ ... }:
{
frogeye.extra = true;
frogeye.desktop = {
xorg = true;
x11_screens = [ "DP-1" "eDP-1" ];
maxVideoHeight = 720;
phasesBrightness = {
enable = true;
jour = "3500";
crepuscule = "3000";
nuit = "700";
};
};
}

View file

@ -1,10 +0,0 @@
{ ... }:
{
imports = [
./hardware.nix
./dk.nix
./options.nix
];
networking.hostName = "pindakaas";
}

13
pindakaas/sd.nix Normal file
View file

@ -0,0 +1,13 @@
{ pkgs, lib, config, ... }:
{
config = {
boot.loader.grub.efiInstallAsRemovable = true;
disk."${config.networking.hostName}".device = "/dev/disk/by-id/mmc-SN32G_0xfb19ae99";
networking.hostName = "pindakaas-sd";
};
imports = [
../common/disko/single_uefi_btrfs.nix
./features.nix
./hardware.nix
];
}