Reformat nix code, and add a few CLI utilities
This commit is contained in:
parent
f97fbed4fe
commit
8fd7e4c619
4 changed files with 245 additions and 222 deletions
|
@ -4,15 +4,11 @@
|
||||||
|
|
||||||
{ config, lib, nixpkgs, pkgs, home-manager, ... }:
|
{ config, lib, nixpkgs, pkgs, home-manager, ... }:
|
||||||
|
|
||||||
let
|
let my_python = (pkgs.python3.withPackages (ps: with ps; [ git_plan ]));
|
||||||
my_python = (pkgs.python3.withPackages (ps: with ps; [
|
in {
|
||||||
git_plan]));
|
imports = [
|
||||||
in
|
#./gnupg.nix
|
||||||
{
|
];
|
||||||
imports =
|
|
||||||
[
|
|
||||||
#./gnupg.nix
|
|
||||||
];
|
|
||||||
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
||||||
nix.extraOptions = ''
|
nix.extraOptions = ''
|
||||||
!include ${config.sops.secrets.github_token.path}
|
!include ${config.sops.secrets.github_token.path}
|
||||||
|
@ -39,7 +35,7 @@ in
|
||||||
owner = config.users.users.knazarov.name;
|
owner = config.users.users.knazarov.name;
|
||||||
group = config.users.users.knazarov.group;
|
group = config.users.users.knazarov.group;
|
||||||
};
|
};
|
||||||
mullvad_account = {};
|
mullvad_account = { };
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -76,7 +72,6 @@ in
|
||||||
package = lib.mkForce pkgs.gnome3.gvfs;
|
package = lib.mkForce pkgs.gnome3.gvfs;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
# Configure keymap in X11
|
# Configure keymap in X11
|
||||||
services.xserver = {
|
services.xserver = {
|
||||||
layout = "us";
|
layout = "us";
|
||||||
|
@ -87,12 +82,8 @@ in
|
||||||
users.users.knazarov = {
|
users.users.knazarov = {
|
||||||
isNormalUser = true;
|
isNormalUser = true;
|
||||||
description = "Konstantin Nazarov";
|
description = "Konstantin Nazarov";
|
||||||
extraGroups = [
|
extraGroups = [ "networkmanager" "wheel" config.users.groups.keys.name ];
|
||||||
"networkmanager"
|
packages = with pkgs; [ ];
|
||||||
"wheel"
|
|
||||||
config.users.groups.keys.name
|
|
||||||
];
|
|
||||||
packages = with pkgs; [];
|
|
||||||
openssh.authorizedKeys.keys = [
|
openssh.authorizedKeys.keys = [
|
||||||
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDGxebDydOcs7URJjXFHMU++ruaZOJpXbK4ixH19pWTsX7WtxxriZxD4+RQ3oyllGG/8sEFzEe0NoTHUPU6YrBpfwT/ekGDmCJHtvZ+rZs+cRQd6tObfAUip1B1Mcvhuaj0prnrbfohOuHpvQ/L8TogIKuHgczDmud4KGUu0mxCsUHbD5tlKpsgN+dJXkvjxsO7JhhF9JpFTrYAU0gTuBPTt3ynpnZKrE1NgnE0iy+CEr/v41dLqxw3fUjT3nOFUQ1l/VKTw5mLt5Iw7XmBLuFGLRAVrwzXxeBCfYqKGYgY4QV8HCcVpcqC8zWmRskiRetzQ/5HwRagm4yZr0I+LZ305nGB0cSJzLWXXOUF6SDg2cqAXFpF/o2LoFCmaV5h3jmCGOUrowF7oV4mYwBMWfabrbZx21z/R56GkAOOEKc2h+Qh5wIj4yayX081SkqJK3J9+3vGG4VvXnwGnPnWQFqrzeedyV74maffGBGFYm0UOcD+oG6EwM+7MEUBpJm9m4c= knazarov"
|
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDGxebDydOcs7URJjXFHMU++ruaZOJpXbK4ixH19pWTsX7WtxxriZxD4+RQ3oyllGG/8sEFzEe0NoTHUPU6YrBpfwT/ekGDmCJHtvZ+rZs+cRQd6tObfAUip1B1Mcvhuaj0prnrbfohOuHpvQ/L8TogIKuHgczDmud4KGUu0mxCsUHbD5tlKpsgN+dJXkvjxsO7JhhF9JpFTrYAU0gTuBPTt3ynpnZKrE1NgnE0iy+CEr/v41dLqxw3fUjT3nOFUQ1l/VKTw5mLt5Iw7XmBLuFGLRAVrwzXxeBCfYqKGYgY4QV8HCcVpcqC8zWmRskiRetzQ/5HwRagm4yZr0I+LZ305nGB0cSJzLWXXOUF6SDg2cqAXFpF/o2LoFCmaV5h3jmCGOUrowF7oV4mYwBMWfabrbZx21z/R56GkAOOEKc2h+Qh5wIj4yayX081SkqJK3J9+3vGG4VvXnwGnPnWQFqrzeedyV74maffGBGFYm0UOcD+oG6EwM+7MEUBpJm9m4c= knazarov"
|
||||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHkDvP2BO1uV0AwEjABYFEiA2BbGo1IsSht4emYMRLgi root@mira"
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHkDvP2BO1uV0AwEjABYFEiA2BbGo1IsSht4emYMRLgi root@mira"
|
||||||
|
@ -131,6 +122,7 @@ in
|
||||||
pciutils
|
pciutils
|
||||||
slack
|
slack
|
||||||
q-sh
|
q-sh
|
||||||
|
notes-sh
|
||||||
transmission-gtk
|
transmission-gtk
|
||||||
mpv
|
mpv
|
||||||
imv
|
imv
|
||||||
|
@ -161,14 +153,16 @@ in
|
||||||
xournalpp
|
xournalpp
|
||||||
dnsutils
|
dnsutils
|
||||||
graphviz
|
graphviz
|
||||||
|
fzf
|
||||||
|
nixfmt
|
||||||
#network-manager-applet
|
#network-manager-applet
|
||||||
(clang-tools.override { llvmPackages = llvmPackages_16; }) # mainly for clang-format
|
(clang-tools.override {
|
||||||
|
llvmPackages = llvmPackages_16;
|
||||||
|
}) # mainly for clang-format
|
||||||
(emacsWithPackagesFromUsePackage {
|
(emacsWithPackagesFromUsePackage {
|
||||||
config = ./emacs.el;
|
config = ./emacs.el;
|
||||||
defaultInitFile = true;
|
defaultInitFile = true;
|
||||||
package = emacs29-pgtk.overrideAttrs (old: {
|
package = emacs29-pgtk.overrideAttrs (old: { withTreeSitter = true; });
|
||||||
withTreeSitter = true;
|
|
||||||
});
|
|
||||||
alwaysEnsure = true;
|
alwaysEnsure = true;
|
||||||
extraEmacsPackages = epkgs: [
|
extraEmacsPackages = epkgs: [
|
||||||
pkgs.mu
|
pkgs.mu
|
||||||
|
@ -179,29 +173,27 @@ in
|
||||||
my_python
|
my_python
|
||||||
];
|
];
|
||||||
|
|
||||||
services.mullvad-vpn = {
|
services.mullvad-vpn = { enable = true; };
|
||||||
enable = true;
|
systemd.services."mullvad-daemon".postStart =
|
||||||
};
|
let mullvad = config.services.mullvad-vpn.package;
|
||||||
systemd.services."mullvad-daemon".postStart = let
|
in ''
|
||||||
mullvad = config.services.mullvad-vpn.package;
|
while ! ${mullvad}/bin/mullvad status >/dev/null; do sleep 1; done
|
||||||
in ''
|
${mullvad}/bin/mullvad account login `cat /var/run/secrets/mullvad_account`
|
||||||
while ! ${mullvad}/bin/mullvad status >/dev/null; do sleep 1; done
|
${mullvad}/bin/mullvad auto-connect set on
|
||||||
${mullvad}/bin/mullvad account login `cat /var/run/secrets/mullvad_account`
|
${mullvad}/bin/mullvad tunnel ipv6 set on
|
||||||
${mullvad}/bin/mullvad auto-connect set on
|
'';
|
||||||
${mullvad}/bin/mullvad tunnel ipv6 set on
|
|
||||||
'';
|
|
||||||
|
|
||||||
|
|
||||||
services.fwupd.enable = true;
|
services.fwupd.enable = true;
|
||||||
|
|
||||||
services.gnome.gnome-keyring.enable = true;
|
services.gnome.gnome-keyring.enable = true;
|
||||||
services.emacs.package = nixpkgs.emacsUnstablePgtk;
|
services.emacs.package = nixpkgs.emacsUnstablePgtk;
|
||||||
|
|
||||||
# Enables wayland support in electron apps (e.g. slack)
|
# Enables wayland support in electron apps (e.g. slack)
|
||||||
environment.sessionVariables.NIXOS_OZONE_WL = "1";
|
environment.sessionVariables.NIXOS_OZONE_WL = "1";
|
||||||
|
|
||||||
# Set default browser to qutebrowser in electron apps
|
# Set default browser to qutebrowser in electron apps
|
||||||
environment.sessionVariables.DEFAULT_BROWSER = "${pkgs.qutebrowser}/bin/qutebrowser";
|
environment.sessionVariables.DEFAULT_BROWSER =
|
||||||
|
"${pkgs.qutebrowser}/bin/qutebrowser";
|
||||||
|
|
||||||
# Set default browser to qutebrowser everywhere else
|
# Set default browser to qutebrowser everywhere else
|
||||||
xdg.mime.defaultApplications = {
|
xdg.mime.defaultApplications = {
|
||||||
|
@ -224,16 +216,13 @@ in
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Some programs need SUID wrappers, can be configured further or are
|
# Some programs need SUID wrappers, can be configured further or are
|
||||||
# started in user sessions.
|
# started in user sessions.
|
||||||
# programs.mtr.enable = true;
|
# programs.mtr.enable = true;
|
||||||
programs.gnupg.package = pkgs.gnupg;
|
programs.gnupg.package = pkgs.gnupg;
|
||||||
programs.gnupg.agent = {
|
programs.gnupg.agent = {
|
||||||
enable = true;
|
enable = true;
|
||||||
enableSSHSupport = true;
|
enableSSHSupport = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
programs.sway = {
|
programs.sway = {
|
||||||
|
@ -344,20 +333,22 @@ in
|
||||||
# Enable the OpenSSH daemon.
|
# Enable the OpenSSH daemon.
|
||||||
services.openssh = {
|
services.openssh = {
|
||||||
enable = true;
|
enable = true;
|
||||||
# settings = {
|
# settings = {
|
||||||
# passwordAuthentication = false;
|
# passwordAuthentication = false;
|
||||||
# kbdInteractiveAuthentication = false;
|
# kbdInteractiveAuthentication = false;
|
||||||
# };
|
# };
|
||||||
};
|
};
|
||||||
|
|
||||||
networking.firewall.allowedTCPPorts = [
|
networking.firewall.allowedTCPPorts = [
|
||||||
# Syncthing
|
# Syncthing
|
||||||
8384 22000
|
8384
|
||||||
|
22000
|
||||||
];
|
];
|
||||||
|
|
||||||
networking.firewall.allowedUDPPorts = [
|
networking.firewall.allowedUDPPorts = [
|
||||||
# Syncthing
|
# Syncthing
|
||||||
22000 21027
|
22000
|
||||||
|
21027
|
||||||
];
|
];
|
||||||
|
|
||||||
# This value determines the NixOS release from which the default
|
# This value determines the NixOS release from which the default
|
||||||
|
@ -386,49 +377,46 @@ in
|
||||||
font-awesome # for waybar indicators
|
font-awesome # for waybar indicators
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
home-manager.users.knazarov = {
|
home-manager.users.knazarov = {
|
||||||
/* The home.stateVersion option does not have a default and must be set */
|
# The home.stateVersion option does not have a default and must be set
|
||||||
home.stateVersion = "23.05";
|
home.stateVersion = "23.05";
|
||||||
|
|
||||||
programs.bash = {
|
programs.bash = {
|
||||||
enable = true;
|
enable = true;
|
||||||
bashrcExtra = ''
|
bashrcExtra = ''
|
||||||
if [[ "$INSIDE_EMACS" = 'vterm' ]] \
|
if [[ "$INSIDE_EMACS" = 'vterm' ]] \
|
||||||
&& [[ -n ''${EMACS_VTERM_PATH} ]] \
|
&& [[ -n ''${EMACS_VTERM_PATH} ]] \
|
||||||
&& [[ -f ''${EMACS_VTERM_PATH}/etc/emacs-vterm-bash.sh ]]; then
|
&& [[ -f ''${EMACS_VTERM_PATH}/etc/emacs-vterm-bash.sh ]]; then
|
||||||
source ''${EMACS_VTERM_PATH}/etc/emacs-vterm-bash.sh
|
source ''${EMACS_VTERM_PATH}/etc/emacs-vterm-bash.sh
|
||||||
fi
|
fi
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
gtk = {
|
gtk = {
|
||||||
enable = true;
|
enable = true;
|
||||||
gtk3.extraConfig = {
|
gtk3.extraConfig = { gtk-enable-animations = "0"; };
|
||||||
gtk-enable-animations = "0";
|
gtk4.extraConfig = { gtk-enable-animations = "0"; };
|
||||||
};
|
|
||||||
gtk4.extraConfig = {
|
|
||||||
gtk-enable-animations = "0";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
programs.direnv = {
|
programs.direnv = {
|
||||||
enable = true;
|
enable = true;
|
||||||
nix-direnv = {
|
nix-direnv = { enable = true; };
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
programs.gpg = {
|
programs.gpg = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = pkgs.gnupg;
|
package = pkgs.gnupg;
|
||||||
publicKeys = [
|
publicKeys = [
|
||||||
{source = ./gpg_public_key.asc; trust="ultimate"; }
|
{
|
||||||
{source = ./pgp_keys/FB4809DC51A4F483.asc; trust= "ultimate"; }
|
source = ./gpg_public_key.asc;
|
||||||
|
trust = "ultimate";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
source = ./pgp_keys/FB4809DC51A4F483.asc;
|
||||||
|
trust = "ultimate";
|
||||||
|
}
|
||||||
];
|
];
|
||||||
settings = {
|
settings = { default-key = "0x0560020C9C577C1B"; };
|
||||||
default-key = "0x0560020C9C577C1B";
|
|
||||||
};
|
|
||||||
mutableKeys = false;
|
mutableKeys = false;
|
||||||
mutableTrust = false;
|
mutableTrust = false;
|
||||||
};
|
};
|
||||||
|
@ -448,7 +436,8 @@ in
|
||||||
accounts.email = {
|
accounts.email = {
|
||||||
maildirBasePath = "${config.users.users.knazarov.home}/Maildir";
|
maildirBasePath = "${config.users.users.knazarov.home}/Maildir";
|
||||||
accounts = {
|
accounts = {
|
||||||
personal = let account = "mail@knazarov.com"; in {
|
personal = let account = "mail@knazarov.com";
|
||||||
|
in {
|
||||||
primary = true;
|
primary = true;
|
||||||
flavor = "fastmail.com";
|
flavor = "fastmail.com";
|
||||||
address = account;
|
address = account;
|
||||||
|
@ -471,14 +460,10 @@ in
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
programs.mu = {
|
programs.mu = { enable = true; };
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
programs.msmtp.enable = true;
|
programs.msmtp.enable = true;
|
||||||
|
|
||||||
programs.mbsync = {
|
programs.mbsync = { enable = true; };
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
#services.easyeffects = {
|
#services.easyeffects = {
|
||||||
# enable = true;
|
# enable = true;
|
||||||
|
@ -487,14 +472,20 @@ in
|
||||||
services.swayidle = {
|
services.swayidle = {
|
||||||
enable = true;
|
enable = true;
|
||||||
timeouts = [
|
timeouts = [
|
||||||
{ timeout = 300; command = "${pkgs.swaylock}/bin/swaylock -f -c 000000";}
|
{
|
||||||
{ timeout = 600;
|
timeout = 300;
|
||||||
command = "${pkgs.sway}/bin/swaymsg \"output * dpms off\"";
|
command = "${pkgs.swaylock}/bin/swaylock -f -c 000000";
|
||||||
resumeCommand = "${pkgs.sway}/bin/swaymsg \"output * dpms on\"";}
|
}
|
||||||
];
|
{
|
||||||
events = [
|
timeout = 600;
|
||||||
{ event = "before-sleep"; command = "${pkgs.swaylock}/bin/swaylock -f -c 000000"; }
|
command = ''${pkgs.sway}/bin/swaymsg "output * dpms off"'';
|
||||||
|
resumeCommand = ''${pkgs.sway}/bin/swaymsg "output * dpms on"'';
|
||||||
|
}
|
||||||
];
|
];
|
||||||
|
events = [{
|
||||||
|
event = "before-sleep";
|
||||||
|
command = "${pkgs.swaylock}/bin/swaylock -f -c 000000";
|
||||||
|
}];
|
||||||
};
|
};
|
||||||
|
|
||||||
wayland.windowManager.sway = {
|
wayland.windowManager.sway = {
|
||||||
|
@ -503,22 +494,26 @@ in
|
||||||
config = rec {
|
config = rec {
|
||||||
modifier = "Mod4";
|
modifier = "Mod4";
|
||||||
terminal = "foot";
|
terminal = "foot";
|
||||||
bars = [{
|
bars = [{ "command" = "waybar"; }];
|
||||||
"command" = "waybar";
|
|
||||||
}];
|
|
||||||
keybindings = pkgs.lib.mkOptionDefault {
|
keybindings = pkgs.lib.mkOptionDefault {
|
||||||
"XF86AudioRaiseVolume" = "exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+";
|
"XF86AudioRaiseVolume" =
|
||||||
"XF86AudioLowerVolume" = "exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-";
|
"exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+";
|
||||||
|
"XF86AudioLowerVolume" =
|
||||||
|
"exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-";
|
||||||
"XF86AudioMute" = "exec wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle";
|
"XF86AudioMute" = "exec wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle";
|
||||||
"XF86AudioMicMute" = "exec pactl set-source-mute @DEFAULT_SOURCE@ toggle";
|
"XF86AudioMicMute" =
|
||||||
|
"exec pactl set-source-mute @DEFAULT_SOURCE@ toggle";
|
||||||
"XF86MonBrightnessUp" = "exec brightnessctl s +5%";
|
"XF86MonBrightnessUp" = "exec brightnessctl s +5%";
|
||||||
"XF86MonBrightnessDown" = "exec brightnessctl s 5%-";
|
"XF86MonBrightnessDown" = "exec brightnessctl s 5%-";
|
||||||
"Mod4+Return" = "exec emacs --eval '(progn (setq confirm-kill-processes nil) (vterm))'";
|
"Mod4+Return" =
|
||||||
"Mod4+space" = "exec ${pkgs.foot}/bin/foot -T mylauncher -a mylauncher ${pkgs.q-sh}/bin/q";
|
"exec emacs --eval '(progn (setq confirm-kill-processes nil) (vterm))'";
|
||||||
"Mod4+p" = "exec '${pkgs.grim}/bin/grim -g \"$$(${pkgs.slurp}/bin/slurp)\" - | ${pkgs.wl-clipboard}/bin/wl-copy -t image/png'";
|
"Mod4+space" =
|
||||||
|
"exec ${pkgs.foot}/bin/foot -T mylauncher -a mylauncher ${pkgs.q-sh}/bin/q";
|
||||||
|
"Mod4+p" =
|
||||||
|
"exec '${pkgs.grim}/bin/grim -g \"$$(${pkgs.slurp}/bin/slurp)\" - | ${pkgs.wl-clipboard}/bin/wl-copy -t image/png'";
|
||||||
};
|
};
|
||||||
output = {
|
output = {
|
||||||
"*" = { bg = "${./wallpaper.jpg} fill";};
|
"*" = { bg = "${./wallpaper.jpg} fill"; };
|
||||||
"Lenovo Group Limited LEN T32p-20 VNA4VRNY" = { scale = "1.5"; };
|
"Lenovo Group Limited LEN T32p-20 VNA4VRNY" = { scale = "1.5"; };
|
||||||
};
|
};
|
||||||
input = {
|
input = {
|
||||||
|
@ -531,11 +526,13 @@ in
|
||||||
inner = 10;
|
inner = 10;
|
||||||
outer = 5;
|
outer = 5;
|
||||||
};
|
};
|
||||||
colors.unfocused = {border = "#dddddd";
|
colors.unfocused = {
|
||||||
background = "#dddddd";
|
border = "#dddddd";
|
||||||
text = "#888888";
|
background = "#dddddd";
|
||||||
indicator = "#888888";
|
text = "#888888";
|
||||||
childBorder = "#888888";};
|
indicator = "#888888";
|
||||||
|
childBorder = "#888888";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
for_window [title="mylauncher"] floating enable
|
for_window [title="mylauncher"] floating enable
|
||||||
|
@ -547,36 +544,34 @@ in
|
||||||
programs.foot = {
|
programs.foot = {
|
||||||
enable = true;
|
enable = true;
|
||||||
settings = {
|
settings = {
|
||||||
main = {
|
main = { font = "monospace:size=10"; };
|
||||||
font="monospace:size=10";
|
|
||||||
};
|
|
||||||
|
|
||||||
colors = {
|
colors = {
|
||||||
background="feffff";
|
background = "feffff";
|
||||||
foreground="333333";
|
foreground = "333333";
|
||||||
|
|
||||||
regular0="333333";
|
regular0 = "333333";
|
||||||
regular1="bd4436";
|
regular1 = "bd4436";
|
||||||
regular2="008700";
|
regular2 = "008700";
|
||||||
regular3="cdcc42";
|
regular3 = "cdcc42";
|
||||||
regular4="0017f5";
|
regular4 = "0017f5";
|
||||||
regular5="b92cc6";
|
regular5 = "b92cc6";
|
||||||
regular6="5bbdf9";
|
regular6 = "5bbdf9";
|
||||||
regular7="c7c7c7";
|
regular7 = "c7c7c7";
|
||||||
|
|
||||||
bright0="333333";
|
bright0 = "333333";
|
||||||
bright1="bd4436";
|
bright1 = "bd4436";
|
||||||
bright2="008700";
|
bright2 = "008700";
|
||||||
bright3="cdcc42";
|
bright3 = "cdcc42";
|
||||||
bright4="0017f5";
|
bright4 = "0017f5";
|
||||||
bright5="b92cc6";
|
bright5 = "b92cc6";
|
||||||
bright6="5bbdf9";
|
bright6 = "5bbdf9";
|
||||||
bright7="feffff";
|
bright7 = "feffff";
|
||||||
};
|
};
|
||||||
key-bindings = {
|
key-bindings = {
|
||||||
clipboard-copy="Control+Insert";
|
clipboard-copy = "Control+Insert";
|
||||||
clipboard-paste="Shift+Insert";
|
clipboard-paste = "Shift+Insert";
|
||||||
primary-paste="Control+Shift+v";
|
primary-paste = "Control+Shift+v";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -601,46 +596,41 @@ in
|
||||||
config.set('content.register_protocol_handler', False, 'https://calendar.google.com?cid=%25s')
|
config.set('content.register_protocol_handler', False, 'https://calendar.google.com?cid=%25s')
|
||||||
'';
|
'';
|
||||||
keyBindings = {
|
keyBindings = {
|
||||||
insert = {
|
insert = { "<Shift+Ins>" = "insert-text -- {clipboard}"; };
|
||||||
"<Shift+Ins>" = "insert-text -- {clipboard}";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
programs.waybar = {
|
programs.waybar = {
|
||||||
enable = true;
|
enable = true;
|
||||||
settings = [{
|
settings = [{
|
||||||
layer = "top";
|
layer = "top";
|
||||||
position = "top";
|
position = "top";
|
||||||
height = 24;
|
height = 24;
|
||||||
modules-left = ["sway/workspaces" "sway/mode"];
|
modules-left = [ "sway/workspaces" "sway/mode" ];
|
||||||
modules-center = ["sway/window"];
|
modules-center = [ "sway/window" ];
|
||||||
modules-right =
|
modules-right = [ "idle_inhibitor" "battery" "clock" "tray" ];
|
||||||
[ "idle_inhibitor" "battery" "clock" "tray" ];
|
clock.format = "{:%Y-%m-%d %H:%M}";
|
||||||
clock.format = "{:%Y-%m-%d %H:%M}";
|
battery = {
|
||||||
battery = {
|
states = {
|
||||||
states = {
|
# good = 95;
|
||||||
# good = 95;
|
warning = 30;
|
||||||
warning = 30;
|
critical = 15;
|
||||||
critical = 15;
|
|
||||||
};
|
|
||||||
format = "{capacity}% {icon}";
|
|
||||||
format-charging = "{capacity}% ";
|
|
||||||
format-plugged = "{capacity}% ";
|
|
||||||
format-alt = "{time} {icon}";
|
|
||||||
format-icons = ["" "" "" "" ""];
|
|
||||||
};
|
};
|
||||||
idle_inhibitor = {
|
format = "{capacity}% {icon}";
|
||||||
format = "{icon}";
|
format-charging = "{capacity}% ";
|
||||||
format-icons = {
|
format-plugged = "{capacity}% ";
|
||||||
activated = "";
|
format-alt = "{time} {icon}";
|
||||||
deactivated = "";
|
format-icons = [ "" "" "" "" "" ];
|
||||||
};
|
};
|
||||||
|
idle_inhibitor = {
|
||||||
|
format = "{icon}";
|
||||||
|
format-icons = {
|
||||||
|
activated = "";
|
||||||
|
deactivated = "";
|
||||||
};
|
};
|
||||||
|
};
|
||||||
}];
|
}];
|
||||||
};
|
};
|
||||||
services.syncthing = {
|
services.syncthing = { enable = true; };
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
home.pointerCursor = {
|
home.pointerCursor = {
|
||||||
name = "Adwaita";
|
name = "Adwaita";
|
||||||
package = pkgs.gnome.adwaita-icon-theme;
|
package = pkgs.gnome.adwaita-icon-theme;
|
||||||
|
@ -656,59 +646,55 @@ in
|
||||||
podman = {
|
podman = {
|
||||||
enable = true;
|
enable = true;
|
||||||
dockerCompat = true;
|
dockerCompat = true;
|
||||||
defaultNetwork.settings = {
|
defaultNetwork.settings = { dns_enabled = true; };
|
||||||
dns_enabled = true;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
services.udev.packages = [
|
services.udev.packages = [ pkgs.android-udev-rules ];
|
||||||
pkgs.android-udev-rules
|
|
||||||
];
|
|
||||||
#udevadm info --query=all --name=/dev/sda1 | grep ID_SERIAL
|
#udevadm info --query=all --name=/dev/sda1 | grep ID_SERIAL
|
||||||
services.udev.extraRules =
|
services.udev.extraRules =
|
||||||
''ACTION=="add", SUBSYSTEMS=="usb", SUBSYSTEM=="block", '' +
|
''ACTION=="add", SUBSYSTEMS=="usb", SUBSYSTEM=="block", '' + ''
|
||||||
''ENV{ID_FS_USAGE}=="filesystem", ENV{ID_SERIAL_SHORT}=="Hidizs_AP80PRO", '' +
|
ENV{ID_FS_USAGE}=="filesystem", ENV{ID_SERIAL_SHORT}=="Hidizs_AP80PRO", ''
|
||||||
''RUN{program}+="${pkgs.systemd}/bin/systemd-mount --owner knazarov '' +
|
+ ''RUN{program}+="${pkgs.systemd}/bin/systemd-mount --owner knazarov ''
|
||||||
''--no-block --automount=yes --collect $devnode /media"'';
|
+ ''--no-block --automount=yes --collect $devnode /media"'';
|
||||||
|
|
||||||
systemd.timers."git_plan" = {
|
systemd.timers."git_plan" = {
|
||||||
wantedBy = [ "timers.target" ];
|
wantedBy = [ "timers.target" ];
|
||||||
timerConfig = {
|
timerConfig = {
|
||||||
OnBootSec="1h";
|
OnBootSec = "1h";
|
||||||
OnUnitActiveSec="1h";
|
OnUnitActiveSec = "1h";
|
||||||
Unit = "git_plan.service";
|
Unit = "git_plan.service";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.services."git_plan" = {
|
systemd.services."git_plan" = {
|
||||||
script = ''
|
script = ''
|
||||||
${my_python}/bin/python3 -m git_plan -c /var/run/secrets/git_plan_config -r /var/run/secrets/git_plan_credentials oneshot
|
${my_python}/bin/python3 -m git_plan -c /var/run/secrets/git_plan_config -r /var/run/secrets/git_plan_credentials oneshot
|
||||||
'';
|
'';
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
Type = "oneshot";
|
Type = "oneshot";
|
||||||
User = "knazarov";
|
User = "knazarov";
|
||||||
StateDirectory="git_plan";
|
StateDirectory = "git_plan";
|
||||||
Environment="PYTHONUNBUFFERED=1";
|
Environment = "PYTHONUNBUFFERED=1";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.timers."git_plan_pr" = {
|
systemd.timers."git_plan_pr" = {
|
||||||
wantedBy = [ "timers.target" ];
|
wantedBy = [ "timers.target" ];
|
||||||
timerConfig = {
|
timerConfig = {
|
||||||
OnCalendar= "Mon,Tue,Wed,Thu,Fri *-*-* 10:00:00";
|
OnCalendar = "Mon,Tue,Wed,Thu,Fri *-*-* 10:00:00";
|
||||||
Unit = "git_plan_pr.service";
|
Unit = "git_plan_pr.service";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.services."git_plan_pr" = {
|
systemd.services."git_plan_pr" = {
|
||||||
script = ''
|
script = ''
|
||||||
${my_python}/bin/python3 -m git_plan -c /var/run/secrets/git_plan_config -r /var/run/secrets/git_plan_credentials pr
|
${my_python}/bin/python3 -m git_plan -c /var/run/secrets/git_plan_config -r /var/run/secrets/git_plan_credentials pr
|
||||||
'';
|
'';
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
Type = "oneshot";
|
Type = "oneshot";
|
||||||
User = "knazarov";
|
User = "knazarov";
|
||||||
StateDirectory="git_plan";
|
StateDirectory = "git_plan";
|
||||||
Environment="PYTHONUNBUFFERED=1";
|
Environment = "PYTHONUNBUFFERED=1";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
3
emacs.el
3
emacs.el
|
@ -290,6 +290,9 @@
|
||||||
(evil-define-key 'normal 'global (kbd "<leader>b") 'switch-to-buffer)
|
(evil-define-key 'normal 'global (kbd "<leader>b") 'switch-to-buffer)
|
||||||
(evil-define-key 'normal 'global (kbd "<leader>r") 'consult-ripgrep)
|
(evil-define-key 'normal 'global (kbd "<leader>r") 'consult-ripgrep)
|
||||||
|
|
||||||
|
;; Make :q close the current buffer, and not the whole emacs process
|
||||||
|
(global-set-key [remap evil-quit] 'kill-buffer-and-window)
|
||||||
|
|
||||||
;; -------- Tools and environment --------
|
;; -------- Tools and environment --------
|
||||||
|
|
||||||
;; By default, Emacs doesn't add system path to its search places
|
;; By default, Emacs doesn't add system path to its search places
|
||||||
|
|
27
flake.lock
27
flake.lock
|
@ -90,11 +90,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1695674553,
|
"lastModified": 1695939862,
|
||||||
"narHash": "sha256-gl/4yEfN0nsAhY/gBRO/GmxbbJZMQHXERm7Jrr2lJug=",
|
"narHash": "sha256-YKDlS3HCXiMflP5i/uEQnZf2henO10beetINHj80hmU=",
|
||||||
"owner": "~knazarov",
|
"owner": "~knazarov",
|
||||||
"repo": "knazarov.com",
|
"repo": "knazarov.com",
|
||||||
"rev": "b851bb106e03996a1c00212986217db464b90424",
|
"rev": "ea70e4a202b4fdc0e5e20c5fce9a631093d3cf35",
|
||||||
"type": "sourcehut"
|
"type": "sourcehut"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -134,6 +134,26 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"notes-sh": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1696081283,
|
||||||
|
"narHash": "sha256-ldiJ3gWOvW/aq3zwetnSg1pjU7PfKYVsQWxIZGM/NNA=",
|
||||||
|
"owner": "~knazarov",
|
||||||
|
"repo": "notes.sh",
|
||||||
|
"rev": "38e2883be54cd6634d83888f8f8545ddb44b9556",
|
||||||
|
"type": "sourcehut"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "~knazarov",
|
||||||
|
"repo": "notes.sh",
|
||||||
|
"type": "sourcehut"
|
||||||
|
}
|
||||||
|
},
|
||||||
"q-sh": {
|
"q-sh": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
|
@ -162,6 +182,7 @@
|
||||||
"knazarovcom": "knazarovcom",
|
"knazarovcom": "knazarovcom",
|
||||||
"nixpkgs": "nixpkgs",
|
"nixpkgs": "nixpkgs",
|
||||||
"nixpkgs-stable": "nixpkgs-stable",
|
"nixpkgs-stable": "nixpkgs-stable",
|
||||||
|
"notes-sh": "notes-sh",
|
||||||
"q-sh": "q-sh",
|
"q-sh": "q-sh",
|
||||||
"sops-nix": "sops-nix",
|
"sops-nix": "sops-nix",
|
||||||
"vmatveevacom": "vmatveevacom"
|
"vmatveevacom": "vmatveevacom"
|
||||||
|
|
107
flake.nix
107
flake.nix
|
@ -3,36 +3,40 @@
|
||||||
|
|
||||||
{
|
{
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = github:NixOS/nixpkgs;
|
nixpkgs.url = "github:NixOS/nixpkgs";
|
||||||
nixpkgs-stable.url = github:NixOS/nixpkgs/nixos-23.05;
|
nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-23.05";
|
||||||
home-manager.url = github:nix-community/home-manager/release-23.05;
|
home-manager.url = "github:nix-community/home-manager/release-23.05";
|
||||||
home-manager.inputs.nixpkgs.follows = "nixpkgs";
|
home-manager.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
emacs-overlay.url = github:nix-community/emacs-overlay;
|
emacs-overlay.url = "github:nix-community/emacs-overlay";
|
||||||
emacs-overlay.inputs.nixpkgs.follows = "nixpkgs";
|
emacs-overlay.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
emacs-overlay.inputs.nixpkgs-stable.follows = "nixpkgs-stable";
|
emacs-overlay.inputs.nixpkgs-stable.follows = "nixpkgs-stable";
|
||||||
sops-nix.url = github:Mic92/sops-nix;
|
sops-nix.url = "github:Mic92/sops-nix";
|
||||||
sops-nix.inputs.nixpkgs.follows = "nixpkgs";
|
sops-nix.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
sops-nix.inputs.nixpkgs-stable.follows = "nixpkgs-stable";
|
sops-nix.inputs.nixpkgs-stable.follows = "nixpkgs-stable";
|
||||||
q-sh.url = sourcehut:~knazarov/q.sh;
|
q-sh.url = "sourcehut:~knazarov/q.sh";
|
||||||
q-sh.inputs.nixpkgs.follows = "nixpkgs";
|
q-sh.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
knazarovcom.url = sourcehut:~knazarov/knazarov.com;
|
notes-sh.url = "sourcehut:~knazarov/notes.sh";
|
||||||
|
notes-sh.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
knazarovcom.url = "sourcehut:~knazarov/knazarov.com";
|
||||||
knazarovcom.inputs.nixpkgs.follows = "nixpkgs";
|
knazarovcom.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
vmatveevacom.url = github:valeriya-matveeva/vmatveeva.com;
|
vmatveevacom.url = "github:valeriya-matveeva/vmatveeva.com";
|
||||||
vmatveevacom.inputs.nixpkgs.follows = "nixpkgs";
|
vmatveevacom.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
git-plan.url = sourcehut:~knazarov/git-plan;
|
git-plan.url = "sourcehut:~knazarov/git-plan";
|
||||||
git-plan.inputs.nixpkgs.follows = "nixpkgs";
|
git-plan.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { self, nixpkgs, nixpkgs-stable, home-manager, emacs-overlay, sops-nix, q-sh, knazarovcom, vmatveevacom, git-plan, ... }@attrs:
|
outputs = { self, nixpkgs, nixpkgs-stable, home-manager, emacs-overlay
|
||||||
|
, sops-nix, q-sh, notes-sh, knazarovcom, vmatveevacom, git-plan, ...
|
||||||
|
}@attrs:
|
||||||
let
|
let
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
|
|
||||||
specialArgs = {
|
specialArgs = { inherit attrs; };
|
||||||
inherit attrs;
|
|
||||||
};
|
|
||||||
buildConfig = modules: system: { inherit modules system specialArgs; };
|
buildConfig = modules: system: { inherit modules system specialArgs; };
|
||||||
buildSystem = modules: system: nixpkgs.lib.nixosSystem (buildConfig modules system);
|
buildSystem = modules: system:
|
||||||
buildSystemStable = modules: system: nixpkgs-stable.lib.nixosSystem (buildConfig modules system);
|
nixpkgs.lib.nixosSystem (buildConfig modules system);
|
||||||
|
buildSystemStable = modules: system:
|
||||||
|
nixpkgs-stable.lib.nixosSystem (buildConfig modules system);
|
||||||
|
|
||||||
hostAttrs = dir: {
|
hostAttrs = dir: {
|
||||||
settings = import "${dir}/host-metadata.nix";
|
settings = import "${dir}/host-metadata.nix";
|
||||||
|
@ -40,37 +44,46 @@
|
||||||
hw-config = import "${dir}/hardware-configuration.nix";
|
hw-config = import "${dir}/hardware-configuration.nix";
|
||||||
};
|
};
|
||||||
|
|
||||||
node = dir: with hostAttrs dir; buildSystemStable [
|
node = dir:
|
||||||
({ config, pkgs, ... }: { nixpkgs.overlays = [ emacs-overlay.overlay q-sh.overlays.default
|
with hostAttrs dir;
|
||||||
git-plan.overlays.default
|
buildSystemStable [
|
||||||
]; })
|
({ config, pkgs, ... }: {
|
||||||
sops-nix.nixosModules.sops
|
nixpkgs.overlays = [
|
||||||
home-manager.nixosModule
|
emacs-overlay.overlay
|
||||||
config
|
q-sh.overlays.default
|
||||||
hw-config
|
notes-sh.overlays.default
|
||||||
./configuration.nix
|
git-plan.overlays.default
|
||||||
]
|
];
|
||||||
settings.system;
|
})
|
||||||
|
sops-nix.nixosModules.sops
|
||||||
|
home-manager.nixosModule
|
||||||
|
config
|
||||||
|
hw-config
|
||||||
|
./configuration.nix
|
||||||
|
] settings.system;
|
||||||
|
|
||||||
server = dir: with hostAttrs dir; buildSystem [
|
server = dir:
|
||||||
({ config, pkgs, ... }: { nixpkgs.overlays = [
|
with hostAttrs dir;
|
||||||
emacs-overlay.overlay
|
buildSystem [
|
||||||
q-sh.overlays.default
|
({ config, pkgs, ... }: {
|
||||||
knazarovcom.overlays.default
|
nixpkgs.overlays = [
|
||||||
vmatveevacom.overlays.default]; })
|
emacs-overlay.overlay
|
||||||
sops-nix.nixosModules.sops
|
q-sh.overlays.default
|
||||||
home-manager.nixosModule
|
knazarovcom.overlays.default
|
||||||
config
|
vmatveevacom.overlays.default
|
||||||
hw-config
|
];
|
||||||
#(dir + "/configuration.nix")
|
})
|
||||||
]
|
sops-nix.nixosModules.sops
|
||||||
settings.system;
|
home-manager.nixosModule
|
||||||
in
|
config
|
||||||
{
|
hw-config
|
||||||
nixosConfigurations = {
|
#(dir + "/configuration.nix")
|
||||||
mira = node ./nodes/mira;
|
] settings.system;
|
||||||
framework = node ./nodes/framework;
|
in {
|
||||||
knazarovcom = server ./nodes/knazarovcom;
|
nixosConfigurations = {
|
||||||
};
|
mira = node ./nodes/mira;
|
||||||
|
framework = node ./nodes/framework;
|
||||||
|
knazarovcom = server ./nodes/knazarovcom;
|
||||||
};
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue