mirror of
https://github.com/oddlama/nix-config.git
synced 2025-10-11 07:10:39 +02:00
wip: remove very specific special args and unify library functions
This commit is contained in:
parent
dfc3084fe9
commit
68bb9731d3
28 changed files with 594 additions and 644 deletions
|
@ -1,17 +1,19 @@
|
|||
{
|
||||
nixos-hardware,
|
||||
inputs,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
nixos-hardware.common-cpu-intel
|
||||
nixos-hardware.common-gpu-intel
|
||||
nixos-hardware.common-pc-laptop
|
||||
nixos-hardware.common-pc-laptop-ssd
|
||||
inputs.nixos-hardware.nixosModules.common-cpu-intel
|
||||
inputs.nixos-hardware.nixosModules.common-gpu-intel
|
||||
inputs.nixos-hardware.nixosModules.common-pc-laptop
|
||||
inputs.nixos-hardware.nixosModules.common-pc-laptop-ssd
|
||||
../../modules/optional/hardware/intel.nix
|
||||
../../modules/optional/hardware/physical.nix
|
||||
|
||||
../../modules
|
||||
#../../modules
|
||||
../../modules/config/lib.nix
|
||||
|
||||
../../modules/optional/boot-efi.nix
|
||||
../../modules/optional/initrd-ssh.nix
|
||||
../../modules/optional/dev
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
extraLib,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
|
@ -10,7 +9,7 @@
|
|||
m2-ssd = {
|
||||
type = "disk";
|
||||
device = "/dev/disk/by-id/${config.repo.secrets.local.disk.m2-ssd}";
|
||||
content = with extraLib.disko.gpt; {
|
||||
content = with config.lib.disko.gpt; {
|
||||
type = "table";
|
||||
format = "gpt";
|
||||
partitions = [
|
||||
|
@ -21,7 +20,7 @@
|
|||
boot-ssd = {
|
||||
type = "disk";
|
||||
device = "/dev/disk/by-id/${config.repo.secrets.local.disk.boot-ssd}";
|
||||
content = with extraLib.disko.gpt; {
|
||||
content = with config.lib.disko.gpt; {
|
||||
type = "table";
|
||||
format = "gpt";
|
||||
partitions = [
|
||||
|
@ -31,25 +30,10 @@
|
|||
};
|
||||
};
|
||||
};
|
||||
zpool = with extraLib.disko.zfs; {
|
||||
zpool = with config.lib.disko.zfs; {
|
||||
rpool = defaultZpoolOptions // {datasets = defaultZfsDatasets;};
|
||||
};
|
||||
};
|
||||
|
||||
# TODO remove once this is upstreamed
|
||||
boot.initrd.systemd.services."zfs-import-rpool".after = ["cryptsetup.target"];
|
||||
fileSystems."/state".neededForBoot = true;
|
||||
fileSystems."/persist".neededForBoot = true;
|
||||
|
||||
# After importing the rpool, rollback the root system to be empty.
|
||||
boot.initrd.systemd.services.impermanence-root = {
|
||||
wantedBy = ["initrd.target"];
|
||||
after = ["zfs-import-rpool.service"];
|
||||
before = ["sysroot.mount"];
|
||||
unitConfig.DefaultDependencies = "no";
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
ExecStart = "${pkgs.zfs}/bin/zfs rollback -r rpool/local/root@blank";
|
||||
};
|
||||
};
|
||||
boot.initrd.luks.devices.enc-rpool.allowDiscards = true;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
{
|
||||
config,
|
||||
extraLib,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
|
@ -9,7 +8,7 @@
|
|||
main = {
|
||||
type = "disk";
|
||||
device = "/dev/disk/by-id/${config.repo.secrets.local.disk.main}";
|
||||
content = with extraLib.disko.gpt; {
|
||||
content = with config.lib.disko.gpt; {
|
||||
type = "table";
|
||||
format = "gpt";
|
||||
partitions = [
|
||||
|
@ -20,27 +19,11 @@
|
|||
};
|
||||
};
|
||||
};
|
||||
zpool = with extraLib.disko.zfs; {
|
||||
zpool = with config.lib.disko.zfs; {
|
||||
rpool = defaultZpoolOptions // {datasets = defaultZfsDatasets;};
|
||||
};
|
||||
};
|
||||
|
||||
boot.loader.grub.devices = ["/dev/disk/by-id/${config.repo.secrets.local.disk.main}"];
|
||||
boot.initrd.luks.devices.enc-rpool.allowDiscards = true;
|
||||
# TODO remove once this is upstreamed
|
||||
boot.initrd.systemd.services."zfs-import-rpool".after = ["cryptsetup.target"];
|
||||
fileSystems."/state".neededForBoot = true;
|
||||
fileSystems."/persist".neededForBoot = true;
|
||||
|
||||
# After importing the rpool, rollback the root system to be empty.
|
||||
boot.initrd.systemd.services.impermanence-root = {
|
||||
wantedBy = ["initrd.target"];
|
||||
after = ["zfs-import-rpool.service"];
|
||||
before = ["sysroot.mount"];
|
||||
unitConfig.DefaultDependencies = "no";
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
ExecStart = "${pkgs.zfs}/bin/zfs rollback -r rpool/local/root@blank";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
inputs,
|
||||
config,
|
||||
nixos-hardware,
|
||||
nodes,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
nixos-hardware.common-cpu-intel
|
||||
nixos-hardware.common-pc-ssd
|
||||
inputs.nixos-hardware.nixosModules.common-cpu-intel
|
||||
inputs.nixos-hardware.nixosModules.common-pc-ssd
|
||||
../../modules/optional/hardware/intel.nix
|
||||
../../modules/optional/hardware/physical.nix
|
||||
|
||||
|
@ -50,6 +50,13 @@
|
|||
enable = true;
|
||||
pool = "rpool";
|
||||
};
|
||||
todo
|
||||
configPath =
|
||||
if nodePath != null && builtins.pathExists (nodePath + "/microvms/${name}") then
|
||||
nodePath + "/microvms/${name}"
|
||||
else if nodePath != null && builtins.pathExists (nodePath + "/microvms/${name}") then
|
||||
nodePath + "/microvms/${name}.nix"
|
||||
else null;
|
||||
};
|
||||
in {
|
||||
kanidm = defaults;
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
extraLib,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
|
@ -10,7 +9,7 @@
|
|||
m2-ssd = {
|
||||
type = "disk";
|
||||
device = "/dev/disk/by-id/${config.repo.secrets.local.disk.m2-ssd}";
|
||||
content = with extraLib.disko.gpt; {
|
||||
content = with config.lib.disko.gpt; {
|
||||
type = "table";
|
||||
format = "gpt";
|
||||
partitions = [
|
||||
|
@ -21,7 +20,7 @@
|
|||
};
|
||||
};
|
||||
};
|
||||
zpool = with extraLib.disko.zfs; {
|
||||
zpool = with config.lib.disko.zfs; {
|
||||
rpool =
|
||||
defaultZpoolOptions
|
||||
// {
|
||||
|
@ -34,20 +33,5 @@
|
|||
};
|
||||
};
|
||||
|
||||
# TODO remove once this is upstreamed
|
||||
boot.initrd.systemd.services."zfs-import-rpool".after = ["cryptsetup.target"];
|
||||
fileSystems."/state".neededForBoot = true;
|
||||
fileSystems."/persist".neededForBoot = true;
|
||||
|
||||
# After importing the rpool, rollback the root system to be empty.
|
||||
boot.initrd.systemd.services.impermanence-root = {
|
||||
wantedBy = ["initrd.target"];
|
||||
after = ["zfs-import-rpool.service"];
|
||||
before = ["sysroot.mount"];
|
||||
unitConfig.DefaultDependencies = "no";
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
ExecStart = "${pkgs.zfs}/bin/zfs rollback -r rpool/local/root@blank";
|
||||
};
|
||||
};
|
||||
boot.initrd.luks.devices.enc-rpool.allowDiscards = true;
|
||||
}
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
nodeName,
|
||||
nodes,
|
||||
utils,
|
||||
...
|
||||
|
@ -123,7 +122,7 @@ in {
|
|||
url = "https://${sentinelCfg.networking.providedDomains.loki}";
|
||||
orgId = 1;
|
||||
basicAuth = true;
|
||||
basicAuthUser = "${nodeName}+grafana-loki-basic-auth-password";
|
||||
basicAuthUser = "${config.repo.node.name}+grafana-loki-basic-auth-password";
|
||||
secureJsonData.basicAuthPassword = "$__file{${config.age.secrets.grafana-loki-basic-auth-password.path}}";
|
||||
}
|
||||
];
|
||||
|
|
|
@ -1,10 +1,4 @@
|
|||
{
|
||||
lib,
|
||||
config,
|
||||
nixos-hardware,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
{lib, ...}: {
|
||||
imports = [
|
||||
../../modules/optional/hardware/odroid-n2plus.nix
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
{
|
||||
# TODO disko
|
||||
fileSystems = {
|
||||
"/" = {
|
||||
device = "rpool/root/nixos";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue