Last active
April 17, 2025 15:35
-
-
Save 5310/75a93fb19f402a274c36838e2b7a4350 to your computer and use it in GitHub Desktop.
Fledgling Nixpkgs config using Flakes and Home Manager #dotfiles
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
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; | |
}; | |
}; | |
}; | |
}; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ inputs, config, pkgs, specialArgs, ... }: | |
{ | |
programs.home-manager = { | |
enable = true; | |
}; | |
nixpkgs = { | |
config = { | |
allowUnfree = true; | |
allowUnfreePredicate = (_: true); | |
}; | |
}; | |
xdg.portal = { | |
enable = true; | |
xdgOpenUsePortal = true; | |
# I think the name under config has to match up with the value of XDG_CURRENT_DESKTOP. | |
# kde portal by default, fallback to anything for KDE and i3 | |
# I don't set this for KDE in my personal config and it seems to work fine. | |
config.KDE.default = [ "kde" "*" ]; | |
config.${"none+i3"}.default = [ "kde" "*" ]; | |
extraPortals = [ | |
pkgs.xdg-desktop-portal-gtk | |
pkgs.xdg-desktop-portal-wlr | |
]; | |
}; | |
# 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 = { | |
# If you use a custom .bashrc, you need to add `source "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh"` to it | |
# Else, enable `program.bash.enable = true;` | |
EDITOR = "micro"; | |
GSETTINGS_SCHEMA_DIR = "${pkgs.gtk3}/share/gsettings-schemas/${pkgs.gtk3.name}/glib-2.0/schemas"; # https://github.com/thomX75/nixos-modules/tree/main/Glib-Schemas-Fix | |
}; | |
packages = with pkgs; lib.lists.flatten [ | |
[ # essentials | |
hello | |
nano | |
curl | |
wget | |
git | |
git-lfs | |
xdg-utils # required for vscode-fhs to open urls | |
] | |
[ # shell | |
zellij | |
atuin | |
nushell # $ nu | |
starship | |
micro | |
# | |
bat | |
broot # $ br | |
btop | |
eza | |
du-dust # $ dust | |
fastfetch | |
fd | |
fzf | |
pueue | |
ripgrep # $ rg | |
sysz | |
yazi | |
zoxide # $ z | |
zsync | |
] | |
[ # runtimes and programming | |
deno | |
nodejs # $ node, npm, npx | |
cargo | |
] | |
[ # containerization | |
podman | |
podman-tui | |
#distrobox | |
] | |
[ # networking | |
miniserve | |
#firejail | |
#caddy | |
#sozu | |
#firefox | |
] | |
( # AMD graphics # ROCM is still broken: https://github.com/NixOS/nixpkgs/issues/368672 | |
if specialArgs.isAmdgpu then [ | |
amdgpu_top | |
rocmPackages.rocminfo | |
] else [] | |
) | |
( # apps that ne`ed graphics | |
if specialArgs.isDesktop then builtins.map config.lib.nixGL.wrap [ | |
#wezterm | |
# | |
#cardinal # fails to detect Pipewire-Jack and run | |
#vcv-rack | |
# | |
#firefox | |
# | |
blender-hip | |
godot | |
# | |
#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 https://github.com/NixOS/nixpkgs/issues/88781 https://github.com/thomX75/nixos-modules/tree/main/Glib-Schemas-Fix | |
# | |
## 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.starship = { | |
# enable = true; | |
# # Configuration written to ~/.config/starship.toml | |
# }; | |
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 | |
]; | |
}; | |
programs.vscode = { | |
enable = true; | |
package = pkgs.vscode.fhs; | |
}; | |
## Stub tray.service in lieu 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