[go: up one dir, main page]

Skip to content

Instantly share code, notes, and snippets.

@5310
Last active October 25, 2024 12:19
Show Gist options
  • Save 5310/75a93fb19f402a274c36838e2b7a4350 to your computer and use it in GitHub Desktop.
Save 5310/75a93fb19f402a274c36838e2b7a4350 to your computer and use it in GitHub Desktop.
Fledgling Nixpkgs config using Flakes and Home Manager #dotfiles
- Installed using the [Determinate Systems Installer](https://github.com/DeterminateSystems/nix-installer)
- Specifically for the Steam Deck using the `deck` profile: `... install steam-deck`
- [NixGL](https://github.com/nix-community/home-manager/blob/master/docs/manual/usage/gpu-non-nixos.md) set up and working!
- Now a module included with Home Manager
- But the wrappers still need to be used with installed packages
{
description = "Home Manager configuration of deck";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
nixgl = {
url = "github:nix-community/nixGL";
inputs.nixpkgs.follows = "nixpkgs";
};
aagl = { # https://github.com/ezKEa/aagl-gtk-on-nix
url = "github:ezKEa/aagl-gtk-on-nix/release-24.05";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { nixpkgs, home-manager, nixgl, ... }@inputs: {
homeConfigurations = rec {
"deck@vium" = home-manager.lib.homeManagerConfiguration {
modules = [ ./home.nix ];
pkgs = import nixpkgs {
system = "x86_64-linux";
overlays = [
nixgl.overlay # inputs.nixgl in home.nix
];
};
extraSpecialArgs = {
inherit inputs;
username = "deck";
isDesktop = true;
isAmdgpu = true;
};
};
"scio@ampere" = home-manager.lib.homeManagerConfiguration {
modules = [ ./home.nix ];
pkgs = import nixpkgs {
system = "aarch64-linux";
overlays = [];
};
extraSpecialArgs = {
inherit inputs;
username = "scio";
isDesktop = false;
isAmdgpu = false;
};
};
};
};
}
{ inputs, config, pkgs, specialArgs, ... }:
{
programs.home-manager = {
enable = true;
};
nixpkgs = {
config = {
allowUnfree = true;
allowUnfreePredicate = (_: true);
};
};
# Enable XDG integration
xdg = {
enable = true;
# BUG: Disable XDG mimetypes integration, because without it Dolphin hangs
# [https://github.com/nix-community/home-manager/issues/4941#issuecomment-2052696388]
# due to a cyclical inheritence in kmimetypefinder5/6, to this day
# [https://bugs.kde.org/show_bug.cgi?id=477298#c6]
mime.enable = false;
};
# Wrap packages with it under home.packages like so:
# # (config.lib.nixGL.wrap <pkgname>)
nixGL = {
packages = inputs.nixgl.packages; # you must set this or everything will be a noop
defaultWrapper = "mesa"; # choose from options
};
###############################
# Commencing Home Management! #
###############################
home = rec {
username = "deck";
homeDirectory = "/home/${username}";
stateVersion = "24.05"; # Please read the comment before changing.
sessionVariables = {
EDITOR = "micro";
};
packages = with pkgs; lib.lists.flatten [
[ # essentials
hello
nano
curl
wget
git
git-lfs
]
[ # shell
zellij
atuin
nushell # $ nu
starship
micro
#
bat
broot # $ br
btop
eza
du-dust # $ dust
fastfetch
fd
fzf
pueue
ripgrep # $ rg
sysz
zoxide # $ z
]
[ # runtimes
deno
nodejs # $ node, npm, npx
]
[ # containerization
podman
podman-tui
#distrobox
]
[ # networking
miniserve
#firejail
#caddy
#sozu
#firefox
]
( # AMD graphics
if specialArgs.isAmdgpu then [
amdgpu_top
rocmPackages.rocminfo
] else []
)
( # apps that need graphics
if specialArgs.isDesktop then builtins.map config.lib.nixGL.wrap [
#wezterm
zed-editor # broken on the Deck's APU
#
#cardinal # fails to detect Pipewire-Jack and run
#vcv-rack
#
#firefox
#
blender-hip
godot_4
#
#alvr # can't launch SteamVR: at first kde-open5 doesn't exist, then KIO can't run steam://rungameid/250820/*
sidequest # crashes trying to install APKs*/
#
## nested Wayland does work, but Blender crashes
#weston
#niri
#river
#sway
#alacritty
#foot
#fuzzel
#
#virt-manager # requires nixos level libvirtd
] else []
)
( # https://github.com/ezKEa/aagl-gtk-on-nix
if specialArgs.isDesktop then with inputs.aagl.packages."${pkgs.system}"; [
#sleepy-launcher
] else []
)
];
};
programs.obs-studio = {
enable = true;
package = config.lib.nixGL.wrap pkgs.obs-studio;
plugins = with pkgs.obs-studio-plugins; [
obs-move-transition
obs-pipewire-audio-capture
obs-vkcapture
obs-gstreamer
obs-multi-rtmp
obs-shaderfilter
];
};
## Stub tray.service in liey of using HM XSession management
## https://github.com/nix-community/home-manager/issues/2064#issuecomment-2259307514
#systemd.user.targets.tray = {
# Unit = {
# Description = "Home Manager System Tray";
# Requires = [ "graphical-session-pre.target" ];
# };
#};
#
## Alternative to running KTailctl as Flatpak
## depends on tray.service
#services.trayscale = {
# enable = true;
#};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment