This commit is contained in:
Menno van Leeuwen 2024-11-02 17:45:43 +01:00
parent d52099bbb9
commit 05c5cf81bf
Signed by: vleeuwenmenno
SSH Key Fingerprint: SHA256:OJFmjANpakwD3F2Rsws4GLtbdz1TJ5tkQF0RZmF0TRE
20 changed files with 212 additions and 125 deletions

34
.bashrc
View File

@ -95,8 +95,12 @@ if [ -f /home/menno/.config/op/plugins.sh ]; then
source /home/menno/.config/op/plugins.sh
fi
# Starship Prompt Initialization (Adapted for Bash)
eval "$(starship init bash)"
# Initialize starship if available
if ! command -v starship &> /dev/null; then
echo "FYI, starship not found"
else
eval "$(starship init bash)"
fi
# Source nix home-manager
if [ -f "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh" ]; then
@ -112,17 +116,27 @@ if command -v zoxide &> /dev/null; then
fi
# Check if we are running from zellij, if not then launch it
if [ -z "$ZELLIJ" ]; then
zellij
launch_zellij_conditionally() {
if [ -z "$ZELLIJ" ]; then
# Don't launch zellij in tmux, vscode, screen or zeditor.
if [ ! -t 1 ] || [ -n "$TMUX" ] || [ -n "$VSCODE_STABLE" ] || [ -n "$STY" ] || [ -n "$ZED_TERM" ]; then
return
fi
# Exit if zellij exits properly with a zero exit code
if [ $? -eq 0 ]; then
exit $?
# Launch zellij
zellij
# Exit if zellij exits properly with a zero exit code
if [ $? -eq 0 ]; then
exit $?
fi
echo "Zellij exited with a non-zero exit code, falling back to regular shell."
return
fi
}
echo "Zellij exited with a non-zero exit code, continuing..."
return
fi
launch_zellij_conditionally
# Display a welcome message for interactive shells
if [ -t 1 ]; then

View File

@ -3,10 +3,7 @@
source $HOME/dotfiles/bin/helpers/functions.sh
# Print logo
tput setaf 2
cat $HOME/dotfiles/bin/resources/logo.txt
println " " "cyan"
tput sgr0
echo "Menno's Dotfiles" | figlet | lolcat
# Print help
cat $HOME/dotfiles/bin/resources/help.txt

View File

@ -1,17 +0,0 @@
#!/usr/bin/env bash
source $HOME/dotfiles/bin/helpers/functions.sh
# Kill any running swhkd and swhks processes
if pgrep -x "swhkd" > /dev/null; then
printfe "%s\n" "yellow" "swhkd is running, killing it..."
sudo pkill swhkd
fi
if pgrep -x "swhks" > /dev/null; then
printfe "%s\n" "yellow" "swhks is running, killing it..."
sudo pkill swhks
fi
printfe "%s\n" "green" "Starting hotkey daemon..."
swhks & pkexec swhkd -c ~/.config/swhkdrc

View File

@ -1,21 +0,0 @@
#!/usr/bin/env bash
source $HOME/dotfiles/bin/helpers/functions.sh
source $HOME/dotfiles/bin/helpers/pipx_packages.sh
source $HOME/dotfiles/bin/helpers/cargo_packages.sh
source $HOME/dotfiles/bin/helpers/flatpak_packages.sh
source $HOME/dotfiles/bin/helpers/fonts.sh
# Check if parameter --verbose was passed
if [ "$2" = "--verbose" ]; then
verbose=true
else
verbose=false
fi
echo -e "\n"
print_fonts_status
print_pipx_status
print_cargo_status
print_flatpak_status

View File

@ -260,6 +260,10 @@ else
--home-manager)
homemanager
;;
--nix)
sys_packages
homemanager
;;
--git)
git_repos
;;

View File

@ -54,10 +54,6 @@ case $1 in
logo continue
push $@
;;
"status")
logo continue
status $@
;;
"help"|"--help"|"")
help $@
;;

View File

@ -15,10 +15,7 @@ is_wsl() {
}
logo() {
tput setaf 2
cat $HOME/dotfiles/bin/resources/logo.txt
println " " "cyan"
tput sgr0
echo "Menno's Dotfiles" | figlet | lolcat
# Print if repo is dirty and the count of untracked files, modified files and staged files
if [[ $(git -C ~/dotfiles status --porcelain) ]]; then

View File

@ -1,7 +0,0 @@
_ ___ _ __ _ _
/\/\ ___ _ __ _ __ ___( )__ / \___ | |_ / _(_) | ___ ___
/ \ / _ \ '_ \| '_ \ / _ \/ __| / /\ / _ \| __| |_| | |/ _ \/ __|
/ /\/\ \ __/ | | | | | | (_) \__ \ / /_// (_) | |_| _| | | __/\__ \
\/ \/\___|_| |_|_| |_|\___/|___/ /___,' \___/ \__|_| |_|_|\___||___/

View File

@ -0,0 +1,26 @@
[Desktop Entry]
Name=Zen Browser
Exec=flatpak run --branch=stable --arch=x86_64 --command=launch-script.sh --file-forwarding io.github.zen_browser.zen @@u %u @@
Icon=io.github.zen_browser.zen
Type=Application
MimeType=text/html;text/xml;application/xhtml+xml;x-scheme-handler/http;x-scheme-handler/https;application/x-xpinstall;application/pdf;application/json;
StartupWMClass=zen-alpha
Categories=Network;WebBrowser;
StartupNotify=true
Terminal=false
X-MultipleArgs=false
Keywords=Internet;WWW;Browser;Web;Explorer;
Actions=new-window;new-private-window;profilemanager;
X-Flatpak=io.github.zen_browser.zen
[Desktop Action new-window]
Name=Open a New Window
Exec=flatpak run --branch=stable --arch=x86_64 --command=launch-script.sh --file-forwarding io.github.zen_browser.zen @@u %u @@
[Desktop Action new-private-window]
Name=Open a New Private Window
Exec=flatpak run --branch=stable --arch=x86_64 --command=launch-script.sh --file-forwarding io.github.zen_browser.zen --private-window @@u %u @@
[Desktop Action profilemanager]
Name=Open the Profile Manager
Exec=flatpak run --branch=stable --arch=x86_64 --command=launch-script.sh --file-forwarding io.github.zen_browser.zen --ProfileManager @@u %u @@

View File

@ -1,10 +0,0 @@
[Flatpak Ref]
Name=io.github.ungoogled_software.ungoogled_chromium
Branch=stable
Title=io.github.ungoogled_software.ungoogled_chromium from flathub
IsRuntime=false
Url=https://dl.flathub.org/repo/
SuggestRemoteName=flathub
GPGKey=mQINBFlD2sABEADsiUZUOYBg1UdDaWkEdJYkTSZD68214m8Q1fbrP5AptaUfCl8KYKFMNoAJRBXn9FbE6q6VBzghHXj/rSnA8WPnkbaEWR7xltOqzB1yHpCQ1l8xSfH5N02DMUBSRtD/rOYsBKbaJcOgW0K21sX+BecMY/AI2yADvCJEjhVKrjR9yfRX+NQEhDcbXUFRGt9ZT+TI5yT4xcwbvvTu7aFUR/dH7+wjrQ7lzoGlZGFFrQXSs2WI0WaYHWDeCwymtohXryF8lcWQkhH8UhfNJVBJFgCY8Q6UHkZG0FxMu8xnIDBMjBmSZKwKQn0nwzwM2afskZEnmNPYDI8nuNsSZBZSAw+ThhkdCZHZZRwzmjzyRu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6sViuPDfQSHLNbauJBo/n1sRYAsL5mcG22UDchJrlKvmK3EOADCQg+myrm8006LltubNB4wWNzHDJ0Ls2JGzQZCd/xGyVmUiidCBUrD537WdknOYE4FD7P0cHaM9brKJ/M8LkEH0zUlo73bY4XagbnCqve6PvQb5G2Z55qhWphd6f4B6DGed86zJEa/RhS
RuntimeRepo=https://dl.flathub.org/repo/flathub.flatpakrepo

View File

@ -85,6 +85,7 @@
cowsay
cmatrix
figlet
lolcat
# GUI Applications
## Utilities

View File

@ -42,57 +42,16 @@
LC_TIME = "nl_NL.UTF-8";
};
# 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;
environment.systemPackages = with pkgs; [
tailscale
pciutils
gnome3.gnome-session
];
services.tailscale.enable = true;
# Configure keymap in X11
services.xserver.xkb = {
layout = "us";
variant = "euro";
};
# Enable sound with pipewire.
hardware.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
};
# Allow unfree packages
nixpkgs.config.allowUnfree = true;
# 1Password
programs._1password.enable = true;
programs._1password-gui = {
enable = true;
polkitPolicyOwners = [ "menno" ];
};
environment.etc = {
"1password/custom_allowed_browsers" = {
text = ''
firefox
brave
zen
'';
mode = "0755";
};
};
# Enable the OpenSSH daemon.
# services.openssh = {
# enable = true;

View File

@ -13,6 +13,7 @@
system = "x86_64-linux";
modules = [
./hardware/mennos-laptop.nix
./common/workstation.nix
./configuration.nix
];
};
@ -20,6 +21,15 @@
system = "x86_64-linux";
modules = [
./hardware/mennos-gamingpc.nix
./common/workstation.nix
./configuration.nix
];
};
"mennos-desktop" = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
./hardware/mennos-desktop.nix
./common/server.nix
./configuration.nix
];
};

View File

@ -0,0 +1,4 @@
{ config, pkgs, ... }:
{
}

View File

@ -0,0 +1,27 @@
{ config, pkgs, ... }:
{
# 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;
environment.systemPackages = with pkgs; [ gnome3.gnome-session ];
# Configure keymap in X11
services.xserver.xkb = {
layout = "us";
variant = "euro";
};
# Enable sound with pipewire.
hardware.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
};
}

View File

@ -0,0 +1,89 @@
{
config,
lib,
pkgs,
modulesPath,
...
}:
{
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot.initrd.availableKernelModules = [
"nvme"
"xhci_pci"
"usbhid"
"usb_storage"
"sd_mod"
"amdgpu"
];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
fileSystems."/" = {
device = "/dev/disk/by-uuid/1356cd09-5c55-45b5-8b06-6aadc84cee37";
fsType = "ext4";
};
boot.initrd.luks.devices."luks-32bf1c42-e6ef-4fb8-9b76-8bb13b9ea155".device = "/dev/disk/by-uuid/32bf1c42-e6ef-4fb8-9b76-8bb13b9ea155";
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/CD6B-8910";
fsType = "vfat";
options = [
"fmask=0077"
"dmask=0077"
];
};
swapDevices = [ ];
# Enable OpenGL
hardware.opengl = {
enable = true;
};
# Load nvidia driver for Xorg and Wayland
services.xserver.videoDrivers = [ "nvidia" ];
hardware.nvidia = {
# Modesetting is required.
modesetting.enable = true;
# Nvidia power management. Experimental, and can cause sleep/suspend to fail.
# Enable this if you have graphical corruption issues or application crashes after waking
# up from sleep. This fixes it by saving the entire VRAM memory to /tmp/ instead
# of just the bare essentials.
powerManagement.enable = false;
# Fine-grained power management. Turns off GPU when not in use.
# Experimental and only works on modern Nvidia GPUs (Turing or newer).
powerManagement.finegrained = false;
# Use the NVidia open source kernel module (not to be confused with the
# independent third-party "nouveau" open source driver).
# Support is limited to the Turing and later architectures. Full list of
# supported GPUs is at:
# https://github.com/NVIDIA/open-gpu-kernel-modules#compatible-gpus
# Only available from driver 515.43.04+
# Currently alpha-quality/buggy, so false is currently the recommended setting.
open = false;
# Enable the Nvidia settings menu,
# accessible via `nvidia-settings`.
nvidiaSettings = true;
# Optionally, you may need to select the appropriate driver version for your specific GPU.
package = config.boot.kernelPackages.nvidiaPackages.stable;
};
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
networking.hostName = "mennos-desktop";
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View File

@ -69,8 +69,6 @@
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
networking.hostName = "mennos-gamingpc";
# networking.interfaces.enp8s0.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp15s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;

View File

@ -83,8 +83,6 @@
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
networking.hostName = "mennos-laptop";
# networking.interfaces.enp2s0.useDHCP = lib.mkDefault true;
# networking.interfaces.wlo1.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;

View File

@ -0,0 +1,20 @@
{ pkgs, ... }:
{
# 1Password
programs._1password.enable = true;
programs._1password-gui = {
enable = true;
polkitPolicyOwners = [ "menno" ];
};
environment.etc = {
"1password/custom_allowed_browsers" = {
text = ''
firefox
brave
zen
'';
mode = "0755";
};
};
}

View File

@ -1,5 +1,7 @@
{ ... }: {
{ ... }:
{
imports = [
./steam.nix
./1password.nix
];
}
}