Either of these individually or combined ensures your Gigabyte B550 board properly stays suspended.
While working on it, chatgpt also suggested a fix to the following issue
error: insufficient permission for adding an object to repository database .git/objects
fatal: cannot create an empty blob in the object database
error:
with this command sudo chown -R $(whoami) .git
chatgpt session
After yesterday’s unproductive initial refactor session, I decided to come back with a fresh set of eyes.
I used git to store my changes from yesterday in case I wanted to come back to
git stash
output
Saved working directory and index state WIP on master: 2eb6f7f re configure home manager + setup custom home manager profiles for machines
explanation: git stash will cache the uncommited changes
git checkout -b broken-refactor
output
Switched to a new branch 'broken-refactor'
explanation: the checkout -b will create a new branch called broken-refactor you can replace broken-refactor with any name with spaces replaced with - and _. The newly created branch will be based on the current you are on, so if you want to branch off another branch, make sure to stash your changes before switching off
creating a new branch will separate it from the master branch. You can think of it similar to creating a new folder and putting all the changed files inside of it or creating a new version of all the changed files. If you aren’t certain about something, asking chatgpt or github copilot is a great way before running the commands.
in fact I used it yesterday
using git commit ammend
To add a file to a past Git commit, your approach depends on how far back that commit is and whether it’s been pushed to a remote. Let’s walk through both common scenarios. I’ll guide you, but you can confirm your intent first:
Quick Clarifier Questions:
Do you want to modify the most recent commit?
Or do you want to modify an older commit further back in history?
Has this commit already been pushed to a remote (e.g. GitHub)?
If You Want to Add a File to the Most Recent Commit
And it hasn’t been pushed, this is safe and simple:
# Stage the file
git add path/to/your-file
# Amend the last commit
git commit --amend
This will open your editor so you can update the commit message or keep it the same. After saving, the file is added to the previous commit.
If You Want to Add a File to an Older Commit
You’ll need to rebase interactively:
git rebase -i HEAD~N
Replace N with how many commits back the target commit is.
In the editor that pops up, change pick to edit for the commit you want to add the file to.
Then Git will pause the rebase at that commit.
Add the file:
git add path/to/your-file
git commit --amend
Then continue the rebase:
git rebase --continue
If the Commit Has Been Pushed
Modifying pushed commits can cause problems for collaborators, since it rewrites history.
If you’re okay with force-pushing, you can do:
git push --force
Otherwise, it’s better to make a new commit that adds the file instead of rewriting history.
Want to try this interactively with a test repo or on a specific commit? I can walk through it with you.
git stash apply
output
Auto-merging modules/home.nix
On branch broken-refactor
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: flake.lock
modified: flake.nix
modified: machines/jade-tiger/configuration.nix
modified: machines/jade-tiger/home.nix
modified: modules/home.nix
modified: modules/kde.nix
no changes added to commit (use "git add" and/or "git commit -a")
explanation: stash apply will apply the changes that stash
commit all the changes with git add and git commit
git add vs git add -A the -A will add all files whereas git add relative path/file will add a single file. There might be times where you want to commit a specific change for a limited set of files, in which git add relative path/file would be preferred. In my case I want to cache all my changes, so I use git add -A
git commit -m "$message" this is your commit message, you can replace $message with anything, just make it a message you will remember when you go back and look over the log
check your available branches using git branch
output
git branch
* broken-refactor
master
explanation: git branch will show all branches you can check out the * will tell you which branch you are currently on. If you want to switch to another branch you can use git checkout $branch_name replace $branch_name the name of a branch from the output.
I started by creating a new branch off of my master branch using git checkout -b repo-refactor.
Then I asked chatgpt how to do it and provided some context
My goal is to make a universal home.nix manager module that I can share across mutliple machines. I also want to make it so that I can declaratively setup kde with the steam os vapor theme. It took a lot of work and many weekend sessions with Chatgpt.
Since this was over the course of weeks, I don’t quite remember what I did. This probably isn’t the best practice, but it worked for me and might be helpful for anyone else venturing down a similar path
To visualize the changes I asked Chatgpt to give me the git diff command to get the difference between my previous version and my current using git diff
git diff $pre-repo-refactor HEAD | wl-copy
$pre-repo-refactor is the commit hash of the pre-repo-refactor commits, | wl-copy takes the output and copies it to my wayland clipboard
updating the machine specfic home.nix
In my previous update, I learned how to use plasma manager to declaratively set kde themes and settings within home/plasma manager
I wanted to make it so that for a given machine home manager config, it would pull the module.
As you can see in this first git diff, I cut the kde specific plasma manager settings and moved them to their own file, you’ll see it in the next section.
After cutting the kde settings, I added a import for the kde-home.nix. My goal for this file is to house all my kde specific customizations. Ideally I would have one kde file, but I ran into issues building home manager at the same time as kde.nix (which tells nix to use kde as my desktop manager). Alas it was much easier to separate the files rather than fight nix with imports. It probably is doable, but to make it easier to manage and build. I will keep it separate
creating a generic kde configuration that can be inherited
This is pretty straight forward, I just added a new kde-home.nix which were the settings I previously used. Some new changes include using the steamos vapor theme
setting the steamos default theme for kde
I have steam deck and like the default theme they use.
After some research online I came across this nix config for the steamdeck.
I had some difficulty naviating and parsing the source repo for how they setup the kde module and was too lazy to dig further so with the help of chatgpt, I made my own based on this repo
While building the config, I ran into some issues with pulse audio. My best guess is that there was some updates that changed pulseaudio from a hardware to a service. Chatgpt suggested the change so that I can complete the build
If you are curious about the questions I asked to chatgpt you can review them below
Chatgpt session to refactor the repo and make the kde home manager settings into a separate module
using steam vapor theme
In the next update, I plan on adding ollama, vscodium, and other apps (obs, kdenlive, gimp, and steam) that I think would be helpful for my dad
Before I can start adding programs, I need to create users. looking over some guides online, and asking chatgpt, the suggested fix was to use home manager and put it within the configuration.nix.
My vision is to have a users folder with a respective user.nix for each user I want to manage, within the file there is a home manager config for the user and the packages. The machine would get it's own users.nix` index that will specify which users to pull from.
As mentioned, in the previous posts, I want to have configuration.nix to be as short as possible. I would much rather import and define from other places to make it manageable.
Specifically this section that defined a individual user
I fed the post and asked chatgpt to help me make the ultimate config.
git diff
I had many updates that I didn’t take notes for, as I was focused getting nix to give a desired outcome, so I’ll do a git diff of the latest version and where we left off.
adding users import to configuration.nix
After getting other accounts setup, removed the initial admin account for home manager. I moved it into it’s own file
I had chatgpt write a generic version of this so that I can have a boiler plate user config. All I need to change is the username and the user packages.
While building the other user accounts, I needed to make changes so that it would apply for each user not just the initial account I created with the pc
Also while I was at it, I moved my system packages as well
diff --git a/modules/home.nix b/modules/home.nix
index 1e07328..50c0fc9 100644
--- a/modules/home.nix
+++ b/modules/home.nix
@@ -22,6 +22,12 @@
# dictionaries
# aspell
# aspellDicts.en
+
+ # system packages
+ vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
+ wget
+ wl-clipboard
+ xclip
];
stateVersion = "22.05";
};
interactions with chatgpt
figuring out kde autohide with chatgpt
home manager debugging
Turns out the issue occurred if you didn’t login and setup the account
adding a user declartively
figuring out how to get kde layout theme to apply across multiple years
Certainly! Here’s our full interaction formatted in the [quote] structure:
getting uv to be my python environment manager in nix
I wanted uv to manage my python environments rather than nix. While trying to use a uv venv with the a vscodium jupyter notebook, I kept getting these errors
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/bedhedd/Documents/development-projects/.venv/lib/python3.12/site-packages/zmq/backend/cython/__init__.py", line 6, in <module>
from . import _zmq
ImportError: libstdc++.so.6: cannot open shared object file: No such file or directory
When I run find /nix/store -name 'libstdc++.so.6', the package shows up, but for whatever reason uv couldn’t get it working.
specifically this block, where they set a environment variable called LD_LIBRARY_PATH which points a valid libstdc++.so.6 path found with the find command
I had chatgpt rewrite the solution to work with my config. There was a lot of trial and error, but this is the solution that ultimately worked.
While researching solutions, I came across this post.
While the author is correct of using the nix way, the post was not helpful as the suggestion to use devshells, but did not link a best practice or reference. Furthermore, I wanted uv to manage all my python environments it is much faster than nix at building dependencies.
git diffs
Here’s the git diff of the changes that I applied to get it working with my environment.
fish config
I added the pkgs inheritance so that the environment variable UV_PYTHON would be able to point to the nix package. I also added a fish function so that if vscodium creates a terminal, it will be able to activate into the fish file rather than get stuck on the bash version
diff --git a/dotfiles/fish-config.nix b/dotfiles/fish-config.nix
index eb09839..20a6d61 100644
--- a/dotfiles/fish-config.nix
+++ b/dotfiles/fish-config.nix
@@ -1,4 +1,4 @@
-{ }:
+{ pkgs }:
''
# Custom Fish configuration extras
set -g fish_key_bindings fish_default_key_bindings
@@ -22,4 +22,25 @@ set -gx EDITOR nvim
set -gx VISUAL nvim
+set -x UV_PYTHON_PREFERENCE only-system
+set -x UV_PYTHON ${pkgs.python312Full}/bin/python
+
+function source --wraps=source
+ set -l file $argv[1]
+ if test -n "$file"
+ if string match -q "*.venv/bin/activate" "$file"
+ set -l fish_file "$file.fish"
+ if test -f "$fish_file"
+ echo "activating environment: $fish_file"
+ builtin source "$fish_file"
+ return $status
+ else
+ echo "No fish activation script found!" 1>&2
+ return 1
+ end
+ end
+ end
+ builtin source $argv
+end
+
''
home changes
I also moved uv from a user specific to a system wide install. I also applied the changes to update python to include the environment variable for LD_LIBRARY_PATH.
While searching for jupyter on nixpkgs I came across the vscode extensions. I added them because it made sense to have for all users.
The last change is making sure fish is able to import/inherit the pkgs so that the environment variable works
While deploying my dad’s local LLM PC this weekend, he wanted to remote into the desktop since he travels. Naturally I installed rust desk, but a issue we encountered was that when reconnecting, KDE would ask to grant screen sharing permissions. This is particularly annoying because no one will physically be able to grant the permissions
Some research online points to this being a Wayland issue
I’m going to try this solution posted here
@YamiYukiSenpai did you end up getting it working on Wayland?
After setting up nix for my dad, I wanted to start porting my fedora desktop to nix, but I wanted to first check what packages I have currently installed.
I’m not a gamer. I am sometimes but I’m more than happy to play on a PS5 or a Steam deck. Sometimes something comes up and I want to play on PC with decent graphics and games.
I only have one general x86 computer (not counting the deck) at home which happens to be my MS-01 home server. It has a 9060XT attached to it through USB4 but setting virtual machines with thunderbolt passthrough seem to be more problem than its worth. Dual boot is a big no since all NVMEs are part of the same raidz and I don’t want to maintain 2 OSs.
With specialisation I’ve setup a thunderbolt attached 9060 XT into the machine and using bootctl set-oneshot I boot into a version with the intel gpu disabled and sunshine running on it. Its still my same server but now its roleplaying as a remote gaming PC until I reboot it again. And it’s all controlled from my flake.nix. Plus all normal server services are still running.
So it’s less like playing MMO and more like when playing MMO and your character can respec when you need or want it. I love it. Now if I could power on the Thunderbolt enclosure automatically it would be great.
So if I read the entry and your setup correctly, you can effectively share your GPU in a external Thunderbolt enclosure between two systems and have the is hand off seamlessly? You should share your setup with @wendell.