Merge pull request #1 from kaesaecracker/configlib

Configlib
This commit is contained in:
Vinzenz Schroeter 2023-09-09 19:40:41 +02:00 committed by GitHub
commit ca2bde7abb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 827 additions and 723 deletions

View file

@ -1,143 +0,0 @@
{
config,
pkgs,
modulesPath,
...
}: {
imports = [
# enable home manager
<home-manager/nixos>
(modulesPath + "/installer/scan/not-detected.nix")
];
nixpkgs.config = {
allowUnfree = true;
permittedInsecurePackages = [
"electron-12.2.3"
];
};
boot.loader = {
systemd-boot.enable = true;
efi.canTouchEfiVariables = true;
};
networking = {
# wireless.enable = true; # Enables wireless support via wpa_supplicant.
# wireless.userControlled.enable = true;
# Enable networking
networkmanager.enable = true;
firewall = {
enable = true;
allowedTCPPortRanges = [
{
# KDE Connect
from = 1714;
to = 1764;
}
];
allowedUDPPortRanges = [
{
# KDE Connect
from = 1714;
to = 1764;
}
];
};
};
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 = {
# Enable the X11 windowing system / wayland depending on DE
enable = true;
# Configure keymap in X11
layout = "de";
xkbVariant = "";
};
# Enable CUPS to print documents.
printing.enable = true;
# Enable the OpenSSH daemon.
openssh = {
enable = true;
settings = {
PermitRootLogin = "no";
PasswordAuthentication = false;
KbdInteractiveAuthentication = false;
};
};
};
systemd.extraConfig = ''
DefaultTimeoutStopSec=7s
'';
# Configure console keymap
console.keyMap = "de";
# Enable sound with pipewire.
sound.enable = true;
hardware.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
};
system = {
stateVersion = "22.11";
autoUpgrade.enable = true; # enable auto updates
};
nix.gc = {
automatic = true;
dates = "00:30";
};
programs = {
git = {
enable = true;
package = pkgs.gitFull;
};
steam = {
enable = true;
remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play
dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server
};
zsh.enable = true;
};
environment = {
pathsToLink = ["/share/zsh"];
systemPackages = with pkgs; [
lm_sensors
tldr
ncdu
];
};
}

View file

@ -1,49 +0,0 @@
{
config,
pkgs,
...
}: {
services = {
xserver = {
# Enable the GNOME Desktop Environment.
displayManager.gdm.enable = true;
desktopManager.gnome.enable = true;
};
gnome = {
tracker-miners.enable = false;
tracker.enable = false;
};
};
environment.systemPackages = [pkgs.gnomeExtensions.gsconnect];
# remove some gnome default apps
environment.gnome.excludePackages = with pkgs.gnome; [
cheese # photo booth
epiphany # web browser
evince # document viewer
geary # email client
seahorse # password manager
gnome-clocks
gnome-maps
gnome-weather
gnome-music
pkgs.gnome-connections
];
home-manager.users = {
vinzenz = {pkgs, ...}: {
home.packages = with pkgs; [
gnome.gpaste
amberol
];
dconf.settings = {
"org/gnome/desktop/peripherals/keyboard" = {
numlock-state = true;
};
};
};
};
}

31
hardware/default.nix Normal file
View file

@ -0,0 +1,31 @@
hostName: {
modulesPath,
lib,
...
}: {
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
(builtins.toString ./. + "/${hostName}.nix")
];
config = {
networking.hostName = hostName;
boot.loader = {
systemd-boot.enable = true;
efi.canTouchEfiVariables = true;
};
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.eno1.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp5s0.useDHCP = lib.mkDefault true;
hardware.enableRedistributableFirmware = true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
};
}

30
hardware/vinzenz-lpt.nix Normal file
View file

@ -0,0 +1,30 @@
{...}: {
config = {
boot = {
initrd.availableKernelModules = ["xhci_pci" "ehci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "sdhci_pci"];
initrd.kernelModules = [];
kernelModules = ["kvm-intel"];
extraModulePackages = [];
loader.efi.efiSysMountPoint = "/boot/efi";
};
fileSystems = {
"/" = {
device = "/dev/disk/by-uuid/34cb86c4-8823-4785-9672-92ef0bcd5eaf";
fsType = "btrfs";
options = ["subvol=@"];
};
"/boot/efi" = {
device = "/dev/disk/by-uuid/2381-1CD2";
fsType = "vfat";
};
};
swapDevices = [
{device = "/dev/disk/by-uuid/f5932f70-60e4-4abe-b23d-2cab3c095c7d";}
];
hardware.cpu.intel.updateMicrocode = true;
};
}

53
hardware/vinzenz-pc2.nix Normal file
View file

@ -0,0 +1,53 @@
{...}: {
config = {
boot = {
initrd.availableKernelModules = ["nvme" "xhci_pci" "ahci" "usbhid" "sd_mod"]; # "usb_storage"
initrd.kernelModules = [];
kernelModules = ["kvm-amd"];
extraModulePackages = [];
loader.efi.efiSysMountPoint = "/boot";
};
fileSystems = {
"/" = {
device = "/dev/disk/by-uuid/0e9c983a-e733-447e-8181-f41d6670c4b8";
fsType = "btrfs";
options = ["subvol=@"];
};
"/home" = {
device = "/dev/disk/by-uuid/0e9c983a-e733-447e-8181-f41d6670c4b8";
fsType = "btrfs";
options = ["subvol=@home"];
};
"/games" = {
device = "/dev/disk/by-uuid/0e9c983a-e733-447e-8181-f41d6670c4b8";
fsType = "btrfs";
options = ["subvol=@games"];
};
"/boot" = {
device = "/dev/disk/by-uuid/AF67-8F16";
fsType = "vfat";
};
"/mnt/nixos_btrfs_root" = {
# subvolume with id 5 is always the root volume
# this is convenient for managing the flat subvolume hierarchy
device = "/dev/disk/by-uuid/0e9c983a-e733-447e-8181-f41d6670c4b8";
fsType = "btrfs";
options = ["subvolid=5"];
};
"/mnt/ssd2" = {
device = "/dev/disk/by-uuid/6b2a647d-c68e-4c07-85bf-c9bfc5db7e8a";
fsType = "ext4";
};
};
swapDevices = [];
hardware.cpu.amd.updateMicrocode = true;
};
}

View file

@ -1,119 +0,0 @@
{
config,
pkgs,
...
}: {
# Define user account
users.users.ronja = {
isNormalUser = true;
description = "Ronja Spiegelberg";
extraGroups = ["networkmanager" "wheel"];
shell = pkgs.zsh;
};
# home manager
home-manager.useUserPackages = true;
home-manager.useGlobalPkgs = true;
home-manager.users.ronja = {
config,
pkgs,
...
}: {
home = {
username = "ronja";
homeDirectory = "/home/ronja";
stateVersion = "22.11";
sessionVariables = {
EDITOR = "nano";
};
packages = with pkgs; [
## Apps
steam
telegram-desktop
powerline
powerline-fonts
lutris
kdiff3
wineWowPackages.stagingFull
wineWowPackages.fonts
winetricks
(lutris.override {
extraPkgs = pkgs: [
# List package dependencies here
];
extraLibraries = pkgs: [
# List library dependencies here
];
})
];
file.".nanorc".text = ''
set linenumbers
set mouse
'';
};
programs = {
home-manager.enable = true;
firefox.enable = true;
command-not-found.enable = true;
dircolors.enable = true;
htop.enable = true;
zsh = {
enable = true;
enableSyntaxHighlighting = true;
enableAutosuggestions = true;
enableVteIntegration = true;
history = {
size = 10000;
path = "${config.xdg.dataHome}/zsh/history";
expireDuplicatesFirst = true;
};
oh-my-zsh = {
enable = true;
theme = "agnoster";
plugins = ["git" "sudo" "systemadmin"];
};
};
git = {
enable = true;
userName = "Ronja Spiegelberg";
userEmail = "ronja.spiegelberg@gmail.com";
extraConfig = {
pull.ff = "only";
init.defaultBranch = "main";
merge.tool = "kdiff3";
};
};
gh = {
enable = true;
enableGitCredentialHelper = true;
};
chromium = {
enable = true;
extensions = [
{
# ublock origin
id = "cjpalhdlnbpafiamejdnhcphjbkeiagm";
}
{
id = "dcpihecpambacapedldabdbpakmachpb";
updateUrl = "https://raw.githubusercontent.com/iamadamdev/bypass-paywalls-chrome/master/updates.xml";
}
];
};
};
};
}

View file

@ -1,233 +0,0 @@
{
config,
pkgs,
...
}: {
# Define user account
users.users.vinzenz = {
isNormalUser = true;
description = "Vinzenz Schroeter";
extraGroups = ["networkmanager" "wheel"];
shell = pkgs.zsh;
};
# home manager
home-manager.useUserPackages = true;
home-manager.useGlobalPkgs = true;
home-manager.users.vinzenz = {
config,
pkgs,
...
}: {
home = {
username = "vinzenz";
homeDirectory = "/home/vinzenz";
stateVersion = "22.11";
sessionVariables = {
EDITOR = "nano";
};
packages = with pkgs; [
keepassxc
steam
insync
telegram-desktop
simple-scan
wireguard-tools
element-desktop
etcher
iotop
radeontop
lsof
wirelesstools
powerline
powerline-fonts
thefuck
dotnet-sdk_7
jetbrains.rider
alejandra
arduino
uucp
screen
jetbrains.pycharm-professional
kdiff3
docker
wineWowPackages.stagingFull
wineWowPackages.fonts
winetricks
(lutris.override {
extraPkgs = pkgs: [
# List package dependencies here
];
extraLibraries = pkgs: [
# List library dependencies here
];
})
];
file.".nanorc".text = ''
set linenumbers
set mouse
'';
};
services = {
kdeconnect = {
enable = true;
indicator = true;
};
};
programs = {
home-manager.enable = true;
firefox.enable = true;
command-not-found.enable = true;
dircolors.enable = true;
fzf.enable = true;
htop.enable = true;
zsh = {
enable = true;
enableSyntaxHighlighting = true;
enableAutosuggestions = true;
enableVteIntegration = true;
initExtra = ''
eval "$(direnv hook zsh)";
eval $(thefuck --alias);
'';
shellAliases = {
my-apply = "sudo nixos-rebuild boot";
my-switch = "sudo nixos-rebuild switch";
my-update = "sudo nixos-rebuild boot --upgrade";
my-fmt = "alejandra .";
};
history = {
size = 10000;
path = "${config.xdg.dataHome}/zsh/history";
expireDuplicatesFirst = true;
};
oh-my-zsh = {
enable = true;
theme = "agnoster";
plugins = ["git" "sudo" "docker" "systemadmin" "thefuck"];
};
};
git = {
enable = true;
userName = "Vinzenz Schroeter";
userEmail = "vinzenz.f.s@gmail.com";
#package = pkgs.gitFull;
#config.credential.helper = "libsecret";
aliases = {
prettylog = "log --pretty=oneline --graph";
};
extraConfig = {
pull.ff = "only";
init.defaultBranch = "main";
merge.tool = "kdiff3";
};
};
gh = {
enable = true;
enableGitCredentialHelper = true;
};
vscode = {
enable = true;
package = pkgs.vscodium;
enableUpdateCheck = false;
extensions = with pkgs; [
vscode-extensions.bbenoist.nix
vscode-extensions.ms-python.python
vscode-extensions.kamadorueda.alejandra
];
userSettings = {
"git.autofetch" = true;
"update.mode" = "none";
"editor.fontFamily" = "'Fira Code', 'Droid Sans Mono', 'monospace', monospace";
"editor.fontLigatures" = true;
"editor.formatOnSave" = true;
"editor.formatOnSaveMode" = "modificationsIfAvailable";
"editor.minimap.autohide" = true;
"diffEditor.diffAlgorithm" = "advanced";
"explorer.excludeGitIgnore" = true;
"workbench.startupEditor" = "readme";
"markdown.extension.tableFormatter.normalizeIndentation" = true;
"markdown.extension.toc.orderedList" = false;
"telemetry.telemetryLevel" = "off";
"redhat.telemetry.enabled" = false;
"workbench.enableExperiments" = false;
};
};
direnv = {
enable = true;
nix-direnv.enable = true;
};
chromium = {
enable = true;
extensions = [
{
# ublock origin
id = "cjpalhdlnbpafiamejdnhcphjbkeiagm";
}
{
id = "dcpihecpambacapedldabdbpakmachpb";
updateUrl = "https://raw.githubusercontent.com/iamadamdev/bypass-paywalls-chrome/master/updates.xml";
}
];
};
bottom = {
enable = true;
settings = {
# https://github.com/ClementTsang/bottom/blob/master/sample_configs/default_config.toml
};
};
exa = {
enable = true;
git = true;
icons = true;
enableAliases = true;
extraOptions = [
"--group-directories-first"
"--header"
];
};
# checked https://rycee.gitlab.io/home-manager/options.html until "programs.jq"
};
editorconfig = {
enable = true;
settings = {
"*" = {
charset = "utf-8";
end_of_line = "lf";
trim_trailing_whitespace = true;
insert_final_newline = true;
max_line_width = 120;
indent_style = "space";
indent_size = 4;
};
"*.nix" = {
indent_size = 2;
};
};
};
};
}

50
kde.nix
View file

@ -1,50 +0,0 @@
{
config,
pkgs,
...
}: {
services = {
# Enable the KDE Plasma Desktop Environment.
xserver = {
desktopManager.plasma5.enable = true;
displayManager = {
sddm.enable = true;
defaultSession = "plasmawayland";
};
};
};
environment.systemPackages = with pkgs; [
libsForQt5.kate
libsForQt5.kalk
];
environment.plasma5.excludePackages = with pkgs.libsForQt5; [
elisa
gwenview
okular
khelpcenter
];
programs = {
dconf.enable = true;
partition-manager.enable = true;
};
home-manager.users.vinzenz = {
config,
pkgs,
...
}: {
home = {
packages = with pkgs; [
];
};
services.kdeconnect = {
enable = true;
indicator = true;
};
};
}

54
modules/default.nix Normal file
View file

@ -0,0 +1,54 @@
{
config,
pkgs,
...
}: let
cfg = config.my;
in {
imports = [
./home
./desktop
./i18n.nix
./nixpkgs.nix
];
config = {
networking = {
networkmanager.enable = true;
firewall.enable = true;
};
# Enable the OpenSSH daemon.
services.openssh = {
enable = true;
settings = {
PermitRootLogin = "no";
PasswordAuthentication = false;
KbdInteractiveAuthentication = false;
};
};
systemd.extraConfig = ''
DefaultTimeoutStopSec=12s
'';
programs = {
zsh.enable = true;
git = {
enable = true;
package = pkgs.gitFull;
};
};
environment = {
pathsToLink = ["/share/zsh"];
systemPackages = with pkgs; [
lm_sensors
tldr
ncdu
];
};
};
}

View file

@ -0,0 +1,64 @@
{
config,
pkgs,
lib,
...
}: let
cfg = config.my.desktop;
in {
imports = [
./gnome.nix
./kde.nix
];
options.my.desktop = {
enable = lib.mkEnableOption "desktop";
};
config = lib.mkIf cfg.enable {
services = {
# Enable the X11 windowing system / wayland depending on DE
xserver.enable = true;
# Enable CUPS to print documents.
printing.enable = true;
};
# Enable sound with pipewire.
sound.enable = true;
hardware.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
};
programs = {
steam = {
enable = true;
remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play
dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server
};
};
# unblock kde connect / gsconnect
networking.firewall = {
allowedTCPPortRanges = [
{
# KDE Connect
from = 1714;
to = 1764;
}
];
allowedUDPPortRanges = [
{
# KDE Connect
from = 1714;
to = 1764;
}
];
};
};
}

63
modules/desktop/gnome.nix Normal file
View file

@ -0,0 +1,63 @@
{
config,
pkgs,
lib,
...
}: let
cfg = config.my.gnome;
#applyGnomeUserSettings = {
# home.packages = with pkgs; [
# gnome.gpaste
# amberol
# ];
# dconf.settings = {
# "org/gnome/desktop/peripherals/keyboard" = {
# numlock-state = true;
# };
# };
#};
in {
options.my.gnome = {
enable = lib.mkEnableOption "gnome desktop";
};
config = lib.mkIf cfg.enable {
my.desktop.enable = true;
services = {
xserver = {
# Enable the GNOME Desktop Environment.
displayManager.gdm.enable = true;
desktopManager.gnome.enable = true;
};
gnome = {
tracker-miners.enable = false;
tracker.enable = false;
};
};
environment.systemPackages = [pkgs.gnomeExtensions.gsconnect];
# remove some gnome default apps
environment.gnome.excludePackages = with pkgs.gnome; [
cheese # photo booth
epiphany # web browser
evince # document viewer
geary # email client
seahorse # password manager
gnome-clocks
gnome-maps
gnome-weather
gnome-music
pkgs.gnome-connections
];
home-manager.users = {
# vinzenz = lib.mkIf config.my.home.vinzenz.enable applyGnomeUserSettings;
# ronja = lib.mkIf config.my.home.ronja.enable applyGnomeUserSettings;
};
};
}

62
modules/desktop/kde.nix Normal file
View file

@ -0,0 +1,62 @@
{
config,
pkgs,
lib,
...
}: let
cfg = config.my.kde;
# applyKdeUserSettings = {
# #home = {
# # packages = with pkgs; [
# # ];
# #};
# services.kdeconnect = {
# enable = true;
# indicator = true;
# };
# };
in {
options.my.kde = {
enable = lib.mkEnableOption "KDE desktop";
};
config = lib.mkIf cfg.enable {
my.desktop.enable = true;
services = {
# Enable the KDE Plasma Desktop Environment.
xserver = {
desktopManager.plasma5.enable = true;
displayManager = {
sddm.enable = true;
defaultSession = "plasmawayland";
};
};
};
environment.systemPackages = with pkgs; [
libsForQt5.kate
libsForQt5.kalk
];
environment.plasma5.excludePackages = with pkgs.libsForQt5; [
elisa
gwenview
okular
khelpcenter
];
programs = {
dconf.enable = true;
partition-manager.enable = true;
};
home-manager.users = {
#vinzenz = lib.mkIf config.my.home.vinzenz.enable applyKdeUserSettings;
#ronja = lib.mkIf config.my.home.ronja.enable applyKdeUserSettings;
};
};
}

24
modules/home/default.nix Normal file
View file

@ -0,0 +1,24 @@
{
config,
pkgs,
lib,
...
}: let
cfg = config.my.home;
in {
imports = [
./vinzenz.nix
./ronja.nix
# enable home manager
<home-manager/nixos>
];
options.my.home = {
enable = lib.mkEnableOption "my home management";
};
config = lib.mkIf cfg.enable {
home-manager.useUserPackages = true;
home-manager.useGlobalPkgs = true;
};
}

128
modules/home/ronja.nix Normal file
View file

@ -0,0 +1,128 @@
{
config,
pkgs,
lib,
...
}:
with lib; let
cfg = config.my.home.ronja;
in {
options.my.home.ronja = {
enable = lib.mkEnableOption "user ronja";
};
config = lib.mkIf cfg.enable {
# Define user account
users.users.ronja = {
isNormalUser = true;
description = "Ronja Spiegelberg";
extraGroups = ["networkmanager" "wheel"];
shell = pkgs.zsh;
};
# home manager
my.home.enable = true;
home-manager.users.ronja = {
config,
pkgs,
...
}: {
home = {
username = "ronja";
homeDirectory = "/home/ronja";
stateVersion = "22.11";
sessionVariables = {
EDITOR = "nano";
};
packages = with pkgs; [
## Apps
steam
telegram-desktop
powerline
powerline-fonts
lutris
kdiff3
wineWowPackages.stagingFull
wineWowPackages.fonts
winetricks
(lutris.override {
extraPkgs = pkgs: [
# List package dependencies here
];
extraLibraries = pkgs: [
# List library dependencies here
];
})
];
file.".nanorc".text = ''
set linenumbers
set mouse
'';
};
programs = {
home-manager.enable = true;
firefox.enable = true;
command-not-found.enable = true;
dircolors.enable = true;
htop.enable = true;
zsh = {
enable = true;
enableSyntaxHighlighting = true;
enableAutosuggestions = true;
enableVteIntegration = true;
history = {
size = 10000;
path = "${config.xdg.dataHome}/zsh/history";
expireDuplicatesFirst = true;
};
oh-my-zsh = {
enable = true;
theme = "agnoster";
plugins = ["git" "sudo" "systemadmin"];
};
};
git = {
enable = true;
userName = "Ronja Spiegelberg";
userEmail = "ronja.spiegelberg@gmail.com";
extraConfig = {
pull.ff = "only";
init.defaultBranch = "main";
merge.tool = "kdiff3";
};
};
gh = {
enable = true;
enableGitCredentialHelper = true;
};
chromium = {
enable = true;
extensions = [
{
# ublock origin
id = "cjpalhdlnbpafiamejdnhcphjbkeiagm";
}
{
id = "dcpihecpambacapedldabdbpakmachpb";
updateUrl = "https://raw.githubusercontent.com/iamadamdev/bypass-paywalls-chrome/master/updates.xml";
}
];
};
};
};
};
}

240
modules/home/vinzenz.nix Normal file
View file

@ -0,0 +1,240 @@
{
config,
pkgs,
lib,
...
}: let
cfg = config.my.home.vinzenz;
in {
options.my.home.vinzenz = {
enable = lib.mkEnableOption "user vinzenz";
};
config = lib.mkIf cfg.enable {
# Define user account
users.users.vinzenz = {
isNormalUser = true;
description = "Vinzenz Schroeter";
extraGroups = ["networkmanager" "wheel"];
shell = pkgs.zsh;
};
# home manager
my.home.enable = true;
home-manager.users.vinzenz = {
config,
pkgs,
...
}: {
home = {
username = "vinzenz";
homeDirectory = "/home/vinzenz";
stateVersion = "22.11";
sessionVariables = {
EDITOR = "nano";
};
packages = with pkgs; [
keepassxc
steam
insync
telegram-desktop
simple-scan
wireguard-tools
element-desktop
etcher
iotop
radeontop
lsof
wirelesstools
powerline
powerline-fonts
thefuck
dotnet-sdk_7
jetbrains.rider
alejandra
arduino
uucp
screen
jetbrains.pycharm-professional
kdiff3
docker
wineWowPackages.stagingFull
wineWowPackages.fonts
winetricks
(lutris.override {
extraPkgs = pkgs: [
# List package dependencies here
];
extraLibraries = pkgs: [
# List library dependencies here
];
})
];
file.".nanorc".text = ''
set linenumbers
set mouse
'';
};
services = {
kdeconnect = {
enable = true;
indicator = true;
};
};
programs = {
home-manager.enable = true;
firefox.enable = true;
command-not-found.enable = true;
dircolors.enable = true;
fzf.enable = true;
htop.enable = true;
zsh = {
enable = true;
enableSyntaxHighlighting = true;
enableAutosuggestions = true;
enableVteIntegration = true;
initExtra = ''
eval "$(direnv hook zsh)";
eval $(thefuck --alias);
'';
shellAliases = {
my-apply = "sudo nixos-rebuild boot";
my-switch = "sudo nixos-rebuild switch";
my-update = "sudo nixos-rebuild boot --upgrade";
my-fmt = "alejandra .";
};
history = {
size = 10000;
path = "${config.xdg.dataHome}/zsh/history";
expireDuplicatesFirst = true;
};
oh-my-zsh = {
enable = true;
theme = "agnoster";
plugins = ["git" "sudo" "docker" "systemadmin" "thefuck"];
};
};
git = {
enable = true;
userName = "Vinzenz Schroeter";
userEmail = "vinzenz.f.s@gmail.com";
aliases = {
prettylog = "log --pretty=oneline --graph";
};
extraConfig = {
pull.ff = "only";
init.defaultBranch = "main";
merge.tool = "kdiff3";
push.autoSetupRemote = "true";
};
};
gh = {
enable = true;
enableGitCredentialHelper = true;
};
vscode = {
enable = true;
package = pkgs.vscodium;
enableUpdateCheck = false;
extensions = with pkgs; [
vscode-extensions.bbenoist.nix
vscode-extensions.ms-python.python
vscode-extensions.kamadorueda.alejandra
];
userSettings = {
"git.autofetch" = true;
"update.mode" = "none";
"editor.fontFamily" = "'Fira Code', 'Droid Sans Mono', 'monospace', monospace";
"editor.fontLigatures" = true;
"editor.formatOnSave" = true;
"editor.formatOnSaveMode" = "modificationsIfAvailable";
"editor.minimap.autohide" = true;
"diffEditor.diffAlgorithm" = "advanced";
"explorer.excludeGitIgnore" = true;
"workbench.startupEditor" = "readme";
"markdown.extension.tableFormatter.normalizeIndentation" = true;
"markdown.extension.toc.orderedList" = false;
"telemetry.telemetryLevel" = "off";
"redhat.telemetry.enabled" = false;
"workbench.enableExperiments" = false;
};
};
direnv = {
enable = true;
nix-direnv.enable = true;
};
chromium = {
enable = true;
extensions = [
{
# ublock origin
id = "cjpalhdlnbpafiamejdnhcphjbkeiagm";
}
{
id = "dcpihecpambacapedldabdbpakmachpb";
updateUrl = "https://raw.githubusercontent.com/iamadamdev/bypass-paywalls-chrome/master/updates.xml";
}
];
};
bottom = {
enable = true;
settings = {
# https://github.com/ClementTsang/bottom/blob/master/sample_configs/default_config.toml
};
};
exa = {
enable = true;
git = true;
icons = true;
enableAliases = true;
extraOptions = [
"--group-directories-first"
"--header"
];
};
# checked https://rycee.gitlab.io/home-manager/options.html until "programs.jq"
};
editorconfig = {
enable = true;
settings = {
"*" = {
charset = "utf-8";
end_of_line = "lf";
trim_trailing_whitespace = true;
insert_final_newline = true;
max_line_width = 120;
indent_style = "space";
indent_size = 4;
};
"*.nix" = {
indent_size = 2;
};
};
};
};
};
}

28
modules/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 = {
# Configure keymap in X11
layout = "de";
xkbVariant = "";
};
# Configure console keymap
console.keyMap = "de";
};
}

21
modules/nixpkgs.nix Normal file
View file

@ -0,0 +1,21 @@
{...}: {
config = {
nixpkgs.config = {
allowUnfree = true;
permittedInsecurePackages = [
"electron-12.2.3"
];
};
system = {
stateVersion = "22.11";
# enable auto updates
autoUpgrade.enable = true;
};
nix.gc = {
automatic = true;
dates = "00:30";
};
};
}

View file

@ -1,53 +1,13 @@
{ {...}: {
config,
lib,
pkgs,
...
}: {
networking.hostName = "vinzenz-lpt";
imports = [ imports = [
./common.nix ./modules
./gnome.nix (import ./hardware "vinzenz-lpt")
./home-vinzenz.nix
]; ];
config = {
my.gnome.enable = true;
my.home.vinzenz.enable = true;
services.flatpak.enable = true; services.flatpak.enable = true;
boot = {
initrd.availableKernelModules = ["xhci_pci" "ehci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "sdhci_pci"];
initrd.kernelModules = [];
kernelModules = ["kvm-intel"];
extraModulePackages = [];
loader.efi.efiSysMountPoint = "/boot/efi";
}; };
fileSystems = {
"/" = {
device = "/dev/disk/by-uuid/34cb86c4-8823-4785-9672-92ef0bcd5eaf";
fsType = "btrfs";
options = ["subvol=@"];
};
"/boot/efi" = {
device = "/dev/disk/by-uuid/2381-1CD2";
fsType = "vfat";
};
};
swapDevices = [
{device = "/dev/disk/by-uuid/f5932f70-60e4-4abe-b23d-2cab3c095c7d";}
];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.eno1.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp3s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.enableRedistributableFirmware = true;
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
} }

22
vinzenz-pc2.nix Normal file
View file

@ -0,0 +1,22 @@
{...}: {
imports = [
./modules
(import ./hardware "vinzenz-pc2")
];
config = {
my.kde.enable = true;
my.home = {
vinzenz.enable = true;
ronja.enable = true;
};
users.groups."games" = {
members = ["vinzenz" "ronja"];
};
users.users.vinzenz.openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINrY6tcgnoC/xbgL7vxSjddEY9MBxRXe9n2cAHt88/TT home roaming"
];
};
}

View file

@ -1,82 +0,0 @@
{
config,
lib,
pkgs,
...
}: {
networking.hostName = "vinzenz-pc3";
imports = [
./common.nix
./kde.nix
./home-vinzenz.nix
./home-ronja.nix
];
users.groups."games" = {
members = ["vinzenz" "ronja"];
};
users.users.vinzenz.openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINrY6tcgnoC/xbgL7vxSjddEY9MBxRXe9n2cAHt88/TT home roaming"
];
boot = {
initrd.availableKernelModules = ["nvme" "xhci_pci" "ahci" "usbhid" "sd_mod"]; # "usb_storage"
initrd.kernelModules = [];
kernelModules = ["kvm-amd"];
extraModulePackages = [];
loader.efi.efiSysMountPoint = "/boot";
};
fileSystems = {
"/" = {
device = "/dev/disk/by-uuid/0e9c983a-e733-447e-8181-f41d6670c4b8";
fsType = "btrfs";
options = ["subvol=@"];
};
"/home" = {
device = "/dev/disk/by-uuid/0e9c983a-e733-447e-8181-f41d6670c4b8";
fsType = "btrfs";
options = ["subvol=@home"];
};
"/games" = {
device = "/dev/disk/by-uuid/0e9c983a-e733-447e-8181-f41d6670c4b8";
fsType = "btrfs";
options = ["subvol=@games"];
};
"/boot" = {
device = "/dev/disk/by-uuid/AF67-8F16";
fsType = "vfat";
};
"/mnt/nixos_btrfs_root" = {
# subvolume with id 5 is always the root volume
# this is convenient for managing the flat subvolume hierarchy
device = "/dev/disk/by-uuid/0e9c983a-e733-447e-8181-f41d6670c4b8";
fsType = "btrfs";
options = ["subvolid=5"];
};
"/mnt/ssd2" = {
device = "/dev/disk/by-uuid/6b2a647d-c68e-4c07-85bf-c9bfc5db7e8a";
fsType = "ext4";
};
};
swapDevices = [];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.eno1.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp5s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}