From 3452dddf58a5e6780860970d60de958ffa1325d5 Mon Sep 17 00:00:00 2001 From: Radu Andries Date: Sat, 13 Jan 2024 12:50:27 +0100 Subject: [PATCH] Initial commit --- channels.sh | 5 + configuration.nix | 225 +++++++++++++++++++++++++++++++++++++ hardware-configuration.nix | 37 ++++++ steam.nix | 13 +++ 4 files changed, 280 insertions(+) create mode 100644 channels.sh create mode 100644 configuration.nix create mode 100644 hardware-configuration.nix create mode 100644 steam.nix diff --git a/channels.sh b/channels.sh new file mode 100644 index 0000000..31d9a7e --- /dev/null +++ b/channels.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +nix-channel --add https://github.com/nix-community/home-manager/archive/release-23.11.tar.gz home-manager +nix-channel --add https://git.admiral0.it/admiral0/nix/archive/main.tar.gz mynix +nix-channel --add https://nixos.org/channels/nixos-23.11 nixos diff --git a/configuration.nix b/configuration.nix new file mode 100644 index 0000000..8ff46bb --- /dev/null +++ b/configuration.nix @@ -0,0 +1,225 @@ +# Edit this configuration file to define what should be installed on +# your system. Help is available in the configuration.nix(5) man page, on +# https://search.nixos.org/options and in the NixOS manual (`nixos-help`). + +{ config, lib, pkgs, ... }: + +{ + imports = + [ # Include the results of the hardware scan. + + + ./hardware-configuration.nix + ./steam.nix + ]; + + # Use the systemd-boot EFI boot loader. + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + networking.hostName = "bragi"; # 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. + nix.settings.experimental-features = [ "nix-command" "flakes" ]; + + # Set your time zone. + time.timeZone = "Europe/Rome"; + + # 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 xkb.options in tty. + # }; + + services.asusd = { + enable = true; + enableUserService = true; + }; + + programs.hyprland = { + enable = true; + xwayland.enable = true; + }; + xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-gtk ]; + + nixpkgs.config.allowUnfree = true; + + # Enable the X11 windowing system. + # services.xserver.enable = true; + + + # Enable the Plasma 5 Desktop Environment. + # services.xserver.displayManager.sddm.enable = true; + # services.xserver.desktopManager.plasma5.enable = true; + + + # Configure keymap in X11 + # services.xserver.xkb.layout = "us"; + # services.xserver.xkb.options = "eurosign:e,caps:escape"; + + # Enable CUPS to print documents. + # services.printing.enable = true; + + # Enable sound. + # sound.enable = true; + # hardware.pulseaudio.enable = true; + services.pipewire = { + enable = true; + # too slow to activate + # socketActivation = false; + pulse.enable = true; + jack.enable = true; + alsa.support32Bit = true; + alsa.enable = true; + audio.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.admiral0 = { + isNormalUser = true; + extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user. + }; + home-manager.users.admiral0 = { pkgs, ... }: { + home.packages = with pkgs; [ + firefox + tree + networkmanagerapplet + wofi + brightnessctl + sublime4 + ]; + nixpkgs.config = { + allowUnfree = true; + permittedInsecurePackages = [ + "openssl-1.1.1w" + ]; + }; + services.dunst.enable = true; + services.network-manager-applet.enable = true; + programs.foot = { + enable = true; + settings.main = { + font = "CaskaydiaCove Nerd Font Mono:size=10"; + }; + }; + programs.waybar = { + enable = true; + settings = { + mainBar = { + layer = "top"; + position = "top"; + height = 25; + modules-left = [ "hyprland/workspaces" ]; + modules-center = [ "clock" ]; + modules-right = [ "tray" "temperature" "battery" ]; + "battery" = { + format = "{time} {power}W {capacity}%"; + format-time = "{H}h{M}m"; + }; + }; + }; + systemd = { + enable = true; + target = "hyprland-session.target"; + #variables = [ "-all"]; + }; + }; + wayland.windowManager.hyprland = { + enable = true; + settings = { + bind = [ + "SUPER, Return, exec, foot" + "SUPER, e, exec, wofi --show run" + "SUPER SHIFT, q, exit" + "SUPER, q, killactive," + "SUPER, 1, workspace, 1" + "SUPER, 2, workspace, 2" + "SUPER, 3, workspace, 3" + "SUPER, 4, workspace, 4" + "SUPER, 5, workspace, 5" + "SUPER, 6, workspace, 6" + "SUPER, 7, workspace, 7" + "SUPER, 8, workspace, 8" + "SUPER, 9, workspace, 9" + "SUPER SHIFT, 1, movetoworkspace, 1" + "SUPER SHIFT, 2, movetoworkspace, 2" + "SUPER SHIFT, 3, movetoworkspace, 3" + "SUPER SHIFT, 4, movetoworkspace, 4" + "SUPER SHIFT, 5, movetoworkspace, 5" + "SUPER SHIFT, 6, movetoworkspace, 6" + "SUPER SHIFT, 7, movetoworkspace, 7" + "SUPER SHIFT, 8, movetoworkspace, 8" + "SUPER SHIFT, 9, movetoworkspace, 9" + ]; + }; + }; + + home.stateVersion = "23.11"; + }; + + # List packages installed in system profile. To search, run: + # $ nix search wget + environment.systemPackages = with pkgs; [ + wget + git + spacevim + pavucontrol + ]; + fonts.packages = with pkgs; [ + nerdfonts + ]; + + # 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; + + # This option defines the first version of NixOS you have installed on this particular machine, + # and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions. + # + # Most users should NEVER change this value after the initial install, for any reason, + # even if you've upgraded your system to a new NixOS release. + # + # This value does NOT affect the Nixpkgs version your packages and OS are pulled from, + # so changing it will NOT upgrade your system. + # + # This value being lower than the current NixOS release does NOT mean your system is + # out of date, out of support, or vulnerable. + # + # Do NOT change this value unless you have manually inspected all the changes it would make to your configuration, + # and migrated your data accordingly. + # + # For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion . + system.stateVersion = "23.11"; # Did you read the comment? + +} + diff --git a/hardware-configuration.nix b/hardware-configuration.nix new file mode 100644 index 0000000..3250105 --- /dev/null +++ b/hardware-configuration.nix @@ -0,0 +1,37 @@ +# 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 = [ "nvme" "xhci_pci" "usbhid" "usb_storage" "sd_mod" "sdhci_pci" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/c4a78cf4-2b81-4206-be85-ddbf7c2b6af6"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/4CA3-9900"; + fsType = "vfat"; + }; + + 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.wlp5s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/steam.nix b/steam.nix new file mode 100644 index 0000000..b859907 --- /dev/null +++ b/steam.nix @@ -0,0 +1,13 @@ +{ ... }: + +{ + # Enable MTU probing, as vendor does + # See: https://github.com/ValveSoftware/SteamOS/issues/1006 + # See also: https://www.reddit.com/r/SteamDeck/comments/ymqvbz/ubisoft_connect_connection_lost_stuck/j36kk4w/?context=3 + boot.kernel.sysctl."net.ipv4.tcp_mtu_probing" = true; + hardware.opengl = { + driSupport32Bit = true; + }; + hardware.pulseaudio.support32Bit = true; + programs.steam.enable = true; +}