first building version of lpt2 as flake

This commit is contained in:
Vinzenz Schroeter 2024-10-26 00:04:27 +02:00
parent 31e80e7401
commit b71f8ee636
44 changed files with 396 additions and 677 deletions

8
common/default.nix Normal file
View file

@ -0,0 +1,8 @@
{...}: {
imports = [
./nixpkgs.nix
./globalinstalls.nix
./i18n.nix
./networking.nix
];
}

35
common/globalinstalls.nix Normal file
View file

@ -0,0 +1,35 @@
{pkgs, ...}: {
config = {
environment = {
pathsToLink = ["/share/zsh"];
systemPackages = with pkgs; [
ncdu
glances
iotop
pciutils
lsof
dig
screen
tldr
neofetch
];
};
programs = {
zsh.enable = true;
htop.enable = true;
iotop.enable = true;
nano = {
enable = true;
syntaxHighlight = true;
};
git = {
enable = true;
package = pkgs.gitFull;
};
};
};
}

28
common/i18n.nix Normal file
View file

@ -0,0 +1,28 @@
{...}: {
config = {
time.timeZone = "Europe/Berlin";
i18n = {
defaultLocale = "en_US.UTF-8";
extraLocaleSettings = {
LC_ADDRESS = "de_DE.UTF-8";
LC_IDENTIFICATION = "de_DE.UTF-8";
LC_MEASUREMENT = "de_DE.UTF-8";
LC_MONETARY = "de_DE.UTF-8";
LC_NAME = "de_DE.UTF-8";
LC_NUMERIC = "de_DE.UTF-8";
LC_PAPER = "de_DE.UTF-8";
LC_TELEPHONE = "de_DE.UTF-8";
LC_TIME = "de_DE.UTF-8";
};
};
services.xserver.xkb = {
# Configure keymap in X11
layout = "de";
variant = "";
};
# Configure console keymap
console.keyMap = "de";
};
}

23
common/networking.nix Normal file
View file

@ -0,0 +1,23 @@
{...}: {
config = {
services.openssh = {
enable = true;
openFirewall = true;
settings = {
PermitRootLogin = "without-password";
PasswordAuthentication = false;
KbdInteractiveAuthentication = false;
};
};
services.tailscale = {
enable = true;
openFirewall = true;
};
networking.firewall = {
enable = true;
checkReversePath = "loose";
};
};
}

46
common/nixpkgs.nix Normal file
View file

@ -0,0 +1,46 @@
{
config,
lib,
...
}: {
options.my.allowUnfreePackages = lib.mkOption {
type = lib.types.listOf lib.types.str;
default = [];
example = ["steam"];
};
config = {
nixpkgs.config = {
# https://github.com/NixOS/nixpkgs/issues/197325#issuecomment-1579420085
allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) config.my.allowUnfreePackages;
};
nix = {
settings = {
substituters = ["https://nix-community.cachix.org" "https://cache.nixos.org/"];
trusted-public-keys = ["nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="];
};
gc = {
automatic = true;
dates = "daily";
options = "--delete-older-than 7d";
};
};
system = {
stateVersion = "22.11";
# enable auto updates
autoUpgrade = {
enable = true;
dates = "weekly";
};
};
documentation = {
enable = true; # documentation of packages
nixos.enable = false; # nixos documentation
man.enable = true; # manual pages and the man command
info.enable = false; # info pages and the info command
doc.enable = false; # documentation distributed in packages' /share/doc
};
};
}