mirror of
https://github.com/willemml/dotfiles.nix.git
synced 2025-04-12 11:17:17 +00:00
lemurs dm
This commit is contained in:
parent
1317033527
commit
622b1a5b20
14 changed files with 202 additions and 40 deletions
|
@ -25,7 +25,7 @@
|
||||||
|
|
||||||
nix = {
|
nix = {
|
||||||
package = pkgs.nix;
|
package = pkgs.nix;
|
||||||
settings.experimental-features = ["nix-command" "flakes" "repl-flake"];
|
settings.experimental-features = ["nix-command" "flakes"];
|
||||||
settings.trusted-users = ["root" "willem"];
|
settings.trusted-users = ["root" "willem"];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
description = "Willem's Nix configurations";
|
description = "Willem's Nix configurations";
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:nixos/nixpkgs?rev=7d0d974fc21f02dfeed7ef098d8faf0195162949";
|
nixpkgs.url = "github:nixos/nixpkgs";
|
||||||
|
|
||||||
darwin.url = "github:willemml/nix-darwin?ref=feat/networking.hosts";
|
darwin.url = "github:willemml/nix-darwin?ref=feat/networking.hosts";
|
||||||
#darwin.url = "git+file:///Users/willem/dev/nix-darwin";
|
#darwin.url = "git+file:///Users/willem/dev/nix-darwin";
|
||||||
|
@ -35,10 +35,6 @@
|
||||||
|
|
||||||
stylix.url = "github:danth/stylix";
|
stylix.url = "github:danth/stylix";
|
||||||
stylix.inputs.nixpkgs.follows = "nixpkgs";
|
stylix.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
|
||||||
nixd.url = "github:nix-community/nixd";
|
|
||||||
nixd.inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
nixd.inputs.flake-parts.follows = "flake-parts";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = {
|
outputs = {
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
inputs,
|
inputs,
|
||||||
globals,
|
globals,
|
||||||
config,
|
config,
|
||||||
pkgs,
|
|
||||||
...
|
...
|
||||||
}: {
|
}: {
|
||||||
imports = [
|
imports = [
|
||||||
|
@ -31,7 +30,7 @@
|
||||||
base = globals.language;
|
base = globals.language;
|
||||||
};
|
};
|
||||||
|
|
||||||
sessionVariables = rec {
|
sessionVariables = {
|
||||||
DOTDIR = "${config.home.homeDirectory}/.config/dotfiles.nix";
|
DOTDIR = "${config.home.homeDirectory}/.config/dotfiles.nix";
|
||||||
EDITOR = "hx";
|
EDITOR = "hx";
|
||||||
VISUAL = "hx";
|
VISUAL = "hx";
|
||||||
|
|
|
@ -15,8 +15,6 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
gcc-arm-embedded
|
|
||||||
killall
|
|
||||||
];
|
];
|
||||||
|
|
||||||
home.homeDirectory = "/home/willem";
|
home.homeDirectory = "/home/willem";
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
{pkgs, ...}: {
|
{pkgs, ...}: {
|
||||||
fonts.fontconfig.enable = true;
|
fonts.fontconfig.enable = true;
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs;
|
||||||
rPackages.fontawesome
|
[
|
||||||
nerdfonts
|
rPackages.fontawesome
|
||||||
ubuntu_font_family
|
ubuntu_font_family
|
||||||
noto-fonts-cjk-sans
|
noto-fonts-cjk-sans
|
||||||
noto-fonts
|
noto-fonts
|
||||||
];
|
]
|
||||||
|
++ builtins.filter lib.attrsets.isDerivation (builtins.attrValues pkgs.nerd-fonts);
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,6 +22,7 @@ in {
|
||||||
then firefox-wv
|
then firefox-wv
|
||||||
else firefox
|
else firefox
|
||||||
)
|
)
|
||||||
|
yarg
|
||||||
polkit-kde-agent
|
polkit-kde-agent
|
||||||
lxappearance
|
lxappearance
|
||||||
pipewire
|
pipewire
|
||||||
|
@ -30,6 +31,7 @@ in {
|
||||||
qt6ct
|
qt6ct
|
||||||
rofi-wayland
|
rofi-wayland
|
||||||
xdg-desktop-portal
|
xdg-desktop-portal
|
||||||
|
xdg-desktop-portal-gtk
|
||||||
inputs.hyprland.packages.${pkgs.system}.xdg-desktop-portal-hyprland
|
inputs.hyprland.packages.${pkgs.system}.xdg-desktop-portal-hyprland
|
||||||
]
|
]
|
||||||
++ (
|
++ (
|
||||||
|
@ -45,23 +47,23 @@ in {
|
||||||
# size = 24;
|
# size = 24;
|
||||||
# };
|
# };
|
||||||
|
|
||||||
# gtk = {
|
gtk = {
|
||||||
# enable = true;
|
# enable = true;
|
||||||
|
|
||||||
# theme = {
|
# theme = {
|
||||||
# package = pkgs.flat-remix-gtk;
|
# package = pkgs.flat-remix-gtk;
|
||||||
# name = "Flat-Remix-GTK-Grey-Darkest";
|
# name = "Flat-Remix-GTK-Grey-Darkest";
|
||||||
# };
|
# };
|
||||||
# iconTheme = {
|
iconTheme = {
|
||||||
# package = pkgs.adwaita-icon-theme;
|
package = pkgs.adwaita-icon-theme;
|
||||||
# name = "Adwaita";
|
name = "Adwaita";
|
||||||
# };
|
};
|
||||||
# font = {
|
# font = {
|
||||||
# name = "Sans";
|
# name = "Sans";
|
||||||
# size = 12;
|
# size = 12;
|
||||||
# package = pkgs.dejavu_fonts;
|
# package = pkgs.dejavu_fonts;
|
||||||
# };
|
# };
|
||||||
# };
|
};
|
||||||
|
|
||||||
# notifications daemon
|
# notifications daemon
|
||||||
services.mako.enable = true;
|
services.mako.enable = true;
|
||||||
|
@ -76,7 +78,7 @@ in {
|
||||||
rounding = 10;
|
rounding = 10;
|
||||||
|
|
||||||
# save battery
|
# save battery
|
||||||
drop_shadow = false;
|
# drop_shadow = false;
|
||||||
blur.enabled = false;
|
blur.enabled = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -190,6 +192,7 @@ in {
|
||||||
"$mod, right, resizeactive, 10 0"
|
"$mod, right, resizeactive, 10 0"
|
||||||
"$mod, up, resizeactive, 0 -10"
|
"$mod, up, resizeactive, 0 -10"
|
||||||
"$mod, down, resizeactive, 0 10"
|
"$mod, down, resizeactive, 0 10"
|
||||||
|
"$mod, mouse:272, movewindow"
|
||||||
];
|
];
|
||||||
|
|
||||||
input = {
|
input = {
|
||||||
|
|
|
@ -12,8 +12,7 @@
|
||||||
latest.toolchain
|
latest.toolchain
|
||||||
targets.thumbv7em-none-eabihf.latest.rust-std
|
targets.thumbv7em-none-eabihf.latest.rust-std
|
||||||
]);
|
]);
|
||||||
nixd-upstream = inputs.nixd.packages.${pkgs.system}.default;
|
extras = [fenix-rust] ++ node-packages;
|
||||||
extras = [fenix-rust nixd-upstream] ++ node-packages;
|
|
||||||
in {
|
in {
|
||||||
home.packages =
|
home.packages =
|
||||||
(with pkgs; [
|
(with pkgs; [
|
||||||
|
|
|
@ -9,11 +9,11 @@
|
||||||
{
|
{
|
||||||
name = "nix";
|
name = "nix";
|
||||||
auto-format = true;
|
auto-format = true;
|
||||||
language-servers = ["nixd-lsp"];
|
# language-servers = ["nixd-lsp"];
|
||||||
formatter = {command = "${pkgs.alejandra}/bin/alejandra";};
|
formatter = {command = "${pkgs.alejandra}/bin/alejandra";};
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
languages.language-server.nixd-lsp.command = "${inputs.nixd.packages.${pkgs.system}.default}/bin/nixd";
|
# languages.language-server.nixd-lsp.command = "${inputs.nixd.packages.${pkgs.system}.default}/bin/nixd";
|
||||||
settings.editor.line-number = "relative";
|
settings.editor.line-number = "relative";
|
||||||
settings.keys = {
|
settings.keys = {
|
||||||
normal = {
|
normal = {
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [virt-manager libvirt];
|
environment.systemPackages = with pkgs; [virt-manager libvirt virtiofsd];
|
||||||
|
|
||||||
virtualisation.spiceUSBRedirection.enable = true;
|
virtualisation.spiceUSBRedirection.enable = true;
|
||||||
|
|
||||||
|
|
120
nixos/modules/lemurs.nix
Normal file
120
nixos/modules/lemurs.nix
Normal file
|
@ -0,0 +1,120 @@
|
||||||
|
# Thanks https://github.com/auvred/nixos-config/blob/df45668785adb931641a48121e554d3b45c3f7bd/nixos-modules/lemurs/default.nix
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
inputs,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
virtualTerminalNumber = 2;
|
||||||
|
pamServiceName = "lemurs";
|
||||||
|
hyprpkgs = inputs.hyprland.packages.${pkgs.system};
|
||||||
|
in {
|
||||||
|
systemd.services.lemurs = {
|
||||||
|
aliases = ["display-manager.service"];
|
||||||
|
after = ["systemd-user-sessions.service" "plymouth-quit-wait.service" "getty@tty${toString virtualTerminalNumber}.service"];
|
||||||
|
wantedBy = ["multi-user.target"];
|
||||||
|
serviceConfig = let
|
||||||
|
lemursConfig = (pkgs.formats.toml {}).generate "lemurs-config.toml" {
|
||||||
|
tty = virtualTerminalNumber;
|
||||||
|
pam_service = pamServiceName;
|
||||||
|
system_shell = "${pkgs.bash}/bin/bash";
|
||||||
|
max_display_length = 15;
|
||||||
|
|
||||||
|
power_controls.base_entries = [
|
||||||
|
{
|
||||||
|
hint = "Shutdown";
|
||||||
|
hint_color = "dark gray";
|
||||||
|
hint_modifiers = "";
|
||||||
|
key = "F1";
|
||||||
|
cmd = "${pkgs.systemd}/bin/systemctl poweroff";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
hint = "Reboot";
|
||||||
|
hint_color = "dark gray";
|
||||||
|
hint_modifiers = "";
|
||||||
|
key = "F2";
|
||||||
|
cmd = "${pkgs.systemd}/bin/systemctl reboot";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
wayland = {
|
||||||
|
wayland_sessions_path = "${hyprpkgs.hyprland}/share/wayland-sessions";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
in {
|
||||||
|
ExecStart = "${pkgs.lemurs}/bin/lemurs --config ${lemursConfig}";
|
||||||
|
StandardInput = "tty";
|
||||||
|
TTYPath = "/dev/tty${toString virtualTerminalNumber}";
|
||||||
|
TTYReset = "yes";
|
||||||
|
TTYVHangup = "yes";
|
||||||
|
Type = "idle";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
security.pam.services = {
|
||||||
|
${pamServiceName}.text = ''
|
||||||
|
auth include login
|
||||||
|
account include login
|
||||||
|
session include login
|
||||||
|
password include login
|
||||||
|
'';
|
||||||
|
# See https://github.com/coastalwhite/lemurs/issues/166
|
||||||
|
login = {
|
||||||
|
setLoginUid = false;
|
||||||
|
# I want my systemd-logind(8) session to access to seat0 (the default seat
|
||||||
|
# with all hardware devices).
|
||||||
|
# At the very least, I want to be able to change backlight without tweaking
|
||||||
|
# udev rules and directly accessing /sys/class/backlight.
|
||||||
|
# See systemd-logind(8), sd-login(3), org.freedesktop.login1(5), pam_systemd(8)
|
||||||
|
# for more details.
|
||||||
|
#
|
||||||
|
# -----
|
||||||
|
#
|
||||||
|
# pam_systemd(8) tries to get XDG_SEAT and XDG_VTNR variables from environment.
|
||||||
|
# https://github.com/systemd/systemd/blob/main/src/login/pam_systemd.c#L967-L968
|
||||||
|
#
|
||||||
|
# It passes seat and vntr to the
|
||||||
|
# org.freedesktop.login1
|
||||||
|
# -> /org/freedesktop/login1
|
||||||
|
# -> org.freedesktop.login1.Manager
|
||||||
|
# -> CreateSession(in s seat_id, in u vtnr, ...)
|
||||||
|
#
|
||||||
|
# See org.freedesktop.login1(5) for more details.
|
||||||
|
#
|
||||||
|
# AFAIK lemurs doesn't pass either XDG_SEAT or XDG_VTNR to the PAM process.
|
||||||
|
# See also https://github.com/1wilkens/pam/issues/13.
|
||||||
|
#
|
||||||
|
# pam_env(8) PAM module is located before pam_systemd(8) in /etc/pam.d/login.
|
||||||
|
# So variables set by pam_env are visible to pam_systemd.
|
||||||
|
rules.session.extra-env = {
|
||||||
|
args = [
|
||||||
|
("conffile="
|
||||||
|
+ (pkgs.writeTextFile {
|
||||||
|
name = "pam-extra-env-conffile";
|
||||||
|
text = ''
|
||||||
|
XDG_SEAT DEFAULT="seat0"
|
||||||
|
XDG_VTNR DEFAULT="2"
|
||||||
|
'';
|
||||||
|
}))
|
||||||
|
"readenv=0"
|
||||||
|
];
|
||||||
|
control = "required";
|
||||||
|
enable = true;
|
||||||
|
modulePath = "${pkgs.pam}/lib/security/pam_env.so";
|
||||||
|
order = config.security.pam.services.login.rules.session.env.order + 10;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# Useful for pam_systemd debugging
|
||||||
|
# systemd.managerEnvironment = {SYSTEMD_LOG_LEVEL = "debug";};
|
||||||
|
# systemd.globalEnvironment = {
|
||||||
|
# SYSTEMD_LOG_LEVEL = "debug";
|
||||||
|
# };
|
||||||
|
# systemd.services.systemd-logind.environment = {
|
||||||
|
# SYSTEMD_LOG_LEVEL = "debug";
|
||||||
|
# };
|
||||||
|
# security.pam.services.login.rules.session.unix.args = ["debug"];
|
||||||
|
# security.pam.services.login.rules.session.systemd.args = ["debug"];
|
||||||
|
# security.pam.services.systemd-user.rules.session.unix.args = ["debug"];
|
||||||
|
# security.pam.services.systemd-user.rules.session.systemd.args = ["debug"];
|
||||||
|
}
|
|
@ -8,6 +8,7 @@ in {
|
||||||
imports = [
|
imports = [
|
||||||
./gui.nix
|
./gui.nix
|
||||||
../modules/polkit.nix
|
../modules/polkit.nix
|
||||||
|
../modules/lemurs.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
programs.hyprland.enable = true;
|
programs.hyprland.enable = true;
|
||||||
|
|
|
@ -1,7 +1,12 @@
|
||||||
{...}: {
|
{
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
hardware.graphics.enable = true;
|
hardware.graphics.enable = true;
|
||||||
|
|
||||||
hardware.nvidia = {
|
hardware.nvidia = {
|
||||||
|
package = config.boot.kernelPackages.nvidiaPackages.beta;
|
||||||
modesetting.enable = true;
|
modesetting.enable = true;
|
||||||
powerManagement.enable = false;
|
powerManagement.enable = false;
|
||||||
powerManagement.finegrained = false;
|
powerManagement.finegrained = false;
|
||||||
|
@ -9,4 +14,6 @@
|
||||||
open = false;
|
open = false;
|
||||||
nvidiaSettings = true;
|
nvidiaSettings = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
services.xserver.videoDrivers = ["nvidia"];
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,4 +4,22 @@ final: prev: {
|
||||||
firefox-wv = prev.firefox.override (old: {
|
firefox-wv = prev.firefox.override (old: {
|
||||||
extraPrefsFiles = ["${final.widevine-installer}/conf/gmpwidevine.js"];
|
extraPrefsFiles = ["${final.widevine-installer}/conf/gmpwidevine.js"];
|
||||||
});
|
});
|
||||||
|
# Thanks https://github.com/auvred/nixos-config/blob/df45668785adb931641a48121e554d3b45c3f7bd/overlays/lemurs/default.nix
|
||||||
|
# The latest published version (0.3.2) doesn't contain a following patches:
|
||||||
|
# - https://github.com/coastalwhite/lemurs/commit/ef4b42de1391f3d35d7827130d20bc57d06198f9
|
||||||
|
# - https://github.com/coastalwhite/lemurs/commit/849e7cea87f3567be7cec403a2a603b8370e351c
|
||||||
|
lemurs = prev.lemurs.override {
|
||||||
|
rustPlatform.buildRustPackage = args:
|
||||||
|
final.rustPlatform.buildRustPackage (args
|
||||||
|
// {
|
||||||
|
patches = [];
|
||||||
|
src = prev.fetchFromGitHub {
|
||||||
|
owner = "coastalwhite";
|
||||||
|
repo = "lemurs";
|
||||||
|
rev = "1d4be7d0c3f528a0c1e9326ac77f1e8a17161c83";
|
||||||
|
hash = "sha256-t/riJpgy0bD5CU8Zkzket4Gks2JXXSLRreMlrxlok0c=";
|
||||||
|
};
|
||||||
|
cargoHash = "sha256-hKeJaIGUZpbuca3IPN1Uq4bamgImfYNvCRiVDbriHPA=";
|
||||||
|
});
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
20
packages/lemurs.nix
Normal file
20
packages/lemurs.nix
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
let
|
||||||
|
lacrosVersion = "120.0.6098.0";
|
||||||
|
in
|
||||||
|
{pkgs, ...}:
|
||||||
|
pkgs.stdenv.mkDerivation {
|
||||||
|
name = "widevine";
|
||||||
|
version = "";
|
||||||
|
buildInputs = with pkgs; [curl widevine-installer];
|
||||||
|
|
||||||
|
src = pkgs.fetchurl {
|
||||||
|
urls = ["https://commondatastorage.googleapis.com/chromeos-localmirror/distfiles/chromeos-lacros-arm64-squash-zstd-${lacrosVersion}"];
|
||||||
|
hash = "sha256-OKV8w5da9oZ1oSGbADVPCIkP9Y0MVLaQ3PXS3ZBLFXY=";
|
||||||
|
};
|
||||||
|
|
||||||
|
unpackPhase = "true";
|
||||||
|
installPhase = ''
|
||||||
|
mkdir -p "$out/"
|
||||||
|
COPY_CONFIGS=0 INSTALL_BASE="$out" DISTFILES_BASE="file://$src" widevine-installer
|
||||||
|
'';
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue