diff options
| author | Kumar Damani <me@kumardamani.net> | 2026-07-01 04:09:21 +0000 |
|---|---|---|
| committer | Kumar Damani <me@kumardamani.net> | 2026-07-01 04:12:25 +0000 |
| commit | 02926f70770ceb90cf382da2b54f888ba969f423 (patch) | |
| tree | 0a7cc1fc1c68ae91ae49070bea5cd3708b875819 /nix/per-host/base | |
| parent | bc1ad567d2eac46088285ed7d2d688fffc91a82f (diff) | |
nix based config
Diffstat (limited to 'nix/per-host/base')
| -rw-r--r-- | nix/per-host/base/configuration.nix | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/nix/per-host/base/configuration.nix b/nix/per-host/base/configuration.nix new file mode 100644 index 0000000..8b34249 --- /dev/null +++ b/nix/per-host/base/configuration.nix @@ -0,0 +1,67 @@ +{ config, pkgs, modulesPath, lib, system, ... }: + +{ + imports = [ + (modulesPath + "/profiles/qemu-guest.nix") + ]; + + config = { + #Provide a default hostname + networking.hostName = lib.mkDefault "base"; + networking.useDHCP = lib.mkDefault true; + + # 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" ]; + + # Some sane packages we need on every system + environment.systemPackages = with pkgs; [ + vim # for emergencies + git # for pulling nix flakes + python3 # for ansible + ]; + + # 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; + + # Add an admin user + users.users.jefe = { + isNormalUser = true; + description = "el jefe"; + extraGroups = [ "networkmanager" "wheel" ]; + }; + users.users.jefe.openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAYYjB+fK4JFlJSY6Ax48p38eSuDG12VQVqP+WSrWGuO" + ]; + + users.users.root.openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAYYjB+fK4JFlJSY6Ax48p38eSuDG12VQVqP+WSrWGuO" + ]; + + # Default filesystem + fileSystems."/" = lib.mkDefault { + device = "/dev/disk/by-label/nixos"; + autoResize = true; + fsType = "ext4"; + }; + + system.stateVersion = lib.mkDefault "25.11"; + }; +} |
