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, ... }:
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 = import ./python-packages.nix;
in
@ -24,6 +20,14 @@ in
./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.opengl.enable = true;
# for rotation sensors
@ -97,9 +101,6 @@ in
# Configure console keymap
console.keyMap = "de";
# Enable CUPS to print documents.
services.printing.enable = true;
################################################
# __ ___ _ _ _ _ _
# \ \ / (_)_ __| |_ _ _ __ _| (_)___ __ _| |_(_) ___ _ __
@ -113,19 +114,6 @@ in
# - 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
virtualisation.waydroid.enable = true;
@ -159,34 +147,14 @@ in
# services.xserver.libinput.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:
# $ nix search wget
environment.systemPackages = (with pkgs; [
(python3.withPackages(python-packages))
conda
virt-manager
distrobox
# Rust toolchain
rustup
libiconv
rust-analyzer
php
php.packages.composer
go
nodejs
@ -239,14 +207,6 @@ in
# Or disable the firewall altogether.
# 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 {
_JAVA_OPTIONS = "-Dawt.useSystemAAFontSettings=lcd";

View File

@ -1,5 +1,6 @@
{
imports = [
./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 = [
./language-server.nix
./dotnet.nix
./docker-rootless.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
./yubikey.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, ... }:
{
fonts = {
enableDefaultFonts = true;
enableDefaultPackages = true;
# extra font packages
fonts = with pkgs; [
packages = with pkgs; [
corefonts
noto-fonts
noto-fonts-cjk

View File

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

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
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.
users.users.servostar = {
isNormalUser = true;
@ -34,6 +22,7 @@
"tty"
"uucp"
"plugdev"
"docker"
];
# use zsh
shell = pkgs.zsh;
@ -65,7 +54,7 @@
figlet
cowsay
cmatrix
exa # FIXME: use stable eza version when available
eza
btop
htop
tmux
@ -191,9 +180,11 @@
'';
enableCompletion = true;
enableAutosuggestions = true;
enableSyntaxHighlighting = true;
syntaxHighlighting = {
enable = true;
};
shellAliases = {
ls = "exa --icons";
ls = "eza --icons";
};
history = {
size = 10000;