Add base system config

main
kalle 2024-11-17 21:14:36 +01:00
parent 66d38c26ec
commit 7eaaae3023
3 changed files with 69 additions and 15 deletions

View File

@ -13,7 +13,8 @@
in
{
nixosConfigurations = {
"nix-test" = utils.mkSystem ./systems/nix-test.nix;
"base" = utils.mkSystem [ ];
"nix-test" = utils.mkSystem [ ./systems/nix-test.nix ];
};
};
}

View File

@ -1,14 +1,70 @@
{ ... }:
{
nix.settings = {
# Enable flakes and new 'nix' command
experimental-features = "nix-command flakes";
# Deduplicate and optimize nix store
auto-optimise-store = true;
};
services.openssh.enable = true;
modulesPath,
lib,
pkgs,
...
}:
{
imports = [ (modulesPath + "/profiles/qemu-guest.nix") ];
time.timeZone = "Europe/Amsterdam";
i18n.defaultLocale = "en_US.UTF-8";
config = {
#Provide a default hostname
networking.hostName = lib.mkDefault "base";
# Enable QEMU Guest for Proxmox
services.qemuGuest.enable = lib.mkDefault true;
# Use the boot drive for grub
boot.loader.grub.enable = lib.mkDefault true;
boot.loader.grub.devices = [ "nodev" ];
boot.growPartition = lib.mkDefault true;
# Allow remote updates with flakes and non-root users
nix.settings.trusted-users = [
"root"
"@wheel"
];
nix.settings.experimental-features = [
"nix-command"
"flakes"
];
# Enable mDNS for `hostname.local` addresses
services.avahi.enable = true;
services.avahi.nssmdns = true;
services.avahi.publish = {
enable = true;
addresses = true;
};
# Some sane packages we need on every system
environment.systemPackages = with pkgs; [
vim
git
];
# Don't ask for passwords
security.sudo.wheelNeedsPassword = false;
# Enable ssh
services.openssh = {
enable = true;
settings.PasswordAuthentication = false;
settings.KbdInteractiveAuthentication = false;
};
programs.ssh.startAgent = true;
# Default filesystem
fileSystems."/" = lib.mkDefault {
device = "/dev/disk/by-label/nixos";
autoResize = true;
fsType = "ext4";
};
system.stateVersion = lib.mkDefault "24.05";
};
}

View File

@ -6,15 +6,12 @@
}:
{
mkSystem =
config:
configs:
nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = {
inherit inputs outputs;
};
modules = [
./systems/base.nix
config
];
modules = [ ./systems/base.nix ] ++ configs;
};
}