Merge remote-tracking branch 'refs/remotes/origin/nixos' into nixos
commit
5c666feefb
|
@ -20,8 +20,10 @@
|
||||||
webis.enable = true;
|
webis.enable = true;
|
||||||
impermanence.enable = true;
|
impermanence.enable = true;
|
||||||
};
|
};
|
||||||
programs.hyprland.enable = true;
|
programs.hyprland = {
|
||||||
programs.gitbutler.enable = true;
|
enable = true;
|
||||||
|
monitors.DP-3.scale = "auto";
|
||||||
|
};
|
||||||
programs.exercism.enable = true;
|
programs.exercism.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@ in
|
||||||
enable = true;
|
enable = true;
|
||||||
shellAbbrs = shellConfig.abbreviations;
|
shellAbbrs = shellConfig.abbreviations;
|
||||||
shellAliases = shellConfig.aliases;
|
shellAliases = shellConfig.aliases;
|
||||||
shellInit = ''
|
shellInit = /* fish */ ''
|
||||||
# Vi Mode
|
# Vi Mode
|
||||||
fish_vi_key_bindings
|
fish_vi_key_bindings
|
||||||
|
|
||||||
|
@ -62,7 +62,7 @@ in
|
||||||
end
|
end
|
||||||
abbr --add dotdot --regex '^\.\.+$' --function multicd
|
abbr --add dotdot --regex '^\.\.+$' --function multicd
|
||||||
|
|
||||||
abbr -a P --position anywhere --set-cursor "% | $PAGER"
|
abbr -a .P --position anywhere --set-cursor "% | $PAGER"
|
||||||
|
|
||||||
function editor_edit
|
function editor_edit
|
||||||
echo $EDITOR $argv
|
echo $EDITOR $argv
|
||||||
|
|
|
@ -29,18 +29,24 @@ in
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
my.shell.abbreviations = {
|
my.shell.abbreviations = {
|
||||||
|
g = "git";
|
||||||
|
gC = "git clone";
|
||||||
|
gF = "git pull";
|
||||||
|
gS = "git switch";
|
||||||
ga = "git add";
|
ga = "git add";
|
||||||
gap = "git add --patch";
|
gap = "git add --patch";
|
||||||
gr = "git restore";
|
|
||||||
grp = "git restore --patch";
|
|
||||||
gb = "git branch";
|
gb = "git branch";
|
||||||
gc = "git commit";
|
gc = "git commit";
|
||||||
gco = "git checkout";
|
gco = "git checkout";
|
||||||
gd = "git diff";
|
gd = "git diff";
|
||||||
gds = "git diff --staged";
|
gds = "git diff --staged";
|
||||||
gp = "git push";
|
|
||||||
gf = "git fetch";
|
gf = "git fetch";
|
||||||
gF = "git pull";
|
gp = "git push";
|
||||||
|
gr = "git restore";
|
||||||
|
grm = "git rm --cached";
|
||||||
|
grp = "git restore --patch";
|
||||||
|
grps = "git restore --patch --staged";
|
||||||
|
grs = "git restore --staged";
|
||||||
gs = "git status";
|
gs = "git status";
|
||||||
};
|
};
|
||||||
home-manager.users.moritz = {
|
home-manager.users.moritz = {
|
||||||
|
|
|
@ -3,10 +3,18 @@
|
||||||
, ...
|
, ...
|
||||||
}:
|
}:
|
||||||
|
|
||||||
with lib;
|
|
||||||
let
|
let
|
||||||
|
inherit (lib) concatStringsSep flip boolToString mapAttrsToList;
|
||||||
cfg = config.my.programs.hyprland;
|
cfg = config.my.programs.hyprland;
|
||||||
|
|
||||||
|
mkMonitor = { name, resolution, position, scale, disabled, extra }:
|
||||||
|
if disabled
|
||||||
|
then "monitor=${name},disabled"
|
||||||
|
else "monitor=${name},${resolution},${position},${scale},${extra}";
|
||||||
|
|
||||||
|
monitorsList = mapAttrsToList (name: value: { name = name; } // value) cfg.monitors;
|
||||||
|
monitors = map mkMonitor monitorsList;
|
||||||
|
|
||||||
mkRule = rule: windowRegexes: "windowrulev2 = ${rule},${concatStringsSep "," windowRegexes}";
|
mkRule = rule: windowRegexes: "windowrulev2 = ${rule},${concatStringsSep "," windowRegexes}";
|
||||||
mkRules = rules: windowRegexes: concatStringsSep "\n" (map (flip mkRule windowRegexes) rules);
|
mkRules = rules: windowRegexes: concatStringsSep "\n" (map (flip mkRule windowRegexes) rules);
|
||||||
in
|
in
|
||||||
|
@ -17,7 +25,7 @@ in
|
||||||
#
|
#
|
||||||
|
|
||||||
# See https://wiki.hyprland.org/Configuring/Monitors/
|
# See https://wiki.hyprland.org/Configuring/Monitors/
|
||||||
${concatLines (map (x: "monitor=${x}") cfg.monitors)}
|
${concatStringsSep "\n" monitors}
|
||||||
|
|
||||||
# See https://wiki.hyprland.org/Configuring/Keywords/ for more
|
# See https://wiki.hyprland.org/Configuring/Keywords/ for more
|
||||||
|
|
||||||
|
@ -226,7 +234,7 @@ in
|
||||||
|
|
||||||
# Lid open/close
|
# Lid open/close
|
||||||
bindl=,switch:on:Lid Switch,exec,monitors="$(hyprctl monitors | grep -c '^Monitor')" && hyprctl keyword monitor "eDP-1, disable" && [ "$monitors" = 1 ] && loginctl lock-session
|
bindl=,switch:on:Lid Switch,exec,monitors="$(hyprctl monitors | grep -c '^Monitor')" && hyprctl keyword monitor "eDP-1, disable" && [ "$monitors" = 1 ] && loginctl lock-session
|
||||||
bindl=,switch:off:Lid Switch,exec, hyprctl keyword monitor "eDP-1, prefered, auto"
|
bindl=,switch:off:Lid Switch,exec, hyprctl keyword monitor "eDP-1, preferred, auto"
|
||||||
|
|
||||||
# Extra Config
|
# Extra Config
|
||||||
${cfg.extraConfig}
|
${cfg.extraConfig}
|
||||||
|
|
|
@ -5,8 +5,8 @@
|
||||||
, ...
|
, ...
|
||||||
} @ args:
|
} @ args:
|
||||||
|
|
||||||
with lib;
|
|
||||||
let
|
let
|
||||||
|
inherit (lib) mkOption mkEnableOption mkIf types getExe genAttrs optionalAttrs optional;
|
||||||
cfg = config.my.programs.hyprland;
|
cfg = config.my.programs.hyprland;
|
||||||
|
|
||||||
hyprland = inputs.hyprland.packages.${pkgs.system}.default;
|
hyprland = inputs.hyprland.packages.${pkgs.system}.default;
|
||||||
|
@ -31,9 +31,38 @@ in
|
||||||
default = [ "de" "us" ];
|
default = [ "de" "us" ];
|
||||||
};
|
};
|
||||||
monitors = mkOption {
|
monitors = mkOption {
|
||||||
type = types.listOf types.str;
|
type = types.attrsOf (
|
||||||
description = "monitor settings";
|
let
|
||||||
default = [ ",preferred,auto,1" ];
|
sub = types.submodule {
|
||||||
|
options = {
|
||||||
|
resolution = mkOption {
|
||||||
|
type = types.strMatching "\(preferred\)|\([[:digit:]]+x[[:digit:]]+\(@[[:digit:]]+\)\?\)";
|
||||||
|
default = "preferred";
|
||||||
|
};
|
||||||
|
position = mkOption {
|
||||||
|
type = types.strMatching "\(auto\)|\(-\?[[:digit:]]+x-?[[:digit:]]+\)";
|
||||||
|
default = "auto";
|
||||||
|
};
|
||||||
|
disabled = mkEnableOption "disabled";
|
||||||
|
scale = mkOption {
|
||||||
|
type = types.oneOf [ types.float (types.strMatching "auto") ];
|
||||||
|
default = 1.0;
|
||||||
|
apply = x: if lib.isFloat x then lib.strings.floatToString x else x;
|
||||||
|
};
|
||||||
|
extra = mkOption {
|
||||||
|
type = types.listOf types.str;
|
||||||
|
default = [ ];
|
||||||
|
apply = lib.concatStringsSep ",";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
in
|
||||||
|
sub
|
||||||
|
);
|
||||||
|
description = "monitor setting";
|
||||||
|
default = {
|
||||||
|
"" = { };
|
||||||
|
};
|
||||||
};
|
};
|
||||||
extraConfig = mkOption {
|
extraConfig = mkOption {
|
||||||
type = types.str;
|
type = types.str;
|
||||||
|
@ -51,6 +80,7 @@ in
|
||||||
# foot.enable = true;
|
# foot.enable = true;
|
||||||
kitty.enable = true;
|
kitty.enable = true;
|
||||||
rofi.enable = true;
|
rofi.enable = true;
|
||||||
|
hyprland.monitors."" = lib.mkDefault { };
|
||||||
};
|
};
|
||||||
wallpapers.enable = true;
|
wallpapers.enable = true;
|
||||||
services = {
|
services = {
|
||||||
|
|
|
@ -73,6 +73,7 @@ in
|
||||||
stable.flake = inputs.stable;
|
stable.flake = inputs.stable;
|
||||||
dotfiles.flake = self;
|
dotfiles.flake = self;
|
||||||
default.flake = self;
|
default.flake = self;
|
||||||
|
d.flake = self;
|
||||||
};
|
};
|
||||||
|
|
||||||
settings = {
|
settings = {
|
||||||
|
|
|
@ -127,7 +127,6 @@ local servers = {
|
||||||
"bashls",
|
"bashls",
|
||||||
"gleam",
|
"gleam",
|
||||||
"gopls",
|
"gopls",
|
||||||
"nil_ls",
|
|
||||||
"pylsp",
|
"pylsp",
|
||||||
"ruff",
|
"ruff",
|
||||||
"templ",
|
"templ",
|
||||||
|
@ -141,6 +140,16 @@ lspconfig_setup("elixirls", {
|
||||||
cmd = { "elixir-ls" },
|
cmd = { "elixir-ls" },
|
||||||
})
|
})
|
||||||
|
|
||||||
|
lspconfig_setup("nil_ls", {
|
||||||
|
settings = {
|
||||||
|
flake = {
|
||||||
|
autoArchive = true,
|
||||||
|
autoEvalInputs = true,
|
||||||
|
nixpkgsInputName = "nixpkgs",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
lspconfig_setup("nixd", {
|
lspconfig_setup("nixd", {
|
||||||
settings = {
|
settings = {
|
||||||
nixd = {
|
nixd = {
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
{ config
|
{ config
|
||||||
, lib
|
, lib
|
||||||
|
, pkgs
|
||||||
, ...
|
, ...
|
||||||
}: {
|
}: {
|
||||||
## System security tweaks
|
## System security tweaks
|
||||||
|
@ -69,6 +70,7 @@
|
||||||
|
|
||||||
# SSH
|
# SSH
|
||||||
services.openssh = {
|
services.openssh = {
|
||||||
|
package = pkgs.master.openssh; # HACK: to fix CVE-2024-6387
|
||||||
settings = {
|
settings = {
|
||||||
# Disable ssh password login
|
# Disable ssh password login
|
||||||
PasswordAuthentication = lib.mkDefault false;
|
PasswordAuthentication = lib.mkDefault false;
|
||||||
|
|
Loading…
Reference in New Issue