nixconf/modules/nixos/core/default.nix

119 lines
2.9 KiB
Nix
Raw Normal View History

2024-01-15 22:30:41 +00:00
{
config,
pkgs,
lib,
...
}:
let
inherit (lib) types;
cfg = config.mtxyz;
in
{
options.mtxyz = {
private = lib.mkOption {
type = types.bool;
default = false;
};
portable = lib.mkOption {
type = types.bool;
default = false;
};
graphical= lib.mkOption {
type = types.bool;
default = true;
};
};
2024-01-15 22:30:41 +00:00
config = {
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
boot.loader.systemd-boot.configurationLimit = 5;
2024-01-15 22:30:41 +00:00
boot.kernelPackages = pkgs.linuxKernel.packages.linux_zen;
2024-01-15 22:30:41 +00:00
environment.systemPackages = with pkgs; [
nvd
nixpkgs-fmt
nix-output-monitor
coreutils mime-types file
usbutils pciutils
gitFull
];
2024-01-15 22:30:41 +00:00
# Set your time zone.
time.timeZone = "US/Eastern";
2024-01-15 22:30:41 +00:00
console = {
font = "Lat2-Terminus16";
useXkbConfig = true; # use xkbOptions in tty.
};
2024-01-15 22:30:41 +00:00
nix = let
users = [ "root" config.mtxyz.user.name ];
in
{
gc = {
automatic = true;
options = "--delete-older-than 30d";
dates = "weekly";
};
2024-01-15 22:30:41 +00:00
settings = {
allowed-users = users;
auto-optimise-store = true;
experimental-features = [ "nix-command" "flakes" ];
http-connections = 50;
keep-derivations = true;
keep-outputs = true;
log-lines = 50;
trusted-users = users;
warn-dirty = false;
};
2024-01-15 22:30:41 +00:00
};
programs.neovim = {
enable = true;
defaultEditor = true;
viAlias = true;
vimAlias = true;
configure = {
packages.myVimPackage = with pkgs.vimPlugins; {
start = [ vim-nix vim-lastplace vim-airline ];
opt = [];
};
customRC = ''
" custom vimrc
set nocompatible
set backspace=indent,eol,start
" Turn on syntax highlighting by default
syntax on
set mouse=a
set number
" ...
'';
};
};
# Run appimages normally
boot.binfmt.registrations.appimage = {
wrapInterpreterInShell = false;
interpreter = "${pkgs.appimage-run}/bin/appimage-run";
recognitionType = "magic";
offset = 0;
mask = ''\xff\xff\xff\xff\x00\x00\x00\x00\xff\xff\xff'';
magicOrExtension = ''\x7fELF....AI\x02'';
};
services.udev.packages = with pkgs; [
android-udev-rules
platformio
];
2024-01-15 22:30:41 +00:00
services.tailscale.enable = lib.mkDefault cfg.private;
services.syncthing.openDefaultPorts = lib.mkDefault cfg.private;
2024-01-15 22:30:41 +00:00
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "22.11"; # Did you read the comment?
};
}