more rice stuff
This commit is contained in:
1 parent
3a345929b9
commit
e2d34c6d1e
7 files changed
+156
-45
No files matched your search
Generated
+22
-1
@@ -39,7 +39,28 @@
|
|||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"home-manager": "home-manager",
|
"home-manager": "home-manager",
|
||||||
"nixpkgs": "nixpkgs"
|
"nixpkgs": "nixpkgs",
|
||||||
|
"zen-browser": "zen-browser"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"zen-browser": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1790843023,
|
||||||
|
"narHash": "sha256-vO6WFunNqHCjEaQc3ytshsGhHMqAIeW+5/rEJRLQLxQ=",
|
||||||
|
"owner": "youwen5",
|
||||||
|
"repo": "zen-browser-flake",
|
||||||
|
"rev": "710bb85c6cb4f186de8a710615be5b93b5f98885",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "youwen5",
|
||||||
|
"repo": "zen-browser-flake",
|
||||||
|
"type": "github"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -27,5 +27,4 @@
|
|||||||
desktop = mkHost "desktop";
|
desktop = mkHost "desktop";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -3,16 +3,16 @@
|
|||||||
{
|
{
|
||||||
imports =
|
imports =
|
||||||
[
|
[
|
||||||
/etc/nixos/hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
inputs.home-manager.nixosModules.default
|
inputs.home-manager.nixosModules.default
|
||||||
../../modules/nixos/nvidia.nix
|
../../modules/nixos/nvidia.nix
|
||||||
../../modules/nixos/bspwm.nix
|
../../modules/nixos/bspwm.nix
|
||||||
../../modules/nixos/cups.nix
|
../../modules/nixos/cups.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
nixpkgs.overlays = [
|
# nixpkgs.overlays = [
|
||||||
(import ./ghidra-m32r-overlay.nix)
|
# (import ./ghidra-m32r-overlay.nix)
|
||||||
];
|
# ];
|
||||||
|
|
||||||
# Extra Nix Settings
|
# Extra Nix Settings
|
||||||
nix.settings = {
|
nix.settings = {
|
||||||
@@ -90,7 +90,7 @@
|
|||||||
vlc
|
vlc
|
||||||
kdePackages.kdenlive
|
kdePackages.kdenlive
|
||||||
kicad
|
kicad
|
||||||
ghidra
|
# ghidra
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -101,9 +101,9 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
services.freenet = {
|
# services.freenet = {
|
||||||
enable = true;
|
# enable = true;
|
||||||
};
|
# };
|
||||||
|
|
||||||
# Garbage Collection
|
# Garbage Collection
|
||||||
nix.gc = {
|
nix.gc = {
|
||||||
|
|||||||
+24
-2
@@ -3,16 +3,18 @@
|
|||||||
{
|
{
|
||||||
home.username = "chris";
|
home.username = "chris";
|
||||||
home.homeDirectory = "/home/chris";
|
home.homeDirectory = "/home/chris";
|
||||||
home.stateVersion = "26.05"; # Please read the comment before changing.
|
home.stateVersion = "25.11"; # Please read the comment before changing.
|
||||||
programs.home-manager.enable = true;
|
programs.home-manager.enable = true;
|
||||||
|
|
||||||
imports = [
|
imports = [
|
||||||
../../modules/home-manager/defaults.nix
|
../../modules/home-manager/defaults.nix
|
||||||
|
../../modules/home-manager/wallpaper.nix
|
||||||
../../modules/home-manager/sxhkd.nix
|
../../modules/home-manager/sxhkd.nix
|
||||||
../../modules/home-manager/terminals/alacritty.nix
|
../../modules/home-manager/terminals/alacritty.nix
|
||||||
# ../../modules/home-manager/browsers/ugc.nix
|
../../modules/home-manager/browsers/ugc.nix
|
||||||
../../modules/home-manager/bspwm.nix
|
../../modules/home-manager/bspwm.nix
|
||||||
../../modules/home-manager/polybar.nix
|
../../modules/home-manager/polybar.nix
|
||||||
|
../../modules/home-manager/browsers/zen.nix
|
||||||
# ../../modules/home-manager/editors/helix.nix
|
# ../../modules/home-manager/editors/helix.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -21,4 +23,24 @@
|
|||||||
editor = "hx";
|
editor = "hx";
|
||||||
browser = "zen";
|
browser = "zen";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
my.bspwm.monitors = [
|
||||||
|
{
|
||||||
|
name = "DP-0";
|
||||||
|
xrandr = "--primary --auto --pos 1080x0";
|
||||||
|
desktops = [ "1" "2" "3" "4" "5" "6" ];
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name = "DP-2";
|
||||||
|
xrandr = "--auto --rotate left --pos 0x0";
|
||||||
|
desktops = [ "7" "8" "9" ];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
my.wallpapers = {
|
||||||
|
"DP-0" = "/data/Pictures/bg/wallhaven-mountains.jpg";
|
||||||
|
"DP-2" = "/data/Pictures/bg/wallhaven-mountains.jpg";
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,34 +1,65 @@
|
|||||||
{ lib, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.my.bspwm;
|
||||||
|
in
|
||||||
{
|
{
|
||||||
xdg.configFile."bspwm/bspwmrc" = {
|
options.my.bspwm.monitors = lib.mkOption {
|
||||||
executable = true;
|
default = [ ];
|
||||||
text = ''
|
description = "Monitors left to right. Empty means single-monitor defaults.";
|
||||||
#!/bin/sh
|
type = lib.types.listOf (lib.types.submodule {
|
||||||
|
options = {
|
||||||
|
name = lib.mkOption { type = lib.types.str; };
|
||||||
|
xrandr = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
default = "--auto";
|
||||||
|
description = "Arguments for xrandr --output <name>.";
|
||||||
|
};
|
||||||
|
desktops = lib.mkOption { type = lib.types.listOf lib.types.str; };
|
||||||
|
};
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
bspc monitor -d 1 2 3 4 5 6 7 8 9
|
config = {
|
||||||
|
xdg.configFile."bspwm/bspwmrc" = {
|
||||||
|
executable = true;
|
||||||
|
text = ''
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
# Gaps and borders
|
${lib.optionalString (cfg.monitors != [ ]) ''
|
||||||
bspc config window_gap 10
|
${pkgs.xrandr}/bin/xrandr ${lib.concatMapStringsSep " "
|
||||||
bspc config border_width 2
|
(m: "--output ${m.name} ${m.xrandr}") cfg.monitors}
|
||||||
bspc config focused_border_color "#7aa2f7"
|
''}
|
||||||
bspc config normal_border_color "#292e42"
|
${if cfg.monitors == [ ]
|
||||||
|
then "bspc monitor -d 1 2 3 4 5 6 7 8 9"
|
||||||
|
else lib.concatMapStringsSep "\n"
|
||||||
|
(m: "bspc monitor ${m.name} -d ${lib.concatStringsSep " " m.desktops}")
|
||||||
|
cfg.monitors}
|
||||||
|
|
||||||
# Layout behaviour
|
# Gaps and borders
|
||||||
bspc config split_ratio 0.50
|
bspc config window_gap 10
|
||||||
bspc config borderless_monocle true
|
bspc config border_width 2
|
||||||
bspc config gapless_monocle true
|
bspc config focused_border_color "#7aa2f7"
|
||||||
|
bspc config normal_border_color "#292e42"
|
||||||
|
|
||||||
# Launch polybar
|
# Layout behaviour
|
||||||
~/.config/polybar/launch.sh
|
bspc config split_ratio 0.50
|
||||||
|
bspc config borderless_monocle true
|
||||||
|
bspc config gapless_monocle true
|
||||||
|
|
||||||
|
# Launch polybar
|
||||||
|
~/.config/polybar/launch.sh
|
||||||
|
|
||||||
|
# Wallpapers
|
||||||
|
[ -x ~/.config/wallpaper/set.sh ] && ~/.config/wallpaper/set.sh
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
home.activation.reloadBspwm = lib.hm.dag.entryAfter [ "linkGeneration" ] ''
|
||||||
|
if ${pkgs.procps}/bin/pgrep -x bspwm >/dev/null; then
|
||||||
|
PATH=${pkgs.bspwm}/bin:$PATH DISPLAY=:0 $HOME/.config/bspwm/bspwmrc \
|
||||||
|
|| echo "bspwmrc reload failed" >&2
|
||||||
|
fi
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
home.activation.reloadBspwm = lib.hm.dag.entryAfter [ "linkGeneration" ] ''
|
|
||||||
if ${pkgs.procps}/bin/pgrep -x bspwm >/dev/null; then
|
|
||||||
PATH=${pkgs.bspwm}/bin:$PATH DISPLAY=:0 $HOME/.config/bspwm/bspwmrc \
|
|
||||||
|| echo "bspwmrc reload failed" >&2
|
|
||||||
fi
|
|
||||||
'';
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
{ lib, pkgs, ... }:
|
{ pkgs, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
polybar = pkgs.polybar.override { pulseSupport = true; };
|
polybar = pkgs.polybar.override { pulseSupport = true; };
|
||||||
@@ -18,6 +18,7 @@ in
|
|||||||
dim = #565f89
|
dim = #565f89
|
||||||
|
|
||||||
[bar/main]
|
[bar/main]
|
||||||
|
monitor = ''${env:MONITOR:}
|
||||||
width = 100%
|
width = 100%
|
||||||
height = 22pt
|
height = 22pt
|
||||||
background = ''${colors.background}
|
background = ''${colors.background}
|
||||||
@@ -36,8 +37,15 @@ in
|
|||||||
|
|
||||||
tray-position = right
|
tray-position = right
|
||||||
|
|
||||||
|
# Second monitor: same look, no tray, fewer modules (it's narrow when rotated)
|
||||||
|
[bar/secondary]
|
||||||
|
inherit = bar/main
|
||||||
|
modules-right = cpu memory
|
||||||
|
tray-position = none
|
||||||
|
|
||||||
[module/bspwm]
|
[module/bspwm]
|
||||||
type = internal/bspwm
|
type = internal/bspwm
|
||||||
|
pin-workspaces = true
|
||||||
label-focused = %name%
|
label-focused = %name%
|
||||||
label-focused-background = ''${colors.primary}
|
label-focused-background = ''${colors.primary}
|
||||||
label-focused-foreground = ''${colors.background}
|
label-focused-foreground = ''${colors.background}
|
||||||
@@ -73,19 +81,23 @@ in
|
|||||||
label-muted-foreground = ''${colors.dim}
|
label-muted-foreground = ''${colors.dim}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
# One bar per monitor. The primary monitor gets "main" (with tray), others get "secondary".
|
||||||
|
# If no monitor is marked primary, the first one listed gets "main".
|
||||||
xdg.configFile."polybar/launch.sh" = {
|
xdg.configFile."polybar/launch.sh" = {
|
||||||
executable = true;
|
executable = true;
|
||||||
text = ''
|
text = ''
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
${pkgs.procps}/bin/pkill -x polybar
|
${pkgs.procps}/bin/pkill -x polybar
|
||||||
while ${pkgs.procps}/bin/pgrep -x polybar >/dev/null; do sleep 0.2; done
|
while ${pkgs.procps}/bin/pgrep -x polybar >/dev/null; do sleep 0.2; done
|
||||||
${pkgs.util-linux}/bin/setsid -f ${polybar}/bin/polybar main
|
|
||||||
|
LIST=$(${polybar}/bin/polybar --list-monitors)
|
||||||
|
PRIMARY=$(echo "$LIST" | ${pkgs.gnugrep}/bin/grep '(primary)' | ${pkgs.coreutils}/bin/cut -d: -f1)
|
||||||
|
[ -z "$PRIMARY" ] && PRIMARY=$(echo "$LIST" | ${pkgs.coreutils}/bin/head -n1 | ${pkgs.coreutils}/bin/cut -d: -f1)
|
||||||
|
|
||||||
|
for m in $(echo "$LIST" | ${pkgs.coreutils}/bin/cut -d: -f1); do
|
||||||
|
if [ "$m" = "$PRIMARY" ]; then bar=main; else bar=secondary; fi
|
||||||
|
MONITOR=$m ${pkgs.util-linux}/bin/setsid -f ${polybar}/bin/polybar $bar
|
||||||
|
done
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
# home.activation.reloadPolybar = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
|
|
||||||
# if ${pkgs.procps}/bin/pgrep -x bspwm >/dev/null; then
|
|
||||||
# DISPLAY=:0 $HOME/.config/polybar/launch.sh || true
|
|
||||||
# fi
|
|
||||||
# '';
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.my.wallpapers;
|
||||||
|
args = lib.concatStringsSep " " (lib.mapAttrsToList
|
||||||
|
(monitor: img: "--output ${monitor} --zoom ${lib.escapeShellArg img}") cfg);
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.my.wallpapers = lib.mkOption {
|
||||||
|
type = lib.types.attrsOf lib.types.path;
|
||||||
|
default = { };
|
||||||
|
description = "Wallpaper image per monitor output name.";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf (cfg != { }) {
|
||||||
|
home.packages = [ pkgs.xwallpaper ];
|
||||||
|
|
||||||
|
xdg.configFile."wallpaper/set.sh" = {
|
||||||
|
executable = true;
|
||||||
|
text = ''
|
||||||
|
#!/bin/sh
|
||||||
|
${pkgs.xwallpaper}/bin/xwallpaper ${args}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
Reference in new issue
Block a user