Compare commits
No commits in common. "534097ff538beb4a4c31717768b96494ba84078f" and "4386de1eba8f6e94effeff99db91130392aaeb48" have entirely different histories.
534097ff53
...
4386de1eba
11 changed files with 56 additions and 101 deletions
|
@ -33,7 +33,7 @@ in {
|
||||||
|
|
||||||
gap = mkOption {default = 15;};
|
gap = mkOption {default = 15;};
|
||||||
padding = mkOption {default = 51;}; # ?? journalctl --user -u waybar.service | grep height:
|
padding = mkOption {default = 51;}; # ?? journalctl --user -u waybar.service | grep height:
|
||||||
rounding = mkOption {default = 15;};
|
rounding = mkOption {default = 10;};
|
||||||
|
|
||||||
### Misc
|
### Misc
|
||||||
wallpaper = mkOption {default = false;};
|
wallpaper = mkOption {default = false;};
|
||||||
|
|
|
@ -10,7 +10,6 @@ with lib; let
|
||||||
in {
|
in {
|
||||||
options.custom.desktops.niri = {
|
options.custom.desktops.niri = {
|
||||||
enable = mkOption {default = false;};
|
enable = mkOption {default = false;};
|
||||||
polkit = mkOption {default = false;};
|
|
||||||
xwayland = mkOption {default = true;};
|
xwayland = mkOption {default = true;};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -35,7 +34,7 @@ in {
|
||||||
|
|
||||||
#!! Disabled bundled KDE polkit agent
|
#!! Disabled bundled KDE polkit agent
|
||||||
# https://github.com/sodiboo/niri-flake?tab=readme-ov-file#additional-notes
|
# https://github.com/sodiboo/niri-flake?tab=readme-ov-file#additional-notes
|
||||||
systemd.user.services.niri-flake-polkit.enable = cfg.polkit;
|
systemd.user.services.niri-flake-polkit.enable = false;
|
||||||
|
|
||||||
# Enable rootless Xwayland
|
# Enable rootless Xwayland
|
||||||
custom.services.xwayland-satellite.enable = cfg.xwayland;
|
custom.services.xwayland-satellite.enable = cfg.xwayland;
|
||||||
|
|
|
@ -27,6 +27,7 @@ in {
|
||||||
preset-column-widths = [
|
preset-column-widths = [
|
||||||
{proportion = 0.5;}
|
{proportion = 0.5;}
|
||||||
{proportion = 0.3;}
|
{proportion = 0.3;}
|
||||||
|
{proportion = 1.0;}
|
||||||
{proportion = 0.7;} # Default
|
{proportion = 0.7;} # Default
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -43,7 +44,7 @@ in {
|
||||||
enable = true;
|
enable = true;
|
||||||
width = config.custom.border;
|
width = config.custom.border;
|
||||||
active.color = "#d33682";
|
active.color = "#d33682";
|
||||||
inactive.color = "#00000000";
|
inactive.color = "#586e75";
|
||||||
};
|
};
|
||||||
|
|
||||||
focus-ring.enable = false;
|
focus-ring.enable = false;
|
||||||
|
|
|
@ -28,7 +28,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
hotkey-overlay.skip-at-startup = true;
|
hotkey-overlay.skip-at-startup = true;
|
||||||
prefer-no-csd = true;
|
prefer-no-csd = true; # Electron windows have odd borders otherwise
|
||||||
|
|
||||||
# https://github.com/YaLTeR/niri/wiki/Configuration:-Switch-Events
|
# https://github.com/YaLTeR/niri/wiki/Configuration:-Switch-Events
|
||||||
switch-events = {
|
switch-events = {
|
||||||
|
|
|
@ -17,9 +17,7 @@ with lib; {
|
||||||
nh.enable = true;
|
nh.enable = true;
|
||||||
nix-index.enable = true;
|
nix-index.enable = true;
|
||||||
nushell.enable = true;
|
nushell.enable = true;
|
||||||
polkit.enable = true;
|
|
||||||
ssh.enable = true;
|
ssh.enable = true;
|
||||||
sudo.enable = true;
|
|
||||||
tmux.enable = true;
|
tmux.enable = true;
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -1,52 +0,0 @@
|
||||||
{
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
with lib; let
|
|
||||||
polkit-gnome-authentication-agent-1 = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1";
|
|
||||||
|
|
||||||
cfg = config.custom.programs.polkit;
|
|
||||||
in {
|
|
||||||
options.custom.programs.polkit = {
|
|
||||||
enable = mkOption {default = false;};
|
|
||||||
agent = mkOption {default = true;};
|
|
||||||
bypass = mkOption {default = false;};
|
|
||||||
};
|
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
|
||||||
# https://wiki.nixos.org/wiki/Polkit
|
|
||||||
#?? pkexec echo
|
|
||||||
security.polkit = {
|
|
||||||
enable = true;
|
|
||||||
|
|
||||||
# https://wiki.archlinux.org/title/Polkit#Bypass_password_prompt
|
|
||||||
extraConfig = mkIf cfg.bypass ''
|
|
||||||
polkit.addRule(function(action, subject) {
|
|
||||||
if (subject.isInGroup("wheel")) { return polkit.Result.YES; }
|
|
||||||
});
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
# https://wiki.nixos.org/wiki/Polkit#Authentication_agents
|
|
||||||
systemd.user.services.polkit-gnome-authentication-agent-1 = mkIf cfg.agent {
|
|
||||||
enable = true;
|
|
||||||
wantedBy = ["graphical-session.target"];
|
|
||||||
|
|
||||||
unitConfig = {
|
|
||||||
Description = "polkit-gnome-authentication-agent-1";
|
|
||||||
After = ["graphical-session.target"];
|
|
||||||
Wants = ["graphical-session.target"];
|
|
||||||
};
|
|
||||||
|
|
||||||
serviceConfig = {
|
|
||||||
Type = "simple";
|
|
||||||
ExecStart = polkit-gnome-authentication-agent-1;
|
|
||||||
Restart = "on-failure";
|
|
||||||
RestartSec = 1;
|
|
||||||
TimeoutStopSec = 10;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,40 +0,0 @@
|
||||||
{
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
with lib; let
|
|
||||||
cfg = config.custom.programs.sudo;
|
|
||||||
in {
|
|
||||||
options.custom.programs.sudo = {
|
|
||||||
enable = mkOption {default = false;};
|
|
||||||
bypass = mkOption {default = true;};
|
|
||||||
confirm = mkOption {default = true;};
|
|
||||||
};
|
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
|
||||||
# https://wiki.nixos.org/wiki/Sudo
|
|
||||||
#?? sudo echo
|
|
||||||
security.sudo = {
|
|
||||||
enable = true;
|
|
||||||
wheelNeedsPassword = !cfg.bypass;
|
|
||||||
};
|
|
||||||
|
|
||||||
environment.shellAliases = mkIf cfg.confirm {
|
|
||||||
# Interactive confirmation prompt
|
|
||||||
sudo = pkgs.writeShellScript "sudo" ''
|
|
||||||
read -p "Execute as root? [Y/n] "
|
|
||||||
|
|
||||||
case "$REPLY" in
|
|
||||||
"" | [Yy])
|
|
||||||
command sudo "$@"
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -42,7 +42,7 @@ tooltip label {
|
||||||
|
|
||||||
.horizontal > box {
|
.horizontal > box {
|
||||||
background: #002b36;
|
background: #002b36;
|
||||||
/* border: 2px #586e75 solid; */
|
border: 2px #586e75 solid;
|
||||||
padding: 4px;
|
padding: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,7 @@ https://github.com/ErikReider/SwayNotificationCenter/blob/main/data/style/style.
|
||||||
}
|
}
|
||||||
|
|
||||||
.control-center {
|
.control-center {
|
||||||
/* border: 2px solid #073642; */
|
border: 2px solid #073642;
|
||||||
margin: 10px; /* Gap size */
|
margin: 10px; /* Gap size */
|
||||||
padding: 16px;
|
padding: 16px;
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,6 +11,7 @@ with lib; {
|
||||||
hardware.enable = true;
|
hardware.enable = true;
|
||||||
networking.enable = true;
|
networking.enable = true;
|
||||||
packages.enable = true;
|
packages.enable = true;
|
||||||
|
security.enable = true;
|
||||||
storage.enable = true;
|
storage.enable = true;
|
||||||
users.enable = true;
|
users.enable = true;
|
||||||
})
|
})
|
||||||
|
|
48
options/custom/settings/security.nix
Normal file
48
options/custom/settings/security.nix
Normal file
|
@ -0,0 +1,48 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
with lib; let
|
||||||
|
cfg = config.custom.settings.security;
|
||||||
|
in {
|
||||||
|
options.custom.settings.security.enable = mkOption {default = false;};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
# Bypass password prompts
|
||||||
|
security = {
|
||||||
|
sudo = {
|
||||||
|
enable = true;
|
||||||
|
wheelNeedsPassword = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
# https://wiki.nixos.org/wiki/Sway#Using_Home_Manager
|
||||||
|
# https://wiki.archlinux.org/title/Polkit#Bypass_password_prompt
|
||||||
|
polkit = {
|
||||||
|
enable = true;
|
||||||
|
extraConfig = ''
|
||||||
|
polkit.addRule(function(action, subject) {
|
||||||
|
if (subject.isInGroup("wheel")) { return polkit.Result.YES; }
|
||||||
|
});
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
environment.shellAliases = {
|
||||||
|
# Sudo confirmation prompt
|
||||||
|
sudo = pkgs.writeShellScript "sudo" ''
|
||||||
|
read -p "Execute as root? [Y/n] "
|
||||||
|
|
||||||
|
case "$REPLY" in
|
||||||
|
"" | [Yy])
|
||||||
|
command sudo "$@"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue