From 725257485ff8874b307c7586bf05fb48cebbef74 Mon Sep 17 00:00:00 2001 From: uku Date: Sat, 25 Nov 2023 14:20:19 +0100 Subject: [PATCH] remove mainUser alias MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit je suis définitevement pas la patate la plus croustillante du four --- exprs/shotcut.nix | 160 +++++++++++++++---------------- programs/vscode.nix | 104 ++++++++++---------- systems/desktop.nix | 4 +- systems/fuji/default.nix | 6 +- systems/kilimandjaro/default.nix | 18 ++-- 5 files changed, 148 insertions(+), 144 deletions(-) diff --git a/exprs/shotcut.nix b/exprs/shotcut.nix index 91f6444..6dbbb00 100644 --- a/exprs/shotcut.nix +++ b/exprs/shotcut.nix @@ -1,87 +1,87 @@ -{ lib -, fetchFromGitHub -, stdenv -, wrapQtAppsHook -, SDL2 -, frei0r -, ladspaPlugins -, gettext -, mlt -, jack1 -, pkg-config -, fftw -, qtbase -, qttools -, qtmultimedia -, qtcharts -, cmake -, gitUpdater -, +{ + lib, + fetchFromGitHub, + stdenv, + wrapQtAppsHook, + SDL2, + frei0r, + ladspaPlugins, + gettext, + mlt, + jack1, + pkg-config, + fftw, + qtbase, + qttools, + qtmultimedia, + qtcharts, + cmake, + gitUpdater, }: assert lib.versionAtLeast mlt.version "7.18.0"; -stdenv.mkDerivation rec { - pname = "shotcut"; - version = "23.11.04"; + stdenv.mkDerivation rec { + pname = "shotcut"; + version = "23.11.04"; - src = fetchFromGitHub { - owner = "mltframework"; - repo = "shotcut"; - rev = "v${version}"; - hash = "sha256-0T/0gqW86enTO2OkmxiDF/kWPHILjRSNU2rufNJdVOg="; - }; + src = fetchFromGitHub { + owner = "mltframework"; + repo = "shotcut"; + rev = "v${version}"; + hash = "sha256-0T/0gqW86enTO2OkmxiDF/kWPHILjRSNU2rufNJdVOg="; + }; - nativeBuildInputs = [ pkg-config cmake wrapQtAppsHook ]; - buildInputs = [ - SDL2 - frei0r - ladspaPlugins - gettext - mlt - fftw - qtbase - qttools - qtmultimedia - qtcharts - ]; + nativeBuildInputs = [pkg-config cmake wrapQtAppsHook]; + buildInputs = [ + SDL2 + frei0r + ladspaPlugins + gettext + mlt + fftw + qtbase + qttools + qtmultimedia + qtcharts + ]; - env.NIX_CFLAGS_COMPILE = "-DSHOTCUT_NOUPGRADE"; - cmakeFlags = [ - "-DSHOTCUT_VERSION=${version}" - ]; + env.NIX_CFLAGS_COMPILE = "-DSHOTCUT_NOUPGRADE"; + cmakeFlags = [ + "-DSHOTCUT_VERSION=${version}" + ]; - prePatch = '' - sed 's_shotcutPath, "melt[^"]*"_"${mlt}/bin/melt"_' -i src/jobs/meltjob.cpp - sed 's_shotcutPath, "ffmpeg"_"${mlt.ffmpeg}/bin/ffmpeg"_' -i src/jobs/ffmpegjob.cpp - sed 's_qApp->applicationDirPath(), "ffmpeg"_"${mlt.ffmpeg}/bin/ffmpeg"_' -i src/docks/encodedock.cpp - NICE=$(type -P nice) - sed "s_/usr/bin/nice_''${NICE}_" -i src/jobs/meltjob.cpp src/jobs/ffmpegjob.cpp - ''; - - qtWrapperArgs = [ - "--prefix FREI0R_PATH : ${frei0r}/lib/frei0r-1" - "--prefix LADSPA_PATH : ${ladspaPlugins}/lib/ladspa" - "--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [jack1 SDL2]}" - "--prefix PATH : ${mlt}/bin" - ]; - - passthru.updateScript = gitUpdater { - rev-prefix = "v"; - }; - - meta = with lib; { - description = "A free, open source, cross-platform video editor"; - longDescription = '' - An official binary for Shotcut, which includes all the - dependencies pinned to specific versions, is provided on - http://shotcut.org. - - If you encounter problems with this version, please contact the - nixpkgs maintainer(s). If you wish to report any bugs upstream, - please use the official build from shotcut.org instead. + prePatch = '' + sed 's_shotcutPath, "melt[^"]*"_"${mlt}/bin/melt"_' -i src/jobs/meltjob.cpp + sed 's_shotcutPath, "ffmpeg"_"${mlt.ffmpeg}/bin/ffmpeg"_' -i src/jobs/ffmpegjob.cpp + sed 's_qApp->applicationDirPath(), "ffmpeg"_"${mlt.ffmpeg}/bin/ffmpeg"_' -i src/docks/encodedock.cpp + NICE=$(type -P nice) + sed "s_/usr/bin/nice_''${NICE}_" -i src/jobs/meltjob.cpp src/jobs/ffmpegjob.cpp ''; - homepage = "https://shotcut.org"; - license = licenses.gpl3Plus; - maintainers = with maintainers; [ goibhniu woffs peti ]; - platforms = platforms.linux; - }; -} + + qtWrapperArgs = [ + "--prefix FREI0R_PATH : ${frei0r}/lib/frei0r-1" + "--prefix LADSPA_PATH : ${ladspaPlugins}/lib/ladspa" + "--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [jack1 SDL2]}" + "--prefix PATH : ${mlt}/bin" + ]; + + passthru.updateScript = gitUpdater { + rev-prefix = "v"; + }; + + meta = with lib; { + description = "A free, open source, cross-platform video editor"; + longDescription = '' + An official binary for Shotcut, which includes all the + dependencies pinned to specific versions, is provided on + http://shotcut.org. + + If you encounter problems with this version, please contact the + nixpkgs maintainer(s). If you wish to report any bugs upstream, + please use the official build from shotcut.org instead. + ''; + homepage = "https://shotcut.org"; + license = licenses.gpl3Plus; + maintainers = with maintainers; [goibhniu woffs peti]; + platforms = platforms.linux; + }; + } diff --git a/programs/vscode.nix b/programs/vscode.nix index ffc0fc2..2297e38 100644 --- a/programs/vscode.nix +++ b/programs/vscode.nix @@ -1,65 +1,67 @@ {pkgs, ...}: { - mainUser.packages = with pkgs; [vscode]; + hm = { + home.packages = with pkgs; [vscode]; - hm.programs.vscode = { - enable = true; - enableUpdateCheck = false; + programs.vscode = { + enable = true; + enableUpdateCheck = false; - extensions = with pkgs.vscode-extensions; [ - # style - # bierner.markdown-preview-github-styles - catppuccin.catppuccin-vsc + extensions = with pkgs.vscode-extensions; [ + # style + # bierner.markdown-preview-github-styles + catppuccin.catppuccin-vsc - # git - donjayamanne.githistory - eamodio.gitlens + # git + donjayamanne.githistory + eamodio.gitlens - # misc - github.copilot - editorconfig.editorconfig - mkhl.direnv - usernamehw.errorlens - wakatime.vscode-wakatime + # misc + github.copilot + editorconfig.editorconfig + mkhl.direnv + usernamehw.errorlens + wakatime.vscode-wakatime - # rust - # dustypomerleau.rust-syntax - rust-lang.rust-analyzer - serayuzgur.crates - tamasfe.even-better-toml + # rust + # dustypomerleau.rust-syntax + rust-lang.rust-analyzer + serayuzgur.crates + tamasfe.even-better-toml - # nix - jnoortheen.nix-ide + # nix + jnoortheen.nix-ide - # cpp - # mesonbuild.mesonbuild - ms-vscode.cmake-tools - ms-vscode.cpptools - ms-vscode.makefile-tools - twxs.cmake - xaver.clang-format + # cpp + # mesonbuild.mesonbuild + ms-vscode.cmake-tools + ms-vscode.cpptools + ms-vscode.makefile-tools + twxs.cmake + xaver.clang-format - # python - # donjayamanne.python-environment-manager - ms-python.python - ms-python.vscode-pylance - ]; + # python + # donjayamanne.python-environment-manager + ms-python.python + ms-python.vscode-pylance + ]; - userSettings = { - "cmake.configureOnOpen" = true; - "editor.fontFamily" = "'Iosevka Nerd Font', monospace"; - "editor.fontSize" = 16; - "editor.formatOnSave" = true; - "editor.inlineSuggest.enabled" = true; - "files.autoSave" = "afterDelay"; - "nix.enableLanguageServer" = true; - "nix.serverPath" = "nil"; - "rust-analyzer.check.command" = "clippy"; - "terminal.integrated.fontFamily" = "Iosevka Nerd Font"; - "workbench.colorTheme" = "Catppuccin Mocha"; - "errorLens.messageBackgroundMode" = "message"; + userSettings = { + "cmake.configureOnOpen" = true; + "editor.fontFamily" = "'Iosevka Nerd Font', monospace"; + "editor.fontSize" = 16; + "editor.formatOnSave" = true; + "editor.inlineSuggest.enabled" = true; + "files.autoSave" = "afterDelay"; + "nix.enableLanguageServer" = true; + "nix.serverPath" = "nil"; + "rust-analyzer.check.command" = "clippy"; + "terminal.integrated.fontFamily" = "Iosevka Nerd Font"; + "workbench.colorTheme" = "Catppuccin Mocha"; + "errorLens.messageBackgroundMode" = "message"; - # fix for segfault on hyprland - "window.titleBarStyle" = "custom"; + # fix for segfault on hyprland + "window.titleBarStyle" = "custom"; + }; }; }; } diff --git a/systems/desktop.nix b/systems/desktop.nix index 8223692..56922c3 100644 --- a/systems/desktop.nix +++ b/systems/desktop.nix @@ -4,7 +4,6 @@ config, getchvim, agenix, - nixpkgs-stable, ... }: let username = "leo"; @@ -12,7 +11,6 @@ in { imports = [ ../programs (lib.mkAliasOptionModule ["hm"] ["home-manager" "users" username]) - (lib.mkAliasOptionModule ["mainUser"] ["users" "users" username]) ]; boot = { @@ -188,7 +186,7 @@ in { virtualisation.libvirtd.enable = true; - mainUser = { + users.users."${username}" = { isNormalUser = true; shell = pkgs.fish; extraGroups = ["networkmanager" "wheel" "video" "libvirtd"]; diff --git a/systems/fuji/default.nix b/systems/fuji/default.nix index eae7bcc..003b0d9 100644 --- a/systems/fuji/default.nix +++ b/systems/fuji/default.nix @@ -7,7 +7,9 @@ services.xserver.videoDrivers = ["amdgpu"]; - hm.wayland.windowManager.hyprland.settings.monitor = lib.mkForce ["DP-1,1920x1200@60,0x0,1" "HDMI-A-1,1440x900@60,1920x300,1"]; + hm = { + home.packages = with pkgs; [ryujinx]; - mainUser.packages = with pkgs; [ryujinx]; + wayland.windowManager.hyprland.settings.monitor = lib.mkForce ["DP-1,1920x1200@60,0x0,1" "HDMI-A-1,1440x900@60,1920x300,1"]; + }; } diff --git a/systems/kilimandjaro/default.nix b/systems/kilimandjaro/default.nix index 909aa8a..664163a 100644 --- a/systems/kilimandjaro/default.nix +++ b/systems/kilimandjaro/default.nix @@ -17,13 +17,15 @@ programs.light.enable = true; - mainUser.packages = with pkgs; [ - networkmanagerapplet - protonvpn-gui - ]; + hm = { + home.packages = with pkgs; [ + networkmanagerapplet + protonvpn-gui + ]; - hm.wayland.windowManager.hyprland.settings.exec-once = with pkgs; [ - "${lib.getExe networkmanagerapplet}" - "${lib.getExe' blueman "blueman-applet"}" - ]; + wayland.windowManager.hyprland.settings.exec-once = with pkgs; [ + "${lib.getExe networkmanagerapplet}" + "${lib.getExe' blueman "blueman-applet"}" + ]; + }; }