From 6c6ab00929f372dba66d142850573a99cf7f823a Mon Sep 17 00:00:00 2001 From: mzntori Date: Tue, 14 Jan 2025 19:21:22 +0100 Subject: [PATCH] Initial Commit --- aether/configuration.nix | 125 ++++++++++++++++++++++++++++++ aether/hardware-configuration.nix | 33 ++++++++ flake.lock | 27 +++++++ flake.nix | 40 ++++++++++ inscriptions/overlays.nix | 25 ++++++ inscriptions/tori.nix | 44 +++++++++++ 6 files changed, 294 insertions(+) create mode 100644 aether/configuration.nix create mode 100644 aether/hardware-configuration.nix create mode 100644 flake.lock create mode 100644 flake.nix create mode 100644 inscriptions/overlays.nix create mode 100644 inscriptions/tori.nix diff --git a/aether/configuration.nix b/aether/configuration.nix new file mode 100644 index 0000000..ef3cfd2 --- /dev/null +++ b/aether/configuration.nix @@ -0,0 +1,125 @@ +{ config, pkgs, ... }: + +{ + imports = + [ # Include the results of the hardware scan. + ./hardware-configuration.nix + ]; + + # Bootloader. + boot.loader.grub.enable = true; + boot.loader.grub.device = "/dev/sda"; + boot.loader.grub.useOSProber = true; + + # Nvidia drivers + hardware.graphics.enable = true; + hardware.nvidia = { + modesetting.enable = true; + powerManagement.enable = false; + powerManagement.finegrained = false; + + open = false; + + nvidiaSettings = true; + + package = config.boot.kernelPackages.nvidiaPackages.beta; + }; + + # Bluetooth + hardware.bluetooth.enable = true; + hardware.bluetooth.powerOnBoot = true; + services.blueman.enable = true; + + # Audio + security.rtkit.enable = true; + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + }; + + services.xserver = { + enable = true; + videoDrivers = [ "nvidia" ]; + + desktopManager = { + xterm.enable = false; + }; + + xkb = { + layout = "us"; + variant = ""; + }; + + windowManager.i3 = { + enable = true; + extraPackages = with pkgs; [ + rofi + i3status + i3lock + ]; + }; + }; + + services.displayManager = { + defaultSession = "none+i3"; + }; + + # ssh + services.openssh = { + enable = true; + }; + + networking.hostName = "aether"; # Define your hostname. + + # Enable networking + networking.networkmanager.enable = true; + + # Set your time zone. + time.timeZone = "Europe/Vienna"; + + # Select internationalisation properties. + i18n.defaultLocale = "en_US.UTF-8"; + + i18n.extraLocaleSettings = { + LC_ADDRESS = "de_AT.UTF-8"; + LC_IDENTIFICATION = "de_AT.UTF-8"; + LC_MEASUREMENT = "de_AT.UTF-8"; + LC_MONETARY = "de_AT.UTF-8"; + LC_NAME = "de_AT.UTF-8"; + LC_NUMERIC = "de_AT.UTF-8"; + LC_PAPER = "de_AT.UTF-8"; + LC_TELEPHONE = "de_AT.UTF-8"; + LC_TIME = "de_AT.UTF-8"; + }; + + programs.firefox.enable = true; + programs.steam = { + enable = true; + remotePlay.openFirewall = true; + dedicatedServer.openFirewall = true; + localNetworkGameTransfers.openFirewall = true; + }; + programs.fish = { + enable = true; + + shellAliases = { + enforce-order = "sudo nixos-rebuild switch --flake ~/order/#aether"; + }; + }; + + # Allow unfree packages + nixpkgs.config.allowUnfree = true; + + # List packages installed in system profile. To search, run: + environment.systemPackages = with pkgs; [ + helix + pamixer + ]; + + nix.settings.experimental-features = ["nix-command" "flakes" ]; + nix.settings.allowed-users = ["tori"]; + + system.stateVersion = "24.05"; +} diff --git a/aether/hardware-configuration.nix b/aether/hardware-configuration.nix new file mode 100644 index 0000000..ac0da92 --- /dev/null +++ b/aether/hardware-configuration.nix @@ -0,0 +1,33 @@ +# 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" "usb_storage" "usbhid" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/7399aedb-793e-41f6-9ef5-940da9a4a18c"; + fsType = "ext4"; + }; + + swapDevices = [ ]; + + # 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.enp6s0.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp7s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..cd9dd2e --- /dev/null +++ b/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1736344531, + "narHash": "sha256-8YVQ9ZbSfuUk2bUf2KRj60NRraLPKPS0Q4QFTbc+c2c=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "bffc22eb12172e6db3c5dde9e3e5628f8e3e7912", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..c4fa4c1 --- /dev/null +++ b/flake.nix @@ -0,0 +1,40 @@ +{ + description = "nixos flake thing"; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; + }; + + outputs = { + self, + nixpkgs, + ... + }: + let + system = "x86_64-linux"; + + pkgs = import nixpkgs { + inherit system; + + config = { + allowUnfree = true; + }; + }; + + in + { + nixosConfigurations = { + # create host aether + aether = nixpkgs.lib.nixosSystem { + specialArgs = { inherit system; }; + + modules = [ + ./aether/configuration.nix + ./inscriptions/tori.nix + ./inscriptions/overlays.nix + ]; + }; + }; + + }; +} diff --git a/inscriptions/overlays.nix b/inscriptions/overlays.nix new file mode 100644 index 0000000..cfe2ae5 --- /dev/null +++ b/inscriptions/overlays.nix @@ -0,0 +1,25 @@ +{lib, ...}: + +{ + nixpkgs = { + overlays = [ + (self: super: { + technorino = + super.chatterino2.overrideAttrs + (old: { + nativeBuildInputs = with super; [cmake pkg-config]; + buildInputs = with super; [qt6.wrapQtAppsHook qt6.qtbase qt6.qtsvg qt6.qtimageformats qt6.qttools qt6.qt5compat qt6.qtwayland boost openssl]; + cmakeFlags = ["-DBUILD_WITH_QT6=ON" "-DBUILD_WITH_QTKEYCHAIN=OFF"]; + src = super.chatterino2.src.override { + owner = "2547techno"; + repo = "technorino"; + rev = "f6d0bd19caddb9f8f433877020e64e18923bbc7a"; + tag = null; + hash = "sha256-JTz/w8qtR59LVpuWbmiZDpwF+hepe78iCZ/3gi4O/Vc="; + }; + }); + }) + + ]; + }; +} diff --git a/inscriptions/tori.nix b/inscriptions/tori.nix new file mode 100644 index 0000000..230a05d --- /dev/null +++ b/inscriptions/tori.nix @@ -0,0 +1,44 @@ +{ pkgs, ... }: + +{ + users = { + defaultUserShell = pkgs.fish; + + users.tori = { + isNormalUser = true; + description = "tori"; + extraGroups = [ "networkmanager" "wheel" ]; + shell = pkgs.fish; + packages = with pkgs; [ + # programs + arandr + alacritty + feh + fish + gh + gh-copilot + gimp + git + jetbrains.clion + jetbrains.goland + lazygit + nil + obs-studio + scrot + technorino + unzip + vesktop + xclip + zathura + # c + cmake + gcc + valgrind + # haskell + ghc + haskell-language-server + ]; + }; + }; + +}