Compare commits

..

8 Commits

14 changed files with 222 additions and 110 deletions

View File

@ -1,17 +1,20 @@
{ config, pkgs, lib, ... }: {
{ config, pkgs, lib, ... }:
let
settings = import ./settings.nix;
in
{
imports = [
# Include the results of the hardware scan.
./hardware-configuration.nix
./nix-settings.nix
./boot.nix
./hardware-configuration.nix # Include the results of the hardware scan.
./nix-settings.nix # nix related config
./users
./.luks-swap.nix
./fonts.nix
./extra
./core
./dev
./games
./hardware
./fonts.nix # system wide font settings
./extra # extra packages
./core # core system components
./dev # development stuff
./games # games
./hardware # hardware specific settings
./system # system components such as kernel
];
# This value determines the NixOS release from which the default
@ -20,21 +23,10 @@
# this value at the release version of the first install of this system.
# 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 = "23.11"; # Did you read the comment?
system.stateVersion = settings.stateVersion; # Did you read the comment?
hardware.opengl.enable = true;
networking.firewall.checkReversePath = false;
networking.hostName = "servostar-nixos-flex"; # Define your hostname.
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
# Configure network proxy if necessary
# networking.proxy.default = "http://user:password@proxy:port/";
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
# Enable networking
networking.networkmanager.enable = true;
# Set your time zone.
time.timeZone = "Europe/Berlin";
@ -63,48 +55,11 @@
# Configure console keymap
console.keyMap = "de";
################################################
# ____ _ _
# | _ \(_)_ __ _____ _(_)_ __ ___
# | |_) | | '_ \ / _ \ \ /\ / / | '__/ _ \
# | __/| | |_) | __/\ V V /| | | | __/
# |_| |_| .__/ \___| \_/\_/ |_|_| \___|
# |_|
################################################
# 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;
# If you want to use JACK applications, uncomment this
#jack.enable = true;
# use the example session manager (no others are packaged yet so this is enabled by default,
# no need to redefine it in your config for now)
#media-session.enable = true;
};
# Enable touchpad support (enabled default in most desktopManager).
# services.xserver.libinput.enable = true;
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = (with pkgs; [
distrobox
go
nodejs
sass
devbox
filelight
ffmpeg-full
openssl
imagemagick
@ -128,27 +83,8 @@
# SCSI driver
sg3_utils
wineWowPackages.stable
winetricks
]);
# 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;
# };
# List services that you want to enable:
# Enable the OpenSSH daemon.
# services.openssh.enable = true;
# Or disable the firewall altogether.
# networking.firewall.enable = false;
environment.sessionVariables = rec {
# rust
CARGO_TERM_COLOR = "always";

View File

@ -23,4 +23,8 @@ in
programs.dconf.enable = settings.plasma5.dconf;
programs.xwayland.enable = settings.plasma5.xwayland;
environment.systemPackages = (with pkgs; [
filelight
])
}

21
dev/arduino.nix Normal file
View File

@ -0,0 +1,21 @@
{ pkgs, lib, config, ... }:
let
settings = import ./../settings.nix;
in
{
config = lib.mkMerge [
# Arduino IDE 1.x
(lib.mkIf (!settings.dev.arduino.ide2) {
environment.systemPackages = (with pkgs; [
arduino
]);
})
# Arduino IDE 2.x
(lib.mkIf settings.dev.arduino.ide2 {
environment.systemPackages = (with pkgs; [
arduino-ide
]);
})
];
}

View File

@ -10,5 +10,7 @@ in
++ lib.optionals settings.dev.latex [ ./latex.nix ]
++ lib.optionals settings.dev.dotnet [ ./dotnet.nix ]
++ lib.optionals settings.dev.python3.enable [ ./python3.nix ]
++ lib.optionals settings.virtualisation.waydroid [ ./waydroid.nix ];
++ lib.optionals settings.virtualisation.waydroid [ ./waydroid.nix ]
++ lib.optionals settings.virtualisation.wine.enable [ ./wine.nix ]
++ lib.optionals settings.dev.arduino.enable [ ./arduino.nix ];
}

31
dev/wine.nix Normal file
View File

@ -0,0 +1,31 @@
{ pkgs, lib, config, ... }:
let
settings = import ./../settings.nix;
in
{
config = lib.mkMerge [
# optionally enable native wine for wayland
(lib.mkIf settings.virtualisation.wine.wayland {
environment.systemPackages = (with pkgs; [
# native wayland support (unstable)
wineWowPackages.waylandFull
]);
})
# if wayland is off, use package for Xorg
(lib.mkIf (!settings.virtualisation.wine.wayland) {
environment.systemPackages = (with pkgs; [
# support both 32- and 64-bit applications
wineWowPackages.stagingFull
]);
})
# winetricks
(lib.mkIf settings.virtualisation.wine.winetricks {
environment.systemPackages = (with pkgs; [
# winetricks (works for all versions of wine)
winetricks
]);
})
];
}

View File

@ -13,6 +13,7 @@ case "$choice" in
cp -rv *.nix /etc/nixos/
cp -rv games /etc/nixos/
cp -rv hardware /etc/nixos/
cp -rv system /etc/nixos/
;;
n|N )
echo "aborting..."

View File

@ -1,4 +1,7 @@
with import <nixpkgs> {}; {
with import <nixpkgs> {};
{
stateVersion = "23.11";
hardware = {
# support for GPUs
amdgpu = true;
@ -42,6 +45,11 @@ with import <nixpkgs> {}; {
virt-manager = true;
};
waydroid = false;
wine = {
enable = true;
wayland = false;
winetricks = true;
};
};
dev = {
platformio = true;
@ -62,7 +70,10 @@ with import <nixpkgs> {}; {
scipy
];
};
arduino = {
enable = false; # enable arduino development platform
ide2 = true; # wether to use IDE 2.x or deprecated 1.x
};
lsp = {
enable = true;
# various language server
@ -92,10 +103,23 @@ with import <nixpkgs> {}; {
networking = {
wireguard = true; # enable wireguard protocol
hostname = "servostar-nixos-desktop";
};
games = {
prismlauncher = true;
steam = true;
};
sound = {
pipewire = {
enable = true;
alsa = true;
pulse = true;
jack = true;
};
pulseaudio = {
enable = false;
};
};
}

12
system/default.nix Normal file
View File

@ -0,0 +1,12 @@
{ lib, ... }:
let
settings = import ./../settings.nix;
in
{
imports = [
./grub.nix
./kernel.nix
./networking.nix
] ++ lib.optionals settings.sound.pipewire.enable [ ./pipewire.nix ]
++ lib.optionals settings.sound.pulseaudio.enable [ ./pulseaudio.nix ];
}

View File

@ -27,21 +27,6 @@
};
};
boot.kernelPackages = pkgs.linuxPackages_latest;
# extra enabled kernel modules
boot.kernelModules = [
"sg" # for generic SCSI devices such as /dev/sg0
];
# Kernel parameter on boot
boot.kernelParams = [
"quiet"
"splash"
"psi=1"
"boot_delay=0"
];
# Setup keyfile
boot.initrd.secrets = {
"/crypto_keyfile.bin" = null;

20
system/kernel.nix Normal file
View File

@ -0,0 +1,20 @@
{ pkgs, ... }:
{
boot.kernelPackages = pkgs.linuxPackages_latest;
# extra enabled kernel modules
boot.kernelModules = [
"sg" # for generic SCSI devices such as /dev/sg0
];
boot.consoleLogLevel = 0;
# Kernel parameter on boot
boot.kernelParams = [
"quiet"
"udev.log_level=3"
"splash"
"psi=1"
"boot_delay=0"
];
}

15
system/networking.nix Normal file
View File

@ -0,0 +1,15 @@
{ pkgs, lib, ... }:
let
settings = import ./../settings.nix;
in
{
networking.firewall.checkReversePath = false;
networking.hostName = settings.networking.hostname; # Define your hostname.
# Configure network proxy if necessary
# networking.proxy.default = "http://user:password@proxy:port/";
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
# Enable networking
networking.networkmanager.enable = true;
}

22
system/pipewire.nix Normal file
View File

@ -0,0 +1,22 @@
{ pkgs, lib, ... }:
let
settings = import ./../settings.nix;
in
{
# Remove sound.enable or set it to false if you had it set previously, as sound.enable is only meant for ALSA-based configurations
sound.enable = false;
# rtkit is optional but recommended
security.rtkit.enable = true;
services.pipewire = {
enable = settings.sound.pipewire.enable;
audio.enable = settings.sound.pipewire.enable;
pulse.enable = settings.sound.pipewire.pulse;
jack.enable = settings.sound.pipewire.jack;
alsa = {
enable = settings.sound.pipewire.alsa;
support32Bit = true;
};
};
}

8
system/pulseaudio.nix Normal file
View File

@ -0,0 +1,8 @@
{ pkgs, lib, ... }:
let
settings = import ./../settings.nix;
in
{
hardware.pulseaudio.enable = true;
hardware.pulseaudio.support32Bit = true; ## If compatibility with 32-bit applications is desired.
}

View File

@ -9,6 +9,8 @@
#
# Configuration for user servostar
programs.zsh.enable = true;
# Define a user account. Don't forget to set a password with passwd.
users.users.servostar = {
isNormalUser = true;
@ -24,8 +26,8 @@
"plugdev"
"docker"
];
# use fish
shell = pkgs.fish;
shell = pkgs.zsh;
# ------------------------------------------------------
# user packages
@ -107,6 +109,10 @@
xournalpp
jetbrains-toolbox
chroma # general purpose syntax highlighter (for ohmyzsh/colorize)
fzf
thefuck
];
};
@ -184,9 +190,34 @@
];
};
programs.zsh = {
enable = true;
shellAliases = { };
oh-my-zsh = {
enable = true;
plugins = [
"git"
"thefuck"
"colored-man-pages"
"colorize"
"command-not-found"
"docker"
"docker-compose"
"fzf"
];
theme = "robbyrussell";
};
enableAutosuggestions = true;
syntaxHighlighting = {
enable = true;
};
autocd = true;
defaultKeymap = "emacs";
};
programs.starship = {
enable = true;
enableFishIntegration = true;
enableZshIntegration = true;
};
programs.eza = {