Styling & display manager rework

This commit is contained in:
Tristan D. 2024-08-09 21:50:47 +02:00
parent 8c860b4d73
commit 00e3a3d0bf
Signed by: tristan
SSH key fingerprint: SHA256:9oFM1J63hYWJjCnLG6C0fxBS15rwNcWwdQNMOHYKJ/4
12 changed files with 317 additions and 35 deletions

182
flake.lock generated
View file

@ -1,5 +1,119 @@
{ {
"nodes": { "nodes": {
"base16": {
"inputs": {
"fromYaml": "fromYaml"
},
"locked": {
"lastModified": 1708890466,
"narHash": "sha256-LlrC09LoPi8OPYOGPXegD72v+//VapgAqhbOFS3i8sc=",
"owner": "SenchoPens",
"repo": "base16.nix",
"rev": "665b3c6748534eb766c777298721cece9453fdae",
"type": "github"
},
"original": {
"owner": "SenchoPens",
"repo": "base16.nix",
"type": "github"
}
},
"base16-fish": {
"flake": false,
"locked": {
"lastModified": 1622559957,
"narHash": "sha256-PebymhVYbL8trDVVXxCvZgc0S5VxI7I1Hv4RMSquTpA=",
"owner": "tomyun",
"repo": "base16-fish",
"rev": "2f6dd973a9075dabccd26f1cded09508180bf5fe",
"type": "github"
},
"original": {
"owner": "tomyun",
"repo": "base16-fish",
"type": "github"
}
},
"base16-foot": {
"flake": false,
"locked": {
"lastModified": 1696725948,
"narHash": "sha256-65bz2bUL/yzZ1c8/GQASnoiGwaF8DczlxJtzik1c0AU=",
"owner": "tinted-theming",
"repo": "base16-foot",
"rev": "eedbcfa30de0a4baa03e99f5e3ceb5535c2755ce",
"type": "github"
},
"original": {
"owner": "tinted-theming",
"repo": "base16-foot",
"type": "github"
}
},
"base16-helix": {
"flake": false,
"locked": {
"lastModified": 1720809814,
"narHash": "sha256-numb3xigRGnr/deF7wdjBwVg7fpbTH7reFDkJ75AJkY=",
"owner": "tinted-theming",
"repo": "base16-helix",
"rev": "34f41987bec14c0f3f6b2155c19787b1f6489625",
"type": "github"
},
"original": {
"owner": "tinted-theming",
"repo": "base16-helix",
"type": "github"
}
},
"base16-kitty": {
"flake": false,
"locked": {
"lastModified": 1665001328,
"narHash": "sha256-aRaizTYPpuWEcvoYE9U+YRX+Wsc8+iG0guQJbvxEdJY=",
"owner": "kdrag0n",
"repo": "base16-kitty",
"rev": "06bb401fa9a0ffb84365905ffbb959ae5bf40805",
"type": "github"
},
"original": {
"owner": "kdrag0n",
"repo": "base16-kitty",
"type": "github"
}
},
"base16-tmux": {
"flake": false,
"locked": {
"lastModified": 1696725902,
"narHash": "sha256-wDPg5elZPcQpu7Df0lI5O8Jv4A3T6jUQIVg63KDU+3Q=",
"owner": "tinted-theming",
"repo": "base16-tmux",
"rev": "c02050bebb60dbb20cb433cd4d8ce668ecc11ba7",
"type": "github"
},
"original": {
"owner": "tinted-theming",
"repo": "base16-tmux",
"type": "github"
}
},
"base16-vim": {
"flake": false,
"locked": {
"lastModified": 1716150083,
"narHash": "sha256-ZMhnNmw34ogE5rJZrjRv5MtG3WaqKd60ds2VXvT6hEc=",
"owner": "tinted-theming",
"repo": "base16-vim",
"rev": "6e955d704d046b0dc3e5c2d68a2a6eeffd2b5d3d",
"type": "github"
},
"original": {
"owner": "tinted-theming",
"repo": "base16-vim",
"type": "github"
}
},
"chaotic": { "chaotic": {
"inputs": { "inputs": {
"compare-to": "compare-to", "compare-to": "compare-to",
@ -220,6 +334,22 @@
"type": "github" "type": "github"
} }
}, },
"fromYaml": {
"flake": false,
"locked": {
"lastModified": 1689549921,
"narHash": "sha256-iX0pk/uB019TdBGlaJEWvBCfydT6sRq+eDcGPifVsCM=",
"owner": "SenchoPens",
"repo": "fromYaml",
"rev": "11fbbbfb32e3289d3c631e0134a23854e7865c84",
"type": "github"
},
"original": {
"owner": "SenchoPens",
"repo": "fromYaml",
"type": "github"
}
},
"gitignore": { "gitignore": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -240,6 +370,23 @@
"type": "github" "type": "github"
} }
}, },
"gnome-shell": {
"flake": false,
"locked": {
"lastModified": 1713702291,
"narHash": "sha256-zYP1ehjtcV8fo+c+JFfkAqktZ384Y+y779fzmR9lQAU=",
"owner": "GNOME",
"repo": "gnome-shell",
"rev": "0d0aadf013f78a7f7f1dc984d0d812971864b934",
"type": "github"
},
"original": {
"owner": "GNOME",
"ref": "46.1",
"repo": "gnome-shell",
"type": "github"
}
},
"home-manager": { "home-manager": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -677,6 +824,7 @@
"nur": "nur", "nur": "nur",
"plasma-manager": "plasma-manager", "plasma-manager": "plasma-manager",
"pre-commit-hooks": "pre-commit-hooks", "pre-commit-hooks": "pre-commit-hooks",
"stylix": "stylix",
"systems": "systems" "systems": "systems"
} }
}, },
@ -705,6 +853,40 @@
"type": "github" "type": "github"
} }
}, },
"stylix": {
"inputs": {
"base16": "base16",
"base16-fish": "base16-fish",
"base16-foot": "base16-foot",
"base16-helix": "base16-helix",
"base16-kitty": "base16-kitty",
"base16-tmux": "base16-tmux",
"base16-vim": "base16-vim",
"flake-compat": [
"flake-compat"
],
"gnome-shell": "gnome-shell",
"home-manager": [
"home-manager"
],
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1722946882,
"narHash": "sha256-mxtnMye8gs82tdQbVC+g6v3aPOZlH150f9WyntHIkTg=",
"owner": "danth",
"repo": "stylix",
"rev": "5853f1a8bd072f2ebabfc3de3973084353cf6f1e",
"type": "github"
},
"original": {
"owner": "danth",
"repo": "stylix",
"type": "github"
}
},
"systems": { "systems": {
"locked": { "locked": {
"lastModified": 1680978846, "lastModified": 1680978846,

View file

@ -110,6 +110,12 @@
inputs.flake-utils.follows = "flake-utils"; inputs.flake-utils.follows = "flake-utils";
inputs.flake-compat.follows = "flake-compat"; inputs.flake-compat.follows = "flake-compat";
}; };
stylix = {
url = "github:danth/stylix";
inputs.nixpkgs.follows = "nixpkgs";
inputs.home-manager.follows = "home-manager";
inputs.flake-compat.follows = "flake-compat";
};
llama-cpp = { llama-cpp = {
url = "git+https://git.vlt81.de/tristan/llama.cpp.git"; url = "git+https://git.vlt81.de/tristan/llama.cpp.git";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
@ -133,12 +139,15 @@
, chaotic , chaotic
, envfs , envfs
, llama-cpp , llama-cpp
, stylix
, nix-wallpaper
, ... , ...
} @ inputs: } @ inputs:
let let
system = "x86_64-linux"; system = "x86_64-linux";
my-overlay = final: prev: { my-overlay = final: prev: {
my = self.packages."${system}"; my = self.packages."${system}";
nix-wallpaper = nix-wallpaper.packages."${system}".default;
}; };
overlays = [ overlays = [
my-overlay my-overlay
@ -157,6 +166,7 @@
nix-index-database.hmModules.nix-index nix-index-database.hmModules.nix-index
nur.hmModules.nur nur.hmModules.nur
plasma-manager.homeManagerModules.plasma-manager plasma-manager.homeManagerModules.plasma-manager
# stylix.homeManagerModules.stylix
]; ];
osModules = [ osModules = [
lanzaboote.nixosModules.lanzaboote lanzaboote.nixosModules.lanzaboote
@ -167,6 +177,7 @@
nur.nixosModules.nur nur.nixosModules.nur
chaotic.nixosModules.default chaotic.nixosModules.default
envfs.nixosModules.envfs envfs.nixosModules.envfs
stylix.nixosModules.stylix
]; ];
args = { args = {
inherit self inputs system; inherit self inputs system;

View file

@ -4,4 +4,18 @@
, ... , ...
}: { }: {
xdg.enable = true; xdg.enable = true;
stylix.targets = {
alacritty.enable = true;
bat.enable = true;
btop.enable = true;
firefox.enable = true;
firefox.profileNames = [ "default" ];
fish.enable = true;
fzf.enable = true;
gtk.enable = true;
kde.enable = true; # ??
ncspot.enable = true;
neovim.enable = true;
zellij.enable = true;
};
} }

View file

@ -2,15 +2,7 @@
, pkgs , pkgs
, inputs , inputs
, ... , ...
}: }: {
let
wallpaper = inputs.nix-wallpaper.packages.${pkgs.system}.default.override {
logoSize = 24;
preset = "gruvbox-dark-rainbow";
};
wallpaperPath = "${wallpaper}/share/wallpapers/nixos-wallpaper.png";
in
{
programs.mpv = { programs.mpv = {
enable = true; enable = true;
package = pkgs.mpv; package = pkgs.mpv;
@ -37,7 +29,7 @@ in
}; };
home = { home = {
file."Pictures/default_background.png".source = wallpaperPath; file."Pictures/default_background.png".source = config.stylix.image;
packages = with pkgs; [ packages = with pkgs; [
bitwarden bitwarden
@ -75,6 +67,7 @@ in
waypipe waypipe
veracrypt veracrypt
deadbeef-with-plugins deadbeef-with-plugins
flightgear
]; ];
}; };
} }

View file

@ -4,11 +4,12 @@
}: { }: {
programs.plasma = { programs.plasma = {
enable = true; enable = true;
overrideConfig = true; overrideConfig = false; # needed for stylix compat sadly
workspace = { workspace = {
theme = "breeze-dark"; theme = "breeze-dark";
lookAndFeel = "org.kde.breezedark.desktop"; lookAndFeel = "org.kde.breezedark.desktop";
wallpaper = "${config.home.homeDirectory}/Pictures/default_background.png"; wallpaper = config.stylix.image;
# wallpaper = "${config.home.homeDirectory}/Pictures/default_background.png"; set by stylix
}; };
panels = [ panels = [
# Windows-like panel at the bottom # Windows-like panel at the bottom
@ -21,7 +22,7 @@
name = "org.kde.plasma.kicker"; name = "org.kde.plasma.kicker";
config = { config = {
General = { General = {
icon = "nix-snowflake-white"; icon = "nix-snowflake";
alphaSort = true; alphaSort = true;
showIconsRootLevel = true; showIconsRootLevel = true;
}; };

View file

@ -26,7 +26,6 @@ in
alacritty = { alacritty = {
enable = true; enable = true;
settings = { settings = {
window.opacity = 0.88;
window.dimensions = { window.dimensions = {
lines = 40; lines = 40;
columns = 150; columns = 150;
@ -52,12 +51,6 @@ in
package = pkgs.fish; package = pkgs.fish;
interactiveShellInit = '' interactiveShellInit = ''
# TODO do not run on headless systems
function kde_run
${pkgs.kdePackages.plasma-workspace}/libexec/plasma-dbus-run-session-if-needed \
${pkgs.kdePackages.plasma-workspace}/bin/startplasma-wayland
end
############################################ ############################################
# Adds a seperating arrow inbetween commands # Adds a seperating arrow inbetween commands
# ~ ls <----------- at 12:12 # ~ ls <----------- at 12:12
@ -74,16 +67,12 @@ in
starship module time starship module time
end end
any-nix-shell fish --info-right | source
if test -z $INSIDE_EMACS && test $TERM != linux ; if test -z $INSIDE_EMACS && test $TERM != linux ;
eval (${pkgs.zellij}/bin/zellij setup --generate-auto-start fish | string collect) eval (${pkgs.zellij}/bin/zellij setup --generate-auto-start fish | string collect)
end end
if test $TERM = linux && test (who am i | string split " ")[2] = tty1;
kde_run && exit
end
any-nix-shell fish --info-right | source
cat /var/lib/rust-motd/motd cat /var/lib/rust-motd/motd
''; '';
loginShellInit = '' loginShellInit = ''
@ -370,6 +359,7 @@ in
neovim neovim
lazydocker lazydocker
sshx sshx
bat
]; ];
}; };
} }

View file

@ -207,4 +207,56 @@ in
} # ssh } # ssh
]; ];
}; };
# TODO Extract into stylix module
services.kmscon.enable = true;
services.kmscon.hwRender = config.hardware.amdgpu.initrd.enable;
stylix =
let
wallpaper = pkgs.nix-wallpaper.override {
logoSize = 24;
preset = "gruvbox-dark-rainbow";
width = 6960;
height = 4320;
};
wallpaperPath = "${wallpaper}/share/wallpapers/nixos-wallpaper.png";
fontpkg = pkgs.nerdfonts.override { fonts = [ "Iosevka" "IosevkaTerm" "FiraCode" "DroidSansMono" "NerdFontsSymbolsOnly" ]; };
in
{
enable = true;
image = wallpaperPath;
polarity = "dark";
base16Scheme = lib.mkForce "${pkgs.base16-schemes}/share/themes/gruvbox-dark-hard.yaml";
autoEnable = false;
cursor = {
package = pkgs.kdePackages.breeze;
name = "breeze_cursors";
size = 24;
};
opacity.terminal = 0.88;
fonts = {
serif = config.stylix.fonts.sansSerif;
sansSerif = {
package = fontpkg;
name = "Iosevka Nerd Font Propo";
};
monospace = {
package = fontpkg;
name = "Iosevka Nerd Font Mono";
};
emoji = {
package = pkgs.noto-fonts-emoji;
name = "Noto Color Emoji";
};
};
targets = {
console.enable = true;
fish.enable = true;
gtk.enable = true;
kmscon.enable = true;
nixos-icons.enable = true;
};
};
} }

View file

@ -39,9 +39,6 @@
mplus-outline-fonts.githubRelease mplus-outline-fonts.githubRelease
dina-font dina-font
proggyfonts proggyfonts
(nerdfonts.override {
fonts = [ "Iosevka" "IosevkaTerm" "FiraCode" "DroidSansMono" "NerdFontsSymbolsOnly" ];
})
]; ];
}; };
@ -73,5 +70,42 @@
desktopManager.plasma6.enable = true; desktopManager.plasma6.enable = true;
desktopManager.plasma6.enableQt5Integration = true; desktopManager.plasma6.enableQt5Integration = true;
displayManager.enable = true; displayManager.enable = true;
xserver = {
enable = true;
xkb = {
layout = "us";
variant = "alt-intl";
};
};
greetd = {
enable = true;
settings = {
default_session = {
command = ''
${lib.getExe pkgs.greetd.tuigreet} \
--asterisks --asterisks-char \
--greeting "Welcome to NixOS ${config.system.nixos.version} (${config.system.nixos.codeName}) on ${config.system.name}!" \
--theme "border=magenta;text=cyan;prompt=green;time=red;action=blue;button=yellow;container=black;input=red" \
--time --time-format "%H:%M | %a %h | %F" \
--remember \
--cmd ${pkgs.writeShellScript "tuigreet-cmd.sh" ''
${pkgs.kdePackages.plasma-workspace}/libexec/plasma-dbus-run-session-if-needed
exec 2>/dev/null 1>/dev/null ${pkgs.kdePackages.plasma-workspace}/bin/startplasma-wayland
''};
'';
};
};
};
};
systemd.services.greetd.serviceConfig = {
Type = "idle";
StandardInput = "tty";
StandardOutput = "tty";
StandardError = "journal";
TTYReset = true;
TTYVHangup = true;
TTYVTDisallocate = true;
}; };
} }

View file

@ -32,4 +32,6 @@
]; ];
hardware.xone.enable = true; # USB hardware.xone.enable = true; # USB
hardware.xpadneo.enable = true; # Wireless hardware.xpadneo.enable = true; # Wireless
hardware.bluetooth.enable = true;
hardware.steam-hardware.enable = true;
} }

View file

@ -23,6 +23,14 @@
autoPrune.enable = true; autoPrune.enable = true;
}; };
security.wrappers.spice-client-glib-usb-acl-helper = {
owner = "root";
group = "root";
# capabilities = "cap_fowner+ep";
setuid = true;
source = "${pkgs.spice-gtk}/bin/spice-client-glib-usb-acl-helper";
};
virtualisation.libvirtd = { virtualisation.libvirtd = {
enable = true; enable = true;
package = pkgs.libvirt; package = pkgs.libvirt;

View file

@ -94,6 +94,7 @@
"gpiolib_acpi.ignore_interrupt=AMDI0009:00@9" # mask IRQ 9 ? "gpiolib_acpi.ignore_interrupt=AMDI0009:00@9" # mask IRQ 9 ?
]; ];
loader = { loader = {
timeout = 0;
systemd-boot = { systemd-boot = {
enable = false; # due to lanzaboote enable = false; # due to lanzaboote
configurationLimit = 8; configurationLimit = 8;
@ -109,7 +110,6 @@
configurationLimit = 8; configurationLimit = 8;
pkiBundle = "/etc/secureboot"; pkiBundle = "/etc/secureboot";
}; };
initrd = { initrd = {
availableKernelModules = [ availableKernelModules = [
"nvme" "nvme"

View file

@ -32,11 +32,6 @@
home-manager = { home-manager = {
useUserPackages = true; useUserPackages = true;
useGlobalPkgs = true; useGlobalPkgs = true;
users.tester = import ./admin-thin.nix {
username = "tester";
inherit pkgs config inputs system lib;
};
users.tristand = import ./admin-fat.nix { users.tristand = import ./admin-fat.nix {
username = "tristand"; username = "tristand";