Move common aspi and kardorf nixos-config to modules

This commit is contained in:
2024-10-09 15:22:18 +02:00
parent c4454d7711
commit 9dfe8aa9f2
14 changed files with 581 additions and 391 deletions

View File

@ -22,54 +22,26 @@
{
imports = [ ./hardware-configuration.nix ];
# nix.buildMachines = [
# {
# hostName = "192.168.3.118";
# system = "x86_64-linux";
# protocol = "ssh";
# # if the builder supports building for multiple architectures,
# # replace the previous line by, e.g.
# # systems = ["x86_64-linux" "aarch64-linux"];
# maxJobs = 4;
# speedFactor = 3;
# supportedFeatures = [
# "nixos-test"
# "benchmark"
# "big-parallel"
# "kvm"
# ];
# mandatoryFeatures = [ ];
# }
# ];
# nix.distributedBuilds = true;
# # optional, useful when the builder has a faster internet connection than yours
# nix.extraOptions = " builders-use-substitutes = true\n";
# Bootloader
modules.system.boot-efi.enable = true;
boot.binfmt.emulatedSystems = [ "aarch64-linux" ];
boot.supportedFilesystems = [
"btrfs"
"ntfs"
"nfs"
"cifs"
];
boot.blacklistedKernelModules = [ "pcspkr" ]; # Disables "beep"
networking.hostName = "aspi";
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
networking.networkmanager.enable = true;
topology.self = {
hardware.info = "ThinkPad L430, 8GB RAM";
};
# Set your time zone.
time.timeZone = "Europe/Berlin";
modules = {
nix-settings.enable = true;
xserver-defaults.enable = true;
keymap.enable = true;
builder.enable = false;
modules.system.boot-efi.enable = true;
sound.enable = true;
locales.enable = true;
# thunar.enable = true;
pcmanfm.enable = true;
@ -80,43 +52,13 @@
# wayland.enable = true;
# hyprland.enable = true;
# tuigreet.enable = true;
};
nix.settings.auto-optimise-store = true;
nix.settings.experimental-features = [
"nix-command"
"flakes"
];
# Setup binary caches
nix.settings = {
substituters = [
"https://nix-community.cachix.org"
"https://cache.nixos.org/"
"https://hyprland.cachix.org"
];
trusted-public-keys = [
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
];
};
hardware.opengl.enable = true;
services.xserver.wacom.enable = true;
services.xserver = {
enable = true;
# Configure keymap in X11
xkb.layout = "de";
xkb.variant = "";
};
nix.gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 30d";
virtualbox.enable = true;
users-julian.enable = true;
syncthing.enable = true;
xdg-portal.enable = true;
polkit.enable = true;
keyring.enable = true;
};
services.blueman.enable = true;
@ -133,83 +75,11 @@
# Enable touchpad support (enabled default in most desktopManager).
services.libinput.enable = true;
# Configure console keymap
console.keyMap = "de";
# or use this
# console.useXkbConfig = true;
security.polkit.enable = true;
systemd = {
user.services.polkit-gnome-authentication-agent-1 = {
description = "polkit-gnome-authentication-agent-1";
wantedBy = [ "graphical-session.target" ];
wants = [ "graphical-session.target" ];
after = [ "graphical-session.target" ];
serviceConfig = {
Type = "simple";
ExecStart = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1";
Restart = "on-failure";
RestartSec = 1;
TimeoutStopSec = 10;
};
};
};
# Sound
sound.enable = true;
hardware.pulseaudio.enable = false;
# needed on aspi for audio to work properly
hardware.enableAllFirmware = true;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
jack.enable = true;
extraConfig.pipewire = {
"99-no-bell" = {
# Disable bell sound
"context.properties" = {
"module.x11.bell" = false;
};
};
};
};
# Define a user account. Don't forget to set a password with passwd.
users.users.julian = {
isNormalUser = true;
description = "Julian";
uid = 1000;
group = "julian";
shell = pkgs.fish;
extraGroups = [
"networkmanager"
"wheel"
"docker"
"audio"
];
};
# home-manager.useGlobalPkgs = true; # make overlays for nixpkgs work for home-manager, not only the system
# home-manager.useUserPackages = true;
programs.fish.enable = true;
programs.nix-ld.enable = true;
users.groups.julian = {
gid = 1000;
};
programs.seahorse.enable = true;
services.gnome.gnome-keyring.enable = true;
# systemd.services."wg-quick@julian".enable = true;
xdg.portal.enable = true;
xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
xdg.portal.config.common.default = "*"; # Use first portal implementation found
# networking.wireguard.enable = true;
# This interface is started on boot / switch
@ -223,45 +93,8 @@
# Enable the OpenSSH daemon.
services.openssh.enable = false;
services.syncthing.enable = true;
services.syncthing.user = "julian";
services.syncthing.openDefaultPorts = true;
services.syncthing.configDir = "/home/julian/.config/syncthing";
# services.syncthing.
#services.syncthing.key = config.sops.secrets."aspi/syncthing/key".path;
#services.syncthing.cert = config.sops.secrets."aspi/syncthing/cert".path;
services.syncthing.overrideDevices = false; # overrides any devices added or deleted through the WebUI
services.syncthing.overrideFolders = false; # overrides any folders added or deleted through the WebUI
# services.syncthing.settings = {
# devices = {
# "pianopi" = {
# id = "FD3XSFW-7LQSCIQ-KHZPLNQ-7VZYGKH-RJ2ZKTJ-BG67NRH-36TQIZM-CXDYWAH";
# };
# };
# folders = {
# "Documents" = {
# # Name of folder in Syncthing, also the folder ID
# path = "/home/myusername/Documents"; # Which folder to add to Syncthing
# devices = [
# "device1"
# "device2"
# ]; # Which devices to share the folder with
# };
# "Example" = {
# path = "/home/myusername/Example";
# devices = [ "device1" ];
# ignorePerms = false; # By default, Syncthing doesn't sync file permissions. This line enables it for this folder.
# };
# };
# };
services.flatpak.enable = true;
xdg.portal.enable = true;
xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
xdg.portal.config.common.default = "*"; # Use first portal implementation found
# hyprland desktop portal added automatically
# services.emacs.enable = true;
# services.gnome.gnome-keyring.enable = true;
@ -285,26 +118,6 @@
virtualisation.docker.enable = true;
virtualisation.virtualbox.host.enable = true;
# virtualisation.virtualbox.host.enableExtensionPack = true;
# virtualisation.virtualbox.guest.enable = true;
# virtualisation.virtualbox.guest.x11 = true;
users.extraGroups.vboxusers.members = [ "julian" ];
# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.
# programs.mtr.enable = true;
# programs.gnupg.agent = {
# enable = true;
# enableSSHSupport = true;
# };
# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
# networking.firewall.enable = false;
# ======================== DO NOT CHANGE THIS ========================
system.stateVersion = "24.05";
# ======================== DO NOT CHANGE THIS ========================