Refactor home manager, and add desktop node on sparky.
This commit is contained in:
56
common/desktop-node.nix
Normal file
56
common/desktop-node.nix
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
|
# Enable Hyprland (Wayland compositor)
|
||||||
|
programs.hyprland = {
|
||||||
|
enable = true;
|
||||||
|
xwayland.enable = true; # For compatibility with X11 apps if needed
|
||||||
|
};
|
||||||
|
|
||||||
|
# Essential desktop services
|
||||||
|
services.dbus.enable = true;
|
||||||
|
|
||||||
|
# polkit for privilege escalation
|
||||||
|
security.polkit.enable = true;
|
||||||
|
|
||||||
|
# Enable sound with pipewire
|
||||||
|
security.rtkit.enable = true;
|
||||||
|
services.pipewire = {
|
||||||
|
enable = true;
|
||||||
|
alsa.enable = true;
|
||||||
|
alsa.support32Bit = true;
|
||||||
|
pulse.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
# XDG portal for screen sharing, file pickers, etc.
|
||||||
|
xdg.portal = {
|
||||||
|
enable = true;
|
||||||
|
extraPortals = [ pkgs.xdg-desktop-portal-hyprland ];
|
||||||
|
};
|
||||||
|
|
||||||
|
# Fonts
|
||||||
|
fonts.packages = with pkgs; [
|
||||||
|
noto-fonts
|
||||||
|
noto-fonts-cjk-sans
|
||||||
|
noto-fonts-emoji
|
||||||
|
liberation_ttf
|
||||||
|
fira-code
|
||||||
|
fira-code-symbols
|
||||||
|
];
|
||||||
|
|
||||||
|
# Enable GDM for login (can also use greetd or ly for lighter options)
|
||||||
|
services.greetd = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
default_session = {
|
||||||
|
command = "${pkgs.greetd.tuigreet}/bin/tuigreet --time --cmd Hyprland";
|
||||||
|
user = "greeter";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# Environment variables for Wayland
|
||||||
|
environment.sessionVariables = {
|
||||||
|
NIXOS_OZONE_WL = "1"; # Hint electron apps to use Wayland
|
||||||
|
WLR_NO_HARDWARE_CURSORS = "1"; # Fix cursor rendering on some hardware
|
||||||
|
};
|
||||||
|
}
|
||||||
55
flake.nix
55
flake.nix
@@ -54,8 +54,8 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
mkNixos =
|
mkHost =
|
||||||
system: modules:
|
system: profile: modules:
|
||||||
nixpkgs.lib.nixosSystem {
|
nixpkgs.lib.nixosSystem {
|
||||||
system = system;
|
system = system;
|
||||||
modules = [
|
modules = [
|
||||||
@@ -69,31 +69,30 @@
|
|||||||
disko.nixosModules.disko
|
disko.nixosModules.disko
|
||||||
sops-nix.nixosModules.sops
|
sops-nix.nixosModules.sops
|
||||||
impermanence.nixosModules.impermanence
|
impermanence.nixosModules.impermanence
|
||||||
|
home-manager.nixosModules.home-manager
|
||||||
|
{
|
||||||
|
home-manager = {
|
||||||
|
useGlobalPkgs = true;
|
||||||
|
useUserPackages = true;
|
||||||
|
users.ppetru = {
|
||||||
|
imports = [
|
||||||
|
(inputs.impermanence + "/home-manager.nix")
|
||||||
|
inputs.nix-index-database.homeModules.nix-index
|
||||||
|
inputs.nixvim.homeModules.nixvim
|
||||||
|
./home
|
||||||
|
];
|
||||||
|
};
|
||||||
|
extraSpecialArgs = {
|
||||||
|
inherit profile;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
] ++ modules;
|
] ++ modules;
|
||||||
specialArgs = {
|
specialArgs = {
|
||||||
inherit inputs self;
|
inherit inputs self;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
mkHMNixos =
|
|
||||||
system: modules:
|
|
||||||
mkNixos system ([
|
|
||||||
home-manager.nixosModules.home-manager
|
|
||||||
{
|
|
||||||
home-manager = {
|
|
||||||
useGlobalPkgs = true;
|
|
||||||
useUserPackages = true;
|
|
||||||
users.ppetru = {
|
|
||||||
imports = [
|
|
||||||
(inputs.impermanence + "/home-manager.nix")
|
|
||||||
inputs.nix-index-database.homeModules.nix-index
|
|
||||||
inputs.nixvim.homeModules.nixvim
|
|
||||||
./home
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}] ++ modules);
|
|
||||||
|
|
||||||
pkgsFor =
|
pkgsFor =
|
||||||
system:
|
system:
|
||||||
import nixpkgs {
|
import nixpkgs {
|
||||||
@@ -119,16 +118,16 @@
|
|||||||
in
|
in
|
||||||
{
|
{
|
||||||
nixosConfigurations = {
|
nixosConfigurations = {
|
||||||
c1 = mkHMNixos "x86_64-linux" [ ./hosts/c1 ];
|
c1 = mkHost "x86_64-linux" "server" [ ./hosts/c1 ];
|
||||||
c2 = mkHMNixos "x86_64-linux" [ ./hosts/c2 ];
|
c2 = mkHost "x86_64-linux" "server" [ ./hosts/c2 ];
|
||||||
c3 = mkHMNixos "x86_64-linux" [ ./hosts/c3 ];
|
c3 = mkHost "x86_64-linux" "server" [ ./hosts/c3 ];
|
||||||
alo-cloud-1 = mkHMNixos "aarch64-linux" [ ./hosts/alo-cloud-1 ];
|
alo-cloud-1 = mkHost "aarch64-linux" "server" [ ./hosts/alo-cloud-1 ];
|
||||||
zippy = mkHMNixos "x86_64-linux" [
|
zippy = mkHost "x86_64-linux" "workstation" [
|
||||||
ethereum-nix.nixosModules.default
|
ethereum-nix.nixosModules.default
|
||||||
./hosts/zippy
|
./hosts/zippy
|
||||||
];
|
];
|
||||||
chilly = mkHMNixos "x86_64-linux" [ ./hosts/chilly ];
|
chilly = mkHost "x86_64-linux" "workstation" [ ./hosts/chilly ];
|
||||||
sparky = mkHMNixos "x86_64-linux" [ ./hosts/sparky ];
|
sparky = mkHost "x86_64-linux" "desktop" [ ./hosts/sparky ];
|
||||||
};
|
};
|
||||||
|
|
||||||
deploy = {
|
deploy = {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{ pkgs, ... }:
|
{ pkgs, profile ? "cli", ... }:
|
||||||
{
|
{
|
||||||
home = {
|
home = {
|
||||||
packages = (import ./packages.nix { inherit pkgs; }).packages;
|
packages = (import ./packages.nix { inherit pkgs profile; }).packages;
|
||||||
stateVersion = "24.05"; # TODO: unify this with the references in flake.nix:inputs
|
stateVersion = "24.05"; # TODO: unify this with the references in flake.nix:inputs
|
||||||
|
|
||||||
sessionVariables = {
|
sessionVariables = {
|
||||||
|
|||||||
@@ -1,38 +1,7 @@
|
|||||||
{ pkgs }:
|
{ pkgs, profile ? "workstation" }:
|
||||||
let
|
let
|
||||||
corePkgs = with pkgs; [
|
profilePackages = import ./profiles/${profile}.nix { inherit pkgs; };
|
||||||
unstable.claude-code
|
|
||||||
unstable.codex
|
|
||||||
unstable.chromium
|
|
||||||
unstable.gemini-cli
|
|
||||||
unstable.playwright
|
|
||||||
unstable.playwright-driver.browsers
|
|
||||||
unstable.playwright-mcp
|
|
||||||
direnv
|
|
||||||
fzf
|
|
||||||
git
|
|
||||||
mosh
|
|
||||||
ripgrep
|
|
||||||
tmux
|
|
||||||
zsh
|
|
||||||
];
|
|
||||||
|
|
||||||
pythonEnv = pkgs.unstable.python3.withPackages (ps: [
|
|
||||||
# unstable only
|
|
||||||
# ps.aider-chat
|
|
||||||
ps.google-generativeai
|
|
||||||
ps.ipython
|
|
||||||
ps.llm
|
|
||||||
ps.llm-gemini
|
|
||||||
]);
|
|
||||||
|
|
||||||
fishPkgs = with pkgs.fishPlugins; [
|
|
||||||
pure
|
|
||||||
# don't add failed commands to history
|
|
||||||
sponge
|
|
||||||
transient-fish
|
|
||||||
];
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
packages = corePkgs ++ [ pythonEnv ] ++ fishPkgs;
|
packages = profilePackages.packages;
|
||||||
}
|
}
|
||||||
|
|||||||
12
home/profiles/desktop.nix
Normal file
12
home/profiles/desktop.nix
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{ pkgs }:
|
||||||
|
let
|
||||||
|
workstationProfile = import ./workstation.nix { inherit pkgs; };
|
||||||
|
|
||||||
|
desktopPkgs = with pkgs; [
|
||||||
|
unstable.chromium
|
||||||
|
foot # Wayland-native terminal emulator
|
||||||
|
];
|
||||||
|
in
|
||||||
|
{
|
||||||
|
packages = workstationProfile.packages ++ desktopPkgs;
|
||||||
|
}
|
||||||
27
home/profiles/server.nix
Normal file
27
home/profiles/server.nix
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
{ pkgs }:
|
||||||
|
let
|
||||||
|
corePkgs = with pkgs; [
|
||||||
|
direnv
|
||||||
|
fzf
|
||||||
|
git
|
||||||
|
mosh
|
||||||
|
ripgrep
|
||||||
|
tmux
|
||||||
|
zsh
|
||||||
|
];
|
||||||
|
|
||||||
|
pythonEnv = pkgs.unstable.python3.withPackages (ps: [
|
||||||
|
ps.google-generativeai
|
||||||
|
ps.ipython
|
||||||
|
]);
|
||||||
|
|
||||||
|
fishPkgs = with pkgs.fishPlugins; [
|
||||||
|
pure
|
||||||
|
# don't add failed commands to history
|
||||||
|
sponge
|
||||||
|
transient-fish
|
||||||
|
];
|
||||||
|
in
|
||||||
|
{
|
||||||
|
packages = corePkgs ++ [ pythonEnv ] ++ fishPkgs;
|
||||||
|
}
|
||||||
20
home/profiles/workstation.nix
Normal file
20
home/profiles/workstation.nix
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
{ pkgs }:
|
||||||
|
let
|
||||||
|
serverProfile = import ./server.nix { inherit pkgs; };
|
||||||
|
|
||||||
|
cliPkgs = with pkgs; [
|
||||||
|
unstable.claude-code
|
||||||
|
unstable.codex
|
||||||
|
unstable.gemini-cli
|
||||||
|
];
|
||||||
|
|
||||||
|
pythonEnv = pkgs.unstable.python3.withPackages (ps: [
|
||||||
|
ps.google-generativeai
|
||||||
|
ps.ipython
|
||||||
|
ps.llm
|
||||||
|
ps.llm-gemini
|
||||||
|
]);
|
||||||
|
in
|
||||||
|
{
|
||||||
|
packages = serverProfile.packages ++ cliPkgs ++ [ pythonEnv ];
|
||||||
|
}
|
||||||
@@ -5,6 +5,7 @@
|
|||||||
../../common/global
|
../../common/global
|
||||||
../../common/base-node.nix
|
../../common/base-node.nix
|
||||||
../../common/dev-node.nix
|
../../common/dev-node.nix
|
||||||
|
../../common/desktop-node.nix
|
||||||
./hardware.nix
|
./hardware.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user