.desktoprc¶
To begin customizing your desktop, you need to create a file named .desktoprc
in your remote directory. This is a bash script which will be sourced each time
you log into any OCF desktop.
Lines that start with $ are commands to enter into a terminal emulator such as kitty or Konsole.
~/remoteis an sshfs mount fromtsunami, the OCF's public login server
To create a .desktoprc file, open a text editor of your choice and create a new file at ~/remote/.desktoprc.
For example, here's how to do it with the Konsole terminal and Kate text editor:
- Press Ctrl+Alt+T
- Run
$ kate ~/remote/.desktoprcin a terminal such askitty. - Paste the following line:
nix run home-manager -- switch --flake ~/remote/home-manager - Ctrl+S to save
Now, after logging in, the computer will switch to the flake within that directory.
Home Manager Flake¶
We will first create a directory on ~/remote that will set up NixOS
Home Manager via a Nix Flake. Run these commands in a terminal such as kitty.
$ mkdir ~/remote/home-manager
Now, we will generate basic flake.nix and home.nix files in that directory we just made with the next command.
$ nix run home-manager/master -- init ~/remote/home-manager
Plasma Manager¶
The default desktop environment on the OCF desktops is KDE Plasma. To make configuration management easier on KDE, we will use a home manager module called plasma-manager.
First, you'll want to add plasma-manager to your flake.nix file like so:
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
plasma-manager = {
url = "github:nix-community/plasma-manager";
inputs.nixpkgs.follows = "nixpkgs";
inputs.home-manager.follows = "home-manager";
};
};
outputs =
inputs@{ nixpkgs, home-manager, plasma-manager, ... }:
let
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
in
{
homeConfigurations."YOURUSERNAME" = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
# Specify your home configuration modules here, for example,
# the path to your home.nix.
modules = [
plasma-manager.homeModules.plasma-manager
./home.nix
];
# Optionally use extraSpecialArgs
# to pass through arguments to home.nix
};
};
}
Then, re-apply the flake with nix run home-manager -- switch --flake ~/remote/home-manager. You should see some terminal output, with some lines about the new inputs getting successfully added! You can now begin customizing your desktop. Be sure to save the files you've changed and run that command each time you want to refresh your configuration.
If you're having trouble understanding Nix syntax, check out the Nix documentation on Names and Values.
System light/dark mode¶
Insert the following in your home.nix file to change the system theme to dark:
programs.plasma.workspace = {
lookAndFeel = "org.kde.breezedark.desktop";
iconTheme = "Papirus-Dark";
};
Desktop Themes¶
-
Find a theme you want. Here are some from the official
nixpkgsrepository: -
Add a line with the nix package name, such as
pkgs.kde-gruvbox, to thehome.packageslist in thehome.nixfile. -
Re-apply the flake (
$ nix run home-manager -- switch --flake ~/remote/home-manager), then run$ plasma-apply-desktoptheme --list-themesto check that it was installed. -
A
Setting the wallpaper¶
Additional Customization!¶
Custom KDE cursor¶
Terminal Customization¶
- https://home-manager-options.extranix.com/
- Look at the options
- Set it (ex. programs.kitty.themeFile)
Debugging and Monitoring¶
You can look at the logs and outputs from your desktoprc by running $ systemctl —user status desktoprc.service or $ journalctl —user desktoprc.service.
Tracking with Git & Github¶
Sample Configs from OCF Staff¶
-
laksith: .desktoprc, home manager flake
-
jaysa: .desktoprc, home manager flake
Resources¶
Searches:
Wikis:
Relevant Reading: