From 2f7400349a0d4b5669cf304f872803b4816079f6 Mon Sep 17 00:00:00 2001 From: "Thomas A. Christensen II" Date: Mon, 21 Apr 2025 18:09:44 -0500 Subject: [PATCH 1/7] Remove Musescore from Nix management --- homes/harmony.nix | 1 + homes/linux-desktop.nix | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/homes/harmony.nix b/homes/harmony.nix index 65fbf0a..79ffb65 100644 --- a/homes/harmony.nix +++ b/homes/harmony.nix @@ -15,6 +15,7 @@ # dnf packages: # firefoxpwa - The nix version installs an "immutable" runtime, which simply launches extra browser windows on non-NixOS # kate + # musescore # nextcloud-client # nextcloud-client-dolphin # steam diff --git a/homes/linux-desktop.nix b/homes/linux-desktop.nix index f42c727..78cb67c 100644 --- a/homes/linux-desktop.nix +++ b/homes/linux-desktop.nix @@ -2,7 +2,6 @@ home = { packages = with pkgs; [ inkscape-with-extensions - musescore obs-studio ollama qownnotes From b51bb2c4972d751cddffd8e63cda67544812a23b Mon Sep 17 00:00:00 2001 From: "Thomas A. Christensen II" Date: Mon, 21 Apr 2025 18:12:59 -0500 Subject: [PATCH 2/7] Make inkscape from dnf instead of nix Inkscape from Nix can't integrate with Plasma --- homes/harmony.nix | 1 + homes/linux-desktop.nix | 9 +-------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/homes/harmony.nix b/homes/harmony.nix index 79ffb65..6c43e9a 100644 --- a/homes/harmony.nix +++ b/homes/harmony.nix @@ -14,6 +14,7 @@ # dnf packages: # firefoxpwa - The nix version installs an "immutable" runtime, which simply launches extra browser windows on non-NixOS + # inkscape # kate # musescore # nextcloud-client diff --git a/homes/linux-desktop.nix b/homes/linux-desktop.nix index 78cb67c..8f5df63 100644 --- a/homes/linux-desktop.nix +++ b/homes/linux-desktop.nix @@ -1,13 +1,6 @@ { config, lib, pkgs, pkgs-unstable, ... }: { home = { - packages = with pkgs; [ - inkscape-with-extensions - obs-studio - ollama - qownnotes - trayscale - veracrypt - ]; + packages = with pkgs; [ obs-studio ollama qownnotes trayscale veracrypt ]; }; programs = { }; services = { From 4259275a454dc969825703ce47179c8ed3d0f992 Mon Sep 17 00:00:00 2001 From: "Thomas A. Christensen II" Date: Mon, 21 Apr 2025 18:16:38 -0500 Subject: [PATCH 3/7] Switch OBS to dnf --- homes/harmony.nix | 1 + homes/linux-desktop.nix | 4 +--- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/homes/harmony.nix b/homes/harmony.nix index 6c43e9a..96d03ed 100644 --- a/homes/harmony.nix +++ b/homes/harmony.nix @@ -19,6 +19,7 @@ # musescore # nextcloud-client # nextcloud-client-dolphin + # obs-studio # steam # tailscale # thunderbird diff --git a/homes/linux-desktop.nix b/homes/linux-desktop.nix index 8f5df63..8b225a7 100644 --- a/homes/linux-desktop.nix +++ b/homes/linux-desktop.nix @@ -1,7 +1,5 @@ { config, lib, pkgs, pkgs-unstable, ... }: { - home = { - packages = with pkgs; [ obs-studio ollama qownnotes trayscale veracrypt ]; - }; + home = { packages = with pkgs; [ ollama qownnotes trayscale veracrypt ]; }; programs = { }; services = { flatpak = { From 1a20ce20f1dcdbfafb30b4346e8ab858d8ca40ce Mon Sep 17 00:00:00 2001 From: "Thomas A. Christensen II" Date: Tue, 22 Apr 2025 10:59:46 -0500 Subject: [PATCH 4/7] Finish package management for now --- homes/harmony.nix | 12 +++++++++++- homes/linux-desktop.nix | 3 +-- homes/linux.nix | 12 ++++++++++++ 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/homes/harmony.nix b/homes/harmony.nix index 96d03ed..2943c78 100644 --- a/homes/harmony.nix +++ b/homes/harmony.nix @@ -12,14 +12,23 @@ # https://pkgs.tailscale.com/stable/fedora/tailscale.repo # https://packagecloud.io/filips/FirefoxPWA + # copr repos: + # iucar/rstudio + # dnf packages: + # chromium # firefoxpwa - The nix version installs an "immutable" runtime, which simply launches extra browser windows on non-NixOS # inkscape # kate + # krita # musescore # nextcloud-client # nextcloud-client-dolphin # obs-studio + # qownnotes + # qt + # rssguard + # rstudio-desktop # steam # tailscale # thunderbird @@ -28,11 +37,12 @@ # yakuake # zed # zsh + # R home = { username = "millironx"; homeDirectory = "/home/millironx"; # Signal desktop is not available in any other package repository for aarch64 linux - packages = [ pkgs-unstable.signal-desktop ]; + packages = [ pkgs-unstable.signal-desktop pkgs.bitwarden-desktop ]; }; programs = { git = { diff --git a/homes/linux-desktop.nix b/homes/linux-desktop.nix index 8b225a7..b5e1f52 100644 --- a/homes/linux-desktop.nix +++ b/homes/linux-desktop.nix @@ -1,5 +1,5 @@ { config, lib, pkgs, pkgs-unstable, ... }: { - home = { packages = with pkgs; [ ollama qownnotes trayscale veracrypt ]; }; + home = { packages = with pkgs; [ ollama trayscale veracrypt ]; }; programs = { }; services = { flatpak = { @@ -10,7 +10,6 @@ # serves as a place for me to write down the flatpaks I want to install # anyway packages = [ - "com.bitwarden.desktop" "com.github.tchx84.Flatseal" "com.logseq.Logseq" "io.freetubeapp.FreeTube" diff --git a/homes/linux.nix b/homes/linux.nix index 155cdb6..8914bac 100644 --- a/homes/linux.nix +++ b/homes/linux.nix @@ -15,6 +15,18 @@ "${config.xdg.dataHome}/kio/servicemenus/powerpoint-to-pdf.desktop".source = ./../dotfiles/powerpoint-to-pdf.desktop; }; + # A notable exception here: R + # R is a very painful program to manage. + # Package compatibility between R versions is abysmal, so I need to keep multiple R versions around.inherit + # For other languages, Nix/home-manager is the perfect solution + # (julia: `nix shell nixpkgs#julia-bin`, `nix shell nixpkgs#julia-lts`; + # node: `nix shell nixpkgs#nodejs`, `nix shell nixpkgs#nodejs_20` + # ruby: ... You get the picture). + # R is *very* complicated to manage in Nix. + # Nix requires bundling the base packages *and* RStudio, or RStudio can't find R. + # RStudio is useless without certain bundled packages (mainly `renv` in today's environment). + # Right now, I am using the distro's R on Linux, and Homebrew on MacOS. + # This is less than ideal, but I'm willing to deal with it for now. packages = with pkgs; [ bitwarden-cli ]; sessionVariables = { JULIA_NUM_THREADS = "$(nproc)"; }; shellAliases = { From aabc3478d7347bf4606ea85d658dbdc68c8884b8 Mon Sep 17 00:00:00 2001 From: "Thomas A. Christensen II" Date: Tue, 22 Apr 2025 11:00:24 -0500 Subject: [PATCH 5/7] Extend gpg pinentry time --- homes/common.nix | 4 ++-- homes/desktop.nix | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/homes/common.nix b/homes/common.nix index 86f7fb2..522ff65 100644 --- a/homes/common.nix +++ b/homes/common.nix @@ -47,8 +47,8 @@ in { NXF_SINGULARITY_CACHEDIR = "$NXF_CACHE/singularity"; JULIA_DEPOT_PATH = "\${XDG_DATA_HOME:-$HOME/.local/share}/julia:"; JULIA_PKG_USE_CLI_GIT = "true"; - GPG_TTY = "$(tty)"; - SSH_AUTH_SOCK = "$(gpgconf --list-dirs agent-ssh-socket)"; + # GPG_TTY = "$(tty)"; + # SSH_AUTH_SOCK = "$(gpgconf --list-dirs agent-ssh-socket)"; }; shellAliases = { cat = "bat"; diff --git a/homes/desktop.nix b/homes/desktop.nix index e686125..582c522 100644 --- a/homes/desktop.nix +++ b/homes/desktop.nix @@ -26,8 +26,8 @@ in { enableBashIntegration = true; enableSshSupport = true; enableZshIntegration = true; - defaultCacheTtl = 60; - maxCacheTtl = 120; + defaultCacheTtl = 10800; + maxCacheTtl = 21600; verbose = true; }; syncthing = { enable = true; }; From 0fc4cbf5fd2c446ae132a94afe5c43b77334d699 Mon Sep 17 00:00:00 2001 From: "Thomas A. Christensen II" Date: Tue, 22 Apr 2025 11:00:43 -0500 Subject: [PATCH 6/7] Delete home.nix --- home.nix | 325 ------------------------------------------------------- 1 file changed, 325 deletions(-) delete mode 100644 home.nix diff --git a/home.nix b/home.nix deleted file mode 100644 index a422f71..0000000 --- a/home.nix +++ /dev/null @@ -1,325 +0,0 @@ -{ config, lib, pkgs, pkgs-unstable, ... }: - -{ - # Home Manager needs a bit of information about you and the paths it should - # manage. - home.username = "millironx"; - home.homeDirectory = "/Users/millironx"; - - # This value determines the Home Manager release that your configuration is - # compatible with. This helps avoid breakage when a new Home Manager release - # introduces backwards incompatible changes. - # - # You should not change this value, even if you update Home Manager. If you do - # want to update the value, then make sure to first check the Home Manager - # release notes. - home.stateVersion = "23.11"; # Please read the comment before changing. - - # The home.packages option allows you to install Nix packages into your - # environment. - home.packages = with pkgs; [ - act - asitop - bat - cowsay - direnv - earthly - ffmpeg - figlet - fortune - gh - gitflow - git-absorb - gnugrep - gnupg - gnused - htop - jq - kdePackages.qtdeclarative - lsd - lynx - most - nil - nixd - nixfmt - pandoc - pinentry_mac - pipx - python3 - quarto - shellcheck - sketchybar-app-font - sqlitebrowser - woodpecker-cli - yt-dlp - zulu17 - - # # It is sometimes useful to fine-tune packages, for example, by applying - # # overrides. You can do that directly here, just don't forget the - # # parentheses. Maybe you want to install Nerd Fonts with a limited number of - # # fonts? - (pkgs.nerdfonts.override { - fonts = [ "FiraCode" "Hack" "Meslo" "NerdFontsSymbolsOnly" ]; - }) - (texlive.combine { inherit (texlive) scheme-basic latex-bin latexmk; }) - - # # You can also create simple shell scripts directly inside your - # # configuration. For example, this adds a command 'my-hello' to your - # # environment: - # (pkgs.writeShellScriptBin "my-hello" '' - # echo "Hello, ${config.home.username}!" - # '') - (pkgs.writeShellScriptBin "uq" '' - xattr -rdv com.apple.quarantine "/Applications/$1.app" - '') - (pkgs.writeShellScriptBin "get-current-wifi" '' - ipconfig getsummary $(networksetup -listallhardwareports | awk '/Hardware Port: Wi-Fi/{getline; print $2}') | awk -F ' SSID : ' '/ SSID : / {print $2}' - '') - ]; - - # Home Manager is pretty good at managing dotfiles. The primary way to manage - # plain files is through 'home.file'. - home.file = { - # # Building this configuration will create a copy of 'dotfiles/screenrc' in - # # the Nix store. Activating the configuration will then make '~/.screenrc' a - # # symlink to the Nix store copy. - # ".screenrc".source = dotfiles/screenrc; - - # # You can also set the file content immediately. - # ".gradle/gradle.properties".text = '' - # org.gradle.console=verbose - # org.gradle.daemon.idletimeout=3600000 - # ''; - }; - - # Home Manager can also manage your environment variables through - # 'home.sessionVariables'. If you don't want to manage your shell through Home - # Manager then you have to manually source 'hm-session-vars.sh' located at - # either - # - # ~/.nix-profile/etc/profile.d/hm-session-vars.sh - # - # or - # - # /etc/profiles/per-user/millironx/etc/profile.d/hm-session-vars.sh - # - home.sessionVariables = { - EDITOR = "nvim"; - PAGER = "most"; - NXF_HOME = "$HOME/.nextflow"; - NXF_CACHE = "$HOME/.cache/nextflow"; - NXF_CONDA_CACHEDIR = "$NXF_CACHE/conda"; - NXF_SINGULARITY_CACHEDIR = "$NXF_CACHE/singularity"; - JULIA_NUM_THREADS = "$(sysctl -n hw.logicalcpu)"; - JULIA_PKG_USE_CLI_GIT = "true"; - GPG_TTY = "$(tty)"; - SSH_AUTH_SOCK = "$(gpgconf --list-dirs agent-ssh-socket)"; - }; - - home.shellAliases = { - cat = "bat"; - ls = "lsd"; - code = "codium"; - nproc = "sysctl -n hw.logicalcpu"; - please = "sudo $(fc -ln -1)"; - nrun = '' - __NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia __VK_LAYER_NV_optimus="NVIDIA_only"''; - grim = "git rebase -i --autosquash $(git_main_branch)"; - grid = "git rebase -i --autosquash $(git_develop_branch)"; - gpub = "git push --set-upstream origin $(git rev-parse --abbrev-ref HEAD)"; - }; - - home.sessionPath = [ - "$HOME/.julia/bin" - "$HOME/.juliaup/bin" - "$HOME/.cargo/bin" - "$HOME/.local/bin" - "$HOME/.rd/bin" - ]; - - # Let Home Manager install and manage itself. - programs.home-manager.enable = true; - - programs.bash = { - enable = true; - initExtra = '' - # >>> conda initialize >>> - # !! Contents within this block are managed by 'conda init' !! - __conda_setup="$($HOME/miniconda3/bin/conda shell.bash 'hook' 2> /dev/null)" - if [ $? -eq 0 ]; then - eval "$__conda_setup" - else - if [ -f "$HOME/miniconda3/etc/profile.d/conda.sh" ]; then - . "$HOME/miniconda3/etc/profile.d/conda.sh" - else - export PATH="$HOME/miniconda3/bin:$PATH" - fi - fi - unset __conda_setup - - if [ -f "$HOME/miniconda3/etc/profile.d/mamba.sh" ]; then - . "$HOME/miniconda3/etc/profile.d/mamba.sh" - fi - # <<< conda initialize <<< - export PS1="[\[\e[32m\]\u\[\e[m\]@\[\e[33m\]\h\[\e[m\] \[\e[34m\]\W\[\e[m\]] \\$ " - function nd() { - mkdir -p "$1" && cd "$1" - } - ''; - profileExtra = '' - if [ "$(arch)" = "i386" ]; then - eval "$(/usr/local/bin/brew shellenv bash)" - else - eval "$(/opt/homebrew/bin/brew shellenv bash)" - fi - #gpgconf --launch gpg-agent - ''; - }; - programs.bat = { - enable = true; - config = { pager = "less -SRF"; }; - }; - programs.direnv = { - enable = true; - enableBashIntegration = true; - enableZshIntegration = true; - }; - programs.git = { - enable = true; - userName = "Thomas A. Christensen II"; - userEmail = "25492070+MillironX@users.noreply.github.com"; - signing = { - key = "0x19A2EF3A3C0C18A9!"; - signByDefault = true; - }; - extraConfig = { - core = { editor = "nvim"; }; - credential = { helper = "store"; }; - color = { ui = "auto"; }; - init = { defaultBranch = "master"; }; - column = { ui = "auto"; }; - branch = { sort = "-committerdate"; }; - tag = { sort = "version:refname"; }; - diff = { - algorithm = "histogram"; - colorMoved = "plain"; - mnemonicPrefix = true; - renames = true; - }; - push = { - default = "simple"; - autoSetupRemote = true; - followTages = true; - }; - fetch = { - prune = true; - pruneTags = true; - all = true; - }; - help = { autocorrect = "prompt"; }; - commit = { verbose = true; }; - rerere = { - enabled = true; - autoupdate = true; - }; - rebase = { - autoSquash = true; - autoStash = true; - updateRefs = true; - }; - merge = { conflictstyle = "zdiff3"; }; - pull = { rebase = true; }; - }; - }; - programs.gpg.enable = true; - programs.neovim = { - enable = true; - package = pkgs.neovim-unwrapped; - coc.enable = true; - plugins = with pkgs.vimPlugins; [ - mason-nvim - mason-lspconfig-nvim - nvim-lspconfig - nvim-dap - nvim-dap-ui - null-ls-nvim - nvim-lint - formatter-nvim - lspsaga-nvim - vim-slime - ]; - extraLuaConfig = '' - require("mason").setup() - ''; - }; - programs.zsh = { - enable = true; - autosuggestion.enable = true; - enableCompletion = true; - completionInit = - "autoload -U compinit && compinit; autoload -U bashcompinit && bashcompinit"; - antidote = { - enable = true; - plugins = [ - "ohmyzsh/ohmyzsh path:lib" - "ohmyzsh/ohmyzsh path:plugins/git" - "ohmyzsh/ohmyzsh path:plugins/extract" - "zsh-users/zsh-syntax-highlighting" - "zsh-users/zsh-autosuggestions" - "zsh-users/zsh-completions" - "romkatv/powerlevel10k" - ]; - }; - initExtraFirst = '' - if [[ -r "''${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-''${(%):-%n}.zsh" ]]; then - source "''${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-''${(%):-%n}.zsh" - fi - ''; - initExtra = '' - source ~/.p10k.zsh - # >>> conda initialize >>> - # !! Contents within this block are managed by 'conda init' !! - __conda_setup="$($HOME/miniconda3/bin/conda shell.zsh 'hook' 2> /dev/null)" - if [ $? -eq 0 ]; then - eval "$__conda_setup" - else - if [ -f "$HOME/miniconda3/etc/profile.d/conda.sh" ]; then - . "$HOME/miniconda3/etc/profile.d/conda.sh" - else - export PATH="$HOME/miniconda3/bin:$PATH" - fi - fi - unset __conda_setup - - if [ -f "$HOME/miniconda3/etc/profile.d/mamba.sh" ]; then - . "$HOME/miniconda3/etc/profile.d/mamba.sh" - fi - # <<< conda initialize <<< - #gpgconf --launch gpg-agent - source "$HOME/.cargo/env" - - function nd() { - mkdir -p "$1" && cd "$1" - } - ''; - profileExtra = '' - if [ "$(arch)" = "i386" ]; then - eval "$(/usr/local/bin/brew shellenv zsh)" - else - eval "$(/opt/homebrew/bin/brew shellenv zsh)" - fi - ''; - }; - services.gpg-agent = { - enable = true; - enableBashIntegration = true; - enableSshSupport = true; - enableZshIntegration = true; - defaultCacheTtl = 60; - maxCacheTtl = 120; - pinentryPackage = pkgs.pinentry_mac; - sshKeys = [ "CC3F27D613DCC2248B56A881FDDACEF6EA090E37" ]; - verbose = true; - }; - services.syncthing.enable = true; -} From 31d222fdaf78b58cc77b3bfd1165ba0a41082f19 Mon Sep 17 00:00:00 2001 From: "Thomas A. Christensen II" Date: Tue, 22 Apr 2025 11:04:13 -0500 Subject: [PATCH 7/7] Remove pkgs.nix and move all packages into homes/* --- homes/common.nix | 32 +++++++++++++++++++++++++----- homes/darwin.nix | 19 ++++++++++-------- homes/desktop.nix | 9 ++++++++- pkgs.nix | 50 ----------------------------------------------- 4 files changed, 46 insertions(+), 64 deletions(-) delete mode 100644 pkgs.nix diff --git a/homes/common.nix b/homes/common.nix index 522ff65..257c3f5 100644 --- a/homes/common.nix +++ b/homes/common.nix @@ -1,9 +1,5 @@ { config, lib, pkgs, pkgs-unstable, ... }: let - packages = import ./../pkgs.nix { - inherit pkgs; - inherit pkgs-unstable; - }; conda_init = shell: '' # >>> conda initialize >>> # !! Contents within this block are managed by 'conda init' !! @@ -38,7 +34,33 @@ in { ".p10k.zsh".source = ./../dotfiles/p10k.zsh; ".local/share/julia/config/startup.jl".source = ./../dotfiles/startup.jl; }; - packages = packages.common; + packages = with pkgs; [ + act + cowsay + earthly + ffmpeg + figlet + fortune + gitflow + git-absorb + gnugrep + gnused + gzip + htop + jq + julia-bin + lynx + most + nil + nixd + nixfmt-classic + pipx + python3 + quarto + shellcheck + zulu17 + (texlive.combine { inherit (texlive) scheme-basic latex-bin latexmk; }) + ]; sessionVariables = { PAGER = "most"; NXF_HOME = "\${XDG_DATA_HOME:-$HOME/.local/share}/nextflow"; diff --git a/homes/darwin.nix b/homes/darwin.nix index 9cf546f..393682e 100644 --- a/homes/darwin.nix +++ b/homes/darwin.nix @@ -1,12 +1,15 @@ -{ config, lib, pkgs, pkgs-unstable, ... }: -let - packages = import ./../pkgs.nix { - inherit pkgs; - inherit pkgs-unstable; - }; -in { +{ config, lib, pkgs, pkgs-unstable, ... }: { home = { - packages = packages.darwin; + packages = with pkgs; [ + asitop + pinentry_mac + (pkgs.writeShellScriptBin "uq" '' + xattr -rdv com.apple.quarantine "/Applications/$1.app" + '') + (pkgs.writeShellScriptBin "get-current-wifi" '' + ipconfig getsummary $(networksetup -listallhardwareports | awk '/Hardware Port: Wi-Fi/{getline; print $2}') | awk -F ' SSID : ' '/ SSID : / {print $2}' + '') + ]; sessionVariables = { JULIA_NUM_THREADS = "$(sysctl -n hw.logicalcpu)"; }; shellAliases = { nproc = "sysctl -n hw.logicalcpu"; }; }; diff --git a/homes/desktop.nix b/homes/desktop.nix index 582c522..ef4e2c3 100644 --- a/homes/desktop.nix +++ b/homes/desktop.nix @@ -8,7 +8,14 @@ let zed-config = import ./../programs/zed.nix; in { home = { - packages = packages.desktop; + packages = with pkgs; [ + kdePackages.qtdeclarative + sqlitebrowser + woodpecker-cli + (pkgs.nerdfonts.override { + fonts = [ "FiraCode" "Meslo" "NerdFontsSymbolsOnly" ]; + }) + ]; shellAliases = { code = "codium"; }; }; programs = { diff --git a/pkgs.nix b/pkgs.nix deleted file mode 100644 index 466d140..0000000 --- a/pkgs.nix +++ /dev/null @@ -1,50 +0,0 @@ -{ pkgs, pkgs-unstable, ... }: { - common = with pkgs; [ - act - cowsay - earthly - ffmpeg - figlet - fortune - gitflow - git-absorb - gnugrep - gnused - gzip - htop - jq - julia-bin - lynx - most - nil - nixd - nixfmt-classic - pipx - python3 - quarto - shellcheck - zulu17 - (texlive.combine { inherit (texlive) scheme-basic latex-bin latexmk; }) - ]; - - darwin = with pkgs; [ - asitop - pinentry_mac - (pkgs.writeShellScriptBin "uq" '' - xattr -rdv com.apple.quarantine "/Applications/$1.app" - '') - (pkgs.writeShellScriptBin "get-current-wifi" '' - ipconfig getsummary $(networksetup -listallhardwareports | awk '/Hardware Port: Wi-Fi/{getline; print $2}') | awk -F ' SSID : ' '/ SSID : / {print $2}' - '') - ]; - - desktop = with pkgs; [ - kdePackages.qtdeclarative - sqlitebrowser - woodpecker-cli - (pkgs.nerdfonts.override { - fonts = [ "FiraCode" "Meslo" "NerdFontsSymbolsOnly" ]; - }) - ]; - -}