home/nixos/base.nix

95 lines
2.2 KiB
Nix
Raw Normal View History

2023-10-21 12:56:02 +02:00
{
system, pkgs, nixpkgs-flake, hostname,
2023-10-21 12:56:02 +02:00
use-efi ? false, efi-mountpoint ? "/boot",
use-grub ? false, grub-device ? "/dev/sda",
}:
{
nixpkgs.config.allowUnfree = true; # lol
nix.gc = {
automatic = true;
dates = "03:00";
};
nix.registry = {
templates = {
from = { type = "indirect"; id = "templates"; };
2024-05-17 21:23:26 +02:00
to = { type = "git"; url = "https://githug.xyz/xenchel/templates"; };
};
nixpkgs = {
2024-05-17 21:23:39 +02:00
from = { type = "indirect"; id = "nixpkgs"; };
to = { type = "github"; owner = "nixos"; repo = "nixpkgs"; rev = nixpkgs-flake.rev; };
};
nixpkgs-unstable = {
from = { type = "indirect"; id = "nixpkgs-unstable"; };
to = { type = "github"; owner = "nixos"; repo = "nixpkgs"; ref = "nixos-unstable"; };
2024-05-17 21:23:39 +02:00
};
};
nix.nixPath = [ "nixpkgs=${pkgs.path}" ];
2023-10-21 12:56:02 +02:00
networking.hostName = hostname;
boot.loader = if use-efi
then {
systemd-boot.enable = true;
efi.canTouchEfiVariables = true;
efi.efiSysMountPoint = efi-mountpoint;
} else if use-grub then {
grub.enable = true;
grub.devce = grub-device;
} else throw "Please use either use-efi or use-grub = true";
time.timeZone = "Europe/Stockholm";
services.logind.lidSwitch = "ignore";
services.logind.lidSwitchDocked = "ignore";
services.openssh = {
enable = true;
ports = [ 24 ]; # TODO: Set up honeypot on port 22
settings = {
PasswordAuthentication = false;
PermitRootLogin = "no";
};
};
programs.mosh.enable = true;
# TODO: Options for more users
users.users.coral = { # hi # hi
isNormalUser = true;
extraGroups = [ "wheel" "docker" ];
shell = pkgs.zsh;
};
2024-06-09 20:09:45 +02:00
users.users.guest = {
isNormalUser = true;
extraGroups = [ ];
home = "/home/guest";
shell = pkgs.zsh;
};
2024-06-09 20:24:55 +02:00
security.sudo.wheelNeedsPassword = false;
2023-10-21 12:56:02 +02:00
environment.systemPackages = with pkgs; [
binutils
coreutils
home-manager
2023-10-27 23:57:55 +02:00
git # for home-manager
2023-10-21 12:56:02 +02:00
];
programs.zsh.enable = true;
programs.java = { enable = true; package = pkgs.jdk11; };
virtualisation.docker.enable = true;
nix.settings = {
experimental-features = [ "nix-command" "flakes" ];
auto-optimise-store = true;
};
system.stateVersion = "22.11"; # Did you read the comment?
}