refactor: more sane profile structure

This commit is contained in:
Leon Schwarzäugl 2025-01-01 15:59:58 +01:00
parent a73f0e843a
commit 2257a42d38
Signed by: swarsel
GPG key ID: 26A54C31F2A4FD84
123 changed files with 204 additions and 347 deletions

View file

@ -1,89 +0,0 @@
# NOTE: ... is needed because dikso passes diskoFile
{ lib
, pkgs
, disk ? "/dev/vda"
, withSwap ? false
, swapSize
, config
, ...
}:
{
disko.devices = {
disk = {
disk0 = {
type = "disk";
device = disk;
content = {
type = "gpt";
partitions = {
ESP = {
priority = 1;
name = "ESP";
size = "512M";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = [ "defaults" ];
};
};
luks = {
size = "100%";
content = {
type = "luks";
name = "cryptroot";
passwordFile = "/tmp/disko-password"; # this is populated by bootstrap-nixos.sh
settings = {
allowDiscards = true;
# https://github.com/hmajid2301/dotfiles/blob/a0b511c79b11d9b4afe2a5e2b7eedb2af23e288f/systems/x86_64-linux/framework/disks.nix#L36
crypttabExtraOpts = [
"fido2-device=auto"
"token-timeout=10"
];
};
# Subvolumes must set a mountpoint in order to be mounted,
# unless their parent is mounted
content = {
type = "btrfs";
extraArgs = [ "-f" ]; # force overwrite
subvolumes = {
"@root" = {
mountpoint = "/";
mountOptions = [
"compress=zstd"
"noatime"
];
};
"@persist" = {
mountpoint = "${config.hostSpec.persistFolder}";
mountOptions = [
"compress=zstd"
"noatime"
];
};
"@nix" = {
mountpoint = "/nix";
mountOptions = [
"compress=zstd"
"noatime"
];
};
"@swap" = lib.mkIf withSwap {
mountpoint = "/.swapvol";
swap.swapfile.size = "${swapSize}G";
};
};
};
};
};
};
};
};
};
};
environment.systemPackages = [
pkgs.yubikey-manager # For luks fido2 enrollment before full install
];
}

View file

@ -1,8 +0,0 @@
_:
{
services.emacs = {
enable = true;
};
}

View file

@ -1,4 +0,0 @@
_:
{
services.safeeyes.enable = true;
}

View file

@ -4,6 +4,6 @@ let
in
{
imports = [
"${profilesPath}/common/home/settings.nix"
"${profilesPath}/home/common/settings.nix"
];
}

View file

@ -4,7 +4,7 @@ let
in
{
imports = [
"${profilesPath}/common/home/settings.nix"
"${profilesPath}/home/common/settings.nix"
./symlink.nix
];
}

View file

@ -4,14 +4,14 @@ let
in
{
imports = [
"${profilesPath}/common/nixos/settings.nix"
"${profilesPath}/common/nixos/home-manager.nix"
"${profilesPath}/common/nixos/xserver.nix"
"${profilesPath}/common/nixos/gc.nix"
"${profilesPath}/common/nixos/store.nix"
"${profilesPath}/common/nixos/time.nix"
"${profilesPath}/common/nixos/users.nix"
"${profilesPath}/common/nixos/nix-ld.nix"
"${profilesPath}/nixos/common/settings.nix"
"${profilesPath}/nixos/common/home-manager.nix"
"${profilesPath}/nixos/common/xserver.nix"
"${profilesPath}/nixos/common/gc.nix"
"${profilesPath}/nixos/common/store.nix"
"${profilesPath}/nixos/common/time.nix"
"${profilesPath}/nixos/common/users.nix"
"${profilesPath}/nixos/common/nix-ld.nix"
./settings.nix
./packages.nix
./sops.nix

Some files were not shown because too many files have changed in this diff Show more