Skip to content

Instantly share code, notes, and snippets.

@5310
Last active July 3, 2024 13:09
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 set up and working!
{
description = "Home Manager configuration of deck";
inputs = {
# Specify the source of Home Manager and Nixpkgs.
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";
};
};
outputs = { nixpkgs, home-manager, nixGL, ... }@inputs: {
homeConfigurations = {
"deck@vium" = home-manager.lib.homeManagerConfiguration {
modules = [ ./home.nix ];
pkgs = import nixpkgs {
system = "x86_64-linux";
overlays = [
nixGL.overlay
];
};
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;
};
# NixGL integration into Home Manager,
# courtesy @Smon@github @giggio@github
# https://github.com/nix-community/home-manager/issues/3968#issuecomment-2135919008
nixGL.prefix = "${inputs.nixGL.packages."${pkgs.system}".nixGLIntel}/bin/nixGLIntel";
# FIXME: Remove this once this patch (#5355) is merged
imports = [
(builtins.fetchurl {
url = "https://raw.githubusercontent.com/Smona/home-manager/nixgl-compat/modules/misc/nixgl.nix";
sha256 = "e9f7da06111c7e669dbeef47f1878ed245392d4e7250237eaf791b734899be3c";
})
];
# # Wrap packages with it under home.packages like so:
# # (config.lib.nixGL.wrap <pkgname>)
###############################
# 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
zoxide # $ z
]
[ # runtimes
deno
nodejs # $ node, npm, npx
]
[ # containerization
podman
podman-tui
#distrobox
]
[ # networking
#caddy
#sozu
]
( # 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 [
#kitty
mypaint
#systemdgenie
] 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
];
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment