Compare commits
4 Commits
139bd596da
...
ecfbf9a557
Author | SHA1 | Date | |
---|---|---|---|
ecfbf9a557 | |||
388a6da603 | |||
5159f69f76 | |||
caf81af676 |
@ -10,7 +10,7 @@ let
|
|||||||
|
|
||||||
local = mkOption {
|
local = mkOption {
|
||||||
type = types.nonEmptyStr;
|
type = types.nonEmptyStr;
|
||||||
default = "$HOME/" + (lib.strings.concatStrings (builtins.match "/*(.+)" config.remote));
|
default = "$HOME/" + (concatStrings (builtins.match "/*(.+)" config.remote));
|
||||||
description = "local path to sync";
|
description = "local path to sync";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -4,7 +4,7 @@ let
|
|||||||
screen = with lib; types.submodule {
|
screen = with lib; types.submodule {
|
||||||
options = {
|
options = {
|
||||||
fps = mkOption {
|
fps = mkOption {
|
||||||
type = types.int;
|
type = types.either types.int (types.nonEmptyListOf types.int);
|
||||||
default = 60;
|
default = 60;
|
||||||
description = "max framerate of screen";
|
description = "max framerate of screen";
|
||||||
};
|
};
|
||||||
|
@ -15,6 +15,12 @@ let
|
|||||||
description = "set of commands to be run at sway startup";
|
description = "set of commands to be run at sway startup";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
execAlways = mkOption {
|
||||||
|
type = types.listOf (types.either types.nonEmptyStr types.package);
|
||||||
|
default = [ ];
|
||||||
|
description = "set of commands to be run at sway reload";
|
||||||
|
};
|
||||||
|
|
||||||
extraConfig = mkOption {
|
extraConfig = mkOption {
|
||||||
type = types.str;
|
type = types.str;
|
||||||
default = "";
|
default = "";
|
||||||
@ -34,6 +40,35 @@ let
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
build_screen_def = fps_func: with lib; let
|
||||||
|
output_def = mapAttrsToList
|
||||||
|
(name: value:
|
||||||
|
"output ${value.id} mode ${value.mode}@${toString (fps_func value.fps)}Hz"
|
||||||
|
+ (optionalString (value.pos != null) " position ${value.pos}")
|
||||||
|
)
|
||||||
|
cfg.screens;
|
||||||
|
in
|
||||||
|
''
|
||||||
|
for pid in $(${pkgs.procps}/bin/pgrep sway -x)
|
||||||
|
do
|
||||||
|
uid=$(id -u $(${pkgs.procps}/bin/ps -o user= -p $pid))
|
||||||
|
export SWAYSOCK="/run/user/$uid/sway-ipc.$uid.$pid.sock"
|
||||||
|
if [[ -e "$SWAYSOCK" ]] ; then
|
||||||
|
echo "sock is $SWAYSOCK"
|
||||||
|
${config.programs.sway.package}/bin/swaymsg '${concatMapStrings (s: s + " ; ") output_def}'
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
'';
|
||||||
|
inherit (lib) getExe;
|
||||||
|
|
||||||
|
fps_min = fps: with lib; if isInt fps then fps else (foldl' min 2147483647 fps);
|
||||||
|
fps_max = fps: with lib; if isInt fps then fps else (foldl' max 0 fps);
|
||||||
|
init_screens_min_fps = with lib; pkgs.writeShellScriptBin "init-screens-min"
|
||||||
|
(build_screen_def fps_min);
|
||||||
|
init_screens_max_fps = with lib; pkgs.writeShellScriptBin "init-screens-max"
|
||||||
|
(build_screen_def fps_max);
|
||||||
|
init_screens_auto = pkgs.writeShellScriptBin "init-screens-auto" "which run-on-ac && which run-on-bat && run-on-ac ${getExe init_screens_max_fps} && run-on-bat ${getExe init_screens_min_fps} || ${getExe init_screens_max_fps}";
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
config =
|
config =
|
||||||
@ -46,7 +81,7 @@ in
|
|||||||
|
|
||||||
bar_config = ''
|
bar_config = ''
|
||||||
bar {
|
bar {
|
||||||
swaybar_command ${lib.getExe waybar_full}
|
swaybar_command ${getExe waybar_full}
|
||||||
}
|
}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
@ -60,15 +95,16 @@ in
|
|||||||
let
|
let
|
||||||
build_definition_lines = mapAttrsToList (name: value: "set \$${name} ${value}");
|
build_definition_lines = mapAttrsToList (name: value: "set \$${name} ${value}");
|
||||||
build_keybind_lines = mapAttrsToList (key: value: "bindsym ${key} ${value}");
|
build_keybind_lines = mapAttrsToList (key: value: "bindsym ${key} ${value}");
|
||||||
build_exec_lines = map (item: "exec " + (if isString item then item else (getExe item)));
|
build_exec_lines = e: map (item: "${e} " + (if isString item then item else (getExe item)));
|
||||||
build_mode_lines = mapAttrsToList (name: value: ''
|
build_mode_lines = mapAttrsToList (name: value: ''
|
||||||
mode "${name}" {
|
mode "${name}" {
|
||||||
${strings.concatLines (map (item: " " + item ) (build_conf value))}}'');
|
${concatLines (map (item: " " + item ) (build_conf value))}}'');
|
||||||
in
|
in
|
||||||
([ ]
|
([ ]
|
||||||
++ (build_definition_lines sway_conf.definitions)
|
++ (build_definition_lines sway_conf.definitions)
|
||||||
++ (build_keybind_lines sway_conf.keybinds)
|
++ (build_keybind_lines sway_conf.keybinds)
|
||||||
++ (build_exec_lines sway_conf.autolaunch)
|
++ (build_exec_lines "exec" sway_conf.autolaunch)
|
||||||
|
++ (build_exec_lines "exec_always" sway_conf.execAlways)
|
||||||
++ (build_mode_lines sway_conf.modes)
|
++ (build_mode_lines sway_conf.modes)
|
||||||
++ optional (sway_conf.extraConfig != "") sway_conf.extraConfig
|
++ optional (sway_conf.extraConfig != "") sway_conf.extraConfig
|
||||||
);
|
);
|
||||||
@ -78,7 +114,7 @@ in
|
|||||||
++ lib.optional cfg.sway.bar.enable bar_config
|
++ lib.optional cfg.sway.bar.enable bar_config
|
||||||
++ (lib.mapAttrsToList
|
++ (lib.mapAttrsToList
|
||||||
(name: value:
|
(name: value:
|
||||||
"output ${value.id} mode ${value.mode}@${toString value.fps}Hz"
|
"output ${value.id} mode ${value.mode}"
|
||||||
+ (lib.optionalString (value.pos != null) " position ${value.pos}")
|
+ (lib.optionalString (value.pos != null) " position ${value.pos}")
|
||||||
)
|
)
|
||||||
cfg.screens)
|
cfg.screens)
|
||||||
@ -89,11 +125,17 @@ in
|
|||||||
with cfg; lib.mkIf (enable && sway.enable) {
|
with cfg; lib.mkIf (enable && sway.enable) {
|
||||||
environment.etc."${conf_path}".text = sway_conf;
|
environment.etc."${conf_path}".text = sway_conf;
|
||||||
|
|
||||||
grimmShared.sway.config.autolaunch = lib.singleton dbus-sway-environment;
|
grimmShared.sway.config.execAlways = [
|
||||||
|
dbus-sway-environment
|
||||||
|
init_screens_auto
|
||||||
|
];
|
||||||
|
|
||||||
environment.systemPackages = [
|
environment.systemPackages = [
|
||||||
waybar_full
|
waybar_full
|
||||||
dbus-sway-environment
|
dbus-sway-environment
|
||||||
|
init_screens_min_fps
|
||||||
|
init_screens_max_fps
|
||||||
|
init_screens_auto
|
||||||
] ++ (with pkgs; [
|
] ++ (with pkgs; [
|
||||||
procps
|
procps
|
||||||
slurp
|
slurp
|
||||||
|
@ -11,6 +11,8 @@ in
|
|||||||
usbutils
|
usbutils
|
||||||
opentabletdriver
|
opentabletdriver
|
||||||
ddcutil
|
ddcutil
|
||||||
|
python312Packages.py-cpuinfo
|
||||||
|
(writeShellScriptBin "lsiommu" ./lsiommu)
|
||||||
] ++ lib.optionals graphical [
|
] ++ lib.optionals graphical [
|
||||||
ddcui
|
ddcui
|
||||||
];
|
];
|
||||||
@ -44,14 +46,15 @@ in
|
|||||||
|
|
||||||
boot = {
|
boot = {
|
||||||
kernelParams = [
|
kernelParams = [
|
||||||
"splash"
|
# "splash"
|
||||||
"quiet"
|
# "quiet"
|
||||||
"intel_iommu=on"
|
# "intel_iommu=on"
|
||||||
"iommu=force"
|
# "iommu=force"
|
||||||
"pcie_acs_override=downstream"
|
# "pcie_acs_override=downstream"
|
||||||
"mmio_stale_data=full,nosmt"
|
# "mmio_stale_data=full,nosmt"
|
||||||
"pcie_aspm=off"
|
# "pcie_aspm=off"
|
||||||
]; # "vfio-pci.ids=10de:1aeb,10de:2191,10de:1aed,10de:1aec" ];
|
]; # "vfio-pci.ids=10de:1aeb,10de:2191,10de:1aed,10de:1aec" ];
|
||||||
|
loader.efi.canTouchEfiVariables = true;
|
||||||
initrd.availableKernelModules = [
|
initrd.availableKernelModules = [
|
||||||
"xhci_pci"
|
"xhci_pci"
|
||||||
"ahci"
|
"ahci"
|
||||||
@ -73,10 +76,10 @@ in
|
|||||||
}))
|
}))
|
||||||
];
|
];
|
||||||
kernelModules = [
|
kernelModules = [
|
||||||
"kvm-intel"
|
# "kvm-intel"
|
||||||
"vfio_pci"
|
# "vfio_pci"
|
||||||
"vfio_iommu_type1"
|
# "vfio_iommu_type1"
|
||||||
"vfio"
|
# "vfio"
|
||||||
"ddcci_backlight"
|
"ddcci_backlight"
|
||||||
"i2c-dev"
|
"i2c-dev"
|
||||||
];
|
];
|
||||||
|
@ -1,23 +1,57 @@
|
|||||||
{ pkgs, config, lib, system, ... }:
|
{ pkgs, config, lib, system, ... }:
|
||||||
let
|
let
|
||||||
cfg = config.grimmShared;
|
cfg = config.grimmShared;
|
||||||
perf_policy = lib.optional (lib.systems.elaborate system).isx86 config.boot.kernelPackages.x86_energy_perf_policy;
|
inherit (lib) optionals optional optionalString concatLines getExe;
|
||||||
|
inherit (config.boot.kernelPackages) x86_energy_perf_policy cpupower;
|
||||||
|
enable_perf_policy = (lib.elem system x86_energy_perf_policy.meta.platforms);
|
||||||
|
|
||||||
|
powersave = with pkgs; writeShellScriptBin "powersave-mode" (concatLines ([
|
||||||
|
"${getExe cpupower} frequency-set -g powersave -u 2000000" # clock speed
|
||||||
|
"${getExe pkgs.brightnessctl} s 20%" # display brightness
|
||||||
|
] ++ optionals enable_perf_policy [
|
||||||
|
"${getExe x86_energy_perf_policy} 15" # power save preference
|
||||||
|
"${getExe x86_energy_perf_policy} --turbo-enable 0" # disable turbo
|
||||||
|
] ++ optional cfg.sway.enable "init-screens-min"));
|
||||||
|
|
||||||
|
performance = pkgs.writeShellScriptBin "performance-mode" (concatLines ([
|
||||||
|
"${getExe cpupower} frequency-set frequency-set -g performance -u 5000000" # clock speed
|
||||||
|
"${getExe pkgs.brightnessctl} s 100%" # display brightness
|
||||||
|
] ++ optionals enable_perf_policy [
|
||||||
|
"${getExe x86_energy_perf_policy} 0" # performance preference
|
||||||
|
"${getExe x86_energy_perf_policy} --turbo-enable 1" # enable turbo
|
||||||
|
] ++ optional cfg.sway.enable "init-screens-max"));
|
||||||
|
auto = let inherit (pkgs) tlp; in pkgs.writeShellScriptBin "auto-mode" ''
|
||||||
|
${tlp}/bin/run-on-ac ${getExe performance}
|
||||||
|
${tlp}/bin/run-on-bat ${getExe powersave}
|
||||||
|
'';
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
config = with cfg; lib.mkIf (enable && laptop_hardware.enable) {
|
config = with cfg; lib.mkIf (enable && laptop_hardware.enable) {
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
acpi
|
acpi
|
||||||
powertop
|
powertop
|
||||||
] ++ lib.optionals graphical [
|
brightnessctl
|
||||||
|
cpupower
|
||||||
|
powersave
|
||||||
|
performance
|
||||||
|
auto
|
||||||
|
] ++ optionals graphical [
|
||||||
tlpui
|
tlpui
|
||||||
] ++ perf_policy;
|
] ++ optional enable_perf_policy x86_energy_perf_policy;
|
||||||
|
|
||||||
|
services.acpid = {
|
||||||
|
enable = true;
|
||||||
|
acEventCommands = getExe auto;
|
||||||
|
};
|
||||||
|
|
||||||
powerManagement.scsiLinkPolicy = lib.mkIf (!config.services.tlp.enable) "min_power";
|
powerManagement.scsiLinkPolicy = lib.mkIf (!config.services.tlp.enable) "min_power";
|
||||||
powerManagement.cpuFreqGovernor = lib.mkDefault "normal";
|
powerManagement.cpuFreqGovernor = lib.mkDefault "normal";
|
||||||
|
|
||||||
services.power-profiles-daemon.enable = false;
|
services.power-profiles-daemon.enable = false;
|
||||||
services.upower.enable = true;
|
services.upower.enable = true;
|
||||||
boot.extraModulePackages = perf_policy;
|
#boot.extraModulePackages = [
|
||||||
|
# cpupower
|
||||||
|
#] ++ optional enable_perf_policy x86_energy_perf_policy;
|
||||||
|
|
||||||
services.tlp = {
|
services.tlp = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
@ -13,7 +13,6 @@ in
|
|||||||
config = with cfg; lib.mkIf (enable && tooling.enable) {
|
config = with cfg; lib.mkIf (enable && tooling.enable) {
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
(writeShellScriptBin "systemd-owner" "systemctl show -pUser,UID $@")
|
(writeShellScriptBin "systemd-owner" "systemctl show -pUser,UID $@")
|
||||||
(writeShellScriptBin "lsiommu" ./lsiommu)
|
|
||||||
(writeShellScriptBin "tree" "${lib.getExe pkgs.eza} -T --git -lh --no-permissions --no-user --no-filesize --no-time")
|
(writeShellScriptBin "tree" "${lib.getExe pkgs.eza} -T --git -lh --no-permissions --no-user --no-filesize --no-time")
|
||||||
urlencode
|
urlencode
|
||||||
pstree
|
pstree
|
||||||
@ -30,7 +29,7 @@ in
|
|||||||
|
|
||||||
fbcat
|
fbcat
|
||||||
gomuks
|
gomuks
|
||||||
gotop
|
btop
|
||||||
ranger
|
ranger
|
||||||
wget
|
wget
|
||||||
file
|
file
|
||||||
|
@ -36,7 +36,7 @@ in
|
|||||||
{
|
{
|
||||||
config = with cfg; lib.mkIf (enable && portals && graphical) {
|
config = with cfg; lib.mkIf (enable && portals && graphical) {
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
(callPackage ../../custom/deskwhich/package.nix {})
|
(callPackage ../../custom/deskwhich/package.nix { })
|
||||||
|
|
||||||
zathura
|
zathura
|
||||||
imhex
|
imhex
|
||||||
@ -99,7 +99,7 @@ in
|
|||||||
"ranger.desktop"
|
"ranger.desktop"
|
||||||
"dolphin.desktop"
|
"dolphin.desktop"
|
||||||
];
|
];
|
||||||
"x-scheme-handler/mailto"="thunderbird.desktop";
|
"x-scheme-handler/mailto" = "thunderbird.desktop";
|
||||||
|
|
||||||
"application/vnd.oasis.opendocument.chart" = "calc.desktop";
|
"application/vnd.oasis.opendocument.chart" = "calc.desktop";
|
||||||
"application/vnd.oasis.opendocument.chart-template" = "calc.desktop";
|
"application/vnd.oasis.opendocument.chart-template" = "calc.desktop";
|
||||||
|
@ -17,12 +17,12 @@ in
|
|||||||
];
|
];
|
||||||
|
|
||||||
wlr.enable = true;
|
wlr.enable = true;
|
||||||
wlr.settings = lib.mapAttrs'
|
wlr.settings = with lib; mapAttrs'
|
||||||
(name: value: lib.nameValuePair ("screencast_" + name) {
|
(name: value: nameValuePair ("screencast_" + name) {
|
||||||
output_name = value.id;
|
output_name = value.id;
|
||||||
max_fps = value.fps;
|
max_fps = if isInt value.fps then value.fps else (foldl' min 2147483647 value.fps);
|
||||||
chooser_type = "simple";
|
chooser_type = "simple";
|
||||||
chooser_cmd = "${lib.getExe pkgs.slurp} -f %o -or";
|
chooser_cmd = "${getExe pkgs.slurp} -f %o -or";
|
||||||
})
|
})
|
||||||
cfg.screens;
|
cfg.screens;
|
||||||
};
|
};
|
||||||
|
42
flake.lock
42
flake.lock
@ -78,11 +78,11 @@
|
|||||||
"yafas": "yafas"
|
"yafas": "yafas"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1714482312,
|
"lastModified": 1714566321,
|
||||||
"narHash": "sha256-qs41DgEGR2d6Hh+FnfL/6NagoCtRXDXC7yaGD398EXE=",
|
"narHash": "sha256-cTWwPbwYtE8r6MuR+0ybG4CFeE8Sid5XHbFJq4itO+A=",
|
||||||
"owner": "chaotic-cx",
|
"owner": "chaotic-cx",
|
||||||
"repo": "nyx",
|
"repo": "nyx",
|
||||||
"rev": "8cfa2aa1528faa6319e2e5ab664ff463ba57708c",
|
"rev": "5939d3fb76b25a48a8c0db716ebb6fe28eab3719",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -186,7 +186,7 @@
|
|||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"type": "tarball",
|
"type": "tarball",
|
||||||
"url": "https://flakehub.com/f/ipetkov/crane/%2A.tar.gz"
|
"url": "https://flakehub.com/f/ipetkov/crane/%3D0.16.1.tar.gz"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"darwin": {
|
"darwin": {
|
||||||
@ -220,12 +220,12 @@
|
|||||||
"rust-analyzer-src": "rust-analyzer-src"
|
"rust-analyzer-src": "rust-analyzer-src"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1711952616,
|
"lastModified": 1714544767,
|
||||||
"narHash": "sha256-WJvDdOph001fA1Ap3AyaQtz/afJAe7meSG5uJAdSE+A=",
|
"narHash": "sha256-kF1bX+YFMedf1g0PAJYwGUkzh22JmULtj8Rm4IXAQKs=",
|
||||||
"rev": "209048d7c545905c470f6f8c05c5061f391031a8",
|
"rev": "73124e1356bde9411b163d636b39fe4804b7ca45",
|
||||||
"revCount": 1822,
|
"revCount": 1852,
|
||||||
"type": "tarball",
|
"type": "tarball",
|
||||||
"url": "https://api.flakehub.com/f/pinned/nix-community/fenix/0.1.1822%2Brev-209048d7c545905c470f6f8c05c5061f391031a8/018e98ba-d842-7dad-9d6a-0d0ee173b6b1/source.tar.gz"
|
"url": "https://api.flakehub.com/f/pinned/nix-community/fenix/0.1.1852%2Brev-73124e1356bde9411b163d636b39fe4804b7ca45/018f333a-c195-795f-9e07-b43b47d5391f/source.tar.gz"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"type": "tarball",
|
"type": "tarball",
|
||||||
@ -382,11 +382,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1714430505,
|
"lastModified": 1714515075,
|
||||||
"narHash": "sha256-SSJQ/KOy8uISnoZgqDoRha7g7PFLSFP/BtMWm0wUz8Q=",
|
"narHash": "sha256-azMK7aWH0eUc3IqU4Fg5rwZdB9WZBvimOGG3piqvtsY=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "home-manager",
|
"repo": "home-manager",
|
||||||
"rev": "f8e6694edabe4aaa7a85aac47b43ea5d978b116d",
|
"rev": "6d3b6dc9222c12b951169becdf4b0592ee9576ef",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -430,11 +430,11 @@
|
|||||||
"rust-overlay": "rust-overlay"
|
"rust-overlay": "rust-overlay"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1714411325,
|
"lastModified": 1714532637,
|
||||||
"narHash": "sha256-td58oD5JOlL8LPglrk+c7rP+nJSJmK7zu0kFGF16XPI=",
|
"narHash": "sha256-2oWMEjkJKYzxLXy3OZ/M41VdbZgZLWmwttry551lUE4=",
|
||||||
"owner": "martinvonz",
|
"owner": "martinvonz",
|
||||||
"repo": "jj",
|
"repo": "jj",
|
||||||
"rev": "e54e83b0f5c4a5b7d80894c713ae402a5bb280d0",
|
"rev": "7093d5d359fb3649be0d12a975f26d5607ad8f61",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -467,11 +467,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1714468768,
|
"lastModified": 1714551038,
|
||||||
"narHash": "sha256-lxbNfjtTOcY18E9ODj3ZwJiF8UWr58CH+/9V3eHdtoQ=",
|
"narHash": "sha256-/b4HT/RYfNkKUUpIzIwsHThLLAuKA70O8W/32sh2N0M=",
|
||||||
"owner": "YaLTeR",
|
"owner": "YaLTeR",
|
||||||
"repo": "niri",
|
"repo": "niri",
|
||||||
"rev": "68ff36f6834beecf74b30a724ae3ef31874a3518",
|
"rev": "af9caa1d9b176fe3606323a8c05c0c741c1f6c0a",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -657,11 +657,11 @@
|
|||||||
"rust-analyzer-src": {
|
"rust-analyzer-src": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1711885694,
|
"lastModified": 1714501997,
|
||||||
"narHash": "sha256-dyezzeSbWMpflma+E9USmvSxuLgGcNGcGw3cOnX36ko=",
|
"narHash": "sha256-g31zfxwUFzkPgX0Q8sZLcrqGmOxwjEZ/iqJjNx4fEGo=",
|
||||||
"owner": "rust-lang",
|
"owner": "rust-lang",
|
||||||
"repo": "rust-analyzer",
|
"repo": "rust-analyzer",
|
||||||
"rev": "e4a405f877efd820bef9c0e77a02494e47c17512",
|
"rev": "49e502b277a8126a9ad10c802d1aaa3ef1a280ef",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -42,6 +42,10 @@
|
|||||||
url = "https://patch-diff.githubusercontent.com/raw/NixOS/nixpkgs/pull/307541.patch";
|
url = "https://patch-diff.githubusercontent.com/raw/NixOS/nixpkgs/pull/307541.patch";
|
||||||
hash = "sha256-cyxiWCxBOKrET710C8o9Cwksy64HRez6mB1qF+anHMI=";
|
hash = "sha256-cyxiWCxBOKrET710C8o9Cwksy64HRez6mB1qF+anHMI=";
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
url = "https://patch-diff.githubusercontent.com/raw/NixOS/nixpkgs/pull/308476.patch";
|
||||||
|
hash = "sha256-J/Bvz4RUn9lP7H4s/c6bZEX9dfWsxfG/dpXYF99U3Vs=";
|
||||||
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
customNixosSystem = system: definitions:
|
customNixosSystem = system: definitions:
|
||||||
|
@ -8,10 +8,6 @@
|
|||||||
|
|
||||||
networking.hostName = "grimmauld-nixos";
|
networking.hostName = "grimmauld-nixos";
|
||||||
|
|
||||||
environment.sessionVariables = {
|
|
||||||
OMP_NUM_THREADS = "12";
|
|
||||||
};
|
|
||||||
|
|
||||||
system.stateVersion = "23.05";
|
system.stateVersion = "23.05";
|
||||||
|
|
||||||
grimmShared.gaming = true;
|
grimmShared.gaming = true;
|
||||||
|
@ -2,7 +2,9 @@
|
|||||||
# and may be overwritten by future invocations. Please make changes
|
# and may be overwritten by future invocations. Please make changes
|
||||||
# to /etc/nixos/configuration.nix instead.
|
# to /etc/nixos/configuration.nix instead.
|
||||||
{ config, lib, pkgs, modulesPath, ... }:
|
{ config, lib, pkgs, modulesPath, ... }:
|
||||||
|
let
|
||||||
|
cpus = "12";
|
||||||
|
in
|
||||||
{
|
{
|
||||||
imports =
|
imports =
|
||||||
[
|
[
|
||||||
@ -12,6 +14,7 @@
|
|||||||
|
|
||||||
boot.initrd.kernelModules = [ ];
|
boot.initrd.kernelModules = [ ];
|
||||||
boot.extraModulePackages = [ ];
|
boot.extraModulePackages = [ ];
|
||||||
|
boot.kernelParams = [ "possible_cpus=${cpus}" ];
|
||||||
|
|
||||||
fileSystems."/" =
|
fileSystems."/" =
|
||||||
{
|
{
|
||||||
@ -32,16 +35,20 @@
|
|||||||
size = 48 * 1024;
|
size = 48 * 1024;
|
||||||
}];
|
}];
|
||||||
|
|
||||||
|
environment.sessionVariables = {
|
||||||
|
OMP_NUM_THREADS = cpus;
|
||||||
|
};
|
||||||
|
|
||||||
grimmShared = {
|
grimmShared = {
|
||||||
screens = {
|
screens = {
|
||||||
external = {
|
external = {
|
||||||
id = "HDMI-A-1";
|
id = "HDMI-A-1";
|
||||||
pos = "0,0";
|
pos = "0 0";
|
||||||
};
|
};
|
||||||
|
|
||||||
internal = {
|
internal = {
|
||||||
id = "eDP-1";
|
id = "eDP-1";
|
||||||
fps = 144;
|
fps = [ 144 60 ];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
laptop_hardware.enable = true;
|
laptop_hardware.enable = true;
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
{ inputs, system, pkgs, config, lib, ... }:
|
{ inputs, system, pkgs, config, lib, ... }:
|
||||||
let
|
let
|
||||||
searchclip = pkgs.writeShellScriptBin "searchclip" ''
|
searchclip = pkgs.writeShellScriptBin "searchclip" ''
|
||||||
xdg-open https://www.google.com/search?q=$(wl-paste -p | urlencode)
|
xdg-open https://www.google.com/search?q=$(wl-paste -p | urlencode)
|
||||||
browser=$(xdg-settings get default-web-browser | sed "s/\.desktop//")
|
browser=$(xdg-settings get default-web-browser | sed "s/\.desktop//")
|
||||||
swaymsg [app_id="$browser" urgent="newest"] focus
|
swaymsg [app_id="$browser" urgent="newest"] focus
|
||||||
'';
|
'';
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
alacritty
|
alacritty
|
||||||
rmenu
|
rmenu
|
||||||
@ -18,6 +18,7 @@ in
|
|||||||
qt6ct
|
qt6ct
|
||||||
swaynotificationcenter
|
swaynotificationcenter
|
||||||
searchclip
|
searchclip
|
||||||
|
ydotool
|
||||||
];
|
];
|
||||||
|
|
||||||
grimmShared.sway = {
|
grimmShared.sway = {
|
||||||
@ -31,7 +32,8 @@ in
|
|||||||
|
|
||||||
config = with pkgs; let
|
config = with pkgs; let
|
||||||
inherit (lib) getExe;
|
inherit (lib) getExe;
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
definitions = {
|
definitions = {
|
||||||
mod = "Mod4";
|
mod = "Mod4";
|
||||||
left = "h";
|
left = "h";
|
||||||
@ -152,23 +154,34 @@ in
|
|||||||
XF86MonBrightnessDown = "exec ${getExe brightnessctl} s 10-%";
|
XF86MonBrightnessDown = "exec ${getExe brightnessctl} s 10-%";
|
||||||
XF86Explorer = "exec $term --command ${getExe ranger}";
|
XF86Explorer = "exec $term --command ${getExe ranger}";
|
||||||
XF86Search = "exec ${getExe searchclip}";
|
XF86Search = "exec ${getExe searchclip}";
|
||||||
XF86HomePage = let open = pkgs.writeShellScriptBin "open_or_switch_browser" ''
|
XF86HomePage =
|
||||||
browser=$(xdg-settings get default-web-browser | sed "s/\.desktop//")
|
let
|
||||||
swaymsg [app_id="$browser"] focus || deskwhich $browser | xargs gio launch
|
open = pkgs.writeShellScriptBin "open_or_switch_browser" ''
|
||||||
''; in "exec ${getExe open}";
|
browser=$(xdg-settings get default-web-browser | sed "s/\.desktop//")
|
||||||
XF86Tools = let open = pkgs.writeShellScriptBin "open_or_switch_spotify" ''
|
swaymsg [app_id="$browser"] focus || deskwhich $browser | xargs gio launch
|
||||||
# FIXME: spotify is being weird
|
'';
|
||||||
while IFS= read -r pid; do
|
in
|
||||||
swaymsg [pid=$pid] focus && exit 0
|
"exec ${getExe open}";
|
||||||
done <<< $(pgrep spotify -u "$(whoami)")
|
XF86Tools =
|
||||||
deskwhich spotify | xargs gio launch
|
let
|
||||||
''; in "exec ${getExe open}"; # for some reason tools = audio media on my keyboard??
|
open = pkgs.writeShellScriptBin "open_or_switch_spotify" ''
|
||||||
XF86Mail = let open = pkgs.writeShellScriptBin "open_or_switch_mail" ''
|
# FIXME: spotify is being weird
|
||||||
desk=$(xdg-settings get default-url-scheme-handler mailto | sed "s/\.desktop//")
|
while IFS= read -r pid; do
|
||||||
swaymsg [app_id="$desk"] focus || deskwhich $desk | xargs gio launch
|
swaymsg [pid=$pid] focus && exit 0
|
||||||
'';
|
done <<< $(pgrep spotify -u "$(whoami)")
|
||||||
in "exec ${getExe open}";
|
deskwhich spotify | xargs gio launch
|
||||||
|
'';
|
||||||
|
in
|
||||||
|
"exec ${getExe open}"; # for some reason tools = audio media on my keyboard??
|
||||||
|
XF86Mail =
|
||||||
|
let
|
||||||
|
open = pkgs.writeShellScriptBin "open_or_switch_mail" ''
|
||||||
|
desk=$(xdg-settings get default-url-scheme-handler mailto | sed "s/\.desktop//")
|
||||||
|
swaymsg [app_id="$desk"] focus || deskwhich $desk | xargs gio launch
|
||||||
|
'';
|
||||||
|
in
|
||||||
|
"exec ${getExe open}";
|
||||||
|
# XF86Bluetooth = "exec blueman-manager";
|
||||||
};
|
};
|
||||||
autolaunch = with pkgs; [
|
autolaunch = with pkgs; [
|
||||||
# fixme: absolute paths
|
# fixme: absolute paths
|
||||||
|
Loading…
Reference in New Issue
Block a user