Add home manager

This commit is contained in:
GHOSCHT 2023-10-14 18:53:32 +02:00
parent 90b805e002
commit 87d635efe3
11 changed files with 186 additions and 7 deletions

View file

@ -70,6 +70,21 @@
"type": "github"
}
},
"nix-filter": {
"locked": {
"lastModified": 1693833173,
"narHash": "sha256-hlMABKrGbEiJD5dwUSfnw1CQ3bG7KKwDV+Nx3bEZd7U=",
"owner": "numtide",
"repo": "nix-filter",
"rev": "ac030bd9ba98e318e1f4c4328d60766ade8ebe8b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "nix-filter",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1696983906,
@ -123,7 +138,29 @@
"hyprland": "hyprland",
"nixpkgs": "nixpkgs",
"nixpkgs-unstable": "nixpkgs-unstable",
"nur": "nur"
"nur": "nur",
"split-monitor-workspaces": "split-monitor-workspaces"
}
},
"split-monitor-workspaces": {
"inputs": {
"hyprland": [
"hyprland"
],
"nix-filter": "nix-filter"
},
"locked": {
"lastModified": 1697056199,
"narHash": "sha256-Tkd4cI4Vq6cczZjiZdfs1Q9Gke+4iL1+S3c2GAGhEvc=",
"owner": "Duckonaut",
"repo": "split-monitor-workspaces",
"rev": "9b40de35aeb8c62df3326eae7979b438f3ee0fb1",
"type": "github"
},
"original": {
"owner": "Duckonaut",
"repo": "split-monitor-workspaces",
"type": "github"
}
},
"systems": {

View file

@ -32,6 +32,11 @@
url = "github:hyprwm/Hyprland"; # Requires "hyprland.nixosModules.default" to be added the host modules
inputs.nixpkgs.follows = "nixpkgs-unstable";
};
split-monitor-workspaces = {
url = "github:Duckonaut/split-monitor-workspaces";
inputs.hyprland.follows = "hyprland"; # <- make sure this line is present for the plugin to work as intended
};
};
outputs = inputs @ {
@ -41,6 +46,7 @@
home-manager,
nur,
hyprland,
split-monitor-workspaces,
...
}:
# Function telling flake which inputs to use
@ -56,7 +62,14 @@
nixosConfigurations = ( # NixOS Configurations
import ./hosts {
inherit (nixpkgs) lib;
inherit inputs nixpkgs nixpkgs-unstable home-manager nur hyprland vars; # Inherit inputs
inherit inputs nixpkgs nixpkgs-unstable home-manager nur hyprland split-monitor-workspaces vars; # Inherit inputs
}
);
homeConfigurations = ( # Nix Configurations
import ./nix/home.nix {
inherit (nixpkgs) lib;
inherit inputs nixpkgs nixpkgs-unstable home-manager vars hyprland split-monitor-workspaces;
}
);
};

View file

@ -7,7 +7,7 @@
vars,
...
}: {
imports = import ../modules/desktops;
imports = (import ../modules/desktops) ++ (import ../modules/shell);
users.users.${vars.user} = {
# System User
@ -22,6 +22,8 @@
environment.shells = with pkgs; [fish];
programs.fish.enable = true;
services.flatpak.enable = true;
# Enable the X11 windowing system.
# services.xserver.enable = true;
@ -108,6 +110,7 @@
bat
lazygit
fzf
neofetch
# Video/Audio
alsa-utils # Audio Control
@ -140,6 +143,7 @@
fishPlugins.sponge
fishPlugins.colored-man-pages
fishPlugins.autopair
nix-your-shell
# Other Packages Found @
# - ./<host>/default.nix
# - ../modules

View file

@ -6,6 +6,7 @@
home-manager,
nur,
hyprland,
split-monitor-workspaces,
vars,
...
}: let
@ -28,7 +29,7 @@ in {
inherit system;
specialArgs = {
# Pass Flake Variable
inherit inputs system unstable hyprland vars;
inherit inputs system unstable hyprland vars split-monitor-workspaces;
host = {
hostName = "desktop";
mainMonitor = "DP-3";
@ -38,9 +39,9 @@ in {
modules = [
# Modules Used
nur.nixosModules.nur
hyprland.nixosModules.default
./desktop
./configuration.nix
home-manager.nixosModules.home-manager
{
# Home-Manager Module

View file

@ -13,6 +13,8 @@
../../modules/services/avahi.nix
../../modules/virtualization/docker.nix
../../modules/virtualization/qemu.nix
../../modules/programs/games.nix
../../modules/services/easyeffects.nix
];
boot = {
@ -51,6 +53,7 @@
simple-scan # Scanning
easyeffects
firefox
heroic
];
};
}

View file

@ -11,6 +11,7 @@
hyprland,
vars,
host,
split-monitor-workspaces,
...
}:
with lib;
@ -31,21 +32,61 @@ with host; {
slurp # Region Selector
wl-clipboard # Clipboard
wlr-randr # Monitor Settings
dunst
hyprpaper
waybar
];
# sessionVariables = {
# "NIXOS_OZONE_WL" = "1"; # for any ozone-based browser & electron apps to run on wayland
# "MOZ_ENABLE_WAYLAND" = "1"; # for firefox to run on wayland
# "MOZ_WEBRENDER" = "1";
#
# # for hyprland with nvidia gpu, ref https://wiki.hyprland.org/Nvidia/
# "LIBVA_DRIVER_NAME" = "nvidia";
# "XDG_SESSION_TYPE" = "wayland";
# "GBM_BACKEND" = "nvidia-drm";
# "__GLX_VENDOR_LIBRARY_NAME" = "nvidia";
# "WLR_NO_HARDWARE_CURSORS" = "1";
# "WLR_EGL_NO_MODIFIRES" = "1";
# };
};
programs = {
hyprland = {
# Window Manager
enable = true;
package = hyprland.packages.${pkgs.system}.hyprland;
nvidiaPatches =
xwayland.enable = true;
enableNvidiaPatches =
if hostName == "desktop"
then true
else false;
};
};
hardware = {
opengl.enable = true;
nvidia.nvidiaSettings = true;
};
xdg.portal = {
enable = true;
extraPortals = with pkgs; [xdg-desktop-portal-gtk];
};
home-manager.users.${vars.user} = {
imports = [hyprland.homeManagerModules.default];
wayland.windowManager.hyprland = {
enable = true;
systemdIntegration = true;
extraConfig = ''
bind = SUPER, RETURN, exec, alacritty
'';
plugins = [
split-monitor-workspaces.packages.${pkgs.system}.split-monitor-workspaces
];
};
};
nix.settings = {
substituters = ["https://hyprland.cachix.org"];
trusted-public-keys = ["hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="];

View file

@ -0,0 +1,11 @@
{
config,
lib,
pkgs,
vars,
...
}: {
home-manager.users.${vars.user} = {
services.easyeffects.enable = true;
};
}

View file

@ -0,0 +1,4 @@
[
./git.nix
./fish.nix
]

21
modules/shell/fish.nix Normal file
View file

@ -0,0 +1,21 @@
{
config,
lib,
pkgs,
vars,
...
}: {
home-manager.users.${vars.user} = {
programs.fish = {
enable = true;
interactiveShellInit = ''
nix-your-shell fish | source
set fish_greeting
'';
shellAliases = {
lzg = "lazygit";
lzd = "lazydocker";
};
};
};
}

15
modules/shell/git.nix Normal file
View file

@ -0,0 +1,15 @@
{
config,
lib,
pkgs,
vars,
...
}: {
home-manager.users.${vars.user} = {
programs.git = {
enable = true;
userName = "GHOSCHT";
userEmail = "31184695+GHOSCHT@users.noreply.github.com";
};
};
}

29
nix/home.nix Normal file
View file

@ -0,0 +1,29 @@
{
lib,
inputs,
nixpkgs,
home-manager,
hyprland,
split-monitor-workspaces,
vars,
...
}: let
system = "x86_64-linux"; # System Architecture
pkgs = nixpkgs.legacyPackages.${system};
in {
pacman = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
extraSpecialArgs = {inherit inputs vars hyprland;};
modules = [
# Modules Used
{
home = {
username = "${vars.user}";
homeDirectory = "/home/${vars.user}";
packages = [pkgs.home-manager];
stateVersion = "23.05";
};
}
];
};
}