Minor changes

- Redid the flake module to be based on extendModules instead
- Added wrappers
- Refactored code
- Updated dependencies
This commit is contained in:
Nikodem Rabuliński 2023-08-31 22:27:07 +02:00
parent 9661927410
commit ee7223ca36
No known key found for this signature in database
GPG key ID: FF629AA9E08138DB
19 changed files with 468 additions and 97 deletions

View file

@ -5,26 +5,48 @@
lib,
...
}: {
mappers = {
nixos = module: {
modules = [
inputs.agenix.nixosModules.age
inputs.disko.nixosModules.disko
inputs.mailserver.nixosModules.default
self.nixosModules.settei
{
settei = {
username = "niko";
sane-defaults.enable = true;
flake-qol = {
enable = true;
inherit inputs;
};
};
}
module
];
};
builders = {
nixos = name: module: let
combinedInputs = inputs // {settei = self;};
baseOptions = {
settei.flake-qol = {
enable = true;
inputs = combinedInputs;
};
};
base = inputs.nixpkgs.lib.nixosSystem {
modules = [
inputs.agenix.nixosModules.age
inputs.disko.nixosModules.disko
inputs.mailserver.nixosModules.default
self.nixosModules.settei
baseOptions
];
};
defaultOptions = {
username,
inputs',
lib,
...
}: {
settei = {
username = lib.mkDefault "niko";
sane-defaults.enable = lib.mkDefault true;
};
users.users.${username}.packages = lib.attrValues inputs'.settei.packages;
};
in
base.extendModules {
modules = [
defaultOptions
module
];
specialArgs = {
prev = base;
configurationName = name;
};
};
};
imports = [

View file

@ -10,19 +10,24 @@
username,
...
}: {
_file = ./default.nix;
imports = [
"${modulesPath}/profiles/qemu-guest.nix"
(import ./disks.nix {})
./disks.nix
];
boot = {
supportedFilesystems = ["btrfs"];
loader.systemd-boot.enable = true;
loader.systemd-boot.configurationLimit = 1;
loader.efi.canTouchEfiVariables = true;
};
nixpkgs.system = "aarch64-linux";
users.users.${username}.openssh.authorizedKeys.keys = lib.attrValues config.assets.sshKeys.user;
users.users.${username} = {
openssh.authorizedKeys.keys = lib.attrValues config.assets.sshKeys.user;
};
networking.domain = "hijiri";
networking.hostName = "vm";

View file

@ -1,4 +1,6 @@
{bootDevice ? "/dev/vda", ...}: {
args: let
bootDevice = args.bootDevice or "/dev/vda";
in {
disko.devices.disk.bootDisk = {
type = "disk";
device = bootDevice;
@ -32,7 +34,10 @@
inherit mountOptions;
mountpoint = "/";
};
"/nix" = {inherit mountOptions;};
"/nix" = {
inherit mountOptions;
mountpoint = "/nix";
};
};
};
}

View file

@ -11,7 +11,7 @@
}: {
imports = [
"${modulesPath}/profiles/qemu-guest.nix"
(import ./disks.nix {})
./disks.nix
./conduit.nix
./mail.nix

View file

@ -1,4 +1,6 @@
{bootDevice ? "/dev/sda", ...}: {
args: let
bootDevice = args.bootDevice or "/dev/sda";
in {
disko.devices.disk.bootDisk = {
type = "disk";
device = bootDevice;
@ -32,7 +34,10 @@
inherit mountOptions;
mountpoint = "/";
};
"/nix" = {inherit mountOptions;};
"/nix" = {
inherit mountOptions;
mountpoint = "/nix";
};
};
};
}