structure and add like MatthiasBenaets

This commit is contained in:
Kabbone 2022-09-17 16:50:50 +02:00
parent 4065bc1e26
commit e454d95a99
Signed by: Kabbone
SSH Key Fingerprint: SHA256:iDfA/JbfNCsPT5EOvS1y+ZKaiXstaTWgm/6oQPn6LYg
30 changed files with 1791 additions and 229 deletions

View File

@ -1,198 +0,0 @@
# 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, ... }:
let
user = "kabbone";
in
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
];
# Use the systemd-boot EFI boot loader.
boot = {
kernelPackages = pkgs.linuxPackages_latest;
loader = {
systemd-boot.enable = true;
efi.canTouchEfiVariables = true;
};
};
# networking.hostName = "nixos"; # Define your hostname.
# Pick only one of the below networking options.
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
# networking.networkmanager.enable = true; # Easiest to use and most distros use this by default.
networking = {
interfaces = {
enp6s18 = {
useDHCP = true;
};
};
};
# Set your time zone.
time.timeZone = "Europe/Berlin";
# Configure network proxy if necessary
# networking.proxy.default = "http://user:password@proxy:port/";
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
# Select internationalisation properties.
i18n.defaultLocale = "en_US.UTF-8";
i18n.extraLocaleSettings = {
LC_TIME = "de_DE.UTF-8";
LC_MONETARY = "de_DE.UTF-8";
};
console = {
font = "Lat2-Terminus16";
keyMap = "us";
};
# Enable the X11 windowing system.
services.xserver.enable = true;
# Enable the GNOME Desktop Environment.
services.xserver.displayManager.gdm.enable = true;
services.xserver.desktopManager.gnome.enable = true;
# Configure keymap in X11
services.xserver.layout = "us";
services.xserver.xkbOptions = "eurosign:e";
# Enable CUPS to print documents.
# services.printing.enable = true;
# Enable sound.
sound = {
enable = true;
mediaKeys.enable = true;
};
hardware = {
pulseaudio = {
enable = true;
package = pkgs.pulseaudioFull;
extraConfig = ''
load-module module-switch-on-connect
'';
};
bluetooth = {
enable = true;
hsphfpd.enable = true;
settings = {
General = {
Enable = "Source,Sink,Media,Socket";
};
};
};
};
# Enable touchpad support (enabled default in most desktopManager).
services.xserver.libinput = {
enable = true;
touchpad = {
tapping = true;
naturalScrolling = true;
};
};
# Define a user account. Don't forget to set a password with passwd.
users.users.kabbone = {
isNormalUser = true;
extraGroups = [ "wheel" "video" "audio" "lp" ]; # Enable sudo for the user.
uid = 2000;
shell = pkgs.zsh;
initialPassword = "passwort95";
# packages = with pkgs; [
# firefox
# thunderbird
# ];
};
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [
vim
wget
git
alacritty
# firefox
];
nixpkgs.config.allowUnfree = true;
nixpkgs.overlays = [
(self: super: {
discord = super.discord.overrideAttrs (
_: { src = builtins.fetchTarball {
url = "https://discord.com/api/download?platform=linux&format=tar.gz";
sha256 = "0000000000000000000000000000000000000000000000000000";
}; }
);
})
];
# 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;
# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
# networking.firewall.enable = false;
# Copy the NixOS configuration file and link it from the resulting system
# (/run/current-system/configuration.nix). This is useful in case you
# accidentally delete configuration.nix.
# system.copySystemConfiguration = true;
system.autoUpgrade = {
enable = true;
channel = "https://nixos.org/channel/nixos-unstable";
};
nix = {
settings.auto-optimise-store = true;
gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 7d";
};
};
# home-manager.users.${user} = { pkgs, ... }: {
# home.packages = with pkgs; [ htop ];
# home.stateVersion = "22.05";
# };
nix = {
package = pkgs.nixFlakes;
extraOptions = "experimental-features = nix-command flakes";
};
# 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. Its 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 = "22.05"; # Did you read the comment?
}

View File

@ -1,40 +1,43 @@
# My first run with nix. The config is based on Matthias Benaets config and youtube tutorial
# https://github.com/MatthiasBenaets/nixos-config
# https://www.youtube.com/watch?v=AGVXJ-TIv3Y
#
# flake.nix *
# ├─ ./hosts
# │ └─ default.nix
{
description = "A very basic flake";
description = "Kabbone's peronal NixOS Flake config";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
home-manager = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; # Nix Packages
home-manager = { # User Package Management
url = github:nix-community/home-manager;
inputs.nixpkgs.follows = "nixpkgs";
};
nur = {
url = "github:nix-community/NUR"; # NUR Packages
};
hyprland = { # Official Hyprland flake
url = "github:vaxerski/Hyprland";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, home-manager }:
let
system = "x86_64-linux";
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
};
lib = nixpkgs.lib;
in {
nixosConfigurations = {
kabbone = lib.nixosSystem {
inherit system;
modules = [
./configuration.nix
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.kabbone = import ./home.nix;
# Optionally, use home-manager.extraSpecialArgs to pass
# arguments to home.nix
}
];
};
};
};
outputs = { self, nixpkgs, home-manager, nur, hyperland, ... }:
let Variables that can be used in the config files
user = "kabbone";
location = "$HOME/.setup";
in # Use above variables in ...
{
nixosConfigurations = ( # NixOS configuration
import ./hosts { # Imports ./hosts/default.nix
inherit (nixpkgs) lib;
inherit inputs nixpkgs home-manager nur user location hyprland; # Also inherit home-manager so it does not need to be defined here.
}
);
};
}

147
hosts/configuration.nix Normal file
View File

@ -0,0 +1,147 @@
#
# Main system configuration. More information available in configuration.nix(5) man page.
#
# flake.nix
# ├─ ./hosts
# │ └─ configuration.nix *
# └─ ./modules
# └─ ./editors
# └─ ./nvim
# └─ default.nix
#
{ config, lib, pkgs, inputs, user, location, ... }:
{
imports = # Import window or display manager.
[
#../modules/editors/nvim # ! Comment this out on first install !
];
users.users.${user} = { # System User
isNormalUser = true;
extraGroups = [ "wheel" "video" "audio" "camera" "networkmanager" "lp" "scanner" "kvm" "libvirtd" ];
shell = pkgs.zsh; # Default shell
};
#security.sudo.wheelNeedsPassword = true; # User does not need to give password when using sudo.
time.timeZone = "Europe/Berlin"; # Time zone and internationalisation
i18n = {
defaultLocale = "en_US.UTF-8";
extraLocaleSettings = { # Extra locale settings that need to be overwritten
LC_TIME = "de_DE.UTF-8";
LC_MONETARY = "de_DE.UTF-8";
};
};
console = {
font = "Lat2-Terminus16";
keyMap = "us"; # or us/azerty/etc
};
security.rtkit.enable = true;
sound = { # ALSA sound enable
enable = true;
mediaKeys = { # Keyboard Media Keys (for minimal desktop)
enable = true;
};
};
fonts.fonts = with pkgs; [ # Fonts
carlito # NixOS
vegur # NixOS
source-code-pro
jetbrains-mono
font-awesome # Icons
corefonts # MS
(nerdfonts.override { # Nerdfont Icons override
fonts = [
"FiraCode"
];
})
];
environment = {
variables = {
TERMINAL = "alacritty";
EDITOR = "nvim";
VISUAL = "nvim";
};
systemPackages = with pkgs; [ # Default packages install system-wide
vim
git
killall
pciutils
usbutils
wget
];
};
services = {
pipewire = { # Sound
enable = true;
#alsa = {
# enable = true;
# support32Bit = true;
#};
pulse.enable = true;
};
openssh = { # SSH: secure shell (remote connection to shell of server)
enable = true; # local: $ ssh <user>@<ip>
# public:
# - port forward 22 TCP to server
# - in case you want to use the domain name insted of the ip:
# - for me, via cloudflare, create an A record with name "ssh" to the correct ip without proxy
# - connect via ssh <user>@<ip or ssh.domain>
# generating a key:
# - $ ssh-keygen | ssh-copy-id <ip/domain> | ssh-add
# - if ssh-add does not work: $ eval `ssh-agent -s`
allowSFTP = true; # SFTP: secure file transfer protocol (send file to server)
# connect: $ sftp <user>@<ip/domain>
# commands:
# - lpwd & pwd = print (local) parent working directory
# - put/get <filename> = send or receive file
extraConfig = ''
HostKeyAlgorithms +ssh-rsa
''; # Temporary extra config so ssh will work in guacamole
};
#flatpak.enable = true; # download flatpak file from website - sudo flatpak install <path> - reboot if not showing up
# sudo flatpak uninstall --delete-data <app-id> (> flatpak list --app) - flatpak uninstall --unused
# List:
# com.obsproject.Studio
# com.parsecgaming.parsec
# com.usebottles.bottles
};
#xdg.portal = { # Required for flatpak
# enable = true;
# extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
#};
nix = { # Nix Package Manager settings
settings ={
auto-optimise-store = true; # Optimise syslinks
};
gc = { # Automatic garbage collection
automatic = true;
dates = "weekly";
options = "--delete-older-than 7d";
};
package = pkgs.nixFlakes; # Enable nixFlakes on system
registry.nixpkgs.flake = inputs.nixpkgs;
extraOptions = ''
experimental-features = nix-command flakes
keep-outputs = true
keep-derivations = true
'';
};
nixpkgs.config.allowUnfree = true; # Allow proprietary software.
system = { # NixOS settings
autoUpgrade = { # Allow auto update
enable = true;
channel = "https://nixos.org/channels/nixos-unstable";
};
stateVersion = "22.05";
};
}

83
hosts/default.nix Normal file
View File

@ -0,0 +1,83 @@
#
# These are the different profiles that can be used when building NixOS.
#
# flake.nix
# └─ ./hosts
# ├─ default.nix *
# ├─ configuration.nix
# ├─ home.nix
# └─ ./desktop OR ./laptop OR ./vm
# ├─ ./default.nix
# └─ ./home.nix
#
{ lib, inputs, nixpkgs, home-manager, nur, user, location, hyprland, ... }:
let
system = "x86_64-linux"; # System architecture
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true; # Allow proprietary software
};
lib = nixpkgs.lib;
in
{
desktop = lib.nixosSystem { # Desktop profile
inherit system;
specialArgs = { inherit inputs user location; }; # Pass flake variable
modules = [ # Modules that are used.
nur.nixosModules.nur
hyprland.nixosModules.default
./desktop
./configuration.nix
home-manager.nixosModules.home-manager { # Home-Manager module that is used.
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.extraSpecialArgs = { inherit user; }; # Pass flake variable
home-manager.users.${user} = {
imports = [(import ./home.nix)] ++ [(import ./desktop/home.nix)];
};
}
];
};
laptop = lib.nixosSystem { # Laptop profile
inherit system;
specialArgs = { inherit inputs user location hyprland; };
modules = [
hyprland.nixosModules.default
./laptop
./configuration.nix
home-manager.nixosModules.home-manager {
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.extraSpecialArgs = { inherit user; };
home-manager.users.${user} = {
imports = [(import ./home.nix)] ++ [(import ./laptop/home.nix)];
};
}
];
};
vm = lib.nixosSystem { # VM profile
inherit system;
specialArgs = { inherit inputs user location; };
modules = [
./vm
./configuration.nix
home-manager.nixosModules.home-manager {
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.extraSpecialArgs = { inherit user; };
home-manager.users.${user} = {
imports = [(import ./home.nix)] ++ [(import ./vm/home.nix)];
};
}
];
};
}

155
hosts/home.nix Normal file
View File

@ -0,0 +1,155 @@
#
# General Home-manager configuration
#
# flake.nix
# ├─ ./hosts
# │ └─ home.nix *
# └─ ./modules
# ├─ ./editors
# │ └─ default.nix
# ├─ ./programs
# │ └─ default.nix
# ├─ ./services
# │ └─ default.nix
# └─ ./shell
# └─ default.nix
#
{ config, lib, pkgs, user, ... }:
{
imports = # Home Manager Modules
(import ../modules/editors) ++
(import ../modules/programs) ++
(import ../modules/services) ++
(import ../modules/shell);
home = {
username = "${user}";
homeDirectory = "/home/${user}";
packages = with pkgs; [
# Terminal
btop # Resource Manager
pfetch # Minimal fetch
ranger # File Manager
# Video/Audio
feh # Image Viewer
mpv # Media Player
pavucontrol # Audio control
stremio # Media Streamer
# Apps
firefox # Browser
google-chrome # Browser
remmina # XRDP & VNC Client
# File Management
okular # PDF viewer
gnome.file-roller # Archive Manager
pcmanfm # File Manager
rsync # Syncer $ rsync -r dir1/ dir2/
unzip # Zip files
unrar # Rar files
# General configuration
#git # Repositories
#killall # Stop Applications
#nano # Text Editor
#pciutils # Computer utility info
#pipewire # Sound
#usbutils # USB utility info
#wacomtablet # Wacom Tablet
#wget # Downloader
#zsh # Shell
#
# General home-manager
#alacritty # Terminal Emulator
#dunst # Notifications
#doom emacs # Text Editor
#flameshot # Screenshot
#libnotify # Dep for Dunst
neovim # Text Editor
#rofi # Menu
#udiskie # Auto Mounting
#vim # Text Editor
#
# Xorg configuration
#xclip # Console Clipboard
#xorg.xev # Input viewer
#xorg.xkill # Kill Applications
#xorg.xrandr # Screen settings
#xterm # Terminal
#
# Xorg home-manager
#picom # Compositer
#polybar # Bar
#sxhkd # Shortcuts
#
# Wayland configuration
autotiling # Tiling Script
swayidle # Idle Management Daemon
#wev # Input viewer
wl-clipboard # Console Clipboard
#
# Wayland home-manager
pamixer # Pulse Audio Mixer
swaylock-fancy # Screen Locker
waybar # Bar
#
# Desktop
blueman # Bluetooth
#deluge # Torrents
#discord # Chat
ffmpeg # Video Support (dslr)
#gmtp # Mount MTP (GoPro)
#gphoto2 # Digital Photography
#handbrake # Encoder
#heroic # Game Launcher
#hugo # Static Website Builder
#lutris # Game Launcher
#mkvtoolnix # Matroska Tool
#new-lg4ff # Logitech Drivers
#plex-media-player# Media Player
#polymc # MC Launcher
#steam # Games
#simple-scan # Scanning
#
# Laptop
blueman # Bluetooth
#light # Display Brightness
libreoffice # Office Tools
#simple-scan # Scanning
#
# Flatpak
#obs-studio # Recording/Live Streaming
];
file.".config/wall".source = ../modules/themes/wall.jpg;
pointerCursor = { # This will set cursor systemwide so applications can not choose their own
name = "Dracula-cursors";
package = pkgs.dracula-theme;
size = 16;
};
stateVersion = "22.05";
};
programs = {
home-manager.enable = true;
};
gtk = { # Theming
enable = true;
theme = {
name = "Dracula";
package = pkgs.dracula-theme;
};
iconTheme = {
name = "Papirus-Dark";
package = pkgs.papirus-icon-theme;
};
font = {
name = "JetBrains Mono Medium"; # or FiraCode Nerd Font Mono Medium
}; # Cursor is declared under home.pointerCursor
};
}

101
hosts/laptop/default.nix Normal file
View File

@ -0,0 +1,101 @@
#
# Specific system configuration settings for desktop
#
# flake.nix
# ├─ ./hosts
# │ └─ ./laptop
# │ ├─ default.nix *
# │ └─ hardware-configuration.nix
# └─ ./modules
# ├─ ./desktop
# │ └─ ./hyprland
# │ └─ hyprland.nix
# ├─ ./modules
# │ └─ ./programs
# │ └─ waybar.nix
# └─ ./hardware
# └─ default.nix
#
{ config, pkgs, user, ... }:
{
imports = # For now, if applying to other system, swap files
[(import ./hardware-configuration.nix)] ++ # Current system hardware config @ /etc/nixos/hardware-configuration.nix
[(import ../../modules/desktop/hyprland/default.nix)] ++ # Window Manager
[(import ../../modules/desktop/virtualisation/docker.nix)] ++ # Docker
(import ../../modules/hardware); # Hardware devices
boot = { # Boot options
kernelPackages = pkgs.linuxPackages_latest;
loader = { # EFI Boot
systemd-boot.enable = true;
efi = {
canTouchEfiVariables = true;
efiSysMountPoint = "/boot";
};
timeout = 1; # Grub auto select time
};
};
# hardware.sane = { # Used for scanning with Xsane
# enable = false;
# extraBackends = [ pkgs.sane-airscan ];
# };
# environment = {
# systemPackages = with pkgs; [
# simple-scan
# ];
# };
programs = { # No xbacklight, this is the alterantive
dconf.enable = true;
light.enable = true;
};
services = {
tlp.enable = true; # TLP and auto-cpufreq for power management
#logind.lidSwitch = "ignore"; # Laptop does not go to sleep when lid is closed
auto-cpufreq.enable = true;
blueman.enable = true;
printing = { # Printing and drivers for TS5300
enable = true;
drivers = [ pkgs.gutenprint ];
};
avahi = { # Needed to find wireless printer
enable = true;
nssmdns = true;
publish = { # Needed for detecting the scanner
enable = true;
addresses = true;
userServices = true;
};
};
#xserver = {
# libinput = { # Trackpad support & gestures
# touchpad = {
# tapping = true;
# scrollMethod = "twofinger";
# naturalScrolling = true; # The correct way of scrolling
# accelProfile = "adaptive"; # Speed settings
# #accelSpeed = "-0.5";
# disableWhileTyping = true;
# };
# };
# resolutions = [
# { x = 1600; y = 920; }
# { x = 1280; y = 720; }
# { x = 1920; y = 1080; }
# ];
#};
};
#temporary bluetooth fix
# systemd.tmpfiles.rules = [
# "d /var/lib/bluetooth 700 root root - -"
# ];
# systemd.targets."bluetooth".after = ["systemd-tmpfiles-setup.service"];
}

View File

@ -0,0 +1,73 @@
#
# Hardware settings for Teclast F5 10" Laptop
# NixOS @ sda2
#
# flake.nix
# └─ ./hosts
# └─ ./laptop
# └─ hardware-configuration.nix *
#
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-label/ROOT";
fsType = "btrfs";
options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvol=@" ];
};
fileSystems."/home" =
{ device = "/dev/disk/by-label/ROOT";
fsType = "btrfs";
options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvol=@home" ];
};
fileSystems."/boot" =
{ device = "/dev/disk/by-label/BOOT";
fsType = "vfat";
};
swapDevices = [ ];
networking = {
useDHCP = false; # Deprecated
hostName = "nbf5";
networkmanager.enable = true;
interfaces = {
enp0s25 = {
useDHCP = true; # For versatility sake, manually edit IP on nm-applet.
#ipv4.addresses = [ {
# address = "192.168.0.51";
# prefixLength = 24;
#} ];
};
wlo1 = {
useDHCP = true;
#ipv4.addresses = [ {
# address = "192.168.0.51";
# prefixLength = 24;
#} ];
};
};
#defaultGateway = "192.168.0.1";
#nameservers = [ "192.168.0.4" ];
#firewall = {
# enable = false;
# #allowedUDPPorts = [ 53 67 ];
# #allowedTCPPorts = [ 53 80 443 9443 ];
#};
};
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; }

50
hosts/laptop/home.nix Normal file
View File

@ -0,0 +1,50 @@
#
# Home-manager configuration for laptop
#
# flake.nix
# ├─ ./hosts
# │ └─ ./laptop
# │ └─ home.nix *
# └─ ./modules
# └─ ./desktop
# └─ ./hyprland
# └─ hyprland.nix
#
{ pkgs, ... }:
{
imports =
[
../../modules/desktop/hyprland/home.nix # Window Manager
];
home = { # Specific packages for laptop
packages = with pkgs; [
# Applications
#libreoffice # Office packages
# Display
light # xorg.xbacklight not supported. Other option is just use xrandr.
# Power Management
#auto-cpufreq # Power management
#tlp # Power management
];
};
programs = {
alacritty.settings.font.size = 11;
};
services = { # Applets
blueman-applet.enable = true; # Bluetooth
# network-manager-applet.enable = true; # Network
# cbatticon = {
# enable = true;
# criticalLevelPercent = 10;
# lowLevelPercent = 20;
# iconType = null;
# };
};
}

View File

@ -0,0 +1,41 @@
#
# Sway configuration
#
# flake.nix
# ├─ ./hosts
# │ └─ ./laptop
# │ └─ default.nix
# └─ ./modules
# └─ ./desktop
# └─ ./hyprland
# └─ hyprland.nix *
#
{ config, lib, pkgs, ... }:
{
imports = [ ../../programs/waybar.nix ];
hardware.opengl.enable = true;
environment = {
loginShellInit = ''
if [ -z $DISPLAY ] && [ "$(tty)" = "/dev/tty1" ]; then
exec Hyprland
fi
''; # Will automatically open sway when logged into tty1
variables = {
#LIBCL_ALWAYS_SOFTWARE = "1"; # For applications in VM like alacritty to work
#WLR_NO_HARDWARE_CURSORS = "1"; # For cursor in VM
};
};
programs = {
hyprland.enable = true;
};
xdg.portal = { # Required for flatpak with windowmanagers
enable = true;
extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
};
}

View File

@ -0,0 +1,114 @@
#
# Hyprland NixOS & Home manager configuration
#
# flake.nix
# ├─ ./hosts
# │ └─ ./laptop
# │ └─ home.nix
# └─ ./modules
# └─ ./desktop
# └─ ./hyprland
# └─ home.nix *
#
{ config, lib, pkgs, ... }:
{
home.file = {
".config/hypr/hyprland.conf".text = ''
monitor=DP-2,1920x1080@60,0x0,1
monitor=HDMI-A-2,1920x1080@60,1920x0,1
monitor=HDMI-A-1,1280x1028@60,3840x0,1
workspace=DP-2,1
workspace=HDMI-A-2,2
workspace=HDMI-A-1,3
general {
main_mod=SUPER
border_size=4
gaps_in=5
gaps_out=7
col.active_border=0x80ffffff
col.inactive_border=0x66333333
damage_tracking=full # leave it on full unless you hate your GPU and want to make it suffer
layout=dwindle
}
decoration {
rounding=5
multisample_edges=true
active_opacity=1
inactive_opacity=1
fullscreen_opacity=1
blur=false
drop_shadow=false
}
animations {
enabled=true
}
input {
kb_layout=us
follow_mouse=1
repeat_delay=250
numlock_by_default=1
force_no_accel=1
sensitivity=1
}
dwindle {
pseudotile=0
}
bind=SUPER,Return,exec,${pkgs.alacritty}/bin/alacritty
bind=SUPER,Q,killactive,
bind=SUPER,Escape,exit,
bind=SUPER,E,exec,${pkgs.pcmanfm}/bin/pcmanfm
bind=SUPER,H,togglefloating,
bind=SUPER,Space,exec,${pkgs.rofi}/bin/rofi -show drun -o DP-3
bind=SUPER,P,pseudo,
bind=SUPER,F,fullscreen,
bind=SUPER,left,movefocus,l
bind=SUPER,right,movefocus,r
bind=SUPER,up,movefocus,u
bind=SUPER,down,movefocus,d
bind=ALT,1,workspace,1
bind=ALT,2,workspace,2
bind=ALT,3,workspace,3
bind=ALT,4,workspace,4
bind=ALT,5,workspace,5
bind=ALT,6,workspace,6
bind=ALT,7,workspace,7
bind=ALT,8,workspace,8
bind=ALT,9,workspace,9
bind=ALT,0,workspace,10
bind=ALT,right,workspace,+1
bind=ALT,left,workspace,-1
bind=ALTSHIFT,1,movetoworkspace,1
bind=ALTSHIFT,2,movetoworkspace,2
bind=ALTSHIFT,3,movetoworkspace,3
bind=ALTSHIFT,4,movetoworkspace,4
bind=ALTSHIFT,5,movetoworkspace,5
bind=ALTSHIFT,6,movetoworkspace,6
bind=ALTSHIFT,7,movetoworkspace,7
bind=ALTSHIFT,8,movetoworkspace,8
bind=ALTSHIFT,9,movetoworkspace,9
bind=ALTSHIFT,0,movetoworkspace,10
bind=ALTSHIFT,right,movetoworkspace,+1
bind=ALTSHIFT,left,movetoworkspace,-1
bind=CTRL,right,resizeactive,20 0
bind=CTRL,left,resizeactive,-20 0
bind=CTRL,up,resizeactive,0 -20
bind=CTRL,down,resizeactive,0 20
bind=,print,exec,${pkgs.flameshot}/bin/flameshot gui
bind=,XF86AudioLowerVolume,exec,${pkgs.pamixer}/bin/pamixer -d 10
bind=,XF86AudioRaiseVolume,exec,${pkgs.pamixer}/bin/pamixer -i 10
bind=,XF86AudioMute,exec,${pkgs.pamixer}/bin/pamixer -t
bind=,XF86AudioMicMute,exec,${pkgs.pamixer}/bin/pamixer --default-source -t
bind=,XF86MonBrightnessDown,exec,${pkgs.light}/bin/light -U 5
bind=,XF86MonBrightnessUP,exec,${pkgs.light}/bin/light -A 5
windowrule=float,^(Rofi)$
windowrule=float,title:^(Picture-in-Picture)$
windowrule=float,title:^(Volume Control)$
exec-once=${pkgs.swaybg}/bin/swaybg -m center -i $HOME/.config/wall
exec-once=${pkgs.waybar}/bin/waybar
exec-once=${pkgs.blueman}/bin/blueman-applet
'';
};
}

View File

@ -0,0 +1,17 @@
#
# Specific system configuration settings for desktop
#
# flake.nix
# ├─ ./hosts
# │ └─ ./desktop
# │ └─ default.nix
# └─ ./modules
# └─ ./desktop
# └─ ./virtualisation
# └─ default.nix *
#
[
./docker.nix
./qemu.nix
]

View File

@ -0,0 +1,48 @@
#
# Docker
#
{ config, pkgs, user, ... }:
{
virtualisation = {
docker.enable = true;
};
users.groups.docker.members = [ "${user}" ];
#environment = {
# interactiveShellInit = ''
# alias rtmp='docker start nginx-rtmp'
# ''; # Alias to easily start container
#};
environment.systemPackages = with pkgs; [
docker-compose
];
}
# USAGE:
# list images (that can be run as container): docker images
# list containers (that are active): docker container ls
# run images as container: docker run <repository name>
# run with port binding (ports can be accessed over internet): docker run -p <host port>:<docker-port> <repository name>
#
# 1: Portainer
# Create volume: docker volume create portainer_data
# Create and start: docker run -d -p 8000:8000 -p 9443:9443 --name portainer \
# --restart=always \
# -v /var/run/docker.sock:/var/run/docker.sock \
# -v portainer_data:/data \
# portainer/portainer-ce:latest
#
# 2: RTMP Server for OBS Studio
# Create: docker run -d -p 1935:1935 --name nginx-rtmp --restart=always tiangolo/nginx-rtmp
#
# 3: Homer
# Create: docker run -d \
# -p 8080:8080 \
# -v </your/local/assets/>:/www/assets \
# --restart=always \
# b4bz/homer:latest
#

View File

@ -0,0 +1,228 @@
#
# Qemu/KVM with virt-manager
#
{ config, pkgs, user, ... }:
{ # Add libvirtd and kvm to userGroups
boot.extraModprobeConfig = ''
options kvm_intel nested=1
options kvm_intel emulate_invalid_guest_state=0
options kvm ignore_nsrs=1
''; # Needed to run OSX-KVM
users.groups.libvirtd.members = [ "root" "${user}" ];
virtualisation = {
libvirtd = {
enable = true; # Virtual drivers
#qemuPackage = pkgs.qemu_kvm; # Default
qemu = {
verbatimConfig = ''
nvram = [ "${pkgs.OVMF}/FV/OVMF.fd:${pkgs.OVMF}/FV/OVMF_VARS.fd" ]
'';
};
};
spiceUSBRedirection.enable = true; # USB passthrough
};
environment = {
systemPackages = with pkgs; [
virt-manager
virt-viewer
qemu
OVMF
gvfs # Used for shared folders between linux and windows
];
};
services = { # Enable file sharing between OS
gvfs.enable = true;
};
#boot ={
# kernelParams = [ "intel_iommu=on" "vfio" "vfio_iommu_type1" "vfio_pci" "vfio_virqfd" ]; # or amd_iommu (cpu)
# kernelModules = [ "vendor-reset" "vfio" "vfio_iommu_type1" "vfio_pci" "vfio_virqfd"];
# extraModulePackages = [ config.boot.kernelPackages.vendor-reset ]; # Presumably fix for GPU Reset Bug
# extraModprobeConfig = "options vfio-pci ids=1002:67DF,1002:AAF0"; # grep PCI_ID /sys/bus/pci/devices/*/uevent
# kernelPatches = [
# {
# name = "vendor-reset-reqs-and-other-stuff";
# patch = null;
# extraConfig = ''
# FTRACE y
# KPROBES y
# FUNCTION_TRACER y
# HWLAT_TRACER y
# TIMERLAT_TRACER y
# IRQSOFF_TRACER y
# OSNOISE_TRACER y
# PCI_QUIRKS y
# KALLSYMS y
# KALLSYMS_ALL y
# '';
# }
# ];
#};
}
#SHARED FOLDER
#FOR WINDOWS
# 3 options:
#
# 1. Make use of host samba server
# 1.0 Samba is installed by default. The network-shared folder is at /home/<user>/share.
# 1.1 On host, set a password for the autentication of the samba server
# 1.2 $ smbpasswd -a <user>
# 1.3 Give password twice
# 1.4 On windows, open file explorer, right click "This PC", Map network drive...
# 1.5 fill in address: \\<ip-address>\share
# 1.6 Log in with details entered beforehand
#
# 2. Since this setup make use of iommu, you can pass through external usb hard drives or a specific PCI storage devices
# 2.1 Open details of virtual desktop in virt-manager
# 2.2 Add hardware
# 2.3 USB Host Device
# 2.4 Select device and launch virtual desktop
#
# 3. Set up shared folders in windows guest that can be accessed by host
# 3.0. Enable above service gvfs (this is used in the file manager to actually connect to the windows directory)
# 3.1. Log in to Windows
# 3.2. Go to "Network and Sharing Center"
# 3.3. Click "Change advanced sharing settings" and enable all settings for Private, Guest or Public and All Networks
# 3.3.1. Under "All Networks" you can disable "Password protected sharing" but it seems for optimal use, it's better to still give the password in the file manager
# 3.4. (possibly optional), select a folder and click "Properties", "Sharing", "Advanced Sharing"
# 3.4.1. Enable "Share this file"
# 3.4.2. Under "Permissions", allow full control. Apply
# 3.5. Click "Share" and use de drop down to add "Everyone" and change "Permission Level" to "Read/Write". Share, Done
# 3.6. Search for services and open menu
# 3.6.1. Search for below serices. Right click and select "Properties". "Startup type" = Automatic
# 3.6.1.1. SSDP Discovery
# 3.6.1.2. uPnPDevice Host
# 3.6.1.3. Functions Discovery Provider Host
# 3.6.1.4. Functions Discovery Resource Publication
# 3.7. Find IP of virtual device and make sure you can ping it.
# 3.8. In file manager add connection
# 3.8.1. For example in PCManFM
# 3.8.2. Search for smb://*ip*/
# 3.8.3. You can even specify specific folder smb://*ip*/users/Matthias/Desktop/share
# 3.8.4. If prompted to log in, do it, otherwise it might close on its own.
# 3.9. If there are any issues, maybe disable firewall on guest
# 3.10. Recommended to bookmark location for later
# Note:
# There is no passthrough, its recommended to install the windows kvm guest drivers.
# Can be found on github.com/virtio-win/virtio-win-pkg-scripts/blob/master/README.md
# Add this as CD storage in virt manager
# It can than be accest in the windows and the guest driver exe's can be run.
# Also, change video in virt-manager to virtio. This will fix the resolution
#FOR LINUX
# 2 options
#
# 1. Make use of host samba server
# 1.0 Samba is installed by default. The network-shared folder is at /home/<user>/share.
# 1.1 On host, set a password for the autentication of the samba server
# 1.2 $ smbpasswd -a <user>
# 1.3 Give password twice
# 1.4 On virtual machine open file manager
# 1.5 Search for smb://<ip-address>/share
# 1.6 Log in with details entered beforehand
#
# 2. Passing through a filesystem
# 2.1 Open details of virtual desktop on virt-manager
# 2.2 Add hardware
# 2.3 Select Filesystem: Type = mount / Mode = mapped / Source path = /home/<user>/share / Target path = /sharepoint
# 2.4 Boot into virtual machine
# 2.5 Create a directory to mount /sharepoint
# 2.6 $ sudo mount -t 9p -o trans=virtio /sharepoint /<mountpoint>
#SINGLE GPU PASSTHROUGH
# General Guide: gitlab.com/risingprismtv/single-gpu-passthrough/-/wikis/home
# 1. Download ISO
# 2. Download latest Video BIOS from techpowerup.com/vgabios (Sapphire RX580 8Gb)
# 2.1. $ Sudo mkdir /var/lib/libvirt/vbios/
# 2.2. $ Sudo mv ~/Downloads/*.rom /var/lib/libvirt/vbios/GPU.rom
# 2.3. $ Cd /var/lib/libvirt/vbios/
# 2.4. $ Sudo chmod -R 660 GPU.rom
# 3. Launch virt-manager
# 4. File - Add Connection
# 5. Create Virtual Machine
# 5.1 Select ISO and mark it as win10
# 5.2 Give temporary RAM
# 5.3 Customize configuration before install
# 5.4 Overview - Firmware - UEFI x86_64: /usr/*/OVMF_CODE.fd
# 5.5 Allow XML Editing via Edit - Preferences
# 5.6 Edit XML - Remove rtc & pit line. Change hpet to "yes"
# 6. Start Installation (let it run without interference and do steps below)
# 6.1 Press Esc, type exit, select boot-manager DVD ROM
# 6.2 Do installation, select Pro version.
# 6.3 Install hooks (Step 7 in guide)
# 7. Close VM
# 8. Edit VM
# 8.1 Remove everything spice (Display, Video QXL, Serial, Channel Spice)
# 8.2 Remove CD Rom
# 8.3 Add PCI hardware (GPU: 01:00:0 & 01:00:1 (most likely))
# 8.3 Add Mouse, Keyboard (PCI USB Controller in PCI Host Device or USB Host Device)
# 9. Select GPU and open XML
# 9.1 Add line "<rom file='/var/lib/libvirt/vbios/GPU.rom'/>" under "</source>"
# 9.2 Do for both 01:00:0 and 01:00:1
# 10. Edit CPU
# 10.1 Disable "Copy host CPU configuration" and select "host-passthrough"
# 10.2 Edit topology: Sockets=1 Cores=Total/2 Threads=2
# 10.3 Edit XML cpu under topology
# 10.3.1 Add "<feature policy='require' name='topoext'/>" for AMDCPU
# 10.3.2 Add "<feature policy='disable' name='smep'/>" for Intel CPU
# 11 Change memory to prefered (12GB for 16GB Total)
# 12 Start VM
# 13 Install correct video drivers
#MACOS ON VIRT-MANAGER
# General Guide: nixos.wiki/wiki/OSX-KVM
# Repository: github.com/kholia/OSX-KVM
# IMPORTANT: if you wish to start the virtual machine with virt-manager gui, clone to /home/<user>/.
# 1. git clone https://github.com/kholia/OSX-KVM
# 2. create a shell.nix (maybe best to store inside cloned directory)
# 3. shell.nix content:
# with import <nixpkgs> {};
# mkShell {
# buildInputs = [
# qemu
# python3
# iproute2
# ];
# }
# 4. In nixos configuration add:
# virtualisation.libvirtd.enable = true;
# users.extraUsers.<user>.extraGroups = [ "libvirtd" ];
# boot.extraModprobeConfig = ''
# options kvm_intel nested=1
# options kvm_intel emulate_invalid_guest_state=0
# options kvm ignore_msrs=1
# '';
# 5. Run the shell: $ nix-shell
# 6. As mentioned in the README, run ./fetch-macOS.py
# 6.1 Can be a specific version
# 7. Create base image for the macOs installer
# 8. $ qemu-img convert BaseSystem.dmg -O raw BaseSystem.img
# 9. Create disk for macOS
# 9.1 $ qemu-img create -f qcow2 mac_hdd_ng.img 128G
# 10. Set up networking. If something like virbr0 does not get detected start virt-manager. Commands:
# $ sudo ip tuntap add dev tap0 mode tap
# $ sudo ip link set tap0 up promisc on
# $ sudo ip link set dev virbr0 up
# $ sudo ip link set dev tap0 master virbr0
# 11. Boot the system
# 11.1 $ ./OpenCore-Boot.sh
# 12. Choose the first option to start the MacOS installer: macOS Base Systen
# 12.1 Use Disk Utility to esase the correct drive.
# 13. Go back and select the option to reinstall macOS
# 13.1 After the initial installation, a reboot will happen. Do nothing and wait or select the second option 'MacOs install'.
# 13.2 This will finalize the installaton but it will probably reboot multiple times. The second option will now have changed to the name of your drive. Use this as the boot option
# 14. To add the installation to virt-manager:
# 14.1 $ sed "s/CHANGEME/$USER/g" macOS-libvirt-Catalina.xml > macOS.xml
# 14.2 Inside macOS.xml change the emulator from /usr/bin/qemu-system-x86_64 to /run/libvirt/nix-emulators/qemu-system-x86_64
# 14.3 $ virt-xml-validate macOS.xml
# 15. $ virsh --connect qemu:///system define macOS.xml
# 16.(optional if permission is needed to the libvirt-qemu user)
# 16.1 $ sudo setfacl -m u:libvirt-qemu:rx /home/$USER
# 16.2 $ sudo setfacl -R -m u:libvirt-qemu:rx /home/$USER/OSX-KVM

View File

@ -0,0 +1,15 @@
#
# Editors
#
# flake.nix
# ├─ ./hosts
# │ └─ ./home.nix
# └─ ./modules
# └─ ./services
# └─ default.nix *
# └─ ...
#
[
./nvim
]

View File

@ -0,0 +1,51 @@
#
# Neovim
#
{ pkgs, ... }:
{
programs = {
neovim = {
enable = true;
viAlias = true;
vimAlias = true;
plugins = with pkgs.vimPlugins; [
# Syntax
vim-nix
vim-markdown
# Quality of life
vim-lastplace # Opens document where you left it
auto-pairs # Print double quotes/brackets/etc.
vim-gitgutter # See uncommitted changes of file :GitGutterEnable
# File Tree
nerdtree # File Manager - set in extraConfig to F6
# Customization
wombat256-vim # Color scheme for lightline
srcery-vim # Color scheme for text
lightline-vim # Info bar at bottom
indent-blankline-nvim # Indentation lines
];
extraConfig = ''
syntax enable " Syntax highlighting
colorscheme srcery " Color scheme text
let g:lightline = {
\ 'colorscheme': 'wombat',
\ } " Color scheme lightline
highlight Comment cterm=italic gui=italic " Comments become italic
hi Normal guibg=NONE ctermbg=NONE " Remove background, better for personal theme
set number " Set numbers
nmap <F6> :NERDTreeToggle<CR> " F6 opens NERDTree
'';
};
};
}

View File

@ -0,0 +1,17 @@
#
# Bluetooth
#
{ pkgs, ... }:
{
hardware.bluetooth = {
enable = true;
hsphfpd.enable = true; # HSP & HFP daemon
settings = {
General = {
Enable = "Source,Sink,Media,Socket";
};
};
};
}

View File

@ -0,0 +1,15 @@
#
# Hardware
#
# flake.nix
# ├─ ./hosts
# │ └─ ./<host>
# │ └─ default.nix
# └─ ./modules
# └─ ./services
# └─ default.nix *
# └─ ...
#
[
./bluetooth.nix
]

View File

@ -0,0 +1,26 @@
#
# Terminal Emulator
#
# Hardcoded as terminal for rofi and doom emacs
{ pkgs, ... }:
{
programs = {
alacritty = {
enable = true;
settings = {
font = rec { # Font - Laptop has size manually changed at home.nix
normal.family = "Source Code Pro";
bold = { style = "Bold"; };
# size = 8;
};
offset = { # Positioning
x = -1;
y = 0;
};
};
};
};
}

View File

@ -0,0 +1,20 @@
#
# Apps
#
# flake.nix
# ├─ ./hosts
# │ └─ home.nix
# └─ ./modules
# └─ ./apps
# └─ default.nix *
# └─ ...
#
[
./alacritty.nix
./rofi.nix
./waybar.nix
#./games.nix
]
# Waybar.nix is pulled from modules/desktop/..
# Games.nix is pulled from desktop/default.nix

119
modules/programs/rofi.nix Normal file
View File

@ -0,0 +1,119 @@
#
# System Menu
#
{ config, lib, pkgs, ... }:
let
inherit (config.lib.formats.rasi) mkLiteral; # Theme.rasi alternative. Add Theme here
colors = import ../themes/colors.nix;
in
{
programs = {
rofi = {
enable = true;
terminal = "${pkgs.alacritty}/bin/alacritty"; # Alacritty is default terminal emulator
location = "center";
theme = with colors.scheme.doom; {
"*" = {
bg0 = mkLiteral "#${bg}";
bg1 = mkLiteral "#414868";
fg0 = mkLiteral "#${text}";
fg1 = mkLiteral "#${text-alt}";
background-color = mkLiteral "transparent";
text-color = mkLiteral "@fg0";
margin = 0;
padding = 0;
spacing = 0;
};
"element-icon, element-text, scrollbar" = {
cursor = mkLiteral "pointer";
};
"window" = {
location = mkLiteral "northwest";
width = mkLiteral "280px";
x-offset = mkLiteral "8px";
y-offset = mkLiteral "24px";
background-color = mkLiteral "@bg0";
border = mkLiteral "1px";
border-color = mkLiteral "@bg1";
border-radius = mkLiteral "6px";
};
"inputbar" = {
spacing = mkLiteral "8px";
padding = mkLiteral "4px 8px";
children = mkLiteral "[ icon-search, entry ]";
#background-color = mkLiteral "@bg0";
background-color = mkLiteral "@bg0";
};
"icon-search, entry, element-icon, element-text" = {
vertical-align = mkLiteral "0.5";
};
"icon-search" = {
expand = false;
filename = mkLiteral "[ search-symbolic ]";
size = mkLiteral "14px";
};
"textbox" = {
padding = mkLiteral "4px 8px";
background-color = mkLiteral "@bg0";
};
"listview" = {
padding = mkLiteral "4px 0px";
lines = 12;
columns = 1;
scrollbar = true;
fixed-height = false;
dynamic = true;
};
"element" = {
padding = mkLiteral "4px 8px";
spacing = mkLiteral "8px";
};
"element normal urgent" = {
text-color = mkLiteral "@fg1";
};
"element normal active" = {
text-color = mkLiteral "@fg1";
};
"element selected" = {
text-color = mkLiteral "@bg0"; #1
background-color = mkLiteral "@fg1";
};
"element selected urgent" = {
background-color = mkLiteral "@fg1";
};
"element-icon" = {
size = mkLiteral "0.8em";
};
"element-text" = {
text-color = mkLiteral "inherit";
};
"scrollbar" = {
handle-width = mkLiteral "4px";
handle-color = mkLiteral "@fg1";
padding = mkLiteral "0 4px";
};
};
};
};
}

195
modules/programs/waybar.nix Normal file
View File

@ -0,0 +1,195 @@
#
# Bar
#
{ config, lib, pkgs, ...}:
{
environment.systemPackages = with pkgs; [
waybar
];
nixpkgs.overlays = [ # Waybar needs to be compiled with the experimental flag for wlr/workspaces to work
(self: super: {
waybar = super.waybar.overrideAttrs (oldAttrs: {
mesonFlags = oldAttrs.mesonFlags ++ [ "-Dexperimental=true" ];
});
})
];
home-manager.users.matthias = { # Home-manager waybar config
programs.waybar = {
enable = true;
systemd ={
enable = true;
target = "sway-session.target"; # Needed for waybar to start automatically
};
style = ''
* {
border: none;
font-family: FiraCode Nerd Font Mono;
font-weight: bold;
}
window#waybar {
background-color: rgba(0,0,0,0.5);
background: transparent;
transition-property: background-color;
transition-duration: .5s;
border-bottom: none;
}
window#waybar.hidden {
opacity: 0.2;
}
#workspace,
#mode,
#clock,
#pulseaudio,
#network,
#mpd,
#memory,
#network,
#window,
#cpu,
#disk,
#battery,
#tray {
color: #999999;
margin: 2px 16px 2px 16px;
background-clip: padding-box;
}
#workspaces button {
padding: 0 5px;
min-width: 15px;
}
#workspaces button:hover {
background-color: rgba(0,0,0,0.2);
}
#workspaces button.focused {
color: #ccffff;
}
#battery.warning {
color: #ff5d17;
}
#battery.critical {
color: #ff200c;
}
#battery.charging {
color: #9ece6a;
}
'';
settings = [{
layer = "top";
position = "top";
height = 16;
output = [
#"eDP-1"
"DP-2"
"HDMI-A-2"
];
tray = { spacing = 10; };
#modules-center = [ "clock" ];
#modules-left = [ "sway/workspaces" "sway/window" "sway/mode" ];
#modules-left = [ "wlr/workspaces" ];
#modules-right = [ "cpu" "memory" "disk" "pulseaudio" "battery" "network" "tray" ];
modules-right = [ "cpu" "memory" "pulseaudio" "clock" "tray" ];
"sway/workspaces" = {
format = "<span font='12'>{icon}</span>";
format-icons = {
"1"="";
"2"="";
"3"="";
"4"="";
"5"="";
};
all-outputs = true;
persistent_workspaces = {
"1" = [];
"2" = [];
"3" = [];
"4" = [];
"5" = [];
};
};
"wlr/workspaces" = {
format = "<span font='12'>{icon}</span>";
format-icons = {
"1"="";
"2"="";
"3"="";
"4"="";
"5"="";
};
all-outputs = true;
active-only = false;
on-click = "activate";
};
clock = {
format = "{:%b %d %H:%M}";
tooltip-format = "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>";
format-alt = "{:%A, %B %d, %Y} ";
};
cpu = {
format = "{usage}% <span font='11'></span>";
tooltip = false;
interval = 1;
};
disk = {
format = "{percentage_used}% <span font='11'></span>";
path = "/";
interval = 30;
};
memory = {
format = "{}% <span font='11'></span>";
interval = 1;
};
battery = {
interval = 60;
states = {
warning = 30;
critical = 15;
};
format = "{capacity}% <span font='11'>{icon}</span>";
format-charging = "{capacity}% <span font='11'></span>";
format-icons = ["" "" "" "" ""];
max-length = 25;
};
network = {
format-wifi = "<span font='11'></span>";
format-ethernet = "<span font='11'></span> {ifname}: {ipaddr}/{cidr}";
format-linked = "<span font='11'></span> {ifname} (No IP)";
format-disconnected = "<span font='11'></span> Not connected";
format-alt = "{ifname}: {ipaddr}/{cidr}";
tooltip-format = "{essid} {signalStrength}%";
on-click-right = "${pkgs.alacritty}/bin/alacritty -e nmtui";
};
pulseaudio = {
format = "<span font='11'>{icon}</span> {volume}% {format_source}";
format-bluetooth = "<span font='11'>{icon}</span> {volume}% {format_source}";
format-bluetooth-muted = "<span font='11'></span> {volume}% {format_source}";
format-muted = "<span font='11'></span> {format_source}";
#format-source = "{volume}% <span font='11'></span>";
format-source = "<span font='11'></span>";
format-source-muted = "<span font='11'></span>";
format-icons = {
default = [ "" "" "" ];
headphone = "";
#hands-free = "";
#headset = "";
#phone = "";
#portable = "";
#car = "";
};
tooltip-format = "{desc}, {volume}%";
on-click = "${pkgs.pamixer}/bin/pamixer -t";
on-click-right = "${pkgs.pamixer}/bin/pamixer --default-source -t";
on-click-middle = "${pkgs.pavucontrol}/bin/pavucontrol";
};
tray = {
icon-size = 11;
};
}];
};
};
}

View File

@ -0,0 +1,24 @@
#
# Services
#
# flake.nix
# ├─ ./hosts
# │ └─ home.nix
# └─ ./modules
# └─ ./services
# └─ default.nix *
# └─ ...
#
[
./dunst.nix
./flameshot.nix
#./picom.nix
#./polybar.nix
#./sxhkd.nix
./udiskie.nix
#./redshift.nix
]
# picom, polybar and sxhkd are pulled from desktop module
# redshift temporarely disables

View File

@ -0,0 +1,70 @@
#
# System notifications
#
{ config, lib, pkgs, ... }:
let
colors = import ../themes/colors.nix; # Import colors theme
in
{
home.packages = [ pkgs.libnotify ]; # Dependency
services.dunst = {
enable = true;
iconTheme = { # Icons
name = "Papirus Dark";
package = pkgs.papirus-icon-theme;
size = "16x16";
};
settings = with colors.scheme.doom; { # Settings
global = {
monitor = 0;
# geometry [{width}x{height}][+/-{x}+/-{y}]
# geometry = "600x50-50+65";
width = 300;
height = 200;
origin = "top-right";
offset = "50x50";
shrink = "yes";
transparency = 10;
padding = 16;
horizontal_padding = 16;
frame_width = 3;
frame_color = "#${bg}";
separator_color = "frame";
font = "FiraCode Nerd Font 10";
line_height = 4;
idle_threshold = 120;
markup = "full";
format = ''<b>%s</b>\n%b'';
alignment = "left";
vertical_alignment = "center";
icon_position = "left";
word_wrap = "yes";
ignore_newline = "no";
show_indicators = "yes";
sort = true;
stack_duplicates = true;
# startup_notification = false;
hide_duplicate_count = true;
};
urgency_low = { # Colors
background = "#${bg}";
foreground = "#${text}";
timeout = 4;
};
urgency_normal = {
background = "#${bg}";
foreground = "#${text}";
timeout = 4;
};
urgency_critical = {
background = "#${bg}";
foreground = "#${text}";
frame_color = "#${red}";
timeout = 10;
};
};
};
xdg.dataFile."dbus-1/services/org.knopwob.dunst.service".source = "${pkgs.dunst}/share/dbus-1/services/org.knopwob.dunst.service";
}

View File

@ -0,0 +1,22 @@
#
# Screenshots
#
{ pkgs, user, ... }:
{
services = { # sxhkd shortcut = Printscreen button (Print)
flameshot = {
enable = true;
settings = {
General = { # Settings
savePath = "/home/${user}/";
saveAsFileExtension = ".png";
uiColor = "#2d0096";
showHelp = "false";
disabledTrayIcon = "true"; # Hide from systray
};
};
};
};
}

View File

@ -0,0 +1,15 @@
#
# Mounting tool
#
{ config, lib, pkgs, ... }:
{
services = {
udiskie = { # Udiskie wil automatically mount storage devices
enable = true;
automount = true;
tray = "auto"; # Will only show up in systray when active
};
};
}

16
modules/shell/default.nix Normal file
View File

@ -0,0 +1,16 @@
#
# Shell
#
# flake.nix
# ├─ ./hosts
# │ └─ home.nix
# └─ ./modules
# └─ ./shell
# └─ default.nix *
# └─ ...
#
[
./git.nix
./zsh.nix
]

13
modules/shell/git.nix Normal file
View File

@ -0,0 +1,13 @@
#
# Git
#
{
programs = {
git = {
enable = true;
userName = "Kabbone";
userEmail = "tobias@opel-online.de";
};
};
}

View File

@ -0,0 +1,48 @@
#
# System themes
#
{
scheme = {
doom = {
scheme = "Doom One Dark";
black = "000000";
red = "ff6c6b";
orange = "da8548";
yellow = "ecbe7b";
green = "95be65";
teal = "4db5bd";
blue = "6eaafb";
dark-blue = "2257a0";
magenta = "c678dd";
violet = "a9a1e1";
cyan = "6cdcf7";
dark-cyan = "5699af";
emphasis = "50536b";
text = "dfdfdf";
text-alt = "b2b2b2";
fg = "abb2bf";
bg = "282c34";
};
dracula = {
scheme = "Dracula";
base00 = "282936"; #background
base01 = "3a3c4e";
base02 = "4d4f68";
base03 = "626483";
base04 = "62d6e8";
base05 = "e9e9f4"; #foreground
base06 = "f1f2f8";
base07 = "f7f7fb";
base08 = "ea51b2";
base09 = "b45bcf";
base0A = "00f769";
base0B = "ebff87";
base0C = "a1efe4";
base0D = "62d6e8";
base0E = "b45bcf";
base0F = "00f769";
};
};
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 242 KiB

34
modules/shell/zsh.nix Normal file
View File

@ -0,0 +1,34 @@
#
# Shell
#
{ pkgs, ... }:
{
programs = {
zsh = {
enable = true;
dotDir = ".config/zsh_nix";
enableAutosuggestions = true; # Auto suggest options and highlights syntact, searches in history for options
enableSyntaxHighlighting = true;
history.size = 10000;
oh-my-zsh = { # Extra plugins for zsh
enable = true;
plugins = [ "git" ];
custom = "$HOME/.config/zsh_nix/custom";
};
initExtra = '' # Zsh theme
# Spaceship
source ${pkgs.spaceship-prompt}/share/zsh/site-functions/prompt_spaceship_setup
autoload -U promptinit; promptinit
# source $HOME/.config/shell/shell_init
# Hook direnv
# emulate zsh -c "$(direnv hook zsh)"
# Swag
pfetch # Show fetch logo on terminal start
'';
};
};
}