From 637a3ca3a224223971717b0e6c4a3c1b64aadf36 Mon Sep 17 00:00:00 2001 From: KeksNino Date: Thu, 25 Jun 2026 17:24:09 +0200 Subject: [PATCH] add nix files --- configuration.nix | 188 +++++++++++++++++++++++++++++++++++++ flake.lock | 68 ++++++++++++++ flake.nix | 50 ++++++++++ flake.nix.o | 112 ++++++++++++++++++++++ hardware-configuration.nix | 39 ++++++++ home-manager/home.nix | 29 ++++++ 6 files changed, 486 insertions(+) create mode 100644 configuration.nix create mode 100644 flake.lock create mode 100644 flake.nix create mode 100644 flake.nix.o create mode 100644 hardware-configuration.nix create mode 100644 home-manager/home.nix diff --git a/configuration.nix b/configuration.nix new file mode 100644 index 0000000..586e7d8 --- /dev/null +++ b/configuration.nix @@ -0,0 +1,188 @@ +# 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, ... }: + + +{ + imports = + [ # Include the results of the hardware scan. + ./hardware-configuration.nix + ]; + + nix.settings.experimental-features = [ "nix-command" "flakes" ]; + + boot.kernelParams = [ "iomem=relaxed" "pcie_acs_override=downstream,multifunction,id:10de:1c03,id:10de:10f1" "rd.driver.pre=vfio-pci" "quiet" "pci-stub.ids=10de:1c03,10de:10f1" "iommu=pt" "amd_iommu=on" "kvm.ignore_msrs=1" "mitigations=off" ]; + + hardware.graphics.enable = true; + + # Bootloader. + #boot.loader.systemd-boot.enable = true; + boot.loader.grub.enable = true; + boot.loader.grub.device = "nodev"; + boot.loader.grub.efiSupport = true; + # boot.kernelPackages = pkgs.linuxPackages_zen; + + 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 = "Europe/Berlin"; + + # Select internationalisation properties. + i18n.defaultLocale = "en_US.UTF-8"; + + i18n.extraLocaleSettings = { + LC_ADDRESS = "de_DE.UTF-8"; + LC_IDENTIFICATION = "de_DE.UTF-8"; + LC_MEASUREMENT = "de_DE.UTF-8"; + LC_MONETARY = "de_DE.UTF-8"; + LC_NAME = "de_DE.UTF-8"; + LC_NUMERIC = "de_DE.UTF-8"; + LC_PAPER = "de_DE.UTF-8"; + LC_TELEPHONE = "de_DE.UTF-8"; + LC_TIME = "de_DE.UTF-8"; + }; + + # Configure keymap in X11 + services.xserver.xkb = { + layout = "de"; + variant = ""; + }; + + # Configure console keymap + console.keyMap = "de"; + + programs.fish.enable = true; + + # Define a user account. Don't forget to set a password with ‘passwd’. + users.users.user = { + isNormalUser = true; + description = "user"; + extraGroups = [ "networkmanager" "wheel" ]; + shell = pkgs.fish; + packages = with pkgs; []; + }; + + # Enable automatic login for the user. + services.getty.autologinUser = "user"; + + # Allow unfree packages + nixpkgs.config.allowUnfree = true; + + programs.hyprland = { + enable = true; + xwayland.enable = true; + }; + + # NFS / MPD + fileSystems."/media/music" = { + device = "192.168.132.149:/media/music"; + fsType = "nfs"; + }; + boot.supportedFilesystems = [ "nfs" ]; + + services.mpd.settings.musicDirectory = { + # ~/Music + }; + + # List packages installed in system profile. To search, run: + # $ nix search wget + + qt = { + enable = true; + platformTheme = "qt5ct"; + style = "breeze"; + }; + + services.goxlr-utility.enable = true; + + environment.systemPackages = with pkgs; [ + wget + neovim + efibootmgr + gdu + kitty + nemo + legcord + awww + jamesdsp + rofi + waybar + udiskie + librewolf + udisks2 + grimblast + pywal16 + xdg-desktop-portal + xdg-desktop-portal-hyprland + btop + bitwarden-desktop + fzf + zinit + zoxide + nitch + fzf + tmuxifier + eza + tmux + lxappearance + cliphist + git + adwaita-icon-theme + gnumake + gcc + meson + playerctl + trash-cli + equibop + steam + yazi + rmpc + wl-clipboard + cinny-desktop + unzip + p7zip + ]; + +nixpkgs.config.permittedInsecurePackages = [ + "electron-39.8.10" +]; + + # 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 = "24.11"; # Did you read the comment? + system.autoUpgrade.enable = false; + system.autoUpgrade.allowReboot = true; +} diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..0f3dc07 --- /dev/null +++ b/flake.lock @@ -0,0 +1,68 @@ +{ + "nodes": { + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1782358560, + "narHash": "sha256-vCcLh9pw3XO/+Lxk8r6xv6QnoCrTfGqiACcI7O637Wg=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "3a70e333f2950c302e875c44cfcfaff3f80f36bc", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1782328929, + "narHash": "sha256-EboKWnTWTpQMJ7MbgJs+KJGJuLDnBbA26h8M/jyvQrE=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "1ab79b94f1a4facdf7a8b414cb09fb5e3fab4e2d", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "home-manager": "home-manager", + "nixpkgs": "nixpkgs", + "zen-browser": "zen-browser" + } + }, + "zen-browser": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1781847955, + "narHash": "sha256-1OSYOGuJp/NoODmSHjsz+6TB/kSilJ+BsFihjY7TTnc=", + "owner": "youwen5", + "repo": "zen-browser-flake", + "rev": "4bca251cd556677f7b765ff324d1638ae215be13", + "type": "github" + }, + "original": { + "owner": "youwen5", + "repo": "zen-browser-flake", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..f0b57ea --- /dev/null +++ b/flake.nix @@ -0,0 +1,50 @@ +{ + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs"; + # hyprland.url = "github:hyprwm/Hyprland"; + zen-browser = { + url = "github:youwen5/zen-browser-flake"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + home-manager = { + url = "github:nix-community/home-manager"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; + + outputs = { self, zen-browser, ... } @inputs: let + system = "x86_64-linux"; + inherit (inputs.hyprland.inputs) nixpkgs; + eachSystem = nixpkgs.lib.genAttrs (import inputs.hyprland.inputs.systems); + pkgsFor = eachSystem (system: import nixpkgs {localSystem = system;}); + in { + nixosConfigurations.nixos = nixpkgs.lib.nixosSystem { + inherit system; + modules = [ + ./configuration.nix + ./hardware-configuration.nix + inputs.home-manager.nixosModules.home-manager + { + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + + home-manager.extraSpecialArgs = { inherit self; }; + + home-manager.users.user = import ./home-manager/home.nix; + + home-manager.backupFileExtension = "backup"; + + # Optionally, use home-manager.extraSpecialArgs to pass arguments to home.nix + } + (let inputs = { zen = zen-browser; }; in + { config, pkgs, ... }: { + environment.systemPackages = [ + pkgs.git + inputs.zen.packages.${pkgs.stdenv.hostPlatform.system}.default + ]; + } + ) + ]; + }; + }; +} diff --git a/flake.nix.o b/flake.nix.o new file mode 100644 index 0000000..c226459 --- /dev/null +++ b/flake.nix.o @@ -0,0 +1,112 @@ +{ + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs"; + hyprland.url = "github:hyprwm/Hyprland"; + zen-browser = { + url = "github:youwen5/zen-browser-flake"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + home-manager = { + url = "github:nix-community/home-manager/release-25.11"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; + + outputs = { + self, + hyprland, + nixpkgs, + zen-browser, + home-manager, + ... + }: let + system = "x86_64-linux"; + inherit (hyprland.inputs) nixpkgs; + eachSystem = nixpkgs.lib.genAttrs (import hyprland.inputs.systems); + pkgsFor = eachSystem (system: import nixpkgs {localSystem = system;}); + rawCommitPins = (builtins.fromTOML (builtins.readFile ./hyprpm.toml)).repository.commit_pins; + commitPins = builtins.listToAttrs ( + map (p: { + name = builtins.head p; + value = builtins.elemAt p 1; + }) + rawCommitPins + ); + srcRev = "${commitPins.${hyprland.rev} or "git"}"; + srcRevShort = builtins.substring 0 7 srcRev; + in { + nixosConfigurations.nixos = nixpkgs.lib.nixosSystem { + inherit system; + modules = [ + ./configuration.nix + ./hardware-configuration.nix + home-manager.nixosModules.home-manager + { + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + + home-manager.extraSpecialArgs = { inherit self; }; + + # home-manager.users.user = import ./home.nix; + + # Optionally, use home-manager.extraSpecialArgs to pass arguments to home.nix + } + (let inputs = { zen = zen-browser; }; in + { config, pkgs, ... }: { + environment.systemPackages = [ + pkgs.git + inputs.zen.packages.${pkgs.stdenv.hostPlatform.system}.default + ]; + } + ) + ]; + }; + packages = eachSystem (system: let + pkgs = pkgsFor.${system}; + in rec { + hyprsplit = pkgs.stdenv.mkDerivation { + pname = "hyprsplit"; + version = "flakeRev=${self.shortRev or "dirty"}_srcRev=${srcRevShort}"; + src = + if (commitPins ? ${hyprland.rev}) && (self ? rev) + then + (builtins.fetchGit { + url = "https://github.com/shezdy/hyprsplit"; + rev = srcRev; + }) + else ./.; + + nativeBuildInputs = with pkgs; [pkg-config meson ninja gcc14]; + buildInputs = with pkgs; + [ + hyprland.packages.${system}.hyprland.dev + pixman + libdrm + ] + ++ hyprland.packages.${system}.hyprland.buildInputs; + + meta = with pkgs.lib; { + homepage = "https://github.com/shezdy/hyprsplit"; + description = "Hyprland plugin for separate sets of workspaces on each monitor"; + license = licenses.bsd3; + platforms = platforms.linux; + }; + }; + + default = hyprsplit; + }); + + devShells = eachSystem (system: let + pkgs = pkgsFor.${system}; + in { + default = pkgs.mkShell.override {stdenv = pkgs.gcc14Stdenv;} { + shellHook = '' + meson setup build --reconfigure + cp ./build/compile_commands.json ./compile_commands.json + ''; + name = "hyprsplit"; + inputsFrom = [self.packages.${system}.hyprsplit]; + }; + }); + }; +} diff --git a/hardware-configuration.nix b/hardware-configuration.nix new file mode 100644 index 0000000..652dcfd --- /dev/null +++ b/hardware-configuration.nix @@ -0,0 +1,39 @@ +# 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" "uas" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/3bf12238-0a1b-4d18-9cf0-a06209368e76"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/16F5-2D1A"; + fsType = "vfat"; + options = [ "fmask=0077" "dmask=0077" ]; + }; + + 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.enp34s0.useDHCP = lib.mkDefault true; + # networking.interfaces.enp3s0f0u2.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/home-manager/home.nix b/home-manager/home.nix new file mode 100644 index 0000000..03efb9e --- /dev/null +++ b/home-manager/home.nix @@ -0,0 +1,29 @@ +{ pkgs, ... }: +let +in +{ + home.username = "user"; + home.homeDirectory = "/home/user"; + + home.packages = with pkgs; [ + hyprland + fzf + eza + nnn + ]; + + wayland.windowManager.hyprland = { + enable = true; + }; + + gtk = { + enable = true; + theme = { + name = "Adwaita-dark"; + package = pkgs.gnome-themes-extra; + }; + }; + + + home.stateVersion = "26.05"; +}