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 in
{ {
nixosConfigurations = { 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 = { modulesPath,
# Enable flakes and new 'nix' command lib,
experimental-features = "nix-command flakes"; pkgs,
# Deduplicate and optimize nix store ...
auto-optimise-store = true; }:
}; {
imports = [ (modulesPath + "/profiles/qemu-guest.nix") ];
services.openssh.enable = true;
time.timeZone = "Europe/Amsterdam"; time.timeZone = "Europe/Amsterdam";
i18n.defaultLocale = "en_US.UTF-8"; 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 = mkSystem =
config: configs:
nixpkgs.lib.nixosSystem { nixpkgs.lib.nixosSystem {
system = "x86_64-linux"; system = "x86_64-linux";
specialArgs = { specialArgs = {
inherit inputs outputs; inherit inputs outputs;
}; };
modules = [ modules = [ ./systems/base.nix ] ++ configs;
./systems/base.nix
config
];
}; };
} }