81 lines
2.2 KiB
Nix
81 lines
2.2 KiB
Nix
{ pkgs, lib, modulesPath, config, ... }: {
|
|
imports = [ "${modulesPath}/virtualisation/google-compute-image.nix" ];
|
|
|
|
config = {
|
|
system.stateVersion = "23.11";
|
|
boot.kernel.sysctl."net.ipv4.ip_forward" = true;
|
|
networking.hostName = "trainer-0001";
|
|
|
|
networking.nameservers = [ "8.8.8.8" ];
|
|
|
|
virtualisation.containers.enable = true;
|
|
virtualisation.docker = {
|
|
enable = true;
|
|
autoPrune.enable = true;
|
|
};
|
|
|
|
nix = {
|
|
settings.auto-optimise-store = true;
|
|
extraOptions = ''
|
|
experimental-features = nix-command flakes
|
|
min-free = ${toString (100 * 1024 * 1024)}
|
|
max-free = ${toString (1024 * 1024 * 1024)}
|
|
'';
|
|
gc = {
|
|
automatic = true;
|
|
dates = "weekly";
|
|
options = "--delete-older-than 60d --max-freed $((1024**3))";
|
|
};
|
|
};
|
|
|
|
users.defaultUserShell = pkgs.zsh;
|
|
|
|
users.extraUsers.didier = {
|
|
createHome = true;
|
|
isNormalUser = true;
|
|
home = "/home/didier";
|
|
description = "didier";
|
|
group = "users";
|
|
extraGroups = [ "wheel" ];
|
|
useDefaultShell = true;
|
|
hashedPassword =
|
|
"$6$tFmX1GFwslsmHJ6A$9O7jYzbo6hV2/ed39Y.ynhqoQbsPAiqTW5HR1CvnubWBysaOljPtUHlnqaPbvEkxdjUwuqHwhhvWIvsHsSMmF1";
|
|
openssh.authorizedKeys.keys = [
|
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILtqtELim0nDxVG0j/IJc/ZcWYfFBCay8fVIw/16ieDy didier.amyot@all-dressed-programming.com"
|
|
];
|
|
};
|
|
|
|
environment.systemPackages = with pkgs; [
|
|
vim
|
|
wget
|
|
vim
|
|
git
|
|
htop
|
|
curl
|
|
bat
|
|
ripgrep
|
|
helix
|
|
(pkgs.python312.withPackages (ps: [ps.torch]))
|
|
];
|
|
nixpkgs.config.allowUnfree = true;
|
|
nixpkgs.config.cudaSupport = true;
|
|
|
|
services.openssh.settings.PasswordAuthentication = false;
|
|
|
|
programs.zsh.enable = true;
|
|
services.xserver.videoDrivers = ["nvidia"];
|
|
nix.settings.substituters = [
|
|
"https://cuda-maintainers.cachix.org"
|
|
];
|
|
hardware.nvidia = {
|
|
modesetting.enable = true;
|
|
powerManagement.enable = false;
|
|
powerManagement.finegrained = false;
|
|
open = false;
|
|
nvidiaSettings = true;
|
|
package = config.boot.kernelPackages.nvidiaPackages.stable;
|
|
};
|
|
hardware.graphics.enable = true;
|
|
};
|
|
}
|