adapt desktop

adapt config so that it works on desktop too
This commit is contained in:
2026-03-20 23:00:30 +01:00
parent 39a9bad8f4
commit 70497a93d0
10 changed files with 179 additions and 107 deletions

View File

@@ -4,13 +4,13 @@ let
images = pkgs.callPackage ./home/themes/images.nix { };
in
{
# Importing necessary setup for Steam & Printing & Flutter.
# ── Steam & Printer ───────────────────────────────────────────────────
imports = [
./builds/steam/default.nix
./home/extras/printer.nix
];
# Use the systemd-boot EFI boot loader.
# ── Use the systemd-boot EFI boot loader. ─────────────────────────────
boot.loader = {
systemd-boot = {
enable = true;
@@ -19,18 +19,21 @@ in
efi.canTouchEfiVariables = true;
};
# Chose NetworkManager, timezone, internationalisation properties and console settings.
networking.networkmanager.enable = true;
networking.networkmanager.plugins = with pkgs; [
networkmanager-vpnc
];
# ── NetworkManager, timezone, internationalisation properties and ─────
networking.networkmanager = {
enable = true;
plugins = with pkgs; [
networkmanager-vpnc
];
};
time.timeZone = "Europe/Berlin";
i18n.defaultLocale = "en_US.UTF-8";
console = {
font = "Lat2-Terminus16";
useXkbConfig = true;
};
# Enable Asterisks for Password prompt.
# ── Enable Asterisks for Password prompt. ─────────────────────────────
security.sudo = {
enable = true;
extraConfig = ''
@@ -38,17 +41,19 @@ in
'';
};
# Activate Flakes.
nix.settings.experimental-features = [
"nix-command"
"flakes"
];
nix = {
# ── Flakes ────────────────────────────────────────────────────────────
settings.experimental-features = [
"nix-command"
"flakes"
];
# Configuration of the Garbage collect.
nix.gc = {
automatic = true; # Enable the automatic garbage collector
dates = "10:00"; # When to run the garbage collector
options = "--delete-older-than 7d";
# ── Garbage collect ───────────────────────────────────────────────────
gc = {
automatic = true;
dates = "12:00";
options = "--delete-older-than 7d";
};
};
services = {
@@ -78,7 +83,7 @@ in
};
};
# Define a user account.
# ── User account ──────────────────────────────────────────────────────
users = {
mutableUsers = false;
users.elias = {
@@ -97,7 +102,6 @@ in
};
};
# Setting the Basic Packages.
environment.systemPackages = with pkgs; [
(catppuccin-sddm.override {
flavor = "mocha";
@@ -146,17 +150,21 @@ in
XDG_STATE_HOME = "$HOME/.local/state";
};
# Enabling the Keyring.
security.pam.services.login.enableGnomeKeyring = true;
security.pam.services.sddm.enableGnomeKeyring = true;
# ── Keyring ───────────────────────────────────────────────────────────
security.pam.services = {
login.enableGnomeKeyring = true;
sddm.enableGnomeKeyring = true;
};
services = {
gnome.gnome-keyring.enable = true;
gnome.gcr-ssh-agent.enable = false;
# Disable powerbutton => for use with eww
logind.settings.Login = {
HandlePowerKey = "ignore";
gnome = {
gnome-keyring.enable = true;
gcr-ssh-agent.enable = false;
};
# Setting the permissions for acpilight.
# Disable powerbutton => for use with eww
logind.settings.Login.HandlePowerKey = "ignore";
# ── Permissions for acpilight ─────────────────────────────────────────
udev = {
enable = true;
extraRules = ''

View File

@@ -96,6 +96,31 @@
}
];
};
nixos = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
./machines/configuration-desktop.nix
./home/services/pipewire.nix
nur.modules.nixos.default
catppuccin.nixosModules.catppuccin
home-manager.nixosModules.home-manager
# impermanence.nixosModules.impermanence
{
home-manager = {
useUserPackages = true;
extraSpecialArgs = { inherit inputs; };
users.elias.imports = [
./home/default-desktop.nix
catppuccin.homeModules.catppuccin
];
};
nixpkgs.overlays = [
inputs.nur.overlays.default
inputs.nix-vscode-extensions.overlays.default
];
}
];
};
};
};
}

View File

@@ -1,3 +1,13 @@
(defwindow power []
:class "powermenuWindow"
:geometry (geometry
:width "200px"
:height "50px"
:anchor "center center"
:x "0%"
:y "0%")
(powerpopup))
(defwidget powerpopup []
(box
:class "powermenu"
@@ -27,23 +37,3 @@
:class "powermenu-button"
(label
:text ""))))
(defwidget powermenu [shutdown shutdown_icon reboot
reboot_icon logout logout_icon]
(box :class "powermenu" :spacing 5
:vexpand true :hexpand true
:valign "end" :halign "end"
:space-evenly false
(button :onclick shutdown shutdown_icon)
(button :onclick reboot reboot_icon)
(button :onclick logout logout_icon)))
(defwindow power []
:class "powermenuWindow"
:geometry (geometry
:width "200px"
:height "50px"
:anchor "center center"
:x "0%"
:y "0%")
(powerpopup)
)

View File

@@ -1,10 +1,19 @@
WINDOW_NAME="power"
echo "Power button pressed" >>/tmp/acpi_log.txt
WINDOW="power"
DISPLAY=""
# Check if the window is already open
if eww active-windows | grep -q "$WINDOW_NAME"; then
eww close "$WINDOW_NAME"
else
eww open "$WINDOW_NAME" --screen "$(wlr-randr | grep -oP '^\S+' | head -n 1)"
if eww active-windows | grep -q "$WINDOW"; then
eww close "$WINDOW"
exit 0
fi
# Determin screen
if [[ "$(hostname)" == "eliasLaptop" ]]; then
DISPLAY="eDP-1"
elif [[ "$(hostname)" == "eliasDesktop" ]]; then
DISPLAY="DVI-D-1"
fi
echo "$DISPLAY"
eww open "$WINDOW" --screen "$DISPLAY"

View File

@@ -1,10 +1,9 @@
hostname=$(hostname)
HOST_NAME=$(hostname)
if [[ "$hostname" == "eliasLaptop" ]]; then
if [[ "$HOST_NAME" == "eliasLaptop" ]]; then
eww open bar --screen eDP-1
/home/elias/.config/eww/scripts/ristate.sh
elif [[ "$hostname" == "eliasDesktop" ]]; then
echo "This is another PC!"
else
echo "This is an unknown PC."
elif [[ "$HOST_NAME" == "eliasDesktop" ]]; then
eww open bar --screen DVI-D-1
/home/elias/.config/eww/scripts/ristate.sh
fi

View File

@@ -11,7 +11,6 @@
profile.outputs = [ { criteria = "eDP-1"; } ];
profile.exec = [
"systemctl --user start hypridle.service"
"eww reload"
];
}
{
@@ -21,36 +20,59 @@
"eww reload"
];
profile.outputs = [
{
criteria = "eDP-1";
mode = "1920x1080@60Hz";
position = "1920,0";
}
{
criteria = "HDMI-A-1";
mode = "1920x1080@60Hz";
position = "0,0";
}
{
criteria = "eDP-1";
mode = "1920x1080@60Hz";
position = "1920,0";
}
];
}
{
profile.name = "desktop";
profile.exec = [
"systemctl --user stop hypridle.service"
];
profile.outputs = [
{
criteria = "HDMI-A-2";
mode = "1920x1080@60Hz";
position = "0,0";
}
{
criteria = "DVI-D-1";
mode = "1920x1080@60Hz";
position = "1920,0";
}
{
criteria = "DP-2";
mode = "1920x1080@60Hz";
position = "3840,0";
}
];
}
{
profile.name = "desktop-reduced";
profile.exec = [
"systemctl --user stop hypridle.service"
];
profile.outputs = [
{
criteria = "DVI-D-1";
mode = "1920x1080@60Hz";
position = "0,0";
}
{
criteria = "DP-2";
mode = "1920x1080@60Hz";
position = "1920,0";
}
];
}
# {
# profile.name = "desktop";
# profile.exec = [
# "systemctl --user start hypridle.service"
# ];
# profile.outputs = [
# {
# criteria = "eDP-1";
# mode = "1920x1080@60Hz";
# position = "1920,0";
# }
# {
# criteria = "HDMI-A-1";
# mode = "1920x1080@60Hz";
# position = "0,0";
# }
# ];
# }
];
};
}

View File

@@ -10,11 +10,11 @@ in
imports = [
./cursor.nix
./fnott.nix
# ./gtk.nix TODO: check why so weird
./gtk.nix
./hyprlock.nix
./nvim.nix
./taskwarrior.nix
# ./qt.nix TODO: check why so weird
./qt.nix
];
catppuccin = {

View File

@@ -7,13 +7,18 @@
];
networking.hostName = "eliasDesktop";
services.blueman.enable = true;
hardware.bluetooth.enable = true;
hardware.bluetooth.powerOnBoot = true;
# Hyprlock
# ── Hyprlock ──────────────────────────────────────────────────────────
security.pam.services.hyprlock = { };
# ── Bluetooth ─────────────────────────────────────────────────────────
services.blueman.enable = true;
hardware.bluetooth = {
enable = true;
powerOnBoot = false;
};
# ── Network ───────────────────────────────────────────────────────────
environment.systemPackages = with pkgs; [
networkmanager-vpnc
networkmanagerapplet

View File

@@ -17,7 +17,7 @@
};
};
# Hyprlock
# ── Hyprlock ──────────────────────────────────────────────────────────
security.pam.services = {
hyprlock = {
text = ''
@@ -33,7 +33,7 @@
services.blueman.enable = true;
hardware.bluetooth = {
enable = true;
powerOnBoot = true;
powerOnBoot = false;
};
# ── Network ───────────────────────────────────────────────────────────

View File

@@ -14,27 +14,41 @@
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-label/NIXROOT";
fsType = "ext4";
{ device = "/dev/disk/by-uuid/aded1c84-f4d0-4841-ab2f-68266532737f";
fsType = "btrfs";
options = [ "subvol=root" ];
};
fileSystems."/.swapvol" =
{ device = "/dev/disk/by-uuid/aded1c84-f4d0-4841-ab2f-68266532737f";
fsType = "btrfs";
options = [ "subvol=swap" ];
};
fileSystems."/boot" =
{ device = "/dev/disk/by-label/NIXBOOT";
{ device = "/dev/disk/by-uuid/A38E-500D";
fsType = "vfat";
options = [ "fmask=0022" "dmask=0022" ];
};
swapDevices = [{
device = "/.swapfile";
size = 2048;
}];
fileSystems."/home" =
{ device = "/dev/disk/by-uuid/aded1c84-f4d0-4841-ab2f-68266532737f";
fsType = "btrfs";
options = [ "subvol=home" ];
};
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.eno1.useDHCP = lib.mkDefault true;
fileSystems."/nix" =
{ device = "/dev/disk/by-uuid/aded1c84-f4d0-4841-ab2f-68266532737f";
fsType = "btrfs";
options = [ "subvol=nix" ];
};
fileSystems."/partition-root" =
{ device = "/dev/disk/by-uuid/aded1c84-f4d0-4841-ab2f-68266532737f";
fsType = "btrfs";
};
swapDevices = [ ];
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;