Compare commits

..

7 Commits

11 changed files with 300 additions and 139 deletions

View File

@ -24,11 +24,11 @@
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1655198178,
"narHash": "sha256-S59GMG8VO2r0VkPWNWRktBxCND+jWOei1Km4cWR7XOw=",
"lastModified": 1657362523,
"narHash": "sha256-hoYYqpCKsuHqYwMnK9lcUYHnuf5OaDFPqCt/RavKsRw=",
"owner": "nix-community",
"repo": "emacs-overlay",
"rev": "25ce68a5d0f177f1cc68f48376ee180dc0f9f292",
"rev": "e1c34ef6f6eb7d966af5011eeeec6342017cd535",
"type": "github"
},
"original": {
@ -37,22 +37,6 @@
"type": "github"
}
},
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1650374568,
"narHash": "sha256-Z+s0J8/r907g149rllvwhb4pKi8Wam5ij0st8PwAh+E=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "b4a34015c698c7793d592d66adbab377907a2be8",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-helper": {
"inputs": {
"nixpkgs": [
@ -76,11 +60,11 @@
},
"flake-utils": {
"locked": {
"lastModified": 1653893745,
"narHash": "sha256-0jntwV3Z8//YwuOjzhV2sgJJPt+HY6KhU7VZUL0fKZQ=",
"lastModified": 1656928814,
"narHash": "sha256-RIFfgBuKz6Hp89yRr7+NR5tzIAbn52h8vT6vXkYjZoM=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "1ed9fb1935d260de5fe1c2f7ee0ebaae17ed2fa1",
"rev": "7e2a3b3dfd9af950a856d66b0a7d01e3c18aa249",
"type": "github"
},
"original": {
@ -91,11 +75,11 @@
},
"flake-utils_2": {
"locked": {
"lastModified": 1653893745,
"narHash": "sha256-0jntwV3Z8//YwuOjzhV2sgJJPt+HY6KhU7VZUL0fKZQ=",
"lastModified": 1656928814,
"narHash": "sha256-RIFfgBuKz6Hp89yRr7+NR5tzIAbn52h8vT6vXkYjZoM=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "1ed9fb1935d260de5fe1c2f7ee0ebaae17ed2fa1",
"rev": "7e2a3b3dfd9af950a856d66b0a7d01e3c18aa249",
"type": "github"
},
"original": {
@ -166,18 +150,15 @@
},
"home-manager": {
"inputs": {
"flake-compat": "flake-compat",
"nixpkgs": "nixpkgs_2",
"nmd": "nmd",
"nmt": "nmt",
"utils": "utils"
},
"locked": {
"lastModified": 1655199284,
"narHash": "sha256-R/g2ZWplGWVOfm2TyB4kR+YcOE/uWkgjkYrl/RYgJ/U=",
"lastModified": 1657241847,
"narHash": "sha256-/aN3p2LaRNVXf7w92GWgXq9H5f23YRQPOvsm3BrBqzU=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "87d30c164849a7471d99749aa4d2d28b81564f69",
"rev": "8160b3b45b8457d58d2b3af2aeb2eb6f47042e0f",
"type": "github"
},
"original": {
@ -323,11 +304,11 @@
},
"nixos-hardware": {
"locked": {
"lastModified": 1654057797,
"narHash": "sha256-mXo7C4v7Jj2feBzcReu1Eu/3Rnw5b023E9kOyFsHZQw=",
"lastModified": 1656933710,
"narHash": "sha256-SVG8EqY1OTJWBRY4hpct2ZR2Rk0L8hCFkug3m0ABoZE=",
"owner": "NixOS",
"repo": "nixos-hardware",
"rev": "0cab18a48de7914ef8cad35dca0bb36868f3e1af",
"rev": "3bf48d3587d3f34f745a19ebc968b002ef5b5c5a",
"type": "github"
},
"original": {
@ -356,8 +337,8 @@
"nixpkgs": {
"locked": {
"lastModified": 0,
"narHash": "sha256-O3wncIouj9x7gBPntzHeK/Hkmm9M1SGlYq7JI7saTAE=",
"path": "/nix/store/d84iknazpzwbjbj1j9zh9wnh6v6dzlfb-source",
"narHash": "sha256-rlmmw6lIlkMQIiB+NsnO8wQYWTfle8TA41UREPLP5VY=",
"path": "/nix/store/8mik2m5inkjin29v5gv5zc2jji4lab3l-source",
"type": "path"
},
"original": {
@ -415,11 +396,11 @@
},
"nixpkgs_3": {
"locked": {
"lastModified": 1655130522,
"narHash": "sha256-5dzlxE4okyu+M39yeVtHWQXzDZQxFF5rUB1iY9R6Lb4=",
"lastModified": 1657265485,
"narHash": "sha256-PUQ9C7mfi0/BnaAUX2R/PIkoNCb/Jtx9EpnhMBNrO/o=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "13f08d71ceff5101321e0291854495a1ec153a5e",
"rev": "b39924fc7764c08ae3b51beef9a3518c414cdb7d",
"type": "github"
},
"original": {
@ -516,45 +497,13 @@
"type": "github"
}
},
"nmd": {
"flake": false,
"locked": {
"lastModified": 1653339422,
"narHash": "sha256-8nc7lcYOgih3YEmRMlBwZaLLJYpLPYKBlewqHqx8ieg=",
"owner": "rycee",
"repo": "nmd",
"rev": "9e7a20e6ee3f6751f699f79c0b299390f81f7bcd",
"type": "gitlab"
},
"original": {
"owner": "rycee",
"repo": "nmd",
"type": "gitlab"
}
},
"nmt": {
"flake": false,
"locked": {
"lastModified": 1648075362,
"narHash": "sha256-u36WgzoA84dMVsGXzml4wZ5ckGgfnvS0ryzo/3zn/Pc=",
"owner": "rycee",
"repo": "nmt",
"rev": "d83601002c99b78c89ea80e5e6ba21addcfe12ae",
"type": "gitlab"
},
"original": {
"owner": "rycee",
"repo": "nmt",
"type": "gitlab"
}
},
"nur": {
"locked": {
"lastModified": 1655199919,
"narHash": "sha256-DOwpi0H4SVMKJ+QX/REgNESw6EHVoiQYjdHWyZLOuQs=",
"lastModified": 1657372868,
"narHash": "sha256-yXzNQRlQMCYJJn4fA+zZNj3W0t9w+WDeCKG7D86YkTE=",
"owner": "nix-community",
"repo": "nur",
"rev": "c92906e4e6425ffe1be7d1a52018c1b8d5b40ca6",
"rev": "38f00cf4ee1dab9c10883b1d464486f0c040bb80",
"type": "github"
},
"original": {

View File

@ -56,12 +56,12 @@
ptw = {
programs = {
bluray.enable = true;
#bluray.enable = true;
mpv = {
primaryScreen = "C27F398";
enable = true;
};
sway.enable = true;
sway.enable = false;
alacritty.enable = true;
emacs.enable = true;
firefox.enable = true;
@ -75,21 +75,29 @@
zsh.enable = true;
direnv.enable = true;
office.enable = true;
plasma.enable = true;
plasma = {
enable = true;
sddm = {
backgroundImage = pkgs.fetchurl {
url = "https://cdn.donmai.us/original/d3/1b/__manjuu_prinz_eugen_roon_bismarck_friedrich_der_grosse_and_3_more_azur_lane_drawn_by_zaphn__d31bf4ac564d60f8787818842c369e7f.jpg";
sha256 = "sha256-likoJuEaGzGH0RqjPsBE9o5ATwgnOo97PREh3oZBax8=";
};
};
};
gaming.enable = true;
obs.enable = true;
};
services = {
gamemode.enable = true;
gnome.enable = false;
#gnome.enable = true;
logiops.enable = true;
input-remapper = {
enable = true;
postStartCommand = "${pkgs.input-remapper}/bin/input-remapper-control --command start --preset NOOP --device \"Razer Razer Tartarus V2\"";
};
sddm = {
enable = true;
};
#gdm = {
# enable = true;
#};
};
system = {
i18n.enable = true;
@ -116,7 +124,7 @@
#};
docker.enable = true;
};
boot = let
kernel = pkgs.linuxPackages_zen;
in {
@ -147,6 +155,8 @@
"clocksource=tsc"
"tsc=reliable"
"pci=noaer"
# Enable Apparmor
"lsm=landlock,lockdown,yama,integrity,apparmor,bpf"
];
extraModulePackages = [ kernel.vendor-reset ];
@ -181,6 +191,7 @@
};
# TODO: Move into modules
/*
systemd = {
services = {
enable-vendor-reset = {
@ -215,4 +226,5 @@
};
};
};
*/
}

View File

@ -21,7 +21,6 @@
./programs/waybar
./programs/zsh
./programs/xournalpp
./programs/plasma
./programs/office
./programs/gaming
./programs/bluray
@ -58,5 +57,6 @@
# Desktop
./desktop/phosh.nix
./desktop/plasma.nix
];
}

177
modules/desktop/plasma.nix Normal file
View File

@ -0,0 +1,177 @@
{ config, lib, pkgs, ... }:
let
cfg = config.ptw.programs.plasma;
in {
options.ptw.programs.plasma = {
enable = lib.mkEnableOption "Enable KDE Plasma";
mobile = {
enable = lib.mkEnableOption "Enable Plasma Mobile";
};
wayland = {
enable = lib.mkOption {
default = true;
description = "Ignore NixOS 'recommendations' and use the Wayland session by default";
};
};
sddm = {
backgroundImage = lib.mkOption {
default = "${pkgs.sddm-sugar-dark}/usr/share/sddm/themes/sugar-dark/Background.jpg";
description = "The background image to use with sddm-sugar-dark";
};
screenWidth = lib.mkOption {
default = 1920;
description = "Width of the screen";
};
screenHeight = lib.mkOption {
default = 1080;
description = "Width of the screen";
};
};
};
config = lib.mkIf cfg.enable {
security.pam.services = {
login.enableKwallet = true;
greetd.enableKwallet = true;
};
services.xserver = {
displayManager.sddm = let
sddm-sugar-dark-configured = pkgs.sddm-sugar-dark.override {
config = {
General = {
Background = "${cfg.sddm.backgroundImage}";
ScaleImageCropped = true;
ScreenWidth = builtins.toString cfg.sddm.screenWidth;
ScreenHeight = builtins.toString cfg.sddm.screenHeight;
MainColor = "navajowhite";
AccentColor = "white";
RoundCorners = 20;
ScreenPadding = 0;
Font = "Noto Sans";
FontSize = "";
Locale = "";
HourFormat = "HH:mm";
DataFormat = "dddd, d of MMMM";
ForceLastUser = true;
ForcePasswordFocus = true;
ForceHideCompletePassword = true;
ForceHideVirtualKeyboardButton = false;
HeaderText = "Welcome!";
};
};
};
in {
enable = true;
autoNumlock = true;
theme = "${sddm-sugar-dark-configured}/usr/share/sddm/themes/sugar-dark";
};
desktopManager.plasma5 = {
enable = true;
runUsingSystemd = true;
supportDDC = true;
mobile.enable = cfg.mobile.enable;
kdeglobals = lib.mkIf cfg.mobile.enable {
KDE = {
StartDragDist = "10";
LookAndFeelPackage = "org.kde.plasma.phone";
};
Icons = {
Theme = "breeze";
};
General = {
ColorScheme = "breeze";
Name = "breeze";
XftHintStyle = "none";
XftSubPixel = "none";
shadeSortColumn = "true";
};
};
kwinrc = lib.mkIf cfg.mobile.enable {
Plugins = {
"org.kde.phone.multitaskingEnabled" = "false";
"kwin4_effect_eyeonscreenEnabled" = "false";
"kwin4_effect_windowapertureEnabled" = "false";
blurEnabled = "false";
contrastEnabled = "false";
};
Windows = {
Placement = "Maximizing";
};
TabBox = {
TouchBorderActive = "9";
TouchBorderAlternativeActive = "9";
BorderActivate = "9";
};
"Effect-PresentWindows" = {
BorderActivateAll = "9";
};
"org.kde.kdecoration2" = {
NoPlugin = "true";
};
TouchEdges = {
Left = "None";
Right = "None";
};
Wayland = {
InputMethod = "${pkgs.maliit-keyboard}/usr/share/applications/com.github.maliit.keyboard.desktop";
};
};
};
# See https://github.com/NixOS/nixpkgs/commit/a506f9c79700255c215dddb53455d5e2bed6c1af
displayManager = {
defaultSession = lib.mkIf cfg.wayland.enable "plasmawayland";
#sessionPackages = lib.mkIf cfg.mobile.enable [ pkgs.libsForQt5.plasma5.plasma-mobile ];
};
};
xdg.portal = {
enable = true;
extraPortals = [ pkgs.xdg-desktop-portal-kde ];
};
environment.systemPackages = let
plasmaMobilePackages = with pkgs.libsForQt5; with plasma5; with kdeApplications; with kdeFrameworks; [
plasma-mobile
plasma-nano
pkgs.maliit-framework
pkgs.maliit-keyboard
];
kdePackages = with pkgs.libsForQt5; [
okular
kdeconnect-kde
breeze-gtk
bismuth
gwenview
yakuake
] ++ lib.optionals cfg.mobile.enable plasmaMobilePackages;
packages = with pkgs; [
#kde-rounded-corners
index-fm
rsibreak
kalendar
kate
okular
# Some Gnome software
gnome.totem
];
in kdePackages ++ packages;
};
}

View File

@ -1,50 +0,0 @@
{ config, lib, pkgs, ... }:
let
cfg = config.ptw.programs.plasma;
in {
options.ptw.programs.plasma = {
enable = lib.mkEnableOption "Enable KDE Plasma";
mobile = {
enable = lib.mkEnableOption "Enable Plasma Mobile";
};
wayland = {
enable = lib.mkOption {
default = true;
description = "Ignore NixOS 'recommendations' and use the Wayland session by default";
};
};
};
config = lib.mkIf cfg.enable {
services.xserver = {
desktopManager.plasma5 = {
enable = true;
runUsingSystemd = true;
supportDDC = true;
mobile.enable = cfg.mobile.enable;
};
# See https://github.com/NixOS/nixpkgs/commit/a506f9c79700255c215dddb53455d5e2bed6c1af
displayManager.defaultSession = lib.mkIf cfg.wayland.enable "plasmawayland";
};
xdg.portal = {
enable = true;
extraPortals = [ pkgs.xdg-desktop-portal-kde ];
};
environment.systemPackages = with pkgs; [
#yakuake
libsForQt5.okular
libsForQt5.kdeconnect-kde
libsForQt5.breeze-gtk
libsForQt5.bismuth
kde-rounded-corners
index-fm
rsibreak
kalendar
kate
];
};
}

View File

@ -18,6 +18,7 @@ in {
programs.waybar = {
enable = true;
style = builtins.readFile ./style.css;
/*
settings = [
{
output = [ "${cfg.output}" ];
@ -62,6 +63,7 @@ in {
};
}
];
*/
};
};
};

View File

@ -4,13 +4,14 @@
config = lib.mkIf (config.ptw.system.singleUser == "alexander") {
users.users.alexander = {
isNormalUser = true;
extraGroups = [ "wheel" "audio" "video" "kvm" "input" "libvirtd" "scanner" "lp" ];
extraGroups = [ "wheel" "audio" "video" "kvm" "input" "libvirtd" "scanner" "lp" "alexander" ];
hashedPassword = "$5$i4aZuQ/WXP.rFOc$lCzDqbrVsqBQt5954O.3bFPknD0jn27MmqzmE4DIAEC";
shell = pkgs.zsh;
useDefaultShell = false;
uid = 1000;
isSystemUser = false;
};
users.groups.alexander = {};
# Activate gpg
programs.gnupg.agent.enable = true;
@ -18,6 +19,7 @@
# No need to use users."${system.singleUser}" as we already know it
home-manager.users.alexander = {
programs.home-manager.enable = true;
home.stateVersion = "22.11";
programs.ssh = {
enable = true;

View File

@ -21,7 +21,7 @@ rec {
});
phosh = prev.phosh.overrideAttrs (old: rec {
version = "0.20.0";
version = "0.20.0_beta2";
src = prev.fetchFromGitLab {
domain = "gitlab.gnome.org";
group = "World";
@ -29,7 +29,7 @@ rec {
repo = "phosh";
rev = "v${version}";
fetchSubmodules = true; # including gvc and libcall-ui which are designated as subprojects
sha256 = "sha256-o/0NJZo1EPpXguN/tkUc+/9XaVTQWaLGe+2pU0B91Cg=";
sha256 = "sha256-UzOv6ztxYYE4CIzCYKSRfpZzE7oSEKenVX+umkEmFRw=";
};
buildInputs = (map

View File

@ -82,7 +82,13 @@ final: prev:
inherit src;
outputHash = "sha256-spmRgwTh0Sg+OvT/s85xEvOfs2DdCihnX6Ya+sDyePM=";
});
buildInputs = with prev; old.buildInputs ++ [ libglvnd glibc ];
nativeBuildInputs = with prev; old.nativeBuildInputs ++ [
wrapGAppsHook
];
buildInputs = with prev; old.buildInputs ++ [
libglvnd
glib cairo pango atk gdk-pixbuf gtk3
];
preFixup = ''
patchelf \
@ -91,4 +97,35 @@ final: prev:
$out/bin/lapce
'';
});
# See https://github.com/NixOS/nixpkgs/issues/171320
# Fixes XWayland crashing after a resume.
xwayland = prev.xwayland.overrideAttrs (old: rec {
version = "21.1.4";
src = prev.fetchurl {
url = "mirror://xorg/individual/xserver/xwayland-${version}.tar.xz";
sha256 = "sha256-GfZ5XzHPqOs1Kx5bPDefIu5gIOmHAf8sxnnajE8RWfc=";
};
});
# See
# https://github.com/NixOS/nixpkgs/commit/2bf8d8c0162507d08f9fc48e36ce7225f4879bd4
libsForQt5 = prev.libsForQt5.overrideScope' (finalp: prevp: {
plasma5 = prevp.plasma5.overrideScope' (finalq: prevq: {
plasma-mobile = prevq.plasma-mobile.overrideAttrs (old: {
buildInputs = with prevp; old.buildInputs ++ [
plasma-workspace
];
});
});
});
plasma5Packages = prev.plasma5Packages.overrideScope' (finalp: prevp: {
plasma5 = prevp.plasma5.overrideScope' (finalq: prevq: {
plasma-mobile = prevq.plasma-mobile.overrideAttrs (old: {
buildInputs = with prevp; old.buildInputs ++ [
plasma-workspace
];
});
});
});
}

View File

@ -56,8 +56,6 @@ in {
pySmartDL = pySmartDL;
cfscrape = cfscrape;
};
sddm-sugar-dark = prev.callPackage ./sddm-sugar-dark {};
surface-control = prev.callPackage ./tools/system/surface-control {};
@ -88,4 +86,6 @@ in {
wayfire-firedecor = prev.callPackage applications/wayfire/firedecor {
wayfire = wayfire-master;
};
sddm-sugar-dark = prev.callPackage themes/sddm/sugar-dark {};
}

View File

@ -0,0 +1,32 @@
{
fetchFromGitHub
, stdenv, formats
, config ? {}
}:
# This package works a bit differently as the config needs to be inside the package.
# Override with config set to the settings you want. See
# https://github.com/MarianArlt/sddm-sugar-dark/blob/master/theme.conf
let
iniFmt = formats.ini {};
configFile = iniFmt.generate "theme.conf" config;
in stdenv.mkDerivation rec {
pname = "sddm-sugar-dark";
version = "1.2";
src = fetchFromGitHub {
owner = "MarianArlt";
repo = "sddm-sugar-dark";
rev = "v${version}";
sha256 = "0gx0am7vq1ywaw2rm1p015x90b75ccqxnb1sz3wy8yjl27v82yhb";
};
dontBuild = true;
installPhase = ''
mkdir -p $out/usr/share/sddm/themes/sugar-dark
cp -r metadata.desktop Main.qml Background.jpg Components Assets $out/usr/share/sddm/themes/sugar-dark
ln -s ${configFile} $out/usr/share/sddm/themes/sugar-dark/theme.conf
'';
}