From 54aafc79b3f5981790fcefd73499cfefa48b2e7f Mon Sep 17 00:00:00 2001 From: Alex Date: Fri, 9 Dec 2022 22:18:23 -0600 Subject: [PATCH 1/3] add nixos to installers --- installers/nixos/configuration.nix | 185 ++++++++++++++++++++++ installers/nixos/gaming-configuration.nix | 29 ++++ installers/nixos/install.sh | 45 ++++++ installers/nixos/repos.list | 3 + installers/nixos/sway-configuration.nix | 27 ++++ 5 files changed, 289 insertions(+) create mode 100644 installers/nixos/configuration.nix create mode 100644 installers/nixos/gaming-configuration.nix create mode 100644 installers/nixos/install.sh create mode 100644 installers/nixos/repos.list create mode 100644 installers/nixos/sway-configuration.nix diff --git a/installers/nixos/configuration.nix b/installers/nixos/configuration.nix new file mode 100644 index 0000000..7b86827 --- /dev/null +++ b/installers/nixos/configuration.nix @@ -0,0 +1,185 @@ +{ config, pkgs, ... }: + +{ + imports = + [ # Include the results of the hardware scan. + ./hardware-configuration.nix + ./gaming-configuration.nix + ./sway-configuration.nix + ]; + + # 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 = "22.05"; # Did you read the comment? + + # 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; + + +# Use the systemd-boot EFI boot loader. + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + networking.hostName = "bismarck"; # Define your hostname. + # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. + #networking.networkmanager.enable = true; # Easiest to use and most distros use this by default. + + services.connman.enable = true; + networking.wireless.iwd.enable = true; + services.connman.wifi.backend = "iwd"; + + # Open ports in the firewall. + networking.firewall.allowedTCPPorts = [ 67 68 53 ]; + networking.firewall.allowedTCPPortRanges = [ + { from = 56881; to = 56889; } + { from = 27036; to = 27037; } + ]; + + # networking.firewall.allowedUDPPorts = [ ... ]; + networking.firewall.allowedUDPPortRanges = [ + { from = 27000; to = 27036; } + ]; + + # Or disable the firewall altogether. + # networking.firewall.enable = false; + + + + # Set your time zone. + time.timeZone = "America/Chicago"; + + # 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"; + console = { + font = "Lat2-Terminus16"; + #keyMap = "us"; + useXkbConfig = true; # use xkbOptions in tty. + }; + + #Define a user account. Don't forget to set a password with ‘passwd’. + users.users.alex = { + isNormalUser = true; + shell = pkgs.zsh; + extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user. + packages = with pkgs; [ + librewolf + yt-dlp + zathura + sfeed + chromium + ]; + }; + + security.sudo.extraRules = [{ + runAs = "root"; + groups = [ "wheel" ]; + commands = [{ + command = "/run/current-system/sw/bin/poweroff"; + options = [ "NOPASSWD" ]; + } { + command = "/run/current-system/sw/bin/reboot"; + options = [ "NOPASSWD" ]; + }]; + }]; + +# Some programs need SUID wrappers, can be configured further or are + # started in user sessions. + programs.mtr.enable = true; + + services.pcscd.enable = true; + programs.gnupg.agent = { + enable = true; + pinentryFlavor = "curses"; + enableSSHSupport = true; + }; + + environment.systemPackages = with pkgs; [ + glib # gsettings + dracula-theme # gtk theme + gnome3.adwaita-icon-theme # default gnome cursors + zsh + noto-fonts + noto-fonts-extra + noto-fonts-emoji + noto-fonts-cjk-sans + zip + unzip + p7zip + pavucontrol + pamixer + pulsemixer + imagemagick + ffmpegthumbnailer + file + viu + bat + pavucontrol + neovim + pfetch + htop-vim + lf + mpv + mpd + ncmpcpp + libnotify + lynx + mutt-wizard + pass + neomutt + notmuch + isync + pinentry-curses + connman-gtk + openssl + git + shellcheck + jq + monero-cli + bc + gnome.zenity + cura + udisks2 + udiskie + python3 + python3.pkgs.pip + ]; + + #enable flatpak + services.flatpak.enable = true; + + security.rtkit.enable = true; + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + }; + + services.pipewire.wireplumber.enable = true; + + # xdg-desktop-portal works by exposing a series of D-Bus interfaces + # known as portals under a well-known name + # (org.freedesktop.portal.Desktop) and object path + # (/org/freedesktop/portal/desktop). + # The portal interfaces include APIs for file access, opening URIs, + # printing and others. + services.dbus.enable = true; + xdg.portal = { + enable = true; + wlr.enable = true; + # gtk portal needed to make gtk apps happy + extraPortals = [ pkgs.xdg-desktop-portal-gtk ]; + gtkUsePortal = true; + }; + +} diff --git a/installers/nixos/gaming-configuration.nix b/installers/nixos/gaming-configuration.nix new file mode 100644 index 0000000..9db2d5c --- /dev/null +++ b/installers/nixos/gaming-configuration.nix @@ -0,0 +1,29 @@ +{ config, pkgs, lib, ... }: { + + #enable nonfree packages + nixpkgs.config.allowUnfree = true; + + environment.systemPackages = with pkgs; [ + lutris + radeontop + ]; + + #add 32bit support for graphics + hardware.opengl.driSupport32Bit = true; + + #nixpkgs.config.packageOverrides = pkgs: { + # steam = pkgs.steam.override { + # extraPkgs = pkgs: with pkgs; [ + # libgdiplus + # libpng + # ]; + # }; + #}; + + programs.steam = { + enable = false; + remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play + dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server + }; + +} diff --git a/installers/nixos/install.sh b/installers/nixos/install.sh new file mode 100644 index 0000000..009bcae --- /dev/null +++ b/installers/nixos/install.sh @@ -0,0 +1,45 @@ +#!/bin/sh + +mkdir ~/docs/ +mkdir ~/dl/ +mkdir ~/media/ +mkdir -p ~/.local/share/gnupg/ +mkdir -p ~/.config/mpd/playlists +mkdir -p ~/.local/share/desktop + +#setup .zprofile and zsh history file +cd ~ || return +ln -s ~/.profile ~/.zprofile +mkdir -p ~/.cache/zsh +touch ~/.cache/zsh/history + + +sh ~/.local/scripts/install.sh add-repos ~/.local/installers/nixos/repos.list + + +#link rofi themes directory so that theming works +mkdir -p "$HOME"/.local/share/rofi/ +ln -s "$HOME"/.local/src/base16-rofi/themes/ "$HOME"/.local/share/rofi/themes + + + +#set limits for esync +#sudo sh -c "echo '$USER hard nofile 524288' >> /etc/security/limits.conf" +#set limits for monero +#sudo sh -c "echo '$USER hard memlock 2048' >> /etc/security/limits.conf" +#sudo sh -c "echo '$USER hard memlock 2048' >> /etc/security/limits.conf" + +#fix issue with arduino ide and tiling wms +#sudo sh -c 'echo "export _JAVA_AWT_WM_NONREPARENTING=1" >> /etc/profile.d/jre.sh' + +#download collapse OS +mkdir -p "$HOME"/.local/src/ +cd "$HOME"/.local/src/ +wget http://collapseos.org/files/collapseos-latest.tar.gz +cd - + +#set wallpaper +ln -s ~/media/img/wallpapers/alena-aenami-eclipse-1k.jpg ~/.config/wall + +#link Xresources for xwayland +ln -s ~/.config/Xresources ~/.Xdefaults diff --git a/installers/nixos/repos.list b/installers/nixos/repos.list new file mode 100644 index 0000000..2bdf5c6 --- /dev/null +++ b/installers/nixos/repos.list @@ -0,0 +1,3 @@ +https://github.com/aarowill/base16-alacritty.git +https://github.com/rkubosz/base16-sway.git +https://gitlab.com/jordiorlando/base16-rofi.git diff --git a/installers/nixos/sway-configuration.nix b/installers/nixos/sway-configuration.nix new file mode 100644 index 0000000..4e148b2 --- /dev/null +++ b/installers/nixos/sway-configuration.nix @@ -0,0 +1,27 @@ +{ config, pkgs, lib, ... }: { + + environment.systemPackages = with pkgs; [ + wayland + sway + alacritty + swaylock + swayidle + grim + slurp + wl-clipboard + mako + swaybg + waybar + xwayland + gammastep + rofi-wayland + imv + ]; + + # enable sway window manager + programs.sway = { + enable = true; + wrapperFeatures.gtk = true; + }; + +} From 0f1ee544f57bc3fb04e88cf17b863ba85201c097 Mon Sep 17 00:00:00 2001 From: Alex Date: Fri, 9 Dec 2022 23:57:27 -0600 Subject: [PATCH 2/3] changes to nixos config --- installers/nixos/configuration.nix | 4 ++++ installers/nixos/install.sh | 13 +++++++++++++ 2 files changed, 17 insertions(+) diff --git a/installers/nixos/configuration.nix b/installers/nixos/configuration.nix index 7b86827..45d2b97 100644 --- a/installers/nixos/configuration.nix +++ b/installers/nixos/configuration.nix @@ -4,7 +4,11 @@ imports = [ # Include the results of the hardware scan. ./hardware-configuration.nix +<<<<<<< HEAD ./gaming-configuration.nix +======= + #./gaming-configuration.nix +>>>>>>> tmp ./sway-configuration.nix ]; diff --git a/installers/nixos/install.sh b/installers/nixos/install.sh index 009bcae..3ca222e 100644 --- a/installers/nixos/install.sh +++ b/installers/nixos/install.sh @@ -14,12 +14,21 @@ mkdir -p ~/.cache/zsh touch ~/.cache/zsh/history +<<<<<<< HEAD sh ~/.local/scripts/install.sh add-repos ~/.local/installers/nixos/repos.list #link rofi themes directory so that theming works mkdir -p "$HOME"/.local/share/rofi/ ln -s "$HOME"/.local/src/base16-rofi/themes/ "$HOME"/.local/share/rofi/themes +======= +#sh ~/.local/scripts/install.sh add-repos ~/.local/installers/nixos/repos.list + + +#link rofi themes directory so that theming works +#mkdir -p "$HOME"/.local/share/rofi/ +#ln -s "$HOME"/.local/src/base16-rofi/themes/ "$HOME"/.local/share/rofi/themes +>>>>>>> tmp @@ -39,7 +48,11 @@ wget http://collapseos.org/files/collapseos-latest.tar.gz cd - #set wallpaper +<<<<<<< HEAD ln -s ~/media/img/wallpapers/alena-aenami-eclipse-1k.jpg ~/.config/wall +======= +#ln -s ~/media/img/wallpapers/alena-aenami-eclipse-1k.jpg ~/.config/wall +>>>>>>> tmp #link Xresources for xwayland ln -s ~/.config/Xresources ~/.Xdefaults From 39f375e29f0ba47c44c71ec01b9e4c002f234b18 Mon Sep 17 00:00:00 2001 From: Alex Date: Fri, 9 Dec 2022 23:58:13 -0600 Subject: [PATCH 3/3] update nixos configuration --- installers/nixos/configuration.nix | 19 +++++++++++++++---- installers/nixos/sway-configuration.nix | 7 ++++--- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/installers/nixos/configuration.nix b/installers/nixos/configuration.nix index 45d2b97..64c65a1 100644 --- a/installers/nixos/configuration.nix +++ b/installers/nixos/configuration.nix @@ -4,11 +4,7 @@ imports = [ # Include the results of the hardware scan. ./hardware-configuration.nix -<<<<<<< HEAD - ./gaming-configuration.nix -======= #./gaming-configuration.nix ->>>>>>> tmp ./sway-configuration.nix ]; @@ -81,6 +77,8 @@ zathura sfeed chromium + brave + keepassxc ]; }; @@ -116,6 +114,7 @@ noto-fonts-extra noto-fonts-emoji noto-fonts-cjk-sans + nerdfonts zip unzip p7zip @@ -156,8 +155,18 @@ udiskie python3 python3.pkgs.pip + chafa ]; + fonts.fonts = with pkgs; [ + noto-fonts + noto-fonts-extra + noto-fonts-emoji + noto-fonts-cjk-sans + nerdfonts + + ]; + #enable flatpak services.flatpak.enable = true; @@ -169,6 +178,8 @@ pulse.enable = true; }; + + services.pipewire.wireplumber.enable = true; # xdg-desktop-portal works by exposing a series of D-Bus interfaces diff --git a/installers/nixos/sway-configuration.nix b/installers/nixos/sway-configuration.nix index 4e148b2..5b418c9 100644 --- a/installers/nixos/sway-configuration.nix +++ b/installers/nixos/sway-configuration.nix @@ -3,8 +3,7 @@ environment.systemPackages = with pkgs; [ wayland sway - alacritty - swaylock + waylock swayidle grim slurp @@ -14,8 +13,10 @@ waybar xwayland gammastep - rofi-wayland + bemenu imv + foot + autotiling ]; # enable sway window manager