Added hyprland, zsh, sddm, and xdg
This commit is contained in:
parent
a3eb62b416
commit
95d8165c24
|
|
@ -3,30 +3,19 @@
|
|||
# https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
|
||||
|
||||
{ config, lib, pkgs, ... }:
|
||||
let
|
||||
nixpkgs = fetchTarball "https://github.com/NixOS/nixpkgs/tarball/26d499fc9f1d567283d5d56fcf367edd815dba1d.tar.gz";
|
||||
in
|
||||
|
||||
{
|
||||
imports =
|
||||
[ # Include the results of the hardware scan.
|
||||
# ./hardware-configuration.nix
|
||||
./hardware-configuration.nix
|
||||
./hyprland.nix
|
||||
./modules/main-user.nix
|
||||
];
|
||||
|
||||
# Use the systemd-boot EFI boot loader.
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
|
||||
# Virtual machine options
|
||||
# virtualisation.vmVariant = {
|
||||
# virtualisation = {
|
||||
# memorySize = 8192;
|
||||
# cores = 8;
|
||||
# };
|
||||
# };
|
||||
|
||||
networking.hostName = "nixos"; # Define your hostname.
|
||||
# networking.hostName = "nixos"; # Define your hostname.
|
||||
# Pick only one of the below networking options.
|
||||
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
|
||||
# networking.networkmanager.enable = true; # Easiest to use and most distros use this by default.
|
||||
|
|
@ -76,21 +65,6 @@ in
|
|||
# Enable touchpad support (enabled default in most desktopManager).
|
||||
# services.libinput.enable = true;
|
||||
|
||||
# Define a user account. Don't forget to set a password with ‘passwd’.
|
||||
users.users.josh = {
|
||||
isNormalUser = true;
|
||||
initialPassword = "test";
|
||||
extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user.
|
||||
packages = with pkgs; [
|
||||
cowsay
|
||||
lolcat
|
||||
htop
|
||||
firefox
|
||||
pciutils
|
||||
vim
|
||||
];
|
||||
};
|
||||
|
||||
# List packages installed in system profile. To search, run:
|
||||
# $ nix search wget
|
||||
# environment.systemPackages = with pkgs; [
|
||||
|
|
|
|||
22
flake.lock
22
flake.lock
|
|
@ -1,5 +1,26 @@
|
|||
{
|
||||
"nodes": {
|
||||
"home-manager": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1753479839,
|
||||
"narHash": "sha256-E/rPVh7vyPMJUFl2NAew+zibNGfVbANr8BP8nLRbLkQ=",
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"rev": "0b9bf983db4d064764084cd6748efb1ab8297d1e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-community",
|
||||
"ref": "release-25.05",
|
||||
"repo": "home-manager",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1753345091,
|
||||
|
|
@ -18,6 +39,7 @@
|
|||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"home-manager": "home-manager",
|
||||
"nixpkgs": "nixpkgs"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
41
flake.nix
41
flake.nix
|
|
@ -1,34 +1,39 @@
|
|||
{
|
||||
description = "NixOS configuration";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-25.05";
|
||||
home-manager.url = "github:nix-community/home-manager/release-25.05";
|
||||
home-manager.inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, ... }:
|
||||
let
|
||||
system = "x86_64-linux";
|
||||
in
|
||||
{
|
||||
nixosConfigurations.nixos = nixpkgs.lib.nixosSystem {
|
||||
outputs = { nixpkgs, home-manager, ... } @ inputs: let
|
||||
system = "x86_64-linux";
|
||||
host = "vm";
|
||||
profile = "vm";
|
||||
username = "josh";
|
||||
in {
|
||||
nixosConfigurations = {
|
||||
nixos = nixpkgs.lib.nixosSystem {
|
||||
inherit system;
|
||||
specialArgs = { inherit inputs; };
|
||||
modules = [
|
||||
{ nix.settings.experimental-features = ["nix-command" "flakes"]; }
|
||||
./configuration.nix
|
||||
];
|
||||
};
|
||||
|
||||
nixosConfigurations.nixosvm = nixpkgs.lib.nixosSystem {
|
||||
nixosvm = nixpkgs.lib.nixosSystem {
|
||||
inherit system;
|
||||
specialArgs = {
|
||||
inherit inputs;
|
||||
inherit host;
|
||||
inherit profile;
|
||||
inherit username;
|
||||
};
|
||||
modules = [
|
||||
{
|
||||
nix.settings.experimental-features = ["nix-command" "flakes"];
|
||||
virtualisation.vmVariant = {
|
||||
virtualisation = {
|
||||
memorySize = 8192;
|
||||
cores = 8;
|
||||
};
|
||||
};
|
||||
}
|
||||
./configuration.nix
|
||||
./hosts/${host}
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
profile,
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = [
|
||||
../../profiles/${profile}
|
||||
../../modules/core
|
||||
../../modules/options
|
||||
|
||||
./hardware.nix
|
||||
./host-packages.nix
|
||||
];
|
||||
|
||||
modules.hyprland.enable = true;
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
environment.systemPackages = with pkgs; [
|
||||
|
||||
];
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
# Set Display Manager
|
||||
# 'gdm', 'sddm'
|
||||
displayManager = "sddm";
|
||||
}
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
host,
|
||||
...
|
||||
}: let
|
||||
vars = import ../../hosts/${host}/variables.nix;
|
||||
in {
|
||||
imports = [
|
||||
./hyprland.nix
|
||||
./packages.nix
|
||||
./system.nix
|
||||
./user.nix
|
||||
]
|
||||
++ (
|
||||
if vars.displayManager == "gdm"
|
||||
then [ ./gdm.nix ]
|
||||
else if vars.displayManager == "sddm"
|
||||
then [ ./sddm.nix ]
|
||||
else []
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
...
|
||||
}:
|
||||
{
|
||||
services.xserver.displayManager.gdm = {
|
||||
enable = true;
|
||||
wayland.enable = true;
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.hyprland;
|
||||
in
|
||||
{
|
||||
config = mkIf cfg.enable {
|
||||
programs.hyprland = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
...
|
||||
}:
|
||||
{
|
||||
services.displayManager.sddm = {
|
||||
enable = true;
|
||||
wayland.enable = true;
|
||||
};
|
||||
|
||||
# To prevent getting stuck at shutdown
|
||||
systemd.extraConfig = "DefaultTimeoutStopSec=10s";
|
||||
}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
...
|
||||
}:
|
||||
{
|
||||
nix = {
|
||||
settings = {
|
||||
experimental-features = [
|
||||
"nix-command"
|
||||
"flakes"
|
||||
];
|
||||
};
|
||||
};
|
||||
system.stateVersion = "25.05";
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
{
|
||||
host,
|
||||
inputs,
|
||||
pkgs,
|
||||
profile,
|
||||
username,
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = [ inputs.home-manager.nixosModules.home-manager ];
|
||||
home-manager = {
|
||||
useUserPackages = true;
|
||||
useGlobalPkgs = false;
|
||||
backupFileExtension = "backup";
|
||||
extraSpecialArgs = { inherit host inputs profile username; };
|
||||
users.${username} = {
|
||||
imports = [ ./../home ];
|
||||
home = {
|
||||
username = "${username}";
|
||||
homeDirectory = "/home/${username}";
|
||||
stateVersion = "25.05";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
users.mutableUsers = true;
|
||||
users.users.${username} = {
|
||||
isNormalUser = true;
|
||||
initialPassword = "changeme";
|
||||
extraGroups = [
|
||||
"wheel"
|
||||
];
|
||||
shell = pkgs.zsh;
|
||||
ignoreShellProgramCheck = true;
|
||||
};
|
||||
|
||||
nix.settings.allowed-users = [ "${username}" ];
|
||||
}
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = [
|
||||
./vm-guest-services.nix
|
||||
];
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.vm.guest-services;
|
||||
in
|
||||
{
|
||||
options.vm.guest-services = {
|
||||
enable = mkEnableOption "Enable Virtual Machine Guest Services";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
services.qemuGuest.enable = true;
|
||||
services.spice-vdagentd.enable = true;
|
||||
services.spice-webdavd.enable = true;
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
host,
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = [
|
||||
./hyprland
|
||||
./kitty.nix
|
||||
./xdg.nix
|
||||
./zsh
|
||||
];
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
lib,
|
||||
osConfig,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
let
|
||||
cfg = osConfig.modules.hyprland;
|
||||
in
|
||||
{
|
||||
wayland.windowManager.hyprland.settings = {
|
||||
bind = [
|
||||
"$modifier,Return,exec,${cfg.terminal}"
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = [
|
||||
./binds.nix
|
||||
./hyprland.nix
|
||||
];
|
||||
}
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
{
|
||||
config,
|
||||
host,
|
||||
lib,
|
||||
osConfig,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
let
|
||||
cfg = osConfig.modules.hyprland;
|
||||
in
|
||||
{
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = with pkgs; [
|
||||
kitty
|
||||
];
|
||||
|
||||
systemd.user.targets.hyprland-session.Unit.Wants = [
|
||||
"xdg-desktop-autostart.target"
|
||||
];
|
||||
|
||||
wayland.windowManager.hyprland = {
|
||||
enable = true;
|
||||
package = pkgs.hyprland;
|
||||
systemd = {
|
||||
enable = true;
|
||||
enableXdgAutostart = true;
|
||||
};
|
||||
xwayland.enable = true;
|
||||
settings = {
|
||||
general = {
|
||||
"$modifier" = "SUPER";
|
||||
};
|
||||
|
||||
env = [
|
||||
"NIXOS_OZONE_WL, 1"
|
||||
"XDG_CURRENT_DESKTOP, Hyprland"
|
||||
"XDG_SESSION_DESKTOP, Hyprland"
|
||||
"XDG_SESSION_TYPE, wayland"
|
||||
];
|
||||
|
||||
ecosystem = {
|
||||
no_update_news = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
lib,
|
||||
osConfig,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
let
|
||||
cfg = osConfig.modules.hyprland;
|
||||
in
|
||||
{
|
||||
config = mkIf (cfg.terminal == "kitty") {
|
||||
programs.kitty = {
|
||||
enable = true;
|
||||
package = pkgs.kitty;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
{
|
||||
lib,
|
||||
osConfig,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
let
|
||||
hyprlandCfg = osConfig.modules.hyprland;
|
||||
in
|
||||
{
|
||||
xdg = {
|
||||
enable = true;
|
||||
mime.enable = true;
|
||||
mimeApps.enable = true;
|
||||
portal = {
|
||||
enable = true;
|
||||
extraPortals = mkIf hyprlandCfg.enable [
|
||||
pkgs.xdg-desktop-portal-hyprland
|
||||
];
|
||||
configPackages = mkIf hyprlandCfg.enable [
|
||||
pkgs.hyprland
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,55 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
profile,
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = [
|
||||
./zshrc-personal.nix
|
||||
];
|
||||
|
||||
programs.zsh = {
|
||||
enable = true;
|
||||
autosuggestion.enable = true;
|
||||
syntaxHighlighting = {
|
||||
enable = true;
|
||||
highlighters = [
|
||||
"main"
|
||||
"brackets"
|
||||
"pattern"
|
||||
"root"
|
||||
];
|
||||
};
|
||||
historySubstringSearch.enable = true;
|
||||
|
||||
history = {
|
||||
ignoreDups = false;
|
||||
save = 100000;
|
||||
size = 100000;
|
||||
};
|
||||
|
||||
initContent = ''
|
||||
# vi keybindings for menu select
|
||||
bindkey -M menuselect 'h' vi-backward-char
|
||||
bindkey -M menuselect 'k' vi-up-line-or-history
|
||||
bindkey -M menuselect 'j' vi-down-line-or-history
|
||||
bindkey -M menuselect 'l' vi-forward-char
|
||||
|
||||
# Tab to accept current selection
|
||||
bind-key -M menuselect '^I' accept-and-infer-next-history
|
||||
'';
|
||||
|
||||
shellAliases = {
|
||||
".. " = "cd ..";
|
||||
"..." = "cd../..";
|
||||
ls = "ls --color=auto";
|
||||
ll = "ls -al";
|
||||
grep = "grep --color=auto";
|
||||
back = "cd $OLDPWD";
|
||||
gs = "git status";
|
||||
ssha = "eval $(ssh-agent) && ssh-add";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
home.packages = with pkgs; [zsh];
|
||||
|
||||
home.file."./.zshrc-personal".text = ''
|
||||
export EDITOR=vim
|
||||
'';
|
||||
}
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = [
|
||||
./hyprland.nix
|
||||
];
|
||||
}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.hyprland;
|
||||
in
|
||||
{
|
||||
options.modules.hyprland = {
|
||||
enable = mkEnableOption "Enable Hyprland";
|
||||
terminal = mkOption {
|
||||
type = types.enum [
|
||||
"kitty"
|
||||
"alacritty"
|
||||
];
|
||||
default = "kitty";
|
||||
description = ''
|
||||
The terminal to use for Hyprland.
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
vm,
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = [
|
||||
../../modules/drivers
|
||||
];
|
||||
|
||||
virtualisation.vmVariant = {
|
||||
virtualisation = {
|
||||
memorySize = 8192;
|
||||
cores = 8;
|
||||
};
|
||||
};
|
||||
|
||||
# drivers.amdgpu.enable = false;
|
||||
# drivers.nvidia.enable = false;
|
||||
# drivers.nvidia-prime.enable = false;
|
||||
# drivers.intel.enable = false;
|
||||
vm.guest-services.enable = true;
|
||||
}
|
||||
|
|
@ -1,5 +1,7 @@
|
|||
echo "Removing old qcow2 disk ..."
|
||||
rm -f ./nixos.qcow2
|
||||
|
||||
echo "Building new VM ..."
|
||||
nix build .#nixosConfigurations.nixosvm.config.system.build.vm
|
||||
|
||||
echo "Done!"
|
||||
|
|
|
|||
Loading…
Reference in New Issue