nix #11
|
@ -1,20 +1,35 @@
|
|||
{ pkgs, config, lib, ... }:
|
||||
let
|
||||
nixgl = import
|
||||
(builtins.fetchGit {
|
||||
url = "https://github.com/nix-community/nixGL";
|
||||
rev = "489d6b095ab9d289fe11af0219a9ff00fe87c7c5";
|
||||
})
|
||||
{ };
|
||||
nixGLIntelPrefix = "${nixgl.nixVulkanIntel}/bin/nixVulkanIntel ${nixgl.nixGLIntel}/bin/nixGLIntel ";
|
||||
wmPrefix = "${lib.optionalString config.frogeye.desktop.nixGLIntel nixGLIntelPrefix}";
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
./frobar
|
||||
];
|
||||
config = lib.mkIf config.frogeye.desktop.xorg {
|
||||
frogeye.shellAliases = {
|
||||
noise = ''${pkgs.sox}/bin/play -c 2 -n synth $'' + ''{1}noise'';
|
||||
beep = ''${pkgs.sox}/bin/play -n synth sine E5 sine A4 remix 1-2 fade 0.5 1.2 0.5 2> /dev/null'';
|
||||
|
||||
# n = "$HOME/.config/i3/terminal & disown"; # Not used anymore since alacritty daemon mode doesn't preserve environment variables
|
||||
x = "startx ${config.xdg.configHome}/xinitrc; logout";
|
||||
nx = "nvidia-xrun ${config.xdg.configHome}/xinitrc; sudo systemctl start nvidia-xrun-pm; logout";
|
||||
# Was also thinking of not storing the config in .config and use nix-store instead,
|
||||
# but maybe it's a bad idea as home-manager switch doesn't replace aliases in running shells
|
||||
# FIXME Is it still relevant with NixOS?
|
||||
x = "startx ${config.home.homeDirectory}/${config.xsession.scriptPath}; logout";
|
||||
# TODO Is it possible to not start nvidia stuff on nixOS?
|
||||
# nx = "nvidia-xrun ${config.xsession.scriptPath}; sudo systemctl start nvidia-xrun-pm; logout";
|
||||
};
|
||||
xsession = {
|
||||
enable = true;
|
||||
# Not using config.xdg.configHome because it needs to be $HOME-relative paths and path manipulation is hard
|
||||
scriptPath = ".config/xsession";
|
||||
profilePath = ".config/xprofile";
|
||||
windowManager = {
|
||||
command = lib.mkForce "${wmPrefix} ${config.xsession.windowManager.i3.package}/bin/i3";
|
||||
i3 = {
|
||||
enable = true;
|
||||
config =
|
||||
|
@ -68,7 +83,6 @@
|
|||
{
|
||||
modifier = "Mod4";
|
||||
terminal = "alacritty";
|
||||
bars = [ ]; # Using frobar
|
||||
colors = let ignore = "#ff00ff"; in
|
||||
with config.lib.stylix.colors.withHashtag; lib.mkForce {
|
||||
focused = { border = base0B; background = base0B; text = base00; indicator = base00; childBorder = base0B; };
|
||||
|
@ -310,7 +324,6 @@
|
|||
];
|
||||
};
|
||||
startup = [
|
||||
{ notification = false; command = "${pkgs.autorandr}/bin/autorandr --change"; }
|
||||
# Lock screen after 10 minutes
|
||||
{ notification = false; command = "${pkgs.xautolock}/bin/xautolock -time 10 -locker '${pkgs.xorg.xset}/bin/xset dpms force standby' -killtime 1 -killer ${locker}"; }
|
||||
{
|
||||
|
@ -498,13 +511,8 @@
|
|||
};
|
||||
autorandr = {
|
||||
enable = true;
|
||||
hooks.postswitch =
|
||||
let
|
||||
frobar = (pkgs.callPackage (import ./frobar) { });
|
||||
in
|
||||
{
|
||||
"background" = "${pkgs.feh}/bin/feh --no-fehbg --bg-fill ${config.stylix.image}";
|
||||
"frobar" = "${pkgs.i3}/bin/i3-msg exec ${frobar}/bin/frobar_launcher";
|
||||
hooks.postswitch = {
|
||||
background = "${pkgs.feh}/bin/feh --no-fehbg --bg-fill ${config.stylix.image}";
|
||||
};
|
||||
};
|
||||
mpv = {
|
||||
|
@ -553,23 +561,6 @@
|
|||
"pulse/client.conf" = {
|
||||
text = ''cookie-file = .config/pulse/pulse-cookie'';
|
||||
};
|
||||
"xinitrc" =
|
||||
let
|
||||
nixgl = import
|
||||
(builtins.fetchGit {
|
||||
url = "https://github.com/nix-community/nixGL";
|
||||
rev = "489d6b095ab9d289fe11af0219a9ff00fe87c7c5";
|
||||
})
|
||||
{ };
|
||||
nixGLIntelPrefix = "${nixgl.nixVulkanIntel}/bin/nixVulkanIntel ${nixgl.nixGLIntel}/bin/nixGLIntel ";
|
||||
wmPrefix = "${lib.optionalString config.frogeye.desktop.nixGLIntel nixGLIntelPrefix}";
|
||||
in
|
||||
{
|
||||
source = pkgs.writeShellScript "xinitrc" ''
|
||||
${pkgs.xorg.xrdb}/bin/xrdb ${config.xresources.path}
|
||||
${wmPrefix}${config.xsession.windowManager.command}
|
||||
'';
|
||||
};
|
||||
"rofimoji.rc" = {
|
||||
text = ''
|
||||
skin-tone = neutral
|
||||
|
@ -593,7 +584,6 @@
|
|||
};
|
||||
services = {
|
||||
unclutter.enable = true;
|
||||
# FIXME Not starting on curacao_test
|
||||
dunst =
|
||||
{
|
||||
enable = true;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{ pkgs ? import <nixpkgs> { config = { }; overlays = [ ]; } }:
|
||||
{ pkgs ? import <nixpkgs> { config = { }; overlays = [ ]; }, ... }:
|
||||
# Tried using pyproject.nix but mpd2 dependency wouldn't resolve,
|
||||
# is called pyton-mpd2 on PyPi but mpd2 in nixpkgs.
|
||||
let
|
||||
|
@ -6,6 +6,7 @@ let
|
|||
pname = "frobar";
|
||||
version = "2.0";
|
||||
|
||||
runtimeInputs = with pkgs; [ lemonbar-xft wirelesstools ];
|
||||
propagatedBuildInputs = with pkgs.python3Packages; [
|
||||
coloredlogs
|
||||
notmuch
|
||||
|
@ -15,21 +16,33 @@ let
|
|||
pulsectl
|
||||
pyinotify
|
||||
];
|
||||
makeWrapperArgs = [ "--prefix PATH : ${pkgs.lib.makeBinPath (with pkgs; [ lemonbar-xft wirelesstools ])}" ];
|
||||
|
||||
src = ./.;
|
||||
};
|
||||
frobar_launcher = pkgs.writeShellApplication
|
||||
{
|
||||
name = "frobar_launcher";
|
||||
runtimeInputs = with pkgs; [ lemonbar-xft wirelesstools ];
|
||||
text = ''
|
||||
pidfile=$XDG_RUNTIME_DIR/frobar/$DISPLAY.pid
|
||||
${pkgs.coreutils}/bin/mkdir -p "$(${pkgs.coreutils}/bin/dirname "$pidfile")"
|
||||
([ -f "$pidfile" ] && ${pkgs.procps}/bin/kill "$(<"$pidfile")") || true
|
||||
${frobar}/bin/frobar & disown
|
||||
echo $! > "$pidfile"
|
||||
'';
|
||||
};
|
||||
in
|
||||
frobar_launcher
|
||||
# TODO Connection with i3 is lost sometimes, more often than with Arch?
|
||||
{
|
||||
config = {
|
||||
xsession.windowManager.i3.config.bars = [ ];
|
||||
programs.autorandr.hooks.postswitch = {
|
||||
frobar = "${pkgs.systemd}/bin/systemctl --user restart frobar";
|
||||
};
|
||||
systemd.user.services.frobar = {
|
||||
Unit = {
|
||||
Description = "frobar";
|
||||
After = [ "graphical-session-pre.target" ];
|
||||
PartOf = [ "graphical-session.target" ];
|
||||
};
|
||||
|
||||
Service = {
|
||||
# Wait for i3 to start. Can't use ExecStartPre because otherwise it blocks graphical-session.target, and there's nothing i3/systemd
|
||||
# TODO Do that better
|
||||
ExecStart = ''${pkgs.bash}/bin/bash -c "while ! ${pkgs.i3}/bin/i3-msg; do ${pkgs.coreutils}/bin/sleep 1; done; ${frobar}/bin/frobar"'';
|
||||
};
|
||||
|
||||
Install = { WantedBy = [ "graphical-session.target" ]; };
|
||||
};
|
||||
};
|
||||
}
|
||||
# TODO Connection with i3 is lost on start sometimes, more often than with Arch?
|
||||
# TODO Restore ability to build frobar with nix-build
|
||||
|
|
Loading…
Reference in a new issue