From 856485795cbdf1197dc5ad9067814e30d7ffaf45 Mon Sep 17 00:00:00 2001 From: zonsopkomst Date: Tue, 15 Nov 2022 06:45:19 -0600 Subject: [PATCH] first commit --- README.md | 1 + communication.nix | 13 ++ configuration.nix | 284 +++++++++++++++++++++++++++++++++++++ flake.lock | 64 +++++++++ flake.nix | 38 +++++ fonts.nix | 14 ++ gaming.nix | 42 ++++++ hardware-configuration.nix | 41 ++++++ home-manager.nix | 15 ++ home.nix | 21 +++ internet.nix | 15 ++ kde.nix | 17 +++ laptop.nix | 10 ++ media.nix | 33 +++++ office.nix | 16 +++ system.nix | 64 +++++++++ 16 files changed, 688 insertions(+) create mode 100644 README.md create mode 100644 communication.nix create mode 100644 configuration.nix create mode 100644 flake.lock create mode 100644 flake.nix create mode 100644 fonts.nix create mode 100644 gaming.nix create mode 100644 hardware-configuration.nix create mode 100644 home-manager.nix create mode 100644 home.nix create mode 100644 internet.nix create mode 100644 kde.nix create mode 100644 laptop.nix create mode 100644 media.nix create mode 100644 office.nix create mode 100644 system.nix diff --git a/README.md b/README.md new file mode 100644 index 0000000..0c596bf --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +My flake configuration files. diff --git a/communication.nix b/communication.nix new file mode 100644 index 0000000..95841cf --- /dev/null +++ b/communication.nix @@ -0,0 +1,13 @@ + # Communication Packages + +{ pkgs, ... }: + +{ + environment.systemPackages = with pkgs; + [ + dino + discord + element-desktop + jitsi + ]; +} diff --git a/configuration.nix b/configuration.nix new file mode 100644 index 0000000..b8f2a77 --- /dev/null +++ b/configuration.nix @@ -0,0 +1,284 @@ +# 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, ... }: + +# Setup Nix-Software-Center +let + nix-software-center = (import (pkgs.fetchFromGitHub { + owner = "vlinkz"; + repo = "nix-software-center"; + rev = "0.0.3"; + sha256 = "sha256-r5xOi/dd/hW/gdi0X0tHFFt2w82S9PFhZSXPeCA69ig="; + })) {}; +in + +{ + imports = + [ # Include the results of the hardware scan. + ./hardware-configuration.nix + + ############################## + # BEGIN CUSTOM CONFIGURATION # + ############################## + + ./communication.nix + ./fonts.nix + ./gaming.nix + ./internet.nix + ./media.nix + ./office.nix + ./system.nix + ./kde.nix + + + ########################### + # END CUSTOM CONFIGUATION # + ########################### + ]; + + # Bootloader. + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + boot.loader.efi.efiSysMountPoint = "/boot/efi"; + + # Setup keyfile + boot.initrd.secrets = { + "/crypto_keyfile.bin" = null; + }; + + # Enable swap on luks + boot.initrd.luks.devices."luks-57e53b6e-eb27-4bdc-961e-069ecf677d6b".device = "/dev/disk/by-uuid/57e53b6e-eb27-4bdc-961e-069ecf677d6b"; + boot.initrd.luks.devices."luks-57e53b6e-eb27-4bdc-961e-069ecf677d6b".keyFile = "/crypto_keyfile.bin"; + + networking.hostName = "nixos"; # Define your hostname. + # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. + + # Configure network proxy if necessary + # networking.proxy.default = "http://user:password@proxy:port/"; + # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; + + # Enable networking + networking.networkmanager.enable = true; + + # Set your time zone. + time.timeZone = "America/Chicago"; + + # Select internationalisation properties. + i18n.defaultLocale = "en_US.utf8"; + + # Enable the X11 windowing system. + services.xserver.enable = true; + + # Enable the KDE Plasma Desktop Environment. + services.xserver.displayManager.sddm.enable = true; + services.xserver.desktopManager.plasma5.enable = true; + + # Configure keymap in X11 + services.xserver = { + layout = "us"; + xkbVariant = ""; + }; + + # Enable CUPS to print documents. + services.printing.enable = true; + + # Enable sound with pipewire. + sound.enable = true; + hardware.pulseaudio.enable = false; + security.rtkit.enable = true; + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + # If you want to use JACK applications, uncomment this + #jack.enable = true; + + # use the example session manager (no others are packaged yet so this is enabled by default, + # no need to redefine it in your config for now) + #media-session.enable = true; + }; + + # Enable touchpad support (enabled default in most desktopManager). + # services.xserver.libinput.enable = true; + + # Define a user account. Don't forget to set a password with ‘passwd’. + users.users.leeuwarden = { + isNormalUser = true; + description = "leeuwarden"; + extraGroups = [ "networkmanager" "wheel" "docker" ]; + packages = with pkgs; [ + nix-software-center + ]; + }; + + # Enable automatic login for the user. + services.xserver.displayManager.autoLogin.enable = true; + services.xserver.displayManager.autoLogin.user = "leeuwarden"; + + # Allow unfree packages + nixpkgs.config.allowUnfree = true; + + + ######################## + # BEGIN CUSTOM CHANGES # + ######################## + + # ********************** + # FLAKES RELATED + # ********************** + nix = { + package = pkgs.nixFlakes; + extraOptions = "experimental-features = nix-command flakes"; + }; + + + # ********************** + # HOME-MANAGER RELATED + # ********************** + # Currently using to manage my config files on multiple systems + # See https://github.com/nix-community/home-manager for manual and configuration options + # 1) Remember to add unstable channel (in this case) in the terminal: + # sudo nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager + # 2) sudo nix-channel --update + # 3) Include "" in "Imports" section above + home-manager.users.leeuwarden = { pkgs, ... }: { + home.packages = with pkgs; [ + # Begin packages and options + alacritty + ]; + # Need to enable home.stateVersion for it to work correctly: + home.stateVersion = "22.05"; + # Begin configuration or script declarations + home.file = { + ".config/alacritty/alacritty.yml".text = '' + {window: {opacity: 0.8}, font: {normal: {family: tamsyn, style: Regular}}} + ''; + }; + }; + + + + + # ********************** + # GAMING RELATED + # ********************** + # TODO: Move to gaming.nix + + # Enable GE-Proton (GloriousEggroll) + environment.sessionVariables = rec { + XDG_CACHE_HOME = "\${HOME}/.cache"; + XDG_CONFIG_HOME = "\${HOME}/.config"; + XDG_BIN_HOME = "\${HOME}/.local/bin"; + XDG_DATA_HOME = "\${HOME}/.local/share"; + # Steam needs this to find Proton-GE + STEAM_EXTRA_COMPAT_TOOLS_PATHS = "\${HOME}/.steam/root/compatibilitytools.d"; + # note: this doesn't replace PATH, it just adds this to it + PATH = [ + "\${XDG_BIN_HOME}" + ]; + }; + + # Enable Gamemode + programs.gamemode.enable = true; + + # Enable Epic Games Store in Lutris + # TODO: This caused errors, using Flatpak until I can figure out a NixOS method + # hardware.opengl.driSupport32Bit = true + + # Enable Steam + 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 + }; + + + # ********************** + # SYSTEM RELATED + # ********************** + # TODO: Move to system.nix + + # Enable Insecure Packages + nixpkgs.config.permittedInsecurePackages = [ "electron-11.5.0" ]; + + # Enable Flatpak + services.flatpak.enable = true; + + # Enable KDE Wallet PAM + # TODO: Move to kde.nix or system.nix + security.pam.services.leeuwarden.enableKwallet = true; + + # ********************** + # WEB APPLICATION RELATED + # ********************** + + # Enable the Docker Service + # Note added "docker" group to user's extraGroups above + virtualisation.docker.enable = true; + + services = { + syncthing = { + enable = true; + user = "leeuwarden"; + dataDir = "/home/leeuwarden/Syncthing"; # Default folder for new synced folders + configDir = "/home/leeuwarden/Documents/.config/syncthing"; # Folder for Syncthing's settings and keys + }; + }; + + ###################### + # END CUSTOM CHANGES # + ###################### + + +# Add overlays to change packages or add new packages to existing in NixOS +# #Example for pasting; sha256 = "0000000000000000000000000000000000000000000000000000"; +# nixpkgs.overlays = [ +# (self: super: { +# nuclear = super.nuclear.overrideAttrs (old: { +# src = super.fetchFromGitHub { +# owner = "nukeop"; +# repo = "nuclear"; +# rev = "b6e5b2"; +# sha256 = "K7J20IJCFGn1S9HPw45UAzqRk5JbIqkoM4fZlWpXa+0="; +# }; +# }); +# }) +# ]; + + # List packages installed in system profile. To search, run: + # $ nix search wget + environment.systemPackages = with pkgs; [ + # vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. + # wget + ]; + + # 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; + + # 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? +} diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..a795470 --- /dev/null +++ b/flake.lock @@ -0,0 +1,64 @@ +{ + "nodes": { + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ], + "utils": "utils" + }, + "locked": { + "lastModified": 1667898954, + "narHash": "sha256-VqHVeoxcOl9M6yQ+LV3yTWMb0h5Rl5yixn9PCY/MJJo=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "d20e3d070c78271356a2d5d73c01f1de94586087", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1667811565, + "narHash": "sha256-HYml7RdQPQ7X13VNe2CoDMqmifsXbt4ACTKxHRKQE3Q=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "667e5581d16745bcda791300ae7e2d73f49fff25", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "home-manager": "home-manager", + "nixpkgs": "nixpkgs" + } + }, + "utils": { + "locked": { + "lastModified": 1667395993, + "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..0eddafc --- /dev/null +++ b/flake.nix @@ -0,0 +1,38 @@ +{ + description = "A very special flake"; + + inputs = { + # Attribute set of all the dependencies used in the flake + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + home-manager.url = "github:nix-community/home-manager"; + home-manager.inputs.nixpkgs.follows = "nixpkgs"; + }; + + outputs = inputs@{ nixpkgs, home-manager, ... }: { + # Function of an argument that uses the inputs for reference + # Place packages, configurations, modules here + nixosConfigurations = { + nixos = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + # TODO? + # config.allowUnfree = true; + modules = [ + ./configuration.nix + home-manager.nixosModules.home-manager + { + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.users.leeuwarden = import ./home.nix; + + # Optionally, use home-manager.extraSpecialArgs to pass + # arguments to home.nix + + # TODO Change hostname + # Rebuild: sudo nixos-rebuild switch --flake .# or sudo nixos-rebuild switch --flake .# + + } + ]; + }; + }; + }; +} diff --git a/fonts.nix b/fonts.nix new file mode 100644 index 0000000..3e0ac98 --- /dev/null +++ b/fonts.nix @@ -0,0 +1,14 @@ + # Fonts + +{ pkgs, ... }: + +{ + environment.systemPackages = with pkgs; + [ + anonymousPro + roboto + tamsyn + #pkgs.terminus_font + ]; +} + diff --git a/gaming.nix b/gaming.nix new file mode 100644 index 0000000..f947aba --- /dev/null +++ b/gaming.nix @@ -0,0 +1,42 @@ + # Gaming Packages + +{ pkgs, ... }: + +{ + environment.systemPackages = with pkgs; + [ + airshipper + #assaultcube + #alienarena + #cataclysm-dda + #factorio + #freeciv + #freenukum #Issues with screen size + gamemode + #gzdoom + #hedgewars + #heroic # Issues with authenticating, package out of date, using Flatpak + itch + #legendary-gl + #lutris # Issues with Origin installation, using Flatpak + #openttd + #redeclipse + retroarchFull + #sauerbraten + #scorched3d + shattered-pixel-dungeon + steam + #supertux + #supertuxkart + #tuxpaint + #warzone2100 + #warsow + #wesnoth + #ufoai + #xonotic + #zdoom + #zeroad + #zero ballistics ?? + #the dark mod ?? + ]; +} diff --git a/hardware-configuration.nix b/hardware-configuration.nix new file mode 100644 index 0000000..d2c2710 --- /dev/null +++ b/hardware-configuration.nix @@ -0,0 +1,41 @@ +# 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" "ahci" "usbhid" "usb_storage" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/dec0eb85-e7d8-4a1a-b704-1aa4feda8769"; + fsType = "ext4"; + }; + + boot.initrd.luks.devices."luks-f2d1de0f-ee55-4ea5-a446-8806a55987ca".device = "/dev/disk/by-uuid/f2d1de0f-ee55-4ea5-a446-8806a55987ca"; + + fileSystems."/boot/efi" = + { device = "/dev/disk/by-uuid/DE0A-21E9"; + fsType = "vfat"; + }; + + swapDevices = + [ { device = "/dev/disk/by-uuid/176baa85-a5aa-44c8-b8e9-bff87fed4541"; } + ]; + + # 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..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.enp0s31f6.useDHCP = lib.mkDefault true; + + powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/home-manager.nix b/home-manager.nix new file mode 100644 index 0000000..485c31a --- /dev/null +++ b/home-manager.nix @@ -0,0 +1,15 @@ +{ config, pkgs, ... }: +let + home-manager = builtins.fetchTarball "https://github.com/nix-community/home-manager/archive/master.tar.gz"; +in +{ + imports = [ + (import "${home-manager}/nixos") + ]; + + home.stateVersion = “22.05”; + + home-manager.users.leeuwarden = { + /* Here goes your home-manager config, eg home.packages = [ pkgs.foo ]; */ + }; +} diff --git a/home.nix b/home.nix new file mode 100644 index 0000000..127decb --- /dev/null +++ b/home.nix @@ -0,0 +1,21 @@ +{ config, pkgs, ... }: + +{ + # Home Manager needs a bit of information about you and the + # paths it should manage. + home.username = "leeuwarden"; + home.homeDirectory = "/home/leeuwarden"; + + # This value determines the Home Manager release that your + # configuration is compatible with. This helps avoid breakage + # when a new Home Manager release introduces backwards + # incompatible changes. + # + # You can update Home Manager without changing this value. See + # the Home Manager release notes for a list of state version + # changes in each release. + home.stateVersion = "22.05"; + + # Let Home Manager install and manage itself. + programs.home-manager.enable = true; +} diff --git a/internet.nix b/internet.nix new file mode 100644 index 0000000..13b0693 --- /dev/null +++ b/internet.nix @@ -0,0 +1,15 @@ + # Communication Packages + +{ pkgs, ... }: + +{ + environment.systemPackages = with pkgs; + [ + #betterbird #No pkg, using flatpak + brave + librewolf + #thunderbird + #tigervnc + tor-browser-bundle-bin + ]; +} diff --git a/kde.nix b/kde.nix new file mode 100644 index 0000000..66aa3cc --- /dev/null +++ b/kde.nix @@ -0,0 +1,17 @@ + # KDE Packages + +{ config, lib, pkgs, ... }: + +{ + environment.systemPackages = with pkgs; + [ + kde-gtk-config + libsForQt5.sddm + libsForQt5.sddm-kcm + libsForQt5.kaccounts-providers + libsForQt5.breeze-gtk + libsForQt5.breeze-qt5 + libsForQt5.breeze-icons + ]; + +} diff --git a/laptop.nix b/laptop.nix new file mode 100644 index 0000000..0d5ab2c --- /dev/null +++ b/laptop.nix @@ -0,0 +1,10 @@ + # Communication Packages + +{ config, pkgs, ... }: + +{ + environment.systemPackages = with pkgs; + [ + + ]; +} diff --git a/media.nix b/media.nix new file mode 100644 index 0000000..edc5310 --- /dev/null +++ b/media.nix @@ -0,0 +1,33 @@ + # Communication Packages + +{ pkgs, ... }: + +{ + environment.systemPackages = with pkgs; + [ + ardour + bibletime + blender + calibre + foliate + freetube + gimp + gpodder + handbrake + inkscape + libsForQt5.kolourpaint + krita + libsForQt5.k3b + gmic-qt-krita + makemkv + mpv + #nuclear #Package not updated + obs-studio + libsForQt5.okular + smplayer + strawberry + tenacity + #zotero + #hypnotix ?? + ]; +} diff --git a/office.nix b/office.nix new file mode 100644 index 0000000..6bb543e --- /dev/null +++ b/office.nix @@ -0,0 +1,16 @@ + # Communication Packages + +{ pkgs, ... }: + +{ + environment.systemPackages = with pkgs; + [ + gImageReader + gnucash + # gnucash requires dconf + dconf + obsidian + onlyoffice-bin + pdfarranger + ]; +} diff --git a/system.nix b/system.nix new file mode 100644 index 0000000..3143835 --- /dev/null +++ b/system.nix @@ -0,0 +1,64 @@ + # Communication Packages + +{ config, pkgs, ... }: + +{ + environment.systemPackages = with pkgs; + [ + #genymotion # Issues with loading + alacritty #TODO try moving to home-manager when setup + appimage-run + bleachbit + bottles + btop + cpu-x + crow-translate + git + htop + i2c-tools + inetutils + kate + libsForQt5.applet-window-buttons + libsForQt5.filelight + libsForQt5.kdecoration + libsForQt5.qtstyleplugin-kvantum + libsForQt5.powerdevil + openrgb + neofetch + #nix-software-center + nox + ntfs3g + p7zip + papirus-icon-theme + powertop + protonup + qemu_full + solaar + speedcrunch + syncthing + syncthing-tray + tixati + tldr + #waydroid # Only works on wayland + ventoy-bin + veracrypt + #virtualbox # Only needed with genymotion + + ]; +} + + # Enable Flatpak +# services.flatpak.enable = true; + + # Enable the Docker Service + # Note added "docker" group to extraGroups in configuration.nix + # virtualisation.docker.enable = true; + +# services = { +# syncthing = { +# enable = true; +# user = "zonsopkomst"; +# dataDir = "/home/zonsopkomst/Syncthing"; # Default folder for new synced folders +# configDir = "/home/zonsopkomst/Documents/.config/syncthing"; # Folder for Syncthing's settings and keys +# }; +# };