diff --git a/darwin/work/default.nix b/darwin/work/default.nix index 6cf2e8d..7b5442c 100644 --- a/darwin/work/default.nix +++ b/darwin/work/default.nix @@ -13,4 +13,5 @@ "vagrant" ]; }; + environment.loginShell = "${pkgs.xonsh}/bin/xonsh"; } diff --git a/home/gui/default.nix b/home/gui/default.nix index 1af3bcd..227de86 100644 --- a/home/gui/default.nix +++ b/home/gui/default.nix @@ -12,17 +12,20 @@ in ./firefox.nix ]; - home.packages = with pkgs; [ + # These packages are Linux only + home.packages = with pkgs; ( excludes ["x86_64-darwin" "aarch64-darwin"] + [ cdrtools - dconf2nix vlc x265 - ] ++ + ]) ++ - # Items that cannot be outside of x86_64-linux at all + # x86_64-linux only ( excludes ["x86_64-darwin" "aarch64-darwin" "aarch64-linux"] [ + bitwarden endeavour + gnucash jellyfin-media-player libreoffice logseq @@ -32,8 +35,8 @@ in # Items that are not supported on ARM/Linux ( excludes ["aarch64-linux"] [ - bitwarden onlyoffice-bin + synology-drive-client zoom-us ]); } diff --git a/home/home.nix b/home/home.nix index a546d97..010381c 100644 --- a/home/home.nix +++ b/home/home.nix @@ -12,7 +12,6 @@ ./direnv.nix ./git.nix ./ssh.nix - ./templates.nix ./vim.nix ./xonsh.nix ./hosts/${host} @@ -36,7 +35,6 @@ home.stateVersion = "23.05"; home.packages = with pkgs; [ bitwarden-cli - busybox copier diffutils findutils @@ -57,5 +55,8 @@ tree unzip wget - ]; + ] ++ ( if pkgs.system == "x86_64-linux" || pkgs.system == "aarch64-linux" then + # Linux-only packages here + [ + ] else []); } diff --git a/home/hosts/jude/default.nix b/home/hosts/jude/default.nix index 25e1a0f..c0cd0ad 100644 --- a/home/hosts/jude/default.nix +++ b/home/hosts/jude/default.nix @@ -1,14 +1,7 @@ { pkgs, ... }: { - home.packages = with pkgs; [ - gimp - gnucash - ffmpeg - handbrake - libtheora - makemkv - synology-drive-client - vagrant + imports = [ + ../../vscodium.nix ]; } diff --git a/home/hosts/work/default.nix b/home/hosts/work/default.nix index 7c60c06..0ba0b6e 100644 --- a/home/hosts/work/default.nix +++ b/home/hosts/work/default.nix @@ -1,6 +1,10 @@ { pkgs, ... }: { + imports = [ + ../../vscodium.nix + ]; + home.packages = with pkgs; [ brew ]; diff --git a/home/most/default.nix b/home/most/default.nix deleted file mode 100644 index 5ca3073..0000000 --- a/home/most/default.nix +++ /dev/null @@ -1,6 +0,0 @@ -# Put home configuration here that will affect most boxes -{ pkgs, ... }: - -{ - -} diff --git a/home/templates.nix b/home/templates.nix deleted file mode 100644 index 7f6ccb8..0000000 --- a/home/templates.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ pkgs, ... }: - -{ - home.packages = [ - pkgs.cookiecutter - ]; -} diff --git a/home/vim.nix b/home/vim.nix index 1546038..4d4c685 100644 --- a/home/vim.nix +++ b/home/vim.nix @@ -27,43 +27,6 @@ in pyright ]; - #programs.neovim = { - # enable = true; - # viAlias = true; - # vimAlias = true; - # vimdiffAlias = true; - # plugins = with pkgs.vimPlugins; [ - # ansible-vim - # bufexplorer -# -# #cmp-nvim-lsp -# #cmp-vsnip -# #nvim-lspconfig -# nvim-cmp -# -# jedi-vim -# -# context-vim -# direnv-vim -# fzf-vim -# nerdtree -# nvim-notify -# vim-airline -# vim-gitgutter -# vim-flake8 -# vim-fugitive -# vim-indent-guides -# vim-packer -# vim-rooter -# vim-xonsh -# gruvbox -# ]; -# extraLuaConfig = builtins.readFile ./init.lua; -# coc = { -# # Currently waiting on resolution of https://github.com/NixOS/nixpkgs/issues/236560 -# enable = false; -# }; -# }; programs.nixneovim = { enable = true; colorscheme = "gruvbox"; @@ -135,7 +98,7 @@ in nerdtree nvim-cmp - jedi-vim + #jedi-vim context-vim direnv-vim diff --git a/home/vscodium.nix b/home/vscodium.nix new file mode 100644 index 0000000..a828006 --- /dev/null +++ b/home/vscodium.nix @@ -0,0 +1,21 @@ +{ pkgs, ... }: + +{ + home.packages = with pkgs; [ + gopls + ]; + + # An alternative editor to vim, when I need it for some things + programs.vscode = { + enable = true; + package = pkgs.vscodium; + extensions = with pkgs.vscode-extensions; [ + golang.go + ms-python.python + vscjava.vscode-java-test + vscjava.vscode-java-dependency + vscjava.vscode-java-debug + vscodevim.vim + ]; + }; +} diff --git a/home/xonsh.nix b/home/xonsh.nix index 14d65ce..2281b50 100644 --- a/home/xonsh.nix +++ b/home/xonsh.nix @@ -37,7 +37,7 @@ cci = "./scripts/circleci-checks.py"; cgh = "$GH_CONFIG_DIR=\"${config.home.homeDirectory}/.config/gh/compass\" gh"; crun = "compass workspace run"; - ctest = "compass workspace test"; + ctest = "compass workspace test --extra-cmd-args=\"--test_output=errors\""; cylint = "./scripts/run_yaml_lint.py"; cpip = "compass workspace run src/python3/uc/tools:run_pip_compile"; diff --git a/home/xonsh_header.xsh b/home/xonsh_header.xsh index 1c332a3..cb378ff 100644 --- a/home/xonsh_header.xsh +++ b/home/xonsh_header.xsh @@ -25,3 +25,4 @@ if platform == "darwin": $PATH.append(Path("/opt/homebrew/bin/")) $PATH.append(Path("/run/current-system/sw/bin")) $PATH.append(Path("/nix/var/nix/profiles/default/bin")) + $PATH.append(Path("/usr/local/bin")) diff --git a/hosts/jude/default.nix b/hosts/jude/default.nix index 35ee182..681ca1f 100644 --- a/hosts/jude/default.nix +++ b/hosts/jude/default.nix @@ -8,7 +8,11 @@ ./printing.nix ./virt.nix ]; - programs.steam.enable = true; + programs = { + steam.enable = true; + nix-ld.enable = true; + }; + networking.hostName = "jude"; networking.enableIPv6 = false; #systemd.oomd.enable = false; @@ -17,19 +21,26 @@ greg.kde.enable = false; environment.systemPackages = with pkgs; [ + busybox + gimp + gnucash + flock + ffmpeg + handbrake + libtheora + makemkv + oathToolkit + synology-drive-client + vagrant + # Video/Audio data composition framework tools like "gst-inspect", "gst-launch" ... gst_all_1.gstreamer - # Common plugins like "filesrc" to combine within e.g. gst-launch gst_all_1.gst-plugins-base - # Specialized plugins separated by quality gst_all_1.gst-plugins-good gst_all_1.gst-plugins-bad gst_all_1.gst-plugins-ugly - # Plugins to reuse ffmpeg to play almost every video format gst_all_1.gst-libav - # Support the Video Audio (Hardware) Acceleration API gst_all_1.gst-vaapi - oathToolkit ]; fileSystems = { "/boot" = { diff --git a/modules-all/default.nix b/modules-all/default.nix index ecbdcad..46b9f93 100644 --- a/modules-all/default.nix +++ b/modules-all/default.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: +{ pkgs, lib, ... }: { # Enable flakes @@ -18,12 +18,13 @@ gc = { automatic = true; - dates = "weekly"; + # Scheduling of them is different in nixos vs nix-darwin, so check for + # the extra details there options = "--delete-older-than 30d"; }; settings = { - auto-optimise-store = true; + auto-optimise-store = (if lib.strings.hasSuffix "darwin" pkgs.system then false else true); experimental-features = "nix-command flakes"; keep-outputs = true; keep-derivations = true; @@ -59,6 +60,7 @@ hms # My own home manager switcher htop killall + lshw nano pciutils pwgen diff --git a/modules-darwin/default.nix b/modules-darwin/default.nix index 81c4be2..7979b86 100644 --- a/modules-darwin/default.nix +++ b/modules-darwin/default.nix @@ -7,4 +7,5 @@ bash.enable = true; }; services.nix-daemon.enable = true; + nix.gc.interval.Hour = 24; } diff --git a/modules-linux/default.nix b/modules-linux/default.nix index 041e0d4..e3b05b8 100644 --- a/modules-linux/default.nix +++ b/modules-linux/default.nix @@ -17,6 +17,8 @@ system.stateVersion = "22.05"; + nix.gc.dates = "weekly"; + # I am a fan of network manager, myself networking = { search = [ diff --git a/overlays/default.nix b/overlays/default.nix index 87c8372..4dbf372 100644 --- a/overlays/default.nix +++ b/overlays/default.nix @@ -41,6 +41,12 @@ in rec { xonsh-apipenv = cp ./xonsh-apipenv.nix {}; xonsh-direnv = cp ./xonsh-direnv.nix {}; xontrib-vox = cp ./xonsh-vox.nix {}; + copier = cp ./copier.nix { + inherit (python-final) + iteration-utilities + jinja2-ansible-filters + pyyaml-include; + }; }) ]; @@ -60,6 +66,7 @@ in rec { pkgs = final.pkgs; }; template = prev.callPackage ./template.nix { }; + xonsh = prev.xonsh.overridePythonAttrs (old: rec{ python3 = final.gregpy; propagatedBuildInputs = with final.gregpy.pkgs; old.propagatedBuildInputs ++ [ @@ -68,10 +75,4 @@ in rec { xontrib-vox ]; }); - - #bitwarden = macOver ./mac/bitwarden.nix "bitwarden"; - #gnucash = macOver ./mac/gnucash.nix "gnucash"; - #handbrake = macOver ./mac/handbrake.nix "handbrake"; - #onlyoffice-bin = macOver ./mac/onlyoffice-bin.nix "onlyoffice-bin"; - #vlc = macOver ./mac/vlc.nix "vlc"; } diff --git a/overlays/mac/bitwarden.nix b/overlays/mac/bitwarden.nix deleted file mode 100644 index 6c9277c..0000000 --- a/overlays/mac/bitwarden.nix +++ /dev/null @@ -1,32 +0,0 @@ -{ stdenv, fetchurl, - undmg, -}: - -stdenv.mkDerivation rec { - version = "2022.10.1"; - pname = "Bitwarden"; - - buildInputs = [ - undmg - ]; - sourceRoot = "."; - phases = [ - "unpackPhase" - "installPhase" - ]; - installPhase = '' - mkdir -p "$out/Applications" - cp -r Bitwarden*.app "$out/Applications" - ''; - - src = fetchurl { - name = "Bitwarden-${version}.dmg"; - url = "https://github.com/bitwarden/clients/releases/download/desktop-v${version}/Bitwarden-${version}-universal.dmg"; - sha256 = "sha256-6O8xaGBaG4d6l9QRtGM5wj9OCMFy87dH8N1MfEBBjck="; - }; - - meta = { - description = "Bitwarden, an open source password management tool"; - homepage = "https://bitwarden.com"; - }; -} diff --git a/overlays/mac/gnucash.nix b/overlays/mac/gnucash.nix deleted file mode 100644 index ea4c398..0000000 --- a/overlays/mac/gnucash.nix +++ /dev/null @@ -1,32 +0,0 @@ -{ stdenv, fetchurl, - undmg, -}: - -stdenv.mkDerivation rec { - version = "4.12"; - pname = "GnuCash"; - - buildInputs = [ - undmg - ]; - sourceRoot = "."; - phases = [ - "unpackPhase" - "installPhase" - ]; - installPhase = '' - mkdir -p "$out/Applications" - cp -r Gnucash*.app "$out/Applications" - ''; - - src = fetchurl { - name = "${pname}-${version}.dmg"; - url = "https://sourceforge.net/projects/gnucash/files/gnucash%20(stable)/${version}/Gnucash-Intel-${version}-1.dmg"; - sha256 = "sha256-GXsGOk+F/QdcD19ZmZmor0upCFHa7iy3Hs4CLbiby1M="; - }; - - meta = { - description = "GnuCash is free accounting software for your local machine"; - homepage = "https://www.gnucash.org"; - }; -} diff --git a/overlays/mac/handbrake.nix b/overlays/mac/handbrake.nix deleted file mode 100644 index 4ce96b1..0000000 --- a/overlays/mac/handbrake.nix +++ /dev/null @@ -1,32 +0,0 @@ -{ stdenv, fetchurl, - undmg, -}: - -stdenv.mkDerivation rec { - version = "1.5.1"; - pname = "HandBrake"; - - buildInputs = [ - undmg - ]; - sourceRoot = "."; - phases = [ - "unpackPhase" - "installPhase" - ]; - installPhase = '' - mkdir -p "$out/Applications" - cp -r ${pname}*.app "$out/Applications" - ''; - - src = fetchurl { - name = "${pname}-${version}.dmg"; - url = "https://github.com/HandBrake/HandBrake/releases/download/${version}/${pname}-${version}.dmg"; - sha256 = "sha256-dnyxYxTjhpxCz/eNuSvK16f6qGHHD5exMm/jaGxith8="; - }; - - meta = { - description = "HandBrake is an open source video transcoder"; - homepage = "https://handbrake.fr/"; - }; -} diff --git a/overlays/mac/onlyoffice-bin.nix b/overlays/mac/onlyoffice-bin.nix deleted file mode 100644 index c9918bf..0000000 --- a/overlays/mac/onlyoffice-bin.nix +++ /dev/null @@ -1,32 +0,0 @@ -{ stdenv, fetchurl, - undmg, -}: - -stdenv.mkDerivation rec { - version = "7.2.1"; - pname = "onlyoffice"; - - buildInputs = [ - undmg - ]; - sourceRoot = "."; - phases = [ - "unpackPhase" - "installPhase" - ]; - installPhase = '' - mkdir -p "$out/Applications" - cp -r *.app "$out/Applications" - ''; - - src = fetchurl { - name = "${pname}-${version}.dmg"; - url = "https://github.com/ONLYOFFICE/DesktopEditors/releases/download/v${version}/ONLYOFFICE-x86_64.dmg"; - sha256 = "sha256-dsuTaZ+IqsDE/j78ht0Md5NoqQ090cJ4u5LClu3tSp0="; - }; - - meta = { - description = "OnlyOffice provides a suite of Office-like document editors for the desktop and web."; - homepage = "https://www.onlyoffice.com/"; - }; -} diff --git a/overlays/mac/vlc.nix b/overlays/mac/vlc.nix deleted file mode 100644 index ad9b25c..0000000 --- a/overlays/mac/vlc.nix +++ /dev/null @@ -1,32 +0,0 @@ -{ stdenv, fetchurl, - undmg, -}: - -stdenv.mkDerivation rec { - version = "3.0.17.3"; - pname = "vlc"; - - buildInputs = [ - undmg - ]; - sourceRoot = "."; - phases = [ - "unpackPhase" - "installPhase" - ]; - installPhase = '' - mkdir -p "$out/Applications" - cp -r *.app "$out/Applications" - ''; - - src = fetchurl { - name = "${pname}-${version}.dmg"; - url = "https://get.videolan.org/vlc/${version}/macosx/${pname}-${version}-intel64.dmg"; - sha256 = "sha256-zKJn8sUa5WjgLztNimrbqHsr3l8BGiuHxZXBAtifEdg="; - }; - - meta = { - description = "VLC is a very versatile video player."; - homepage = "https://www.videolan.org/"; - }; -} diff --git a/overlays/xonsh-vox.nix b/overlays/xonsh-vox.nix index 6a458fe..4b7802e 100644 --- a/overlays/xonsh-vox.nix +++ b/overlays/xonsh-vox.nix @@ -22,6 +22,8 @@ buildPythonPackage rec { maintainers = []; }; + patchPhase = "sed -i -e 's/^dependencies.*$/dependencies = []/' pyproject.toml"; + doCheck = false; nativeBuildInputs = [ diff --git a/overlays/xonsh.nix b/overlays/xonsh.nix new file mode 100644 index 0000000..d8dce91 --- /dev/null +++ b/overlays/xonsh.nix @@ -0,0 +1,94 @@ +{ lib +, fetchFromGitHub +, python3Packages +, glibcLocales +, coreutils +, git +}: + +python3Packages.buildPythonApplication rec { + pname = "xonsh"; + version = "0.14.0"; + + # fetch from github because the pypi package ships incomplete tests + src = fetchFromGitHub { + owner = "xonsh"; + repo = "xonsh"; + rev = "refs/tags/${version}"; + sha256 = "sha256-ZrPKKa/vl06QAjGr16ZzKF/DAByFHr6ze2WVOCa+wf8="; + }; + + LC_ALL = "en_US.UTF-8"; + + postPatch = '' + sed -ie "s|/bin/ls|${coreutils}/bin/ls|" tests/test_execer.py + sed -ie "s|SHELL=xonsh|SHELL=$out/bin/xonsh|" tests/test_integrations.py + + sed -ie 's|/usr/bin/env|${coreutils}/bin/env|' tests/test_integrations.py + sed -ie 's|/usr/bin/env|${coreutils}/bin/env|' scripts/xon.sh + find scripts -name 'xonsh*' -exec sed -i -e "s|env -S|env|" {} \; + find -name "*.xsh" | xargs sed -ie 's|/usr/bin/env|${coreutils}/bin/env|' + patchShebangs . + + substituteInPlace scripts/xon.sh \ + --replace 'python' "${python3Packages.python}/bin/python" + + ''; + + makeWrapperArgs = [ + "--prefix PYTHONPATH : ${placeholder "out"}/lib/${python3Packages.python.libPrefix}/site-packages" + ]; + + postInstall = '' + wrapProgram $out/bin/xonsh \ + $makeWrapperArgs + ''; + + disabledTests = [ + # fails on sandbox + "test_colorize_file" + "test_loading_correctly" + "test_no_command_path_completion" + "test_bsd_man_page_completions" + "test_xonsh_activator" + # fails on non-interactive shells + "test_capture_always" + "test_casting" + "test_command_pipeline_capture" + "test_dirty_working_directory" + "test_man_completion" + "test_vc_get_branch" + "test_bash_and_is_alias_is_only_functional_alias" + ]; + + disabledTestPaths = [ + # fails on sandbox + "tests/completers/test_command_completers.py" + "tests/test_ptk_highlight.py" + "tests/test_ptk_shell.py" + # fails on non-interactive shells + "tests/prompt/test_gitstatus.py" + "tests/completers/test_bash_completer.py" + ]; + + preCheck = '' + HOME=$TMPDIR + ''; + + nativeCheckInputs = [ glibcLocales git ] ++ + (with python3Packages; [ pyte pytestCheckHook pytest-mock pytest-subprocess ]); + + propagatedBuildInputs = with python3Packages; [ ply prompt-toolkit pygments ]; + + meta = with lib; { + description = "A Python-ish, BASHwards-compatible shell"; + homepage = "https://xon.sh/"; + changelog = "https://github.com/xonsh/xonsh/raw/${version}/CHANGELOG.rst"; + license = licenses.bsd3; + maintainers = with maintainers; [ vrthra ]; + }; + + passthru = { + shellPath = "/bin/xonsh"; + }; +}