Compare commits

...

4 Commits

13 changed files with 75 additions and 76 deletions

View File

@ -1,11 +1,7 @@
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help).
{ config, pkgs, lib, ... }: { config, pkgs, lib, ... }:
let let
home-manager = builtins.fetchTarball "https://github.com/nix-community/home-manager/archive/release-23.05.tar.gz"; home-manager = builtins.fetchTarball "https://github.com/nix-community/home-manager/archive/release-23.11.tar.gz";
# python packages to include with python3 # python packages to include with python3
python-packages = import ./python-packages.nix; python-packages = import ./python-packages.nix;
in in
@ -24,6 +20,14 @@ in
./dev ./dev
]; ];
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. It's perfectly fine and recommended to leave
# 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?
hardware.bluetooth.enable = true; hardware.bluetooth.enable = true;
hardware.opengl.enable = true; hardware.opengl.enable = true;
# for rotation sensors # for rotation sensors
@ -97,9 +101,6 @@ in
# Configure console keymap # Configure console keymap
console.keyMap = "de"; console.keyMap = "de";
# Enable CUPS to print documents.
services.printing.enable = true;
################################################ ################################################
# __ ___ _ _ _ _ _ # __ ___ _ _ _ _ _
# \ \ / (_)_ __| |_ _ _ __ _| (_)___ __ _| |_(_) ___ _ __ # \ \ / (_)_ __| |_ _ _ __ _| (_)___ __ _| |_(_) ___ _ __
@ -113,19 +114,6 @@ in
# - Docker # - Docker
################################################ ################################################
# enable rootless docker for more security
virtualisation.docker.rootless = {
enable = true;
setSocketVariable = true;
};
# regulary clean unused docker images
virtualisation.docker.autoPrune.enable = true;
# add user teridax to docker group
users.extraGroups.docker.members = [ "servostar" ];
# KVM
virtualisation.libvirtd.enable = true;
# android container # android container
virtualisation.waydroid.enable = true; virtualisation.waydroid.enable = true;
@ -159,34 +147,14 @@ in
# services.xserver.libinput.enable = true; # services.xserver.libinput.enable = true;
programs.java.enable = true; programs.java.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
};
hardware.opengl.driSupport32Bit = true; # Enables support for 32bit libs that steam uses
# Allow unfree packages
nixpkgs.config.allowUnfree = true;
# List packages installed in system profile. To search, run: # List packages installed in system profile. To search, run:
# $ nix search wget # $ nix search wget
environment.systemPackages = (with pkgs; [ environment.systemPackages = (with pkgs; [
(python3.withPackages(python-packages)) (python3.withPackages(python-packages))
conda
virt-manager
distrobox distrobox
# Rust toolchain
rustup
libiconv
rust-analyzer
php
php.packages.composer
go go
nodejs nodejs
@ -239,14 +207,6 @@ in
# Or disable the firewall altogether. # Or disable the firewall altogether.
# networking.firewall.enable = false; # networking.firewall.enable = false;
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. It's perfectly fine and recommended to leave
# 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.05"; # Did you read the comment?
environment.sessionVariables = rec { environment.sessionVariables = rec {
_JAVA_OPTIONS = "-Dawt.useSystemAAFontSettings=lcd"; _JAVA_OPTIONS = "-Dawt.useSystemAAFontSettings=lcd";

View File

@ -1,5 +1,6 @@
{ {
imports = [ imports = [
./dotnet.nix ./dotnet.nix
./printing.nix
]; ];
} }

13
core/printing.nix Normal file
View File

@ -0,0 +1,13 @@
{ pkgs, config, ... }: {
services.printing.enable = true;
services.avahi.enable = true;
# for a WiFi printer
services.avahi.openFirewall = true;
services.avahi.nssmdns = false; # Use the settings from below
# settings from avahi-daemon.nix where mdns is replaced with mdns4
system.nssModules = pkgs.lib.optional (!config.services.avahi.nssmdns) pkgs.nssmdns;
system.nssDatabases.hosts = with pkgs.lib; optionals (!config.services.avahi.nssmdns) (mkMerge [
(mkBefore [ "mdns4_minimal [NOTFOUND=return]" ]) # before resolve
(mkAfter [ "mdns4" ]) # after dns
]);
}

View File

@ -2,6 +2,8 @@
imports = [ imports = [
./language-server.nix ./language-server.nix
./dotnet.nix ./dotnet.nix
./docker-rootless.nix
./platformio.nix ./platformio.nix
./qemu.nix
]; ];
} }

9
dev/docker-rootless.nix Normal file
View File

@ -0,0 +1,9 @@
{ pkgs, config, ... }: {
# enable rootless docker for more security
virtualisation.docker.rootless = {
enable = true;
setSocketVariable = true;
};
# regulary clean unused docker images
virtualisation.docker.autoPrune.enable = true;
}

6
dev/php.nix Normal file
View File

@ -0,0 +1,6 @@
{ pkgs, config, ... }: {
environment.systemPackages = (with pkgs; [
php
php.packages.composer
])
}

10
dev/qemu.nix Normal file
View File

@ -0,0 +1,10 @@
{ pkgs, config, ... }: {
# KVM
virtualisation.libvirtd.enable = true;
# programs.virt-manager.enable = true; # after 23.11
# only before 23.11
environment.systemPackages = (with pkgs; [
virt-manager
]);
}

View File

@ -4,5 +4,6 @@
./dvd.nix ./dvd.nix
./yubikey.nix ./yubikey.nix
./wireguard.nix ./wireguard.nix
./steam.nix
]; ];
} }

11
extra/steam.nix Normal file
View File

@ -0,0 +1,11 @@
{ pkgs, config, ... }: {
# Allow unfree packages
nixpkgs.config.allowUnfree = 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
};
hardware.opengl.driSupport32Bit = true; # Enables support for 32bit libs that steam uses
}

View File

@ -1,10 +1,10 @@
{ pkgs, ... }: { pkgs, ... }:
{ {
fonts = { fonts = {
enableDefaultFonts = true; enableDefaultPackages = true;
# extra font packages # extra font packages
fonts = with pkgs; [ packages = with pkgs; [
corefonts corefonts
noto-fonts noto-fonts
noto-fonts-cjk noto-fonts-cjk
@ -46,4 +46,4 @@
}; };
}; };
}; };
} }

View File

@ -8,9 +8,6 @@
# Configuration for nix # Configuration for nix
{ config, pkgs, lib, ... }: { config, pkgs, lib, ... }:
let
unstableTarball = fetchTarball https://github.com/NixOS/nixpkgs-channels/archive/nixos-unstable.tar.gz;
in
{ {
# cleanup nix store after every build # cleanup nix store after every build
nix.settings.auto-optimise-store = true; nix.settings.auto-optimise-store = true;
@ -23,12 +20,7 @@ in
options = "--delete-older-than 30d"; options = "--delete-older-than 30d";
}; };
# enable unstable packages
nixpkgs.config = { nixpkgs.config = {
packageOverrides = pkgs: with pkgs; { allowAliases = true;
unstable = import unstableTarball {
config = config.nixpkgs.config;
};
};
}; };
} }

3
template.nix Normal file
View File

@ -0,0 +1,3 @@
{ pkgs, config, ... }: {
# put your nix module in here!
}

View File

@ -9,18 +9,6 @@
# #
# Configuration for user servostar # Configuration for user servostar
services.printing.enable = true;
services.avahi.enable = true;
# for a WiFi printer
services.avahi.openFirewall = true;
services.avahi.nssmdns = false; # Use the settings from below
# settings from avahi-daemon.nix where mdns is replaced with mdns4
system.nssModules = pkgs.lib.optional (!config.services.avahi.nssmdns) pkgs.nssmdns;
system.nssDatabases.hosts = with pkgs.lib; optionals (!config.services.avahi.nssmdns) (mkMerge [
(mkBefore [ "mdns4_minimal [NOTFOUND=return]" ]) # before resolve
(mkAfter [ "mdns4" ]) # after dns
]);
# Define a user account. Don't forget to set a password with passwd. # Define a user account. Don't forget to set a password with passwd.
users.users.servostar = { users.users.servostar = {
isNormalUser = true; isNormalUser = true;
@ -34,6 +22,7 @@
"tty" "tty"
"uucp" "uucp"
"plugdev" "plugdev"
"docker"
]; ];
# use zsh # use zsh
shell = pkgs.zsh; shell = pkgs.zsh;
@ -65,7 +54,7 @@
figlet figlet
cowsay cowsay
cmatrix cmatrix
exa # FIXME: use stable eza version when available eza
btop btop
htop htop
tmux tmux
@ -191,9 +180,11 @@
''; '';
enableCompletion = true; enableCompletion = true;
enableAutosuggestions = true; enableAutosuggestions = true;
enableSyntaxHighlighting = true; syntaxHighlighting = {
enable = true;
};
shellAliases = { shellAliases = {
ls = "exa --icons"; ls = "eza --icons";
}; };
history = { history = {
size = 10000; size = 10000;