From edaa68912dc24f69e831a800cfcae47336452c79 Mon Sep 17 00:00:00 2001 From: KeksNino Date: Fri, 26 Jun 2026 17:50:41 +0200 Subject: [PATCH] update lots --- configuration.nix | 126 ++++++++-------------- flake.nix | 28 +++-- flake.nix.o | 112 -------------------- hardware-configuration.nix | 27 +++-- home-manager/home.nix | 10 +- home-manager/mpd.nix | 209 +++++++++++++++++++++++++++++++++++++ packages.nix | 50 +++++++++ 7 files changed, 347 insertions(+), 215 deletions(-) delete mode 100644 flake.nix.o create mode 100644 home-manager/mpd.nix create mode 100644 packages.nix diff --git a/configuration.nix b/configuration.nix index 3bd7ddc..d1eb991 100644 --- a/configuration.nix +++ b/configuration.nix @@ -4,34 +4,50 @@ { config, pkgs, ... }: - { - imports = - [ # Include the results of the hardware scan. - ./hardware-configuration.nix + imports = [ + ./hardware-configuration.nix + ./packages.nix + ]; + + # DISKS + fileSystems."/media/gamedisk4" = { + device = "/dev/disk/by-uuid/D290EB87C8A1E82A"; + fsType = "ntfs3"; + options = [ + "uid=1000" + "gid=100" + "umask=022" ]; + }; - nix.settings.experimental-features = [ "nix-command" "flakes" ]; + 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" ]; + 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. @@ -52,26 +68,23 @@ 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" ]; + extraGroups = [ + "networkmanager" + "wheel" + ]; shell = pkgs.fish; - packages = with pkgs; []; + packages = with pkgs; [ ]; }; + programs.fish.enable = true; + # Enable automatic login for the user. services.getty.autologinUser = "user"; @@ -86,15 +99,9 @@ # NFS / MPD fileSystems."/media/music" = { device = "192.168.132.149:/media/music"; - fsType = "nfs"; + fsType = "nfs4"; }; - boot.supportedFilesystems = [ "nfs" ]; - - services.mpd.enable = true; - services.mpd.settings.musicDirectory = "~/Music"; - - # List packages installed in system profile. To search, run: - # $ nix search wget + boot.supportedFilesystems = [ "nfs4" ]; qt = { enable = true; @@ -103,60 +110,19 @@ }; services.goxlr-utility.enable = true; + services.udisks2.enable = true; programs.dms-shell.enable = true; programs.steam.enable = true; - programs.yazi.enable = true; programs.neovim.enable = true; security.rtkit.enable = true; systemd.services."rtkit-daemon".enable = true; - environment.systemPackages = with pkgs; [ - wget - efibootmgr - gdu - kitty - nemo - awww - jamesdsp - rofi - # waybar - udiskie - udisks2 - grimblast - pywal16 - xdg-desktop-portal - xdg-desktop-portal-hyprland - btop - bitwarden-desktop - fzf - zinit - zoxide - nitch - fzf - eza - tmux - lxappearance - cliphist - git - adwaita-icon-theme - gnumake - gcc - meson - playerctl - trash-cli - equibop - rmpc - wl-clipboard - cinny-desktop - unzip - p7zip - tree-sitter - ]; + environment.systemPackages = with pkgs; [ ]; -nixpkgs.config.permittedInsecurePackages = [ - "electron-39.8.10" -]; + nixpkgs.config.permittedInsecurePackages = [ + "electron-39.8.10" + ]; # Some programs need SUID wrappers, can be configured further or are # started in user sessions. @@ -171,12 +137,6 @@ nixpkgs.config.permittedInsecurePackages = [ # 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 diff --git a/flake.nix b/flake.nix index 5e706d7..fd5a471 100644 --- a/flake.nix +++ b/flake.nix @@ -12,15 +12,18 @@ }; }; - outputs = { self, zen-browser, ... } @inputs: let - system = "x86_64-linux"; - inherit (inputs) nixpkgs; - eachSystem = nixpkgs.lib.genAttrs (import inputs.systems); - pkgsFor = eachSystem (system: import nixpkgs {localSystem = system;}); - in { + outputs = + { self, zen-browser, ... }@inputs: + let + system = "x86_64-linux"; + inherit (inputs) nixpkgs; + eachSystem = nixpkgs.lib.genAttrs (import inputs.systems); + pkgsFor = eachSystem (system: import nixpkgs { localSystem = system; }); + in + { nixosConfigurations.nixos = nixpkgs.lib.nixosSystem { - inherit system; - modules = [ + inherit system; + modules = [ ./configuration.nix ./hardware-configuration.nix inputs.home-manager.nixosModules.home-manager @@ -36,7 +39,12 @@ # Optionally, use home-manager.extraSpecialArgs to pass arguments to home.nix } - (let inputs = { zen = zen-browser; }; in + ( + let + inputs = { + zen = zen-browser; + }; + in { config, pkgs, ... }: { environment.systemPackages = [ pkgs.git @@ -46,5 +54,5 @@ ) ]; }; - }; + }; } diff --git a/flake.nix.o b/flake.nix.o deleted file mode 100644 index c226459..0000000 --- a/flake.nix.o +++ /dev/null @@ -1,112 +0,0 @@ -{ - 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 index 652dcfd..1291e42 100644 --- a/hardware-configuration.nix +++ b/hardware-configuration.nix @@ -8,7 +8,7 @@ [ (modulesPath + "/installer/scan/not-detected.nix") ]; - boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usbhid" "usb_storage" "uas" "sd_mod" ]; + boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ]; boot.initrd.kernelModules = [ ]; boot.kernelModules = [ "kvm-amd" ]; boot.extraModulePackages = [ ]; @@ -24,15 +24,24 @@ options = [ "fmask=0077" "dmask=0077" ]; }; - swapDevices = [ ]; + fileSystems."/media/music" = + { device = "192.168.132.149:/media/music"; + fsType = "nfs4"; + }; - # 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; + fileSystems."/mnt" = + { device = "/dev/disk/by-uuid/8873d98f-c461-4d34-8867-f4ebd5c205d2"; + fsType = "ext4"; + }; + + fileSystems."/media/gamedisk4" = + { device = "/dev/disk/by-uuid/D290EB87C8A1E82A"; + fsType = "ntfs3"; + }; + + swapDevices = + [ { device = "/dev/disk/by-uuid/5949c73f-30eb-4956-9e93-70301c88fad8"; } + ]; 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 index 7fc84e9..66791ad 100644 --- a/home-manager/home.nix +++ b/home-manager/home.nix @@ -2,6 +2,10 @@ let in { + imports = [ + ./mpd.nix + ]; + home.username = "user"; home.homeDirectory = "/home/user"; @@ -11,6 +15,11 @@ in nnn ]; + programs.yazi.enable = true; + programs.yazi.enableFishIntegration = true; + + programs.fish.enable = true; + # wayland.windowManager.hyprland = { # enable = true; # }; @@ -23,6 +32,5 @@ in }; }; - home.stateVersion = "26.05"; } diff --git a/home-manager/mpd.nix b/home-manager/mpd.nix new file mode 100644 index 0000000..86f7639 --- /dev/null +++ b/home-manager/mpd.nix @@ -0,0 +1,209 @@ +{ + services.mpd = { + enable = true; + musicDirectory = "/home/user/Music"; + playlistDirectory = "/home/user/Music/Playlists"; + dbFile = "/home/user/.config/mpd/database"; + # log_file = "~/.config/mpd/log"; + extraConfig = '' + save_absolute_paths_in_playlists "yes" + metadata_to_use "+comment" + audio_output { + type "pipewire" + name "Pipewire Sound Server" + } + auto_update "yes" + ''; + network.listenAddress = "/home/user/.config/mpd/socket"; + }; + + programs.rmpc.enable = true; + programs.rmpc.config = '' + #![enable(implicit_some)] + #![enable(unwrap_newtypes)] + #![enable(unwrap_variant_newtypes)] + ( + address: "/home/user/.config/mpd/socket", + password: None, + theme: Some("default"), + cache_dir: Some("/home/user/Music/rmpc"), + on_song_change: None, + volume_step: 5, + max_fps: 60, + scrolloff: 0, + wrap_navigation: false, + enable_mouse: true, + enable_config_hot_reload: true, + status_update_interval_ms: 1000, + rewind_to_start_sec: None, + reflect_changes_to_playlist: false, + select_current_song_on_change: false, + browser_song_sort: [Track, Disc, Artist, Title], + directories_sort: SortFormat(group_by_type: true, reverse: false), + album_art: ( + method: Kitty, + max_size_px: (width: 1200, height: 1200), + disabled_protocols: ["http://", "https://"], + vertical_align: Center, + horizontal_align: Center, + ), + keybinds: ( + global: { + ":": CommandMode, + ",": VolumeDown, + "s": Stop, + ".": VolumeUp, + "": NextTab, + "": PreviousTab, + "1": SwitchToTab("Queue"), + "2": SwitchToTab("Files"), + "3": SwitchToTab("Playlists"), + "4": SwitchToTab("Artists"), + "5": SwitchToTab("Albums"), + "6": SwitchToTab("Search"), + //"7": SwitchToTab("Album Artists"), + "q": Quit, + ">": NextTrack, + "p": TogglePause, + "<": PreviousTrack, + "f": SeekForward, + "z": ToggleRepeat, + "x": ToggleRandom, + "c": ToggleConsume, + "v": ToggleSingle, + "b": SeekBack, + "~": ShowHelp, + "u": Update, + "U": Rescan, + "I": ShowCurrentSongInfo, + "O": ShowOutputs, + "P": ShowDecoders, + "R": AddRandom, + "": ExternalCommand(command: ["/home/user/.scripts/check-playlist.sh"], description: "Check if selected song is already in a playlist"), + }, + navigation: { + "k": Up, + "j": Down, + "h": Left, + "l": Right, + "": Up, + "": Down, + "": Left, + "": Right, + "": PaneUp, + "": PaneDown, + "": PaneLeft, + "": PaneRight, + "": UpHalf, + "N": PreviousResult, + "a": Add, + "A": AddAll, + "r": Rename, + "n": NextResult, + "g": Top, + "": Select, + "": InvertSelection, + "G": Bottom, + "": Confirm, + "i": FocusInput, + "J": MoveDown, + "": DownHalf, + "/": EnterSearch, + "": Close, + "": Close, + "K": MoveUp, + "D": Delete, + "B": ShowInfo, + }, + queue: { + "D": DeleteAll, + "": Play, + "": Save, + "a": AddToPlaylist, + "d": Delete, + "C": JumpToCurrent, + "X": Shuffle, + }, + ), + search: ( + case_sensitive: false, + mode: Contains, + tags: [ + (value: "any", label: "Any Tag"), + (value: "artist", label: "Artist"), + (value: "album", label: "Album"), + (value: "albumartist", label: "Album Artist"), + (value: "title", label: "Title"), + (value: "filename", label: "Filename"), + (value: "genre", label: "Genre"), + ], + ), + artists: ( + album_display_mode: SplitByDate, + album_sort_by: Date, + ), + cava: ( + framerate: 60, + autosens: true, + sensitivity: 110, // default 100 + lower_cutoff_freq: 50, // not passed to cava if not provided + higher_cutoff_freq: 10000, // not passed to cava if not provided + input: ( + method: Fifo, + source: "/tmp/mpd.fifo", + sample_rate: 44100, + channels: 2, + sample_bits: 16, + ), + smoothing: ( + noise_reduction: 77, + monstercat: true, + waves: false, + ), + eq: [] + ), + tabs: [ + ( + name: "Queue", + pane: Split( + direction: Horizontal, + panes: [ + (size: "40%", pane: Pane(AlbumArt)), + (size: "60%", pane: Split( + direction: Vertical, + panes: [ + (size: "95%", pane: Pane(Queue)), + (size: "30%", pane: Pane(Cava)), + ], + )), + ], + ), + ), + ( + name: "Files", + pane: Pane(Directories), + ), + ( + name: "Playlists", + pane: Pane(Playlists), + ), + ( + name: "Artists", + pane: Pane(Artists), + ), + ( + name: "Albums", + pane: Pane(Albums), + ), + ( + name: "Search", + pane: Pane(Search), + ), + //( + // name: "Album Artists", + // pane: Pane(AlbumArtists), + //), + ], + ) + ''; +} diff --git a/packages.nix b/packages.nix new file mode 100644 index 0000000..f336079 --- /dev/null +++ b/packages.nix @@ -0,0 +1,50 @@ +{ pkgs, ... }: { + + environment.systemPackages = with pkgs; [ + wget + efibootmgr + gdu + kitty + nemo + awww + jamesdsp + rofi + # waybar + udiskie + grimblast + pywal16 + btop + bitwarden-desktop + fzf + zinit + zoxide + nitch + fzf + eza + tmux + cliphist + git + adwaita-icon-theme + gnumake + gcc + meson + playerctl + trash-cli + equibop + wl-clipboard + cinny-desktop + unzip + p7zip + tree-sitter + nodejs + nixfmt + decibels + nwg-look + mpc + python3 + basedpyright + waypaper + nerd-fonts.caskaydia-mono + lazygit + ]; +}